utils: Use the host toolchain to build.
[syslinux.git] / com32 / mboot / mb_info.h
blob597a73819d1e0ff38e0f98d61eadc42bce1f556c
1 /*
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
27 #include <inttypes.h>
29 struct mod_list {
30 /* the memory used goes from bytes 'mod_start' to 'mod_end-1' inclusive */
31 uint32_t mod_start;
32 uint32_t mod_end;
34 /* Module command line */
35 uint32_t cmdline;
37 /* padding to take it to 16 bytes (must be zero) */
38 uint32_t pad;
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 {
49 uint32_t size;
50 uint64_t BaseAddr;
51 uint64_t Length;
52 uint32_t Type;
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. */
60 struct drive_info {
61 /* The size of this structure. */
62 uint32_t size;
64 /* The BIOS drive number. */
65 uint8_t drive_number;
67 /* The access mode (see below). */
68 uint8_t drive_mode;
70 /* The BIOS geometry. */
71 uint16_t drive_cylinders;
72 uint8_t drive_heads;
73 uint8_t drive_sectors;
75 /* The array of I/O ports used for the drive. */
76 uint16_t drive_ports[0];
79 /* Drive Mode. */
80 #define MB_DI_CHS_MODE 0
81 #define MB_DI_LBA_MODE 1
83 /* APM BIOS info. */
84 struct apm_info {
85 uint16_t version;
86 uint16_t cseg;
87 uint32_t offset;
88 uint16_t cseg_16;
89 uint16_t dseg_16;
90 uint16_t cseg_len;
91 uint16_t cseg_16_len;
92 uint16_t dseg_16_len;
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 */
104 uint32_t flags;
106 /* Available memory from BIOS */
107 uint32_t mem_lower;
108 uint32_t mem_upper;
110 /* "root" partition */
111 uint32_t boot_device;
113 /* Kernel command line */
114 uint32_t cmdline;
116 /* Boot-Module list */
117 uint32_t mods_count;
118 uint32_t mods_addr;
120 union {
121 struct {
122 /* (a.out) Kernel symbol table info */
123 uint32_t tabsize;
124 uint32_t strsize;
125 uint32_t addr;
126 uint32_t pad;
127 } a;
128 struct {
129 /* (ELF) Kernel section header table */
130 uint32_t num;
131 uint32_t size;
132 uint32_t addr;
133 uint32_t shndx;
134 } e;
135 } syms;
137 /* Memory Mapping buffer */
138 uint32_t mmap_length;
139 uint32_t mmap_addr;
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;
151 /* APM table */
152 uint32_t apm_table;
154 /* Video */
155 uint32_t vbe_control_info;
156 uint32_t vbe_mode_info;
157 uint16_t vbe_mode;
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 */