2 Copyright (C) 2008 Mathias Gottschlag
4 Permission is hereby granted, free of charge, to any person obtaining a copy of
5 this software and associated documentation files (the "Software"), to deal in the
6 Software without restriction, including without limitation the rights to use,
7 copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
8 Software, and to permit persons to whom the Software is furnished to do so,
9 subject to the following conditions:
11 The above copyright notice and this permission notice shall be included in all
12 copies or substantial portions of the Software.
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15 INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
16 PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
18 OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
19 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 * Multiboot information
26 #ifndef KE_MULTIBOOT_H_INCLUDED
27 #define KE_MULTIBOOT_H_INCLUDED
31 #define MULTIBOOT_HEADER_MAGIC 0x1BADB002
32 #define MULTIBOOT_HEADER_FLAGS 0x00000003
33 #define MULTIBOOT_BOOTLOADER_MAGIC 0x2BADB002
36 * a.out symbol table. Not used anywhere.
38 typedef struct AoutSymbolTable
47 * ELF section header table holding the information about the kernel executable.
49 typedef struct ElfSectionHeaderTable
55 } ElfSectionHeaderTable
;
58 * Multiboot module information.
60 typedef struct MbModule
63 * Start of the physical module memory.
67 * End of the physical module memory.
71 * File name of the module.
78 * Multiboot memory map.
80 typedef struct MbMemoryMap
83 * Size of the rest of the structure not including this member (can be more
88 * Low 32 bits of the base address.
92 * High 32 bits of the base address.
94 uint32_t baseaddrhigh
;
96 * Low 32 bits of the length of the memory range.
100 * High 32 bits of the length of the memory range.
104 * Type of the memory range.
110 * Multiboot information structure.
112 typedef struct MultibootInfo
115 * Flags telling what information is included in the struct.
119 * Amount of base memory.
123 * Approximated amount of upper memory.
127 * Device the operating system was booted from. The first byte contains the
128 * BIOS number of the device, the rest contains the partition information.
132 * Kernel command line.
136 * Number of modules loaded by the boot loader.
140 * Pointer to the module info block (array of MbModule).
144 * Kernel symbol information.
148 AoutSymbolTable aoutsym
;
149 ElfSectionHeaderTable elfsections
;
152 * Length of the memory map.
156 * Pointer to the first memory range information (MbMemoryMap).
161 #define CHECK_FLAG(flags,bit) ((flags) & (1 << (bit)))