]> git.proxmox.com Git - grub2.git/blame - include/multiboot2.h
Merge branch 'master' of git.sv.gnu.org:/srv/git/grub
[grub2.git] / include / multiboot2.h
CommitLineData
bc8b32b3
RM
1/* multiboot2.h - Multiboot 2 header file. */
2/* Copyright (C) 1999,2003,2007,2008,2009,2010 Free Software Foundation, Inc.
e5dfe777 3 *
bc8b32b3
RM
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:
e5dfe777 10 *
bc8b32b3
RM
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
e5dfe777 13 *
bc8b32b3
RM
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.
e5dfe777 20 */
21
bc8b32b3
RM
22#ifndef MULTIBOOT_HEADER
23#define MULTIBOOT_HEADER 1
e5dfe777 24
25/* How many bytes from the start of the file we search for the header. */
b1f6f35a
VS
26#define MULTIBOOT_SEARCH 32768
27#define MULTIBOOT_HEADER_ALIGN 8
e5dfe777 28
29/* The magic field should contain this. */
bc8b32b3 30#define MULTIBOOT2_HEADER_MAGIC 0xe85250d6
e5dfe777 31
bc8b32b3
RM
32/* This should be in %eax. */
33#define MULTIBOOT2_BOOTLOADER_MAGIC 0x36d76289
e5dfe777 34
35/* Alignment of multiboot modules. */
bc8b32b3 36#define MULTIBOOT_MOD_ALIGN 0x00001000
e5dfe777 37
bc8b32b3 38/* Alignment of the multiboot info structure. */
016883a5 39#define MULTIBOOT_INFO_ALIGN 0x00000008
e5dfe777 40
bc8b32b3 41/* Flags set in the 'flags' member of the multiboot header. */
e5dfe777 42
8eb567e6 43#define MULTIBOOT_TAG_ALIGN 8
5408044f
VS
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
c3a8dfc8
VS
53#define MULTIBOOT_TAG_TYPE_ELF_SECTIONS 9
54#define MULTIBOOT_TAG_TYPE_APM 10
77a94e98
VS
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
329550c4 61#define MULTIBOOT_TAG_TYPE_EFI_MMAP 17
0df77d79 62#define MULTIBOOT_TAG_TYPE_EFI_BS 18
bc8b32b3 63
b1f6f35a
VS
64#define MULTIBOOT_HEADER_TAG_END 0
65#define MULTIBOOT_HEADER_TAG_INFORMATION_REQUEST 1
66#define MULTIBOOT_HEADER_TAG_ADDRESS 2
67#define MULTIBOOT_HEADER_TAG_ENTRY_ADDRESS 3
68#define MULTIBOOT_HEADER_TAG_CONSOLE_FLAGS 4
69#define MULTIBOOT_HEADER_TAG_FRAMEBUFFER 5
70#define MULTIBOOT_HEADER_TAG_MODULE_ALIGN 6
0df77d79 71#define MULTIBOOT_HEADER_TAG_EFI_BS 7
b1f6f35a 72
8c46a785
VS
73#define MULTIBOOT_ARCHITECTURE_I386 0
74#define MULTIBOOT_ARCHITECTURE_MIPS32 4
b1f6f35a
VS
75#define MULTIBOOT_HEADER_TAG_OPTIONAL 1
76
c3a8dfc8
VS
77#define MULTIBOOT_CONSOLE_FLAGS_CONSOLE_REQUIRED 1
78#define MULTIBOOT_CONSOLE_FLAGS_EGA_TEXT_SUPPORTED 2
79
bc8b32b3
RM
80#ifndef ASM_FILE
81
57e41c71 82typedef unsigned char multiboot_uint8_t;
bc8b32b3
RM
83typedef unsigned short multiboot_uint16_t;
84typedef unsigned int multiboot_uint32_t;
85typedef unsigned long long multiboot_uint64_t;
86
87struct multiboot_header
e5dfe777 88{
bc8b32b3
RM
89 /* Must be MULTIBOOT_MAGIC - see above. */
90 multiboot_uint32_t magic;
91
b1f6f35a
VS
92 /* ISA */
93 multiboot_uint32_t architecture;
94
95 /* Total header length. */
96 multiboot_uint32_t header_length;
bc8b32b3
RM
97
98 /* The above fields plus this one must equal 0 mod 2^32. */
99 multiboot_uint32_t checksum;
b1f6f35a
VS
100};
101
102struct multiboot_header_tag
103{
46960ff9
VS
104 multiboot_uint16_t type;
105 multiboot_uint16_t flags;
b1f6f35a 106 multiboot_uint32_t size;
b1f6f35a
VS
107};
108
109struct multiboot_header_tag_information_request
110{
46960ff9
VS
111 multiboot_uint16_t type;
112 multiboot_uint16_t flags;
b1f6f35a 113 multiboot_uint32_t size;
b1f6f35a
VS
114 multiboot_uint32_t requests[0];
115};
bc8b32b3 116
b1f6f35a
VS
117struct multiboot_header_tag_address
118{
46960ff9
VS
119 multiboot_uint16_t type;
120 multiboot_uint16_t flags;
b1f6f35a 121 multiboot_uint32_t size;
bc8b32b3
RM
122 multiboot_uint32_t header_addr;
123 multiboot_uint32_t load_addr;
124 multiboot_uint32_t load_end_addr;
125 multiboot_uint32_t bss_end_addr;
b1f6f35a
VS
126};
127
128struct multiboot_header_tag_entry_address
129{
46960ff9
VS
130 multiboot_uint16_t type;
131 multiboot_uint16_t flags;
b1f6f35a 132 multiboot_uint32_t size;
bc8b32b3 133 multiboot_uint32_t entry_addr;
b1f6f35a
VS
134};
135
136struct multiboot_header_tag_console_flags
137{
46960ff9
VS
138 multiboot_uint16_t type;
139 multiboot_uint16_t flags;
b1f6f35a 140 multiboot_uint32_t size;
b1f6f35a
VS
141 multiboot_uint32_t console_flags;
142};
bc8b32b3 143
b1f6f35a
VS
144struct multiboot_header_tag_framebuffer
145{
46960ff9
VS
146 multiboot_uint16_t type;
147 multiboot_uint16_t flags;
b1f6f35a 148 multiboot_uint32_t size;
b1f6f35a
VS
149 multiboot_uint32_t width;
150 multiboot_uint32_t height;
151 multiboot_uint32_t depth;
152};
153
154struct multiboot_header_tag_module_align
155{
46960ff9
VS
156 multiboot_uint16_t type;
157 multiboot_uint16_t flags;
b1f6f35a 158 multiboot_uint32_t size;
bc8b32b3
RM
159 multiboot_uint32_t width;
160 multiboot_uint32_t height;
161 multiboot_uint32_t depth;
e5dfe777 162};
163
5408044f
VS
164struct multiboot_color
165{
166 multiboot_uint8_t red;
167 multiboot_uint8_t green;
168 multiboot_uint8_t blue;
169};
170
171struct multiboot_mmap_entry
172{
5408044f
VS
173 multiboot_uint64_t addr;
174 multiboot_uint64_t len;
175#define MULTIBOOT_MEMORY_AVAILABLE 1
176#define MULTIBOOT_MEMORY_RESERVED 2
3f5a90c6
VS
177#define MULTIBOOT_MEMORY_ACPI_RECLAIMABLE 3
178#define MULTIBOOT_MEMORY_NVS 4
77a94e98 179#define MULTIBOOT_MEMORY_BADRAM 5
5408044f 180 multiboot_uint32_t type;
8eb567e6 181 multiboot_uint32_t zero;
7e47e27b 182} GRUB_PACKED;
5408044f
VS
183typedef struct multiboot_mmap_entry multiboot_memory_map_t;
184
185struct multiboot_tag
e5dfe777 186{
5408044f
VS
187 multiboot_uint32_t type;
188 multiboot_uint32_t size;
e5dfe777 189};
190
5408044f 191struct multiboot_tag_string
e5dfe777 192{
5408044f 193 multiboot_uint32_t type;
bc8b32b3 194 multiboot_uint32_t size;
5408044f 195 char string[0];
e5dfe777 196};
197
5408044f 198struct multiboot_tag_module
e5dfe777 199{
5408044f
VS
200 multiboot_uint32_t type;
201 multiboot_uint32_t size;
202 multiboot_uint32_t mod_start;
203 multiboot_uint32_t mod_end;
204 char cmdline[0];
205};
bc8b32b3 206
5408044f
VS
207struct multiboot_tag_basic_meminfo
208{
209 multiboot_uint32_t type;
210 multiboot_uint32_t size;
bc8b32b3
RM
211 multiboot_uint32_t mem_lower;
212 multiboot_uint32_t mem_upper;
5408044f 213};
bc8b32b3 214
5408044f
VS
215struct multiboot_tag_bootdev
216{
217 multiboot_uint32_t type;
218 multiboot_uint32_t size;
219 multiboot_uint32_t biosdev;
220 multiboot_uint32_t slice;
221 multiboot_uint32_t part;
222};
bc8b32b3 223
5408044f
VS
224struct multiboot_tag_mmap
225{
226 multiboot_uint32_t type;
227 multiboot_uint32_t size;
8eb567e6
VS
228 multiboot_uint32_t entry_size;
229 multiboot_uint32_t entry_version;
5408044f
VS
230 struct multiboot_mmap_entry entries[0];
231};
bc8b32b3 232
5408044f
VS
233struct multiboot_vbe_info_block
234{
235 multiboot_uint8_t external_specification[512];
236};
bc8b32b3 237
5408044f
VS
238struct multiboot_vbe_mode_info_block
239{
240 multiboot_uint8_t external_specification[256];
241};
bc8b32b3 242
5408044f
VS
243struct multiboot_tag_vbe
244{
245 multiboot_uint32_t type;
246 multiboot_uint32_t size;
bc8b32b3 247
bc8b32b3
RM
248 multiboot_uint16_t vbe_mode;
249 multiboot_uint16_t vbe_interface_seg;
250 multiboot_uint16_t vbe_interface_off;
251 multiboot_uint16_t vbe_interface_len;
57e41c71 252
5408044f
VS
253 struct multiboot_vbe_info_block vbe_control_info;
254 struct multiboot_vbe_mode_info_block vbe_mode_info;
255};
256
257struct multiboot_tag_framebuffer_common
258{
259 multiboot_uint32_t type;
260 multiboot_uint32_t size;
261
57e41c71
VS
262 multiboot_uint64_t framebuffer_addr;
263 multiboot_uint32_t framebuffer_pitch;
264 multiboot_uint32_t framebuffer_width;
265 multiboot_uint32_t framebuffer_height;
266 multiboot_uint8_t framebuffer_bpp;
01740292
VS
267#define MULTIBOOT_FRAMEBUFFER_TYPE_INDEXED 0
268#define MULTIBOOT_FRAMEBUFFER_TYPE_RGB 1
269#define MULTIBOOT_FRAMEBUFFER_TYPE_EGA_TEXT 2
57e41c71 270 multiboot_uint8_t framebuffer_type;
8eb567e6 271 multiboot_uint16_t reserved;
5408044f
VS
272};
273
274struct multiboot_tag_framebuffer
275{
276 struct multiboot_tag_framebuffer_common common;
277
57e41c71
VS
278 union
279 {
280 struct
281 {
57e41c71 282 multiboot_uint16_t framebuffer_palette_num_colors;
5408044f 283 struct multiboot_color framebuffer_palette[0];
57e41c71
VS
284 };
285 struct
286 {
287 multiboot_uint8_t framebuffer_red_field_position;
288 multiboot_uint8_t framebuffer_red_mask_size;
289 multiboot_uint8_t framebuffer_green_field_position;
290 multiboot_uint8_t framebuffer_green_mask_size;
291 multiboot_uint8_t framebuffer_blue_field_position;
292 multiboot_uint8_t framebuffer_blue_mask_size;
293 };
294 };
e5dfe777 295};
e5dfe777 296
8eb567e6
VS
297struct multiboot_tag_elf_sections
298{
299 multiboot_uint32_t type;
300 multiboot_uint32_t size;
301 multiboot_uint32_t num;
302 multiboot_uint32_t entsize;
303 multiboot_uint32_t shndx;
304 char sections[0];
305};
306
307struct multiboot_tag_apm
308{
309 multiboot_uint32_t type;
310 multiboot_uint32_t size;
311 multiboot_uint16_t version;
312 multiboot_uint16_t cseg;
313 multiboot_uint32_t offset;
314 multiboot_uint16_t cseg_16;
315 multiboot_uint16_t dseg;
316 multiboot_uint16_t flags;
317 multiboot_uint16_t cseg_len;
318 multiboot_uint16_t cseg_16_len;
319 multiboot_uint16_t dseg_len;
320};
321
77a94e98
VS
322struct multiboot_tag_efi32
323{
324 multiboot_uint32_t type;
325 multiboot_uint32_t size;
326 multiboot_uint32_t pointer;
327};
328
329struct multiboot_tag_efi64
330{
331 multiboot_uint32_t type;
332 multiboot_uint32_t size;
333 multiboot_uint64_t pointer;
334};
335
336struct multiboot_tag_smbios
337{
338 multiboot_uint32_t type;
339 multiboot_uint32_t size;
340 multiboot_uint8_t major;
341 multiboot_uint8_t minor;
342 multiboot_uint8_t reserved[6];
343 multiboot_uint8_t tables[0];
344};
345
346struct multiboot_tag_old_acpi
347{
348 multiboot_uint32_t type;
349 multiboot_uint32_t size;
350 multiboot_uint8_t rsdp[0];
351};
352
353struct multiboot_tag_new_acpi
354{
355 multiboot_uint32_t type;
356 multiboot_uint32_t size;
357 multiboot_uint8_t rsdp[0];
358};
359
360struct multiboot_tag_network
361{
362 multiboot_uint32_t type;
363 multiboot_uint32_t size;
364 multiboot_uint8_t dhcpack[0];
365};
366
329550c4
VS
367struct multiboot_tag_efi_mmap
368{
369 multiboot_uint32_t type;
370 multiboot_uint32_t size;
371 multiboot_uint32_t descr_size;
372 multiboot_uint32_t descr_vers;
373 multiboot_uint8_t efi_mmap[0];
374};
375
e5dfe777 376#endif /* ! ASM_FILE */
377
bc8b32b3 378#endif /* ! MULTIBOOT_HEADER */