]> git.proxmox.com Git - grub2.git/blob - include/multiboot2.h
2010-01-07 Robert Millan <rmh.grub@aybabtu.com>
[grub2.git] / include / multiboot2.h
1 /* multiboot2.h - multiboot 2 header file. */
2 /*
3 * GRUB -- GRand Unified Bootloader
4 * Copyright (C) 2007,2009 Free Software Foundation, Inc.
5 *
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.
10 *
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.
15 *
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/>.
18 */
19
20 #ifndef MULTIBOOT2_HEADER
21 #define MULTIBOOT2_HEADER 1
22
23 /* How many bytes from the start of the file we search for the header. */
24 #define MULTIBOOT2_HEADER_SEARCH 8192
25
26 /* The magic field should contain this. */
27 #define MULTIBOOT2_HEADER_MAGIC 0xe85250d6
28
29 /* Passed from the bootloader to the kernel. */
30 #define MULTIBOOT2_BOOTLOADER_MAGIC 0x36d76289
31
32 /* Alignment of multiboot modules. */
33 #define MULTIBOOT2_MOD_ALIGN 0x00001000
34
35 #ifndef ASM_FILE
36
37 #ifndef __WORDSIZE
38 #include <stdint.h>
39 #endif
40
41 /* XXX not portable? */
42 #if __WORDSIZE == 64
43 typedef uint64_t multiboot2_word;
44 #else
45 typedef uint32_t multiboot2_word;
46 #endif
47
48 struct multiboot2_header
49 {
50 uint32_t magic;
51 uint32_t flags;
52 };
53
54 struct multiboot2_tag_header
55 {
56 uint32_t key;
57 uint32_t len;
58 };
59
60 #define MULTIBOOT2_TAG_RESERVED1 0
61 #define MULTIBOOT2_TAG_RESERVED2 (~0)
62
63 #define MULTIBOOT2_TAG_START 1
64 struct multiboot2_tag_start
65 {
66 struct multiboot2_tag_header header;
67 multiboot2_word size; /* Total size of all multiboot tags. */
68 };
69
70 #define MULTIBOOT2_TAG_NAME 2
71 struct multiboot2_tag_name
72 {
73 struct multiboot2_tag_header header;
74 char name[1];
75 };
76
77 #define MULTIBOOT2_TAG_MODULE 3
78 struct multiboot2_tag_module
79 {
80 struct multiboot2_tag_header header;
81 multiboot2_word addr;
82 multiboot2_word size;
83 char type[36];
84 char cmdline[1];
85 };
86
87 #define MULTIBOOT2_TAG_MEMORY 4
88 struct multiboot2_tag_memory
89 {
90 struct multiboot2_tag_header header;
91 multiboot2_word addr;
92 multiboot2_word size;
93 multiboot2_word type;
94 };
95
96 #define MULTIBOOT2_TAG_UNUSED 5
97 struct multiboot2_tag_unused
98 {
99 struct multiboot2_tag_header header;
100 };
101
102 #define MULTIBOOT2_TAG_END 0xffff
103 struct multiboot2_tag_end
104 {
105 struct multiboot2_tag_header header;
106 };
107
108 #endif /* ! ASM_FILE */
109
110 #endif /* ! MULTIBOOT2_HEADER */