ignore grub-dumpbios
[grub2/phcoder.git] / include / multiboot2.h
blob0f2b0cf2d1363175d78ca21258b3bf0ec8df25af
1 /* multiboot2.h - multiboot 2 header file. */
2 /*
3 * GRUB -- GRand Unified Bootloader
4 * Copyright (C) 2007 Free Software Foundation, Inc.
6 * GRUB is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * GRUB is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef MULTIBOOT2_HEADER
21 #define MULTIBOOT2_HEADER 1
23 /* How many bytes from the start of the file we search for the header. */
24 #define MULTIBOOT2_HEADER_SEARCH 8192
26 /* The magic field should contain this. */
27 #define MULTIBOOT2_HEADER_MAGIC 0xe85250d6
29 /* Passed from the bootloader to the kernel. */
30 #define MULTIBOOT2_BOOTLOADER_MAGIC 0x36d76289
32 /* Alignment of multiboot modules. */
33 #define MULTIBOOT2_MOD_ALIGN 0x00001000
35 #ifndef ASM_FILE
37 #include "stdint.h"
39 /* XXX not portable? */
40 #if __WORDSIZE == 64
41 typedef uint64_t multiboot_word;
42 #else
43 typedef uint32_t multiboot_word;
44 #endif
46 struct multiboot_header
48 uint32_t magic;
49 uint32_t flags;
52 struct multiboot_tag_header
54 uint32_t key;
55 uint32_t len;
58 #define MULTIBOOT2_TAG_RESERVED1 0
59 #define MULTIBOOT2_TAG_RESERVED2 (~0)
61 #define MULTIBOOT2_TAG_START 1
62 struct multiboot_tag_start
64 struct multiboot_tag_header header;
65 multiboot_word size; /* Total size of all multiboot tags. */
68 #define MULTIBOOT2_TAG_NAME 2
69 struct multiboot_tag_name
71 struct multiboot_tag_header header;
72 char name[1];
75 #define MULTIBOOT2_TAG_MODULE 3
76 struct multiboot_tag_module
78 struct multiboot_tag_header header;
79 multiboot_word addr;
80 multiboot_word size;
81 char type[36];
82 char cmdline[1];
85 #define MULTIBOOT2_TAG_MEMORY 4
86 struct multiboot_tag_memory
88 struct multiboot_tag_header header;
89 multiboot_word addr;
90 multiboot_word size;
91 multiboot_word type;
94 #define MULTIBOOT2_TAG_UNUSED 5
95 struct multiboot_tag_unused
97 struct multiboot_tag_header header;
100 #define MULTIBOOT2_TAG_END 0xffff
101 struct multiboot_tag_end
103 struct multiboot_tag_header header;
106 #endif /* ! ASM_FILE */
108 #endif /* ! MULTIBOOT2_HEADER */