Upgraded GRUB2 to 2.00 release.
[AROS.git] / arch / all-pc / boot / grub2-aros / include / multiboot2.h
blob0e26a8ec27a5bbdd76990ec682d77d8c6e83f840
1 /* multiboot2.h - Multiboot 2 header file. */
2 /* Copyright (C) 1999,2003,2007,2008,2009,2010 Free Software Foundation, Inc.
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
5 * of this software and associated documentation files (the "Software"), to
6 * deal in the Software without restriction, including without limitation the
7 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
8 * sell copies of the Software, and to permit persons to whom the Software is
9 * furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ANY
17 * DEVELOPER OR DISTRIBUTOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
18 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
19 * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 #ifndef MULTIBOOT_HEADER
23 #define MULTIBOOT_HEADER 1
25 /* How many bytes from the start of the file we search for the header. */
26 #define MULTIBOOT_SEARCH 32768
27 #define MULTIBOOT_HEADER_ALIGN 8
29 /* The magic field should contain this. */
30 #define MULTIBOOT2_HEADER_MAGIC 0xe85250d6
32 /* This should be in %eax. */
33 #define MULTIBOOT2_BOOTLOADER_MAGIC 0x36d76289
35 /* Alignment of multiboot modules. */
36 #define MULTIBOOT_MOD_ALIGN 0x00001000
38 /* Alignment of the multiboot info structure. */
39 #define MULTIBOOT_INFO_ALIGN 0x00000008
41 /* Flags set in the 'flags' member of the multiboot header. */
43 #define MULTIBOOT_TAG_ALIGN 8
44 #define MULTIBOOT_TAG_TYPE_END 0
45 #define MULTIBOOT_TAG_TYPE_CMDLINE 1
46 #define MULTIBOOT_TAG_TYPE_BOOT_LOADER_NAME 2
47 #define MULTIBOOT_TAG_TYPE_MODULE 3
48 #define MULTIBOOT_TAG_TYPE_BASIC_MEMINFO 4
49 #define MULTIBOOT_TAG_TYPE_BOOTDEV 5
50 #define MULTIBOOT_TAG_TYPE_MMAP 6
51 #define MULTIBOOT_TAG_TYPE_VBE 7
52 #define MULTIBOOT_TAG_TYPE_FRAMEBUFFER 8
53 #define MULTIBOOT_TAG_TYPE_ELF_SECTIONS 9
54 #define MULTIBOOT_TAG_TYPE_APM 10
55 #define MULTIBOOT_TAG_TYPE_EFI32 11
56 #define MULTIBOOT_TAG_TYPE_EFI64 12
57 #define MULTIBOOT_TAG_TYPE_SMBIOS 13
58 #define MULTIBOOT_TAG_TYPE_ACPI_OLD 14
59 #define MULTIBOOT_TAG_TYPE_ACPI_NEW 15
60 #define MULTIBOOT_TAG_TYPE_NETWORK 16
62 #define MULTIBOOT_HEADER_TAG_END 0
63 #define MULTIBOOT_HEADER_TAG_INFORMATION_REQUEST 1
64 #define MULTIBOOT_HEADER_TAG_ADDRESS 2
65 #define MULTIBOOT_HEADER_TAG_ENTRY_ADDRESS 3
66 #define MULTIBOOT_HEADER_TAG_CONSOLE_FLAGS 4
67 #define MULTIBOOT_HEADER_TAG_FRAMEBUFFER 5
68 #define MULTIBOOT_HEADER_TAG_MODULE_ALIGN 6
70 #define MULTIBOOT_ARCHITECTURE_I386 0
71 #define MULTIBOOT_ARCHITECTURE_MIPS32 4
72 #define MULTIBOOT_HEADER_TAG_OPTIONAL 1
74 #define MULTIBOOT_CONSOLE_FLAGS_CONSOLE_REQUIRED 1
75 #define MULTIBOOT_CONSOLE_FLAGS_EGA_TEXT_SUPPORTED 2
77 #ifndef ASM_FILE
79 typedef unsigned char multiboot_uint8_t;
80 typedef unsigned short multiboot_uint16_t;
81 typedef unsigned int multiboot_uint32_t;
82 typedef unsigned long long multiboot_uint64_t;
84 struct multiboot_header
86 /* Must be MULTIBOOT_MAGIC - see above. */
87 multiboot_uint32_t magic;
89 /* ISA */
90 multiboot_uint32_t architecture;
92 /* Total header length. */
93 multiboot_uint32_t header_length;
95 /* The above fields plus this one must equal 0 mod 2^32. */
96 multiboot_uint32_t checksum;
99 struct multiboot_header_tag
101 multiboot_uint16_t type;
102 multiboot_uint16_t flags;
103 multiboot_uint32_t size;
106 struct multiboot_header_tag_information_request
108 multiboot_uint16_t type;
109 multiboot_uint16_t flags;
110 multiboot_uint32_t size;
111 multiboot_uint32_t requests[0];
114 struct multiboot_header_tag_address
116 multiboot_uint16_t type;
117 multiboot_uint16_t flags;
118 multiboot_uint32_t size;
119 multiboot_uint32_t header_addr;
120 multiboot_uint32_t load_addr;
121 multiboot_uint32_t load_end_addr;
122 multiboot_uint32_t bss_end_addr;
125 struct multiboot_header_tag_entry_address
127 multiboot_uint16_t type;
128 multiboot_uint16_t flags;
129 multiboot_uint32_t size;
130 multiboot_uint32_t entry_addr;
133 struct multiboot_header_tag_console_flags
135 multiboot_uint16_t type;
136 multiboot_uint16_t flags;
137 multiboot_uint32_t size;
138 multiboot_uint32_t console_flags;
141 struct multiboot_header_tag_framebuffer
143 multiboot_uint16_t type;
144 multiboot_uint16_t flags;
145 multiboot_uint32_t size;
146 multiboot_uint32_t width;
147 multiboot_uint32_t height;
148 multiboot_uint32_t depth;
151 struct multiboot_header_tag_module_align
153 multiboot_uint16_t type;
154 multiboot_uint16_t flags;
155 multiboot_uint32_t size;
156 multiboot_uint32_t width;
157 multiboot_uint32_t height;
158 multiboot_uint32_t depth;
161 struct multiboot_color
163 multiboot_uint8_t red;
164 multiboot_uint8_t green;
165 multiboot_uint8_t blue;
168 struct multiboot_mmap_entry
170 multiboot_uint64_t addr;
171 multiboot_uint64_t len;
172 #define MULTIBOOT_MEMORY_AVAILABLE 1
173 #define MULTIBOOT_MEMORY_RESERVED 2
174 #define MULTIBOOT_MEMORY_ACPI_RECLAIMABLE 3
175 #define MULTIBOOT_MEMORY_NVS 4
176 #define MULTIBOOT_MEMORY_BADRAM 5
177 multiboot_uint32_t type;
178 multiboot_uint32_t zero;
179 } __attribute__((packed));
180 typedef struct multiboot_mmap_entry multiboot_memory_map_t;
182 struct multiboot_tag
184 multiboot_uint32_t type;
185 multiboot_uint32_t size;
188 struct multiboot_tag_string
190 multiboot_uint32_t type;
191 multiboot_uint32_t size;
192 char string[0];
195 struct multiboot_tag_module
197 multiboot_uint32_t type;
198 multiboot_uint32_t size;
199 multiboot_uint32_t mod_start;
200 multiboot_uint32_t mod_end;
201 char cmdline[0];
204 struct multiboot_tag_basic_meminfo
206 multiboot_uint32_t type;
207 multiboot_uint32_t size;
208 multiboot_uint32_t mem_lower;
209 multiboot_uint32_t mem_upper;
212 struct multiboot_tag_bootdev
214 multiboot_uint32_t type;
215 multiboot_uint32_t size;
216 multiboot_uint32_t biosdev;
217 multiboot_uint32_t slice;
218 multiboot_uint32_t part;
221 struct multiboot_tag_mmap
223 multiboot_uint32_t type;
224 multiboot_uint32_t size;
225 multiboot_uint32_t entry_size;
226 multiboot_uint32_t entry_version;
227 struct multiboot_mmap_entry entries[0];
230 struct multiboot_vbe_info_block
232 multiboot_uint8_t external_specification[512];
235 struct multiboot_vbe_mode_info_block
237 multiboot_uint8_t external_specification[256];
240 struct multiboot_tag_vbe
242 multiboot_uint32_t type;
243 multiboot_uint32_t size;
245 multiboot_uint16_t vbe_mode;
246 multiboot_uint16_t vbe_interface_seg;
247 multiboot_uint16_t vbe_interface_off;
248 multiboot_uint16_t vbe_interface_len;
250 struct multiboot_vbe_info_block vbe_control_info;
251 struct multiboot_vbe_mode_info_block vbe_mode_info;
254 struct multiboot_tag_framebuffer_common
256 multiboot_uint32_t type;
257 multiboot_uint32_t size;
259 multiboot_uint64_t framebuffer_addr;
260 multiboot_uint32_t framebuffer_pitch;
261 multiboot_uint32_t framebuffer_width;
262 multiboot_uint32_t framebuffer_height;
263 multiboot_uint8_t framebuffer_bpp;
264 #define MULTIBOOT_FRAMEBUFFER_TYPE_INDEXED 0
265 #define MULTIBOOT_FRAMEBUFFER_TYPE_RGB 1
266 #define MULTIBOOT_FRAMEBUFFER_TYPE_EGA_TEXT 2
267 multiboot_uint8_t framebuffer_type;
268 multiboot_uint16_t reserved;
271 struct multiboot_tag_framebuffer
273 struct multiboot_tag_framebuffer_common common;
275 union
277 struct
279 multiboot_uint16_t framebuffer_palette_num_colors;
280 struct multiboot_color framebuffer_palette[0];
282 struct
284 multiboot_uint8_t framebuffer_red_field_position;
285 multiboot_uint8_t framebuffer_red_mask_size;
286 multiboot_uint8_t framebuffer_green_field_position;
287 multiboot_uint8_t framebuffer_green_mask_size;
288 multiboot_uint8_t framebuffer_blue_field_position;
289 multiboot_uint8_t framebuffer_blue_mask_size;
294 struct multiboot_tag_elf_sections
296 multiboot_uint32_t type;
297 multiboot_uint32_t size;
298 multiboot_uint32_t num;
299 multiboot_uint32_t entsize;
300 multiboot_uint32_t shndx;
301 char sections[0];
304 struct multiboot_tag_apm
306 multiboot_uint32_t type;
307 multiboot_uint32_t size;
308 multiboot_uint16_t version;
309 multiboot_uint16_t cseg;
310 multiboot_uint32_t offset;
311 multiboot_uint16_t cseg_16;
312 multiboot_uint16_t dseg;
313 multiboot_uint16_t flags;
314 multiboot_uint16_t cseg_len;
315 multiboot_uint16_t cseg_16_len;
316 multiboot_uint16_t dseg_len;
319 struct multiboot_tag_efi32
321 multiboot_uint32_t type;
322 multiboot_uint32_t size;
323 multiboot_uint32_t pointer;
326 struct multiboot_tag_efi64
328 multiboot_uint32_t type;
329 multiboot_uint32_t size;
330 multiboot_uint64_t pointer;
333 struct multiboot_tag_smbios
335 multiboot_uint32_t type;
336 multiboot_uint32_t size;
337 multiboot_uint8_t major;
338 multiboot_uint8_t minor;
339 multiboot_uint8_t reserved[6];
340 multiboot_uint8_t tables[0];
343 struct multiboot_tag_old_acpi
345 multiboot_uint32_t type;
346 multiboot_uint32_t size;
347 multiboot_uint8_t rsdp[0];
350 struct multiboot_tag_new_acpi
352 multiboot_uint32_t type;
353 multiboot_uint32_t size;
354 multiboot_uint8_t rsdp[0];
357 struct multiboot_tag_network
359 multiboot_uint32_t type;
360 multiboot_uint32_t size;
361 multiboot_uint8_t dhcpack[0];
364 #endif /* ! ASM_FILE */
366 #endif /* ! MULTIBOOT_HEADER */