kern
diff src/boot/mboot.h @ 17:098b1cb5eeaa
forgot to add a shitload of files
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sat, 26 Mar 2011 21:39:14 +0200 |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/boot/mboot.h Sat Mar 26 21:39:14 2011 +0200 1.3 @@ -0,0 +1,103 @@ 1.4 +#ifndef MBOOT_H_ 1.5 +#define MBOOT_H_ 1.6 + 1.7 +#include <inttypes.h> 1.8 + 1.9 +#define MB_MEM (1 << 0) 1.10 +#define MB_BOOTDEV (1 << 1) 1.11 +#define MB_CMDLINE (1 << 2) 1.12 +#define MB_MODULES (1 << 3) 1.13 +#define MB_AOUT_SYM (1 << 4) 1.14 +#define MB_ELF_SHDR (1 << 5) 1.15 +#define MB_MMAP (1 << 6) 1.16 +#define MB_DRIVES (1 << 7) 1.17 +#define MB_CFGTAB (1 << 8) 1.18 +#define MB_LDRNAME (1 << 9) 1.19 +#define MB_APM (1 << 10) 1.20 +#define MB_GFX (1 << 11) 1.21 + 1.22 +#define MB_MEM_VALID 1 1.23 +#define MB_DRIVE_CHS 0 1.24 +#define MB_DRIVE_LBA 1 1.25 + 1.26 +struct mboot_module { 1.27 + uint32_t start_addr, end_addr; 1.28 + char *str; 1.29 + uint32_t reserved; 1.30 +}; 1.31 + 1.32 +struct mboot_elf_shdr_table { 1.33 + uint32_t num; 1.34 + uint32_t size; 1.35 + uint32_t addr; 1.36 + uint32_t shndx; 1.37 +}; 1.38 + 1.39 +struct mboot_mmap { 1.40 + uint32_t skip; 1.41 + uint32_t base_low, base_high; 1.42 + uint32_t length_low, length_high; 1.43 + uint32_t type; 1.44 +}; 1.45 + 1.46 +struct mboot_drive { 1.47 + uint32_t size; 1.48 + uint8_t id; 1.49 + uint8_t mode; 1.50 + uint16_t cyl; 1.51 + uint8_t heads, sect; 1.52 + uint16_t ports[1]; /* zero-terminated */ 1.53 +} __attribute__ ((packed)); 1.54 + 1.55 +struct mboot_apm { 1.56 + uint16_t ver; 1.57 + uint16_t cseg; 1.58 + uint32_t offs; 1.59 + uint16_t cseg16; 1.60 + uint16_t dseg; 1.61 + uint16_t flags; 1.62 + uint16_t cseg_len; 1.63 + uint16_t cseg16_len; 1.64 + uint16_t dseg_len; 1.65 +} __attribute__ ((packed)); 1.66 + 1.67 +struct mboot_vbe { 1.68 + uint32_t ctl_info; 1.69 + uint32_t mode_info; 1.70 + uint16_t mode; 1.71 + uint16_t ifseg, ifoffs, iflen; 1.72 +} __attribute__ ((packed)); 1.73 + 1.74 + 1.75 +/* multiboot information structure */ 1.76 +struct mboot_info { 1.77 + uint32_t flags; 1.78 + /* mem_lower: available low memory (up to 640kb) 1.79 + * mem_upper: available upper memory (from 1mb and upwards) 1.80 + */ 1.81 + uint32_t mem_lower, mem_upper; 1.82 + /* boot device fields: MSB -> [part3|part2|part1|drive] <- LSB */ 1.83 + uint32_t boot_dev; 1.84 + char *cmdline; 1.85 + /* loaded kernel modules */ 1.86 + uint32_t mods_count; 1.87 + struct mboot_module *mods; 1.88 + /* elf sections table */ 1.89 + struct mboot_elf_shdr_table elf; 1.90 + /* memory map */ 1.91 + uint32_t mmap_len; 1.92 + struct mboot_mmap *mmap; 1.93 + /* drives table */ 1.94 + uint32_t drives_len; 1.95 + struct mboot_drive *drives; 1.96 + /* address of BIOS ROM configuration table */ 1.97 + uint32_t cfgtable; 1.98 + char *boot_loader_name; 1.99 + /* advanced power management */ 1.100 + struct mboot_apm *apm; 1.101 + /* video bios extensions */ 1.102 + struct mboot_vbe vbe; 1.103 +}; 1.104 + 1.105 + 1.106 +#endif /* MBOOT_H_ */