00001 /* multiboot.h - the header for Multiboot */ 00002 /* Macros. */ 00003 00004 /* The magic number for the Multiboot header. */ 00005 #define MULTIBOOT_HEADER_MAGIC 0x1BADB002 00006 00007 /* The flags for the Multiboot header. */ 00008 #ifdef __ELF__ 00009 # define MULTIBOOT_HEADER_FLAGS 0x00000003 00010 #else 00011 # define MULTIBOOT_HEADER_FLAGS 0x00010003 00012 #endif 00013 00014 /* The magic number passed by a Multiboot-compliant boot loader. */ 00015 #define MULTIBOOT_BOOTLOADER_MAGIC 0x2BADB002 00016 00017 /* The size of our stack (16KB). */ 00018 #define STACK_SIZE 0x4000 00019 00020 /* C symbol format. HAVE_ASM_USCORE is defined by configure. */ 00021 #ifdef HAVE_ASM_USCORE 00022 # define EXT_C(sym) _ ## sym 00023 #else 00024 # define EXT_C(sym) sym 00025 #endif 00026 00027 #ifndef ASM 00028 /* Do not include here in boot.S. */ 00029 00030 /* Types. */ 00031 00032 /* The Multiboot header. */ 00033 typedef struct multiboot_header 00034 { 00035 unsigned long magic; 00036 unsigned long flags; 00037 unsigned long checksum; 00038 unsigned long header_addr; 00039 unsigned long load_addr; 00040 unsigned long load_end_addr; 00041 unsigned long bss_end_addr; 00042 unsigned long entry_addr; 00043 } multiboot_header_t; 00044 00045 /* The symbol table for a.out. */ 00046 typedef struct aout_symbol_table 00047 { 00048 unsigned long tabsize; 00049 unsigned long strsize; 00050 unsigned long addr; 00051 unsigned long reserved; 00052 } aout_symbol_table_t; 00053 00054 /* The section header table for ELF. */ 00055 typedef struct elf_section_header_table 00056 { 00057 unsigned long num; 00058 unsigned long size; 00059 unsigned long addr; 00060 unsigned long shndx; 00061 } elf_section_header_table_t; 00062 00063 /* The Multiboot information. */ 00064 typedef struct multiboot_info 00065 { 00066 unsigned long flags; 00067 unsigned long mem_lower; 00068 unsigned long mem_upper; 00069 unsigned long boot_device; 00070 unsigned long cmdline; 00071 unsigned long mods_count; 00072 unsigned long mods_addr; 00073 union 00074 { 00075 aout_symbol_table_t aout_sym; 00076 elf_section_header_table_t elf_sec; 00077 } u; 00078 unsigned long mmap_length; 00079 unsigned long mmap_addr; 00080 } multiboot_info_t; 00081 00082 /* The module structure. */ 00083 typedef struct module 00084 { 00085 unsigned long mod_start; 00086 unsigned long mod_end; 00087 unsigned long string; 00088 unsigned long reserved; 00089 } module_t; 00090 00091 /* The memory map. Be careful that the offset 0 is base_addr_low 00092 but no size. */ 00093 typedef struct memory_map 00094 { 00095 unsigned long size; 00096 unsigned long base_addr_low; 00097 unsigned long base_addr_high; 00098 unsigned long length_low; 00099 unsigned long length_high; 00100 unsigned long type; 00101 } memory_map_t; 00102 00103 #endif /* ! ASM */