2 * GRUB -- GRand Unified Bootloader
3 * Copyright (C) 2000 Free Software Foundation, Inc.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 * The structure type "mod_list" is used by the "multiboot_info" structure.
24 #ifndef MBOOT_MB_INFO_H
25 #define MBOOT_MB_INFO_H
30 /* the memory used goes from bytes 'mod_start' to 'mod_end-1' inclusive */
34 /* Module command line */
37 /* padding to take it to 16 bytes (must be zero) */
42 * INT-15, AX=E820 style "AddressRangeDescriptor"
43 * ...with a "size" parameter on the front which is the structure size - 4,
44 * pointing to the next one, up until the full buffer length of the memory
45 * map has been reached.
48 struct AddrRangeDesc
{
53 /* unspecified optional padding... */
54 } __attribute__ ((packed
));
56 /* usable memory "Type", all others are reserved. */
57 #define MB_ARD_MEMORY 1
59 /* Drive Info structure. */
61 /* The size of this structure. */
64 /* The BIOS drive number. */
67 /* The access mode (see below). */
70 /* The BIOS geometry. */
71 uint16_t drive_cylinders
;
73 uint8_t drive_sectors
;
75 /* The array of I/O ports used for the drive. */
76 uint16_t drive_ports
[0];
80 #define MB_DI_CHS_MODE 0
81 #define MB_DI_LBA_MODE 1
96 * MultiBoot Info description
98 * This is the struct passed to the boot image. This is done by placing
99 * its address in the EAX register.
102 struct multiboot_info
{
103 /* MultiBoot info version number */
106 /* Available memory from BIOS */
110 /* "root" partition */
111 uint32_t boot_device
;
113 /* Kernel command line */
116 /* Boot-Module list */
122 /* (a.out) Kernel symbol table info */
129 /* (ELF) Kernel section header table */
137 /* Memory Mapping buffer */
138 uint32_t mmap_length
;
141 /* Drive Info buffer */
142 uint32_t drives_length
;
143 uint32_t drives_addr
;
145 /* ROM configuration table */
146 uint32_t config_table
;
148 /* Boot Loader Name */
149 uint32_t boot_loader_name
;
155 uint32_t vbe_control_info
;
156 uint32_t vbe_mode_info
;
158 uint16_t vbe_interface_seg
;
159 uint16_t vbe_interface_off
;
160 uint16_t vbe_interface_len
;
164 * Flags to be set in the 'flags' parameter above
167 /* is there basic lower/upper memory information? */
168 #define MB_INFO_MEMORY 0x00000001
169 /* is there a boot device set? */
170 #define MB_INFO_BOOTDEV 0x00000002
171 /* is the command-line defined? */
172 #define MB_INFO_CMDLINE 0x00000004
173 /* are there modules to do something with? */
174 #define MB_INFO_MODS 0x00000008
176 /* These next two are mutually exclusive */
178 /* is there a symbol table loaded? */
179 #define MB_INFO_AOUT_SYMS 0x00000010
180 /* is there an ELF section header table? */
181 #define MB_INFO_ELF_SHDR 0x00000020
183 /* is there a full memory map? */
184 #define MB_INFO_MEM_MAP 0x00000040
186 /* Is there drive info? */
187 #define MB_INFO_DRIVE_INFO 0x00000080
189 /* Is there a config table? */
190 #define MB_INFO_CONFIG_TABLE 0x00000100
192 /* Is there a boot loader name? */
193 #define MB_INFO_BOOT_LOADER_NAME 0x00000200
195 /* Is there a APM table? */
196 #define MB_INFO_APM_TABLE 0x00000400
198 /* Is there video information? */
199 #define MB_INFO_VIDEO_INFO 0x00000800
202 * The following value must be present in the EAX register.
205 #define MULTIBOOT_VALID 0x2BADB002
207 #endif /* MBOOT_MB_INFO_H */