kern
annotate src/boot/mboot.h @ 68:0a205396e1a0
- added a generic red-black tree data structure
- added a VM map as an red-black tree of vm_pages in the process structure
- constructed the vm map of the memory passed by the kernel initially to the first process.
author | John Tsiombikas <nuclear@mutantstargoat.com> |
---|---|
date | Mon, 10 Oct 2011 04:16:01 +0300 |
parents | |
children |
rev | line source |
---|---|
nuclear@17 | 1 #ifndef MBOOT_H_ |
nuclear@17 | 2 #define MBOOT_H_ |
nuclear@17 | 3 |
nuclear@17 | 4 #include <inttypes.h> |
nuclear@17 | 5 |
nuclear@17 | 6 #define MB_MEM (1 << 0) |
nuclear@17 | 7 #define MB_BOOTDEV (1 << 1) |
nuclear@17 | 8 #define MB_CMDLINE (1 << 2) |
nuclear@17 | 9 #define MB_MODULES (1 << 3) |
nuclear@17 | 10 #define MB_AOUT_SYM (1 << 4) |
nuclear@17 | 11 #define MB_ELF_SHDR (1 << 5) |
nuclear@17 | 12 #define MB_MMAP (1 << 6) |
nuclear@17 | 13 #define MB_DRIVES (1 << 7) |
nuclear@17 | 14 #define MB_CFGTAB (1 << 8) |
nuclear@17 | 15 #define MB_LDRNAME (1 << 9) |
nuclear@17 | 16 #define MB_APM (1 << 10) |
nuclear@17 | 17 #define MB_GFX (1 << 11) |
nuclear@17 | 18 |
nuclear@17 | 19 #define MB_MEM_VALID 1 |
nuclear@17 | 20 #define MB_DRIVE_CHS 0 |
nuclear@17 | 21 #define MB_DRIVE_LBA 1 |
nuclear@17 | 22 |
nuclear@17 | 23 struct mboot_module { |
nuclear@17 | 24 uint32_t start_addr, end_addr; |
nuclear@17 | 25 char *str; |
nuclear@17 | 26 uint32_t reserved; |
nuclear@17 | 27 }; |
nuclear@17 | 28 |
nuclear@17 | 29 struct mboot_elf_shdr_table { |
nuclear@17 | 30 uint32_t num; |
nuclear@17 | 31 uint32_t size; |
nuclear@17 | 32 uint32_t addr; |
nuclear@17 | 33 uint32_t shndx; |
nuclear@17 | 34 }; |
nuclear@17 | 35 |
nuclear@17 | 36 struct mboot_mmap { |
nuclear@17 | 37 uint32_t skip; |
nuclear@17 | 38 uint32_t base_low, base_high; |
nuclear@17 | 39 uint32_t length_low, length_high; |
nuclear@17 | 40 uint32_t type; |
nuclear@17 | 41 }; |
nuclear@17 | 42 |
nuclear@17 | 43 struct mboot_drive { |
nuclear@17 | 44 uint32_t size; |
nuclear@17 | 45 uint8_t id; |
nuclear@17 | 46 uint8_t mode; |
nuclear@17 | 47 uint16_t cyl; |
nuclear@17 | 48 uint8_t heads, sect; |
nuclear@17 | 49 uint16_t ports[1]; /* zero-terminated */ |
nuclear@17 | 50 } __attribute__ ((packed)); |
nuclear@17 | 51 |
nuclear@17 | 52 struct mboot_apm { |
nuclear@17 | 53 uint16_t ver; |
nuclear@17 | 54 uint16_t cseg; |
nuclear@17 | 55 uint32_t offs; |
nuclear@17 | 56 uint16_t cseg16; |
nuclear@17 | 57 uint16_t dseg; |
nuclear@17 | 58 uint16_t flags; |
nuclear@17 | 59 uint16_t cseg_len; |
nuclear@17 | 60 uint16_t cseg16_len; |
nuclear@17 | 61 uint16_t dseg_len; |
nuclear@17 | 62 } __attribute__ ((packed)); |
nuclear@17 | 63 |
nuclear@17 | 64 struct mboot_vbe { |
nuclear@17 | 65 uint32_t ctl_info; |
nuclear@17 | 66 uint32_t mode_info; |
nuclear@17 | 67 uint16_t mode; |
nuclear@17 | 68 uint16_t ifseg, ifoffs, iflen; |
nuclear@17 | 69 } __attribute__ ((packed)); |
nuclear@17 | 70 |
nuclear@17 | 71 |
nuclear@17 | 72 /* multiboot information structure */ |
nuclear@17 | 73 struct mboot_info { |
nuclear@17 | 74 uint32_t flags; |
nuclear@17 | 75 /* mem_lower: available low memory (up to 640kb) |
nuclear@17 | 76 * mem_upper: available upper memory (from 1mb and upwards) |
nuclear@17 | 77 */ |
nuclear@17 | 78 uint32_t mem_lower, mem_upper; |
nuclear@17 | 79 /* boot device fields: MSB -> [part3|part2|part1|drive] <- LSB */ |
nuclear@17 | 80 uint32_t boot_dev; |
nuclear@17 | 81 char *cmdline; |
nuclear@17 | 82 /* loaded kernel modules */ |
nuclear@17 | 83 uint32_t mods_count; |
nuclear@17 | 84 struct mboot_module *mods; |
nuclear@17 | 85 /* elf sections table */ |
nuclear@17 | 86 struct mboot_elf_shdr_table elf; |
nuclear@17 | 87 /* memory map */ |
nuclear@17 | 88 uint32_t mmap_len; |
nuclear@17 | 89 struct mboot_mmap *mmap; |
nuclear@17 | 90 /* drives table */ |
nuclear@17 | 91 uint32_t drives_len; |
nuclear@17 | 92 struct mboot_drive *drives; |
nuclear@17 | 93 /* address of BIOS ROM configuration table */ |
nuclear@17 | 94 uint32_t cfgtable; |
nuclear@17 | 95 char *boot_loader_name; |
nuclear@17 | 96 /* advanced power management */ |
nuclear@17 | 97 struct mboot_apm *apm; |
nuclear@17 | 98 /* video bios extensions */ |
nuclear@17 | 99 struct mboot_vbe vbe; |
nuclear@17 | 100 }; |
nuclear@17 | 101 |
nuclear@17 | 102 |
nuclear@17 | 103 #endif /* MBOOT_H_ */ |