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