Merge branch 'master' of git://github.com/illumos/illumos-gate
[unleashed.git] / usr / src / grub / grub-0.97 / stage2 / mb_info.h
blob1e1e63bae6023d99339c9f869ee9b9ee2ef7ab7b
1 /*
2 * GRUB -- GRand Unified Bootloader
3 * Copyright (C) 2000,2003 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 struct mod_list
26 /* the memory used goes from bytes 'mod_start' to 'mod_end-1' inclusive */
27 unsigned long mod_start;
28 unsigned long mod_end;
30 /* Module command line */
31 unsigned long cmdline;
33 /* padding to take it to 16 bytes (must be zero) */
34 unsigned long pad;
39 * INT-15, AX=E820 style "AddressRangeDescriptor"
40 * ...with a "size" parameter on the front which is the structure size - 4,
41 * pointing to the next one, up until the full buffer length of the memory
42 * map has been reached.
45 struct AddrRangeDesc
47 unsigned long size;
48 unsigned long long BaseAddr;
49 unsigned long long Length;
50 unsigned long Type;
52 /* unspecified optional padding... */
53 } __attribute__ ((packed));
55 /* usable memory "Type", all others are reserved. */
56 #define MB_ARD_MEMORY 1
59 /* Drive Info structure. */
60 struct drive_info
62 /* The size of this structure. */
63 unsigned long size;
65 /* The BIOS drive number. */
66 unsigned char drive_number;
68 /* The access mode (see below). */
69 unsigned char drive_mode;
71 /* The BIOS geometry. */
72 unsigned short drive_cylinders;
73 unsigned char drive_heads;
74 unsigned char drive_sectors;
76 /* The array of I/O ports used for the drive. */
77 unsigned short drive_ports[0];
80 /* Drive Mode. */
81 #define MB_DI_CHS_MODE 0
82 #define MB_DI_LBA_MODE 1
85 /* APM BIOS info. */
86 struct apm_info
88 unsigned short version;
89 unsigned short cseg;
90 unsigned long offset;
91 unsigned short cseg_16;
92 unsigned short dseg_16;
93 unsigned short cseg_len;
94 unsigned short cseg_16_len;
95 unsigned short dseg_16_len;
100 * MultiBoot Info description
102 * This is the struct passed to the boot image. This is done by placing
103 * its address in the EAX register.
106 struct multiboot_info
108 /* MultiBoot info version number */
109 unsigned long flags;
111 /* Available memory from BIOS */
112 unsigned long mem_lower;
113 unsigned long mem_upper;
115 /* "root" partition */
116 unsigned long boot_device;
118 /* Kernel command line */
119 unsigned long cmdline;
121 /* Boot-Module list */
122 unsigned long mods_count;
123 unsigned long mods_addr;
125 union
127 struct
129 /* (a.out) Kernel symbol table info */
130 unsigned long tabsize;
131 unsigned long strsize;
132 unsigned long addr;
133 unsigned long pad;
137 struct
139 /* (ELF) Kernel section header table */
140 unsigned long num;
141 unsigned long size;
142 unsigned long addr;
143 unsigned long shndx;
147 syms;
149 /* Memory Mapping buffer */
150 unsigned long mmap_length;
151 unsigned long mmap_addr;
153 /* Drive Info buffer */
154 unsigned long drives_length;
155 unsigned long drives_addr;
157 /* ROM configuration table */
158 unsigned long config_table;
160 /* Boot Loader Name */
161 unsigned long boot_loader_name;
163 /* APM table */
164 unsigned long apm_table;
166 /* Video */
167 unsigned long vbe_control_info;
168 unsigned long vbe_mode_info;
169 unsigned short vbe_mode;
170 unsigned short vbe_interface_seg;
171 unsigned short vbe_interface_off;
172 unsigned short vbe_interface_len;
176 * Flags to be set in the 'flags' parameter above
179 /* is there basic lower/upper memory information? */
180 #define MB_INFO_MEMORY 0x00000001
181 /* is there a boot device set? */
182 #define MB_INFO_BOOTDEV 0x00000002
183 /* is the command-line defined? */
184 #define MB_INFO_CMDLINE 0x00000004
185 /* are there modules to do something with? */
186 #define MB_INFO_MODS 0x00000008
188 /* These next two are mutually exclusive */
190 /* is there a symbol table loaded? */
191 #define MB_INFO_AOUT_SYMS 0x00000010
192 /* is there an ELF section header table? */
193 #define MB_INFO_ELF_SHDR 0x00000020
195 /* is there a full memory map? */
196 #define MB_INFO_MEM_MAP 0x00000040
198 /* Is there drive info? */
199 #define MB_INFO_DRIVE_INFO 0x00000080
201 /* Is there a config table? */
202 #define MB_INFO_CONFIG_TABLE 0x00000100
204 /* Is there a boot loader name? */
205 #define MB_INFO_BOOT_LOADER_NAME 0x00000200
207 /* Is there a APM table? */
208 #define MB_INFO_APM_TABLE 0x00000400
210 /* Is there video information? */
211 #define MB_INFO_VIDEO_INFO 0x00000800
214 * The following value must be present in the EAX register.
217 #define MULTIBOOT_VALID 0x2BADB002