You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. #ifndef _BZIMAGE_H
  2. #define _BZIMAGE_H
  3. #include <stdint.h>
  4. /**
  5. * A bzImage header
  6. *
  7. * As documented in Documentation/i386/boot.txt
  8. */
  9. struct bzimage_header {
  10. /** The size of the setup in sectors
  11. *
  12. * If this field contains 0, assume it contains 4.
  13. */
  14. uint8_t setup_sects;
  15. /** If set, the root is mounted readonly */
  16. uint16_t root_flags;
  17. /** DO NOT USE - for bootsect.S use only */
  18. uint16_t syssize;
  19. /** DO NOT USE - obsolete */
  20. uint16_t swap_dev;
  21. /** DO NOT USE - for bootsect.S use only */
  22. uint16_t ram_size;
  23. /** Video mode control */
  24. uint16_t vid_mode;
  25. /** Default root device number */
  26. uint16_t root_dev;
  27. /** 0xAA55 magic number */
  28. uint16_t boot_flag;
  29. /** Jump instruction */
  30. uint16_t jump;
  31. /** Magic signature "HdrS" */
  32. uint32_t header;
  33. /** Boot protocol version supported */
  34. uint16_t version;
  35. /** Boot loader hook (see below) */
  36. uint32_t realmode_swtch;
  37. /** The load-low segment (0x1000) (obsolete) */
  38. uint16_t start_sys;
  39. /** Pointer to kernel version string */
  40. uint16_t kernel_version;
  41. /** Boot loader identifier */
  42. uint8_t type_of_loader;
  43. /** Boot protocol option flags */
  44. uint8_t loadflags;
  45. /** Move to high memory size (used with hooks) */
  46. uint16_t setup_move_size;
  47. /** Boot loader hook (see below) */
  48. uint32_t code32_start;
  49. /** initrd load address (set by boot loader) */
  50. uint32_t ramdisk_image;
  51. /** initrd size (set by boot loader) */
  52. uint32_t ramdisk_size;
  53. /** DO NOT USE - for bootsect.S use only */
  54. uint32_t bootsect_kludge;
  55. /** Free memory after setup end */
  56. uint16_t heap_end_ptr;
  57. /** Unused */
  58. uint16_t pad1;
  59. /** 32-bit pointer to the kernel command line */
  60. uint32_t cmd_line_ptr;
  61. /** Highest legal initrd address */
  62. uint32_t initrd_addr_max;
  63. } __attribute__ (( packed ));
  64. /** Offset of bzImage header within kernel image */
  65. #define BZI_HDR_OFFSET 0x1f1
  66. /** bzImage magic signature value */
  67. #define BZI_SIGNATURE 0x53726448
  68. /** bzImage boot loader identifier for Etherboot */
  69. #define BZI_LOADER_TYPE_ETHERBOOT 0x40
  70. /** bzImage boot loader identifier for gPXE
  71. *
  72. * We advertise ourselves as Etherboot version 6.
  73. */
  74. #define BZI_LOADER_TYPE_GPXE ( BZI_LOADER_TYPE_ETHERBOOT | 0x06 )
  75. /** bzImage "load high" flag */
  76. #define BZI_LOAD_HIGH 0x01
  77. /** Load address for high-loaded kernels */
  78. #define BZI_LOAD_HIGH_ADDR 0x100000
  79. /** Load address for low-loaded kernels */
  80. #define BZI_LOAD_LOW_ADDR 0x10000
  81. /** bzImage "kernel can use heap" flag */
  82. #define BZI_CAN_USE_HEAP 0x80
  83. /** bzImage special video mode "normal" */
  84. #define BZI_VID_MODE_NORMAL 0xffff
  85. /** bzImage special video mode "ext" */
  86. #define BZI_VID_MODE_EXT 0xfffe
  87. /** bzImage special video mode "ask" */
  88. #define BZI_VID_MODE_ASK 0xfffd
  89. /** bzImage maximum initrd address for versions < 2.03 */
  90. #define BZI_INITRD_MAX 0x37ffffff
  91. /** bzImage command-line structure used by older kernels */
  92. struct bzimage_cmdline {
  93. /** Magic signature */
  94. uint16_t magic;
  95. /** Offset to command line */
  96. uint16_t offset;
  97. } __attribute__ (( packed ));
  98. /** Offset of bzImage command-line structure within kernel image */
  99. #define BZI_CMDLINE_OFFSET 0x20
  100. /** bzImage command line present magic marker value */
  101. #define BZI_CMDLINE_MAGIC 0xa33f
  102. /** Assumed size of real-mode portion (including .bss) */
  103. #define BZI_ASSUMED_RM_SIZE 0x8000
  104. /** Amount of stack space to provide */
  105. #define BZI_STACK_SIZE 0x1000
  106. /** Maximum size of command line */
  107. #define BZI_CMDLINE_SIZE 0x100
  108. #endif /* _BZIMAGE_H */