kern

view src/boot/mboot.h @ 80:4db99a52863e

fixed the "endianess" of the text messages in the ATA identify info block. this is the first time I've seen wrong byteorder in ascii text, the ATA committee should be commended.
author John Tsiombikas <nuclear@member.fsf.org>
date Tue, 06 Dec 2011 13:35:39 +0200
parents
children
line source
1 #ifndef MBOOT_H_
2 #define MBOOT_H_
4 #include <inttypes.h>
6 #define MB_MEM (1 << 0)
7 #define MB_BOOTDEV (1 << 1)
8 #define MB_CMDLINE (1 << 2)
9 #define MB_MODULES (1 << 3)
10 #define MB_AOUT_SYM (1 << 4)
11 #define MB_ELF_SHDR (1 << 5)
12 #define MB_MMAP (1 << 6)
13 #define MB_DRIVES (1 << 7)
14 #define MB_CFGTAB (1 << 8)
15 #define MB_LDRNAME (1 << 9)
16 #define MB_APM (1 << 10)
17 #define MB_GFX (1 << 11)
19 #define MB_MEM_VALID 1
20 #define MB_DRIVE_CHS 0
21 #define MB_DRIVE_LBA 1
23 struct mboot_module {
24 uint32_t start_addr, end_addr;
25 char *str;
26 uint32_t reserved;
27 };
29 struct mboot_elf_shdr_table {
30 uint32_t num;
31 uint32_t size;
32 uint32_t addr;
33 uint32_t shndx;
34 };
36 struct mboot_mmap {
37 uint32_t skip;
38 uint32_t base_low, base_high;
39 uint32_t length_low, length_high;
40 uint32_t type;
41 };
43 struct mboot_drive {
44 uint32_t size;
45 uint8_t id;
46 uint8_t mode;
47 uint16_t cyl;
48 uint8_t heads, sect;
49 uint16_t ports[1]; /* zero-terminated */
50 } __attribute__ ((packed));
52 struct mboot_apm {
53 uint16_t ver;
54 uint16_t cseg;
55 uint32_t offs;
56 uint16_t cseg16;
57 uint16_t dseg;
58 uint16_t flags;
59 uint16_t cseg_len;
60 uint16_t cseg16_len;
61 uint16_t dseg_len;
62 } __attribute__ ((packed));
64 struct mboot_vbe {
65 uint32_t ctl_info;
66 uint32_t mode_info;
67 uint16_t mode;
68 uint16_t ifseg, ifoffs, iflen;
69 } __attribute__ ((packed));
72 /* multiboot information structure */
73 struct mboot_info {
74 uint32_t flags;
75 /* mem_lower: available low memory (up to 640kb)
76 * mem_upper: available upper memory (from 1mb and upwards)
77 */
78 uint32_t mem_lower, mem_upper;
79 /* boot device fields: MSB -> [part3|part2|part1|drive] <- LSB */
80 uint32_t boot_dev;
81 char *cmdline;
82 /* loaded kernel modules */
83 uint32_t mods_count;
84 struct mboot_module *mods;
85 /* elf sections table */
86 struct mboot_elf_shdr_table elf;
87 /* memory map */
88 uint32_t mmap_len;
89 struct mboot_mmap *mmap;
90 /* drives table */
91 uint32_t drives_len;
92 struct mboot_drive *drives;
93 /* address of BIOS ROM configuration table */
94 uint32_t cfgtable;
95 char *boot_loader_name;
96 /* advanced power management */
97 struct mboot_apm *apm;
98 /* video bios extensions */
99 struct mboot_vbe vbe;
100 };
103 #endif /* MBOOT_H_ */