AquilaOS documentation
How it works, and its code
Loading...
Searching...
No Matches
multiboot.h
Go to the documentation of this file.
1
3/* Copyright (C) 1999,2003,2007,2008,2009 Free Software Foundation, Inc.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a copy
6 * of this software and associated documentation files (the "Software"), to
7 * deal in the Software without restriction, including without limitation the
8 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
9 * sell copies of the Software, and to permit persons to whom the Software is
10 * furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ANY
18 * DEVELOPER OR DISTRIBUTOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
19 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
20 * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 */
22
23#ifndef MULTIBOOT_HEADER
24#define MULTIBOOT_HEADER 1
25
26/* How many bytes from the start of the file we search for the header. */
27#define MULTIBOOT_SEARCH 8192
28
29/* The magic field should contain this. */
30#define MULTIBOOT_HEADER_MAGIC 0x1BADB002
31
32/* This should be in %eax. */
33#define MULTIBOOT_BOOTLOADER_MAGIC 0x2BADB002
34
35/* The bits in the required part of flags field we don't support. */
36#define MULTIBOOT_UNSUPPORTED 0x0000fffc
37
38/* Alignment of multiboot modules. */
39#define MULTIBOOT_MOD_ALIGN 0x00001000
40
41/* Alignment of the multiboot info structure. */
42#define MULTIBOOT_INFO_ALIGN 0x00000004
43
44/* Flags set in the 'flags' member of the multiboot header. */
45
46/* Align all boot modules on i386 page (4KB) boundaries. */
47#define MULTIBOOT_PAGE_ALIGN 0x00000001
48
49/* Must pass memory information to OS. */
50#define MULTIBOOT_MEMORY_INFO 0x00000002
51
52/* Must pass video information to OS. */
53#define MULTIBOOT_VIDEO_MODE 0x00000004
54
55/* This flag indicates the use of the address fields in the header. */
56#define MULTIBOOT_AOUT_KLUDGE 0x00010000
57
58/* Flags to be set in the 'flags' member of the multiboot info structure. */
59
60/* is there basic lower/upper memory information? */
61#define MULTIBOOT_INFO_MEMORY 0x00000001
62/* is there a boot device set? */
63#define MULTIBOOT_INFO_BOOTDEV 0x00000002
64/* is the command-line defined? */
65#define MULTIBOOT_INFO_CMDLINE 0x00000004
66/* are there modules to do something with? */
67#define MULTIBOOT_INFO_MODS 0x00000008
68
69/* These next two are mutually exclusive */
70
71/* is there a symbol table loaded? */
72#define MULTIBOOT_INFO_AOUT_SYMS 0x00000010
73/* is there an ELF section header table? */
74#define MULTIBOOT_INFO_ELF_SHDR 0X00000020
75
76/* is there a full memory map? */
77#define MULTIBOOT_INFO_MEM_MAP 0x00000040
78
79/* Is there drive info? */
80#define MULTIBOOT_INFO_DRIVE_INFO 0x00000080
81
82/* Is there a config table? */
83#define MULTIBOOT_INFO_CONFIG_TABLE 0x00000100
84
85/* Is there a boot loader name? */
86#define MULTIBOOT_INFO_BOOT_LOADER_NAME 0x00000200
87
88/* Is there a APM table? */
89#define MULTIBOOT_INFO_APM_TABLE 0x00000400
90
91/* Is there video information? */
92#define MULTIBOOT_INFO_VIDEO_INFO 0x00000800
93
94/* is there framebuffer information? */
95#define MULTIBOOT_INFO_FRAMEBUFFER_INFO 0x00001000
96
97#ifndef ASM_FILE
98
99#include <stdint.h>
100
102{
103 /* Must be MULTIBOOT_MAGIC - see above. */
105
106 /* Feature flags. */
108
109 /* The above fields plus this one must equal 0 mod 2^32. */
111
112 /* These are only valid if MULTIBOOT_AOUT_KLUDGE is set. */
118
119 /* These are only valid if MULTIBOOT_VIDEO_MODE is set. */
124};
125
126/* The symbol table for a.out. */
135
136/* The section header table for ELF. */
145
147{
148 /* Multiboot info version number */
150
151 /* Available memory from BIOS */
154
155 /* "root" partition */
157
158 /* Kernel command line */
160
161 /* Boot-Module list */
164
170
171 /* Memory Mapping buffer */
174
175 /* Drive Info buffer */
178
179 /* ROM configuration table */
181
182 /* Boot Loader Name */
184
185 /* APM table */
187
188 /* Video */
195
196 /* Framebuffer, valid if MULTIBOOT_INFO_FRAMEBUFFER_INFO is set */
202#define MULTIBOOT_FRAMEBUFFER_TYPE_INDEXED 0
203#define MULTIBOOT_FRAMEBUFFER_TYPE_RGB 1
204#define MULTIBOOT_FRAMEBUFFER_TYPE_EGA_TEXT 2
207};
209
211{
215#define MULTIBOOT_MEMORY_AVAILABLE 1
216#define MULTIBOOT_MEMORY_RESERVED 2
218} __attribute__((packed));
220
222{
223 /* the memory used goes from bytes 'mod_start' to 'mod_end-1' inclusive */
226
227 /* Module command line */
229
230 /* padding to take it to 16 bytes (must be zero) */
232};
234
237
238#endif /* ! ASM_FILE */
239
240#endif /* ! MULTIBOOT_HEADER */
struct multiboot_mmap_entry multiboot_mmap_t
Definition multiboot.h:219
struct multiboot_elf_section_header_table multiboot_elf_section_header_table_t
Definition multiboot.h:144
struct multiboot_aout_symbol_table multiboot_aout_symbol_table_t
Definition multiboot.h:134
uint32_t multiboot_signature
struct multiboot_mod_list multiboot_module_t
Definition multiboot.h:233
struct multiboot_info multiboot_info_t
Definition multiboot.h:208
unsigned int uint32_t
Definition stddef.h:22
unsigned char uint8_t
Definition stddef.h:20
unsigned long long int uint64_t
Definition stddef.h:23
unsigned short int uint16_t
Definition stddef.h:21
uint32_t checksum
Definition multiboot.h:110
uint32_t bss_end_addr
Definition multiboot.h:116
uint32_t load_end_addr
Definition multiboot.h:115
uint32_t height
Definition multiboot.h:122
uint32_t load_addr
Definition multiboot.h:114
uint32_t header_addr
Definition multiboot.h:113
uint32_t entry_addr
Definition multiboot.h:117
uint32_t mode_type
Definition multiboot.h:120
uint32_t vbe_control_info
Definition multiboot.h:189
uint32_t drives_length
Definition multiboot.h:176
uint32_t boot_device
Definition multiboot.h:156
uint32_t flags
Definition multiboot.h:149
uint32_t vbe_mode_info
Definition multiboot.h:190
uint8_t framebuffer_type
Definition multiboot.h:205
uint32_t framebuffer_pitch
Definition multiboot.h:198
uint16_t vbe_interface_off
Definition multiboot.h:193
uint32_t mmap_length
Definition multiboot.h:172
uint16_t vbe_interface_len
Definition multiboot.h:194
uint16_t vbe_mode
Definition multiboot.h:191
union multiboot_info::@271253110040301035057036353331356106057115263040 u
uint32_t mem_lower
Definition multiboot.h:152
uint32_t mem_upper
Definition multiboot.h:153
uint32_t mods_addr
Definition multiboot.h:163
uint32_t cmdline
Definition multiboot.h:159
uint32_t apm_table
Definition multiboot.h:186
uint32_t drives_addr
Definition multiboot.h:177
uint32_t mmap_addr
Definition multiboot.h:173
uint8_t framebuffer_color_info[6]
Definition multiboot.h:206
uint32_t config_table
Definition multiboot.h:180
uint64_t framebuffer_addr
Definition multiboot.h:197
uint32_t framebuffer_width
Definition multiboot.h:199
uint32_t mods_count
Definition multiboot.h:162
uint32_t boot_loader_name
Definition multiboot.h:183
uint32_t framebuffer_height
Definition multiboot.h:200
uint8_t framebuffer_bpp
Definition multiboot.h:201
uint16_t vbe_interface_seg
Definition multiboot.h:192
Definition multiboot.h:211
uint32_t type
Definition multiboot.h:217
uint64_t len
Definition multiboot.h:214
uint64_t addr
Definition multiboot.h:213
uint32_t size
Definition multiboot.h:212
multiboot_aout_symbol_table_t aout_sym
multiboot_elf_section_header_table_t elf_sec