cynix

x86 UNIX-like OS
git clone git://git.2f30.org/cynix
Log | Files | Refs | README | LICENSE

multiboot.h (2182B)


      1 /* The magic number for the Multiboot header. */
      2 #define MULTIBOOT_HEADER_MAGIC 0x1BADB002
      3 
      4 /* The flags for the Multiboot header. */
      5 #ifdef __ELF__
      6 #define MULTIBOOT_HEADER_FLAGS 0x00000003
      7 #else
      8 #define MULTIBOOT_HEADER_FLAGS 0x00010003
      9 #endif
     10 
     11 /* The magic number passed by a Multiboot-compliant boot loader. */
     12 #define MULTIBOOT_BOOTLOADER_MAGIC 0x2BADB002
     13 
     14 /* The size of our stack (16KB). */
     15 #define STACK_SIZE 0x4000
     16 
     17 /* C symbol format. HAVE_ASM_USCORE is defined by configure. */
     18 #ifdef HAVE_ASM_USCORE
     19 #define EXT_C(sym) _ ## sym
     20 #else
     21 #define EXT_C(sym) sym
     22 #endif
     23 
     24 #ifndef ASM
     25 /* Do not include here in boot.S. */
     26 
     27 /* Types. */
     28 
     29 /* The Multiboot header. */
     30 typedef struct multiboot_header {
     31 	unsigned long magic;
     32 	unsigned long flags;
     33 	unsigned long checksum;
     34 	unsigned long header_addr;
     35 	unsigned long load_addr;
     36 	unsigned long load_end_addr;
     37 	unsigned long bss_end_addr;
     38 	unsigned long entry_addr;
     39 } multiboot_header_t;
     40 
     41 /* The symbol table for a.out. */
     42 typedef struct aout_symbol_table {
     43 	unsigned long tabsize;
     44 	unsigned long strsize;
     45 	unsigned long addr;
     46 	unsigned long reserved;
     47 } aout_symbol_table_t;
     48 
     49 /* The section header table for ELF. */
     50 typedef struct elf_section_header_table {
     51 	unsigned long num;
     52 	unsigned long size;
     53 	unsigned long addr;
     54 	unsigned long shndx;
     55 } elf_section_header_table_t;
     56 
     57 /* The Multiboot information. */
     58 typedef struct multiboot_info {
     59 	unsigned long flags;
     60 	unsigned long mem_lower;
     61 	unsigned long mem_upper;
     62 	unsigned long boot_device;
     63 	unsigned long cmdline;
     64 	unsigned long mods_count;
     65 	unsigned long mods_addr;
     66 	union {
     67 		aout_symbol_table_t aout_sym;
     68 		elf_section_header_table_t elf_sec;
     69 	} u;
     70 
     71 	unsigned long mmap_length;
     72 	unsigned long mmap_addr;
     73 } multiboot_info_t;
     74 
     75 /* The module structure. */
     76 typedef struct module {
     77 	unsigned long mod_start;
     78 	unsigned long mod_end;
     79 	unsigned long string;
     80 	unsigned long reserved;
     81 } module_t;
     82 
     83 /* The memory map. Be careful that the offset 0 is base_addr_low
     84    but no size. */
     85 typedef struct memory_map {
     86 	unsigned long size;
     87 	unsigned long base_addr_low;
     88 	unsigned long base_addr_high;
     89 	unsigned long length_low;
     90 	unsigned long length_high;
     91 	unsigned long type;
     92 } memory_map_t;
     93 
     94 #endif
     95