iPXE
arch
x86
include
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
*/
13
struct
bzimage_header
{
14
/** The size of the setup in sectors
15
*
16
* If this field contains 0, assume it contains 4.
17
*/
18
uint8_t
setup_sects
;
19
/** If set, the root is mounted readonly */
20
uint16_t
root_flags
;
21
/** DO NOT USE - for bootsect.S use only */
22
uint16_t
syssize
;
23
/** DO NOT USE - obsolete */
24
uint16_t
swap_dev
;
25
/** DO NOT USE - for bootsect.S use only */
26
uint16_t
ram_size
;
27
/** Video mode control */
28
uint16_t
vid_mode
;
29
/** Default root device number */
30
uint16_t
root_dev
;
31
/** 0xAA55 magic number */
32
uint16_t
boot_flag
;
33
/** Jump instruction */
34
uint16_t
jump
;
35
/** Magic signature "HdrS" */
36
uint32_t
header
;
37
/** Boot protocol version supported */
38
uint16_t
version
;
39
/** Boot loader hook (see below) */
40
uint32_t
realmode_swtch
;
41
/** The load-low segment (0x1000) (obsolete) */
42
uint16_t
start_sys
;
43
/** Pointer to kernel version string */
44
uint16_t
kernel_version
;
45
/** Boot loader identifier */
46
uint8_t
type_of_loader
;
47
/** Boot protocol option flags */
48
uint8_t
loadflags
;
49
/** Move to high memory size (used with hooks) */
50
uint16_t
setup_move_size
;
51
/** Boot loader hook (see below) */
52
uint32_t
code32_start
;
53
/** initrd load address (set by boot loader) */
54
uint32_t
ramdisk_image
;
55
/** initrd size (set by boot loader) */
56
uint32_t
ramdisk_size
;
57
/** DO NOT USE - for bootsect.S use only */
58
uint32_t
bootsect_kludge
;
59
/** Free memory after setup end */
60
uint16_t
heap_end_ptr
;
61
/** Unused */
62
uint16_t
pad1
;
63
/** 32-bit pointer to the kernel command line */
64
uint32_t
cmd_line_ptr
;
65
/** Highest legal initrd address */
66
uint32_t
initrd_addr_max
;
67
/** Physical addr alignment required for kernel */
68
uint32_t
kernel_alignment
;
69
/** Whether kernel is relocatable or not */
70
uint8_t
relocatable_kernel
;
71
/** Unused */
72
uint8_t
pad2
[3];
73
/** Maximum size of the kernel command line */
74
uint32_t
cmdline_size
;
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 */
120
struct
bzimage_cmdline
{
121
/** Magic signature */
122
uint16_t
magic
;
123
/** Offset to command line */
124
uint16_t
offset
;
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
unsigned short uint16_t
Definition
stdint.h:11
uint32_t
unsigned int uint32_t
Definition
stdint.h:12
uint8_t
unsigned char uint8_t
Definition
stdint.h:10
FILE_LICENCE
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition
compiler.h:896
__attribute__
#define __attribute__(x)
Definition
compiler.h:10
stdint.h
bzimage_cmdline
bzImage command-line structure used by older kernels
Definition
bzimage.h:120
bzimage_cmdline::magic
uint16_t magic
Magic signature.
Definition
bzimage.h:122
bzimage_cmdline::offset
uint16_t offset
Offset to command line.
Definition
bzimage.h:124
bzimage_header
A bzImage header.
Definition
bzimage.h:13
bzimage_header::kernel_version
uint16_t kernel_version
Pointer to kernel version string.
Definition
bzimage.h:44
bzimage_header::setup_move_size
uint16_t setup_move_size
Move to high memory size (used with hooks)
Definition
bzimage.h:50
bzimage_header::realmode_swtch
uint32_t realmode_swtch
Boot loader hook (see below)
Definition
bzimage.h:40
bzimage_header::initrd_addr_max
uint32_t initrd_addr_max
Highest legal initrd address.
Definition
bzimage.h:66
bzimage_header::syssize
uint16_t syssize
DO NOT USE - for bootsect.S use only.
Definition
bzimage.h:22
bzimage_header::version
uint16_t version
Boot protocol version supported.
Definition
bzimage.h:38
bzimage_header::root_dev
uint16_t root_dev
Default root device number.
Definition
bzimage.h:30
bzimage_header::setup_sects
uint8_t setup_sects
The size of the setup in sectors.
Definition
bzimage.h:18
bzimage_header::type_of_loader
uint8_t type_of_loader
Boot loader identifier.
Definition
bzimage.h:46
bzimage_header::ramdisk_image
uint32_t ramdisk_image
initrd load address (set by boot loader)
Definition
bzimage.h:54
bzimage_header::relocatable_kernel
uint8_t relocatable_kernel
Whether kernel is relocatable or not.
Definition
bzimage.h:70
bzimage_header::start_sys
uint16_t start_sys
The load-low segment (0x1000) (obsolete)
Definition
bzimage.h:42
bzimage_header::swap_dev
uint16_t swap_dev
DO NOT USE - obsolete.
Definition
bzimage.h:24
bzimage_header::header
uint32_t header
Magic signature "HdrS".
Definition
bzimage.h:36
bzimage_header::pad1
uint16_t pad1
Unused.
Definition
bzimage.h:62
bzimage_header::root_flags
uint16_t root_flags
If set, the root is mounted readonly.
Definition
bzimage.h:20
bzimage_header::boot_flag
uint16_t boot_flag
0xAA55 magic number
Definition
bzimage.h:32
bzimage_header::kernel_alignment
uint32_t kernel_alignment
Physical addr alignment required for kernel.
Definition
bzimage.h:68
bzimage_header::bootsect_kludge
uint32_t bootsect_kludge
DO NOT USE - for bootsect.S use only.
Definition
bzimage.h:58
bzimage_header::cmdline_size
uint32_t cmdline_size
Maximum size of the kernel command line.
Definition
bzimage.h:74
bzimage_header::loadflags
uint8_t loadflags
Boot protocol option flags.
Definition
bzimage.h:48
bzimage_header::code32_start
uint32_t code32_start
Boot loader hook (see below)
Definition
bzimage.h:52
bzimage_header::pad2
uint8_t pad2[3]
Unused.
Definition
bzimage.h:72
bzimage_header::cmd_line_ptr
uint32_t cmd_line_ptr
32-bit pointer to the kernel command line
Definition
bzimage.h:64
bzimage_header::ram_size
uint16_t ram_size
DO NOT USE - for bootsect.S use only.
Definition
bzimage.h:26
bzimage_header::vid_mode
uint16_t vid_mode
Video mode control.
Definition
bzimage.h:28
bzimage_header::ramdisk_size
uint32_t ramdisk_size
initrd size (set by boot loader)
Definition
bzimage.h:56
bzimage_header::jump
uint16_t jump
Jump instruction.
Definition
bzimage.h:34
bzimage_header::heap_end_ptr
uint16_t heap_end_ptr
Free memory after setup end.
Definition
bzimage.h:60
Generated by
1.14.0