1
/* multiboot.h - multiboot header file. */
3
* GRUB -- GRand Unified Bootloader
4
* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
6
* This program 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 2 of the License, or
9
* (at your option) any later version.
11
* This program 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 this program; if not, write to the Free Software
18
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21
#ifndef GRUB_MULTIBOOT_MACHINE_HEADER
22
#define GRUB_MULTIBOOT_MACHINE_HEADER 1
24
/* How many bytes from the start of the file we search for the header. */
25
#define GRUB_MB_SEARCH 8192
27
/* The magic field should contain this. */
28
#define GRUB_MB_MAGIC 0x1BADB002
30
/* This should be in %eax. */
31
#define GRUB_MB_MAGIC2 0x2BADB002
33
/* The bits in the required part of flags field we don't support. */
34
#define GRUB_MB_UNSUPPORTED 0x0000fffc
36
/* Alignment of multiboot modules. */
37
#define GRUB_MB_MOD_ALIGN 0x00001000
40
* Flags set in the 'flags' member of the multiboot header.
43
/* Align all boot modules on i386 page (4KB) boundaries. */
44
#define GRUB_MB_PAGE_ALIGN 0x00000001
46
/* Must pass memory information to OS. */
47
#define GRUB_MB_MEMORY_INFO 0x00000002
49
/* Must pass video information to OS. */
50
#define GRUB_MB_VIDEO_MODE 0x00000004
52
/* This flag indicates the use of the address fields in the header. */
53
#define GRUB_MB_AOUT_KLUDGE 0x00010000
56
* Flags to be set in the 'flags' member of the multiboot info structure.
59
/* is there basic lower/upper memory information? */
60
#define GRUB_MB_INFO_MEMORY 0x00000001
61
/* is there a boot device set? */
62
#define GRUB_MB_INFO_BOOTDEV 0x00000002
63
/* is the command-line defined? */
64
#define GRUB_MB_INFO_CMDLINE 0x00000004
65
/* are there modules to do something with? */
66
#define GRUB_MB_INFO_MODS 0x00000008
68
/* These next two are mutually exclusive */
70
/* is there a symbol table loaded? */
71
#define GRUB_MB_INFO_AOUT_SYMS 0x00000010
72
/* is there an ELF section header table? */
73
#define GRUB_MB_INFO_ELF_SHDR 0x00000020
75
/* is there a full memory map? */
76
#define GRUB_MB_INFO_MEM_MAP 0x00000040
78
/* Is there drive info? */
79
#define GRUB_MB_INFO_DRIVE_INFO 0x00000080
81
/* Is there a config table? */
82
#define GRUB_MB_INFO_CONFIG_TABLE 0x00000100
84
/* Is there a boot loader name? */
85
#define GRUB_MB_INFO_BOOT_LOADER_NAME 0x00000200
87
/* Is there a APM table? */
88
#define GRUB_MB_INFO_APM_TABLE 0x00000400
90
/* Is there video information? */
91
#define GRUB_MB_INFO_VIDEO_INFO 0x00000800
95
#include <grub/types.h>
97
struct grub_multiboot_header
99
/* Must be GRUB_MB_MAGIC - see above. */
105
/* The above fields plus this one must equal 0 mod 2^32. */
106
grub_uint32_t checksum;
108
/* These are only valid if GRUB_MB_AOUT_KLUDGE is set. */
109
grub_uint32_t header_addr;
110
grub_uint32_t load_addr;
111
grub_uint32_t load_end_addr;
112
grub_uint32_t bss_end_addr;
113
grub_uint32_t entry_addr;
115
/* These are only valid if GRUB_MB_VIDEO_MODE is set. */
116
grub_uint32_t mode_type;
118
grub_uint32_t height;
122
struct grub_multiboot_info
124
/* MultiBoot info version number */
127
/* Available memory from BIOS */
128
grub_uint32_t mem_lower;
129
grub_uint32_t mem_upper;
131
/* "root" partition */
132
grub_uint32_t boot_device;
134
/* Kernel command line */
135
grub_uint32_t cmdline;
137
/* Boot-Module list */
138
grub_uint32_t mods_count;
139
grub_uint32_t mods_addr;
141
grub_uint32_t syms[4];
143
/* Memory Mapping buffer */
144
grub_uint32_t mmap_length;
145
grub_uint32_t mmap_addr;
147
/* Drive Info buffer */
148
grub_uint32_t drives_length;
149
grub_uint32_t drives_addr;
151
/* ROM configuration table */
152
grub_uint32_t config_table;
154
/* Boot Loader Name */
155
grub_uint32_t boot_loader_name;
158
grub_uint32_t apm_table;
161
grub_uint32_t vbe_control_info;
162
grub_uint32_t vbe_mode_info;
163
grub_uint16_t vbe_mode;
164
grub_uint16_t vbe_interface_seg;
165
grub_uint16_t vbe_interface_off;
166
grub_uint16_t vbe_interface_len;
171
/* the memory used goes from bytes 'mod_start' to 'mod_end-1' inclusive */
172
grub_uint32_t mod_start;
173
grub_uint32_t mod_end;
175
/* Module command line */
176
grub_uint32_t cmdline;
178
/* padding to take it to 16 bytes (must be zero) */
182
#endif /* ! ASM_FILE */
184
#endif /* ! GRUB_MULTIBOOT_MACHINE_HEADER */