]> begriffs open source - cmsis-freertos/blob - Demo/IA32_flat_GCC_Galileo_Gen_2/Support_Files/multiboot.h
Update README.md - branch main is now the base branch
[cmsis-freertos] / Demo / IA32_flat_GCC_Galileo_Gen_2 / Support_Files / multiboot.h
1 /*
2  * Multiboot OS definitions and structures.
3  */
4
5 #ifndef _MULTIBOOT_H_
6 #define _MULTIBOOT_H_
7
8 #define MULTIBOOT_HEADER_MAGIC          0x1BADB002
9 #define MULTIBOOT_HEADER_FLAGS          0x00010003
10 #define MULTIBOOT_BOOTLOADER_MAGIC      0x2BADB002
11
12 typedef unsigned long t_32 ;
13
14 typedef struct multiboot_header
15  {
16         t_32 Magic;
17         t_32 flags;
18         t_32 checksum;
19         t_32 header_addr;
20         t_32 load_addr;
21         t_32 load_end_addr;
22         t_32 bss_end_addr;
23         t_32 entry_addr;
24         t_32 video_mode;
25         t_32 width;
26         t_32 height;
27         t_32 depth;
28 } multiboot_header_t;
29
30 /* Symbol table for a.out. */
31 typedef struct aout_symbol_table
32 {
33         t_32 tabsize;
34         t_32 strsize;
35         t_32 addr;
36         t_32 reserved;
37 } aout_symbol_table_t;
38
39 /* Section header table for ELF. */
40 typedef struct elf_section_header_table
41 {
42         t_32 num;
43         t_32 size;
44         t_32 addr;
45         t_32 shndx;
46 } elf_section_header_table_t;
47
48 /* Multiboot information. */
49 typedef struct multiboot_info
50 {
51         t_32 flags;
52         t_32 mem_lower;
53         t_32 mem_upper;
54         t_32 boot_device;
55         t_32 cmdline;
56         t_32 mods_count;
57         t_32 mods_addr;
58         union
59         {
60                 aout_symbol_table_t aout_sym;
61             elf_section_header_table_t elf_sec;
62         } u;
63         t_32 mmap_length;
64         t_32 mmap_addr;
65 } multiboot_info_t;
66
67 /* Module structure. */
68 typedef struct module
69 {
70         t_32 mod_start;
71         t_32 mod_end;
72         t_32 string;
73         t_32 reserved;
74 } module_t;
75
76 /* Memory map. Offset 0 is base_addr_low -no size. */
77 typedef struct memory_map
78 {
79         t_32 size;
80         t_32 base_addr_low;
81         t_32 base_addr_high;
82         t_32 length_low;
83         t_32 length_high;
84         t_32 type;
85 } memory_map_t;
86
87 #define CHECK_FLAG(flags,bit)    ((flags) & (1 << (bit)))
88
89 #endif /* _MULTIBOOT_H_ */