#ifndef __KERNEL_MULTIBOOT_H
#define __KERNEL_MULTIBOOT_H
/** The magic number for the Multiboot header. */
#define MULTIBOOT_HEADER_MAGIC 0x1BADB002
/** The flags for the Multiboot header. */
#define MULTIBOOT_HEADER_FLAGS 0x00000003
/** Marks an ELF-compatible executable. */
#define MULTIBOOT_HEADER_ELF_FLAGS 0x00010003
/** Size of the multiboot header structure. */
#define MULTIBOOT_HEADER_SIZE 52
/** The magic number passed by a Multiboot-compliant boot loader. */
#define MULTIBOOT_BOOTLOADER_MAGIC 0x2BADB002
/* Do not include in assembler source. */
#ifndef __ASSEMBLER__
#include
/**The symbol table for a.out.*/
typedef struct AoutSymbolTable
{
uint32_t tabSize;
uint32_t strSize;
uint32_t address;
uint32_t reserved;
} AoutSymbolTable;
/**The section header table for ELF.*/
typedef struct ElfSectionHeaderTable
{
uint32_t num;
uint32_t size;
uint32_t address;
uint32_t shndx;
} ElfSectionHeaderTable;
/**The Multiboot information.*/
typedef struct MultibootInfo
{
uint32_t flags;
uint32_t memLower;
uint32_t memUpper;
uint32_t bootDevice;
uint32_t cmdline;
uint32_t modsCount;
uint32_t modsAddress;
union
{
AoutSymbolTable aout;
ElfSectionHeaderTable elf;
};
uint32_t mmapLength;
uint32_t mmapAddress;
} MultibootInfo;
/**The module class.*/
typedef struct MultibootModule
{
uint32_t modStart;
uint32_t modEnd;
uint32_t string;
uint32_t reserved;
} MultibootModule;
/**The memory map. Be careful that the offset 0 is base_addr_low but no size.*/
typedef struct MultibootMemoryMap
{
uint32_t size;
uint32_t baseAddressLow;
uint32_t baseAddressHigh;
uint32_t lengthLow;
uint32_t lengthHigh;
uint32_t type;
} MultibootMemoryMap;
#endif /* !__ASSEMBLER__ */
#endif
阅读(1146) | 评论(0) | 转发(0) |