11 /* The entire multiboot_header must be contained
12 * within the first MULTIBOOT_SEARCH bytes of the kernel image. */
15 /* Magic value identifying the multiboot_header. */
18 /* Features flags for 'flags'.
19 * If a boot loader sees a flag in MULTIBOOT_MUSTKNOW set
20 * and it doesn't understand it, it must fail. */
21 Mustknow = 0x0000ffff,
23 /* Align all boot modules on page (4KB) boundaries. */
24 Page_align = 0x00000001,
26 /* Must be provided memory information in multiboot_info structure */
27 Memory_info = 0x00000002,
29 /* Use the load address fields above instead of the ones in the a.out
30 * header to figure out what to load where, and what to do afterwards.
31 * This should only be needed for a.out kernel images (ELF and other
32 * formats can generally provide the needed information). */
33 Aout_kludge = 0x00010000,
35 /* The boot loader passes this value in register EAX to signal the kernel
36 * that the multiboot method is being used */
40 /* Must be MULTIBOOT_MAGIC */
43 /* Feature flags - see below. */
46 /* Checksum: magic + flags + checksum == 0 */
49 /* These are only valid if MULTIBOOT_AOUT_KLUDGE is set. */
50 Unsigned32 header_addr;
52 Unsigned32 load_end_addr;
53 Unsigned32 bss_end_addr;
55 } __attribute__((packed));
57 /* VBE controller information. */
58 class Multiboot_vbe_controller
61 Unsigned8 signature[4];
63 Unsigned32 oem_string;
64 Unsigned32 capabilities;
65 Unsigned32 video_mode;
66 Unsigned16 total_memory;
67 Unsigned16 oem_software_rev;
68 Unsigned32 oem_vendor_name;
69 Unsigned32 oem_product_name;
70 Unsigned32 oem_product_rev;
71 Unsigned8 reserved[222];
72 Unsigned8 oem_data[256];
73 } __attribute__((packed));
75 /* VBE mode information. */
76 class Multiboot_vbe_mode
79 Unsigned16 mode_attributes;
80 Unsigned8 win_a_attributes;
81 Unsigned8 win_b_attributes;
82 Unsigned16 win_granularity;
84 Unsigned16 win_a_segment;
85 Unsigned16 win_b_segment;
87 Unsigned16 bytes_per_scanline;
90 Unsigned16 x_resolution;
91 Unsigned16 y_resolution;
92 Unsigned8 x_char_size;
93 Unsigned8 y_char_size;
94 Unsigned8 number_of_planes;
95 Unsigned8 bits_per_pixel;
96 Unsigned8 number_of_banks;
97 Unsigned8 memory_model;
99 Unsigned8 number_of_image_pages;
103 Unsigned8 red_mask_size;
104 Unsigned8 red_field_position;
105 Unsigned8 green_mask_size;
106 Unsigned8 green_field_position;
107 Unsigned8 blue_mask_size;
108 Unsigned8 blue_field_position;
109 Unsigned8 reserved_mask_size;
110 Unsigned8 reserved_field_position;
111 Unsigned8 direct_color_mode_info;
114 Unsigned32 phys_base;
115 Unsigned32 reserved1;
116 Unsigned16 reversed2;
119 Unsigned16 linear_bytes_per_scanline;
120 Unsigned8 banked_number_of_image_pages;
121 Unsigned8 linear_number_of_image_pages;
122 Unsigned8 linear_red_mask_size;
123 Unsigned8 linear_red_field_position;
124 Unsigned8 linear_green_mask_size;
125 Unsigned8 linear_green_field_position;
126 Unsigned8 linear_blue_mask_size;
127 Unsigned8 linear_blue_field_position;
128 Unsigned8 linear_reserved_mask_size;
129 Unsigned8 linear_reserved_field_position;
130 Unsigned32 max_pixel_clock;
132 Unsigned8 reserved3[189];
133 } __attribute__((packed));
141 Boot_device = (1L<<1),
147 Drive_info = (1L<<7),
149 Boot_ld_name = (1L<<9),
150 Apm_table = (1L<<10),
151 Video_info = (1L<<11),
154 /* These flags indicate which parts of the multiboot_info are valid;
155 * see below for the actual flag bit definitions. */
158 /* Lower/Upper memory installed in the machine.
159 * Valid only if MULTIBOOT_MEMORY is set in flags word above. */
160 Unsigned32 mem_lower;
161 Unsigned32 mem_upper;
163 /* BIOS disk device the kernel was loaded from.
164 * Valid only if MULTIBOOT_BOOT_DEVICE is set in flags word above. */
165 Unsigned8 boot_device[4];
167 /* Command-line for the OS kernel: a null-terminated ASCII string.
168 * Valid only if MULTIBOOT_CMDLINE is set in flags word above. */
171 /* List of boot modules loaded with the kernel.
172 * Valid only if MULTIBOOT_MODS is set in flags word above. */
173 Unsigned32 mods_count;
174 Unsigned32 mods_addr;
176 /* Symbol information for a.out or ELF executables. */
179 struct __attribute__((packed))
181 /* a.out symbol information valid only if MULTIBOOT_AOUT_SYMS
182 is set in flags word above. */
189 struct __attribute__((packed))
191 /* ELF section header information valid only if
192 MULTIBOOT_ELF_SHDR is set in flags word above. */
200 /* Memory map buffer.
201 Valid only if MULTIBOOT_MEM_MAP is set in flags word above. */
202 Unsigned32 mmap_count;
203 Unsigned32 mmap_addr;
205 /* Drive Info buffer */
206 Unsigned32 drives_length;
207 Unsigned32 drives_addr;
209 /* ROM configuration table */
210 Unsigned32 config_table;
212 /* Boot Loader Name */
213 Unsigned32 boot_loader_name;
216 Unsigned32 apm_table;
219 Unsigned32 vbe_control_info;
220 Unsigned32 vbe_mode_info;
222 Unsigned16 vbe_interface_seg;
223 Unsigned16 vbe_interface_off;
224 Unsigned16 vbe_interface_len;
225 } __attribute__((packed));
227 /* The mods_addr field above contains the physical address of the first
228 of 'mods_count' multiboot_module structures. */
229 class Multiboot_module
232 /* Physical start and end addresses of the module data itself. */
233 Unsigned32 mod_start;
236 /* Arbitrary ASCII string associated with the module. */
239 /* Boot loader must set to 0; OS must ignore. */
241 } __attribute__((packed));
244 /* The mmap_addr field above contains the physical address of the first
245 of the AddrRangeDesc structure. "size" represents the size of the
246 rest of the structure and optional padding. The offset to the beginning
247 of the next structure is therefore "size + 4". */
251 Unsigned32 BaseAddrLow;
252 Unsigned32 BaseAddrHigh;
253 Unsigned32 LengthLow;
254 Unsigned32 LengthHigh;
256 /* unspecified optional padding... */
257 } __attribute__((packed));