1 #ifndef MULTIBOOT_HEADER
2 #define MULTIBOOT_HEADER 1
4 /* How many bytes from the start of the file to search for the header. */
5 #define MULTIBOOT_SEARCH 8192
7 /* the magic field should contain this. */
8 #define MULTIBOOT_HEADER_MAGIC 0x1badb002
10 /* this should be in eax */
11 #define MULTIBOOT_BOOTLOADER_MAGIC 0x2badb002
13 /* bits in the required part of flags field we don't support */
14 #define MULTIBOOT_UNSUPPORTED 0x0000fffc
16 /* alignment of multiboot modules */
17 #define MULTIBOOT_MOD_ALIGN 0x00001000
19 /* alignment of the multiboot info structure */
20 #define MULTIBOOT_INFO_ALIGN 0x00000004
23 * multiboot header flags
26 /* align each boot module on 4KB page boundary */
27 #define MULTIBOOT_PAGE_ALIGN 0x00000001
29 /* pass memory information to OS */
30 #define MULTIBOOT_MEMORY_INFO 0x00000002
32 /* pass video information to OS */
33 #define MULTIBOOT_VIDEO_MODE 0x00000004
35 /* This flag indicates the use of the address fields in the header */
36 #define MULTIBOOT_AOUT_KLUDGE 0x00010000
39 * multiboot info flags
42 /* has basic memory information */
43 #define MULTIBOOT_INFO_MEMORY 0x00000001
46 #define MULTIBOOT_INFO_BOOTDEV 0x00000002
48 /* has command-line */
49 #define MULTIBOOT_INFO_CMDLINE 0x00000004
52 #define MULTIBOOT_INFO_MODS 0x00000008
55 /* only one of the next two should be set */
56 /* has a.out symbol table */
57 #define MULTIBOOT_INFO_AOUT_SYMS 0x00000010
58 /* has ELF section header table */
59 #define MULTIBOOT_INFO_ELF_SHDR 0X00000020
61 /* has complete memory map */
62 #define MULTIBOOT_INFO_MEM_MAP 0x00000040
65 #define MULTIBOOT_INFO_DRIVE_INFO 0x00000080
67 /* has config table */
68 #define MULTIBOOT_INFO_CONFIG_TABLE 0x00000100
70 /* has boot loader name */
71 #define MULTIBOOT_INFO_BOOT_LOADER_NAME 0x00000200
74 #define MULTIBOOT_INFO_APM_TABLE 0x00000400
76 /* has video information */
77 #define MULTIBOOT_INFO_VIDEO_INFO 0x00000800
81 struct multiboot_header {
82 uint32_t magic; /* should == MULTIBOOT_MAGIC */
86 uint32_t checksum; /* magic + flags + checksum & 0xffffffff == 0 */
88 /* only valid if MULTIBOOT_AOUT_KLUDGE is set */
91 uint32_t load_end_addr;
92 uint32_t bss_end_addr;
95 /* only valid if MULTIBOOT_VIDEO_MODE is set */
102 /* a.out symbol table */
103 struct multiboot_aout_symbol_table {
110 /* ELF section header table */
111 struct multiboot_elf_section_header_table {
118 struct multiboot_info {
121 /* available memory from BIOS */
125 uint32_t boot_device; /* root partition */
127 uint32_t cmdline; /* kernel command line */
129 uint32_t mods_count; /* number of mods */
130 uint32_t mods_addr; /* physical address of list */
133 struct multiboot_aout_symbol_table aout_sym;
134 struct multiboot_elf_section_header_table elf_sec;
138 uint32_t mmap_length;
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;
154 /* video information */
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;
163 #define MULTIBOOT_MEMORY_AVAILABLE 1
164 #define MULTIBOOT_MEMORY_RESERVED 2
165 struct multiboot_mmap_entry {
170 } __attribute__((packed));
172 struct multiboot_mod_list {
173 /* memory used goes from mod_start through mod_end-1 */
179 uint32_t padding; /* each entry is 16 bytes */