ReactOS  0.4.15-dev-309-g7c8d563
multiboot.h
Go to the documentation of this file.
1 /* multiboot.h - the header for Multiboot */
2 /* Copyright (C) 1999 Free Software Foundation, Inc.
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or
7  (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License along
15  with this program; if not, write to the Free Software Foundation, Inc.,
16  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 */
18 
19 #ifndef __ASM__
20 #pragma once
21 #endif
22 
23 /* Macros. */
24 
25 /* The magic number for the Multiboot header. */
26 #define MULTIBOOT_HEADER_MAGIC HEX(1BADB002)
27 
28 /* The flags for the Multiboot header. */
29 #define MULTIBOOT_HEADER_FLAGS HEX(00010003)
30 
31 /* The magic number passed by a Multiboot-compliant boot loader. */
32 #define MULTIBOOT_BOOTLOADER_MAGIC HEX(2BADB002)
33 
34 /* The size of our stack (16KB). */
35 #define STACK_SIZE 0x4000
36 
37 /* C symbol format. HAVE_ASM_USCORE is defined by configure. */
38 #ifdef HAVE_ASM_USCORE
39 # define EXT_C(sym) _ ## sym
40 #else
41 # define EXT_C(sym) sym
42 #endif
43 
44 #define MB_INFO_FLAG_MEM_SIZE HEX(00000001)
45 #define MB_INFO_FLAG_BOOT_DEVICE HEX(00000002)
46 #define MB_INFO_FLAG_COMMAND_LINE HEX(00000004)
47 #define MB_INFO_FLAG_MODULES HEX(00000008)
48 #define MB_INFO_FLAG_AOUT_SYMS HEX(00000010)
49 #define MB_INFO_FLAG_ELF_SYMS HEX(00000020)
50 #define MB_INFO_FLAG_MEMORY_MAP HEX(00000040)
51 #define MB_INFO_FLAG_DRIVES HEX(00000080)
52 #define MB_INFO_FLAG_CONFIG_TABLE HEX(00000100)
53 #define MB_INFO_FLAG_BOOT_LOADER_NAME HEX(00000200)
54 #define MB_INFO_FLAG_APM_TABLE HEX(00000400)
55 #define MB_INFO_FLAG_GRAPHICS_TABLE HEX(00000800)
56 
57 #ifndef __ASM__
58 /* Do not include here in boot.S. */
59 
60 /* Types. */
61 
62 /* The Multiboot header. */
63 typedef struct multiboot_header
64 {
65  unsigned long magic;
66  unsigned long flags;
67  unsigned long checksum;
68  unsigned long header_addr;
69  unsigned long load_addr;
70  unsigned long load_end_addr;
71  unsigned long bss_end_addr;
72  unsigned long entry_addr;
74 
75 /* The symbol table for a.out. */
76 typedef struct aout_symbol_table
77 {
78  unsigned long tabsize;
79  unsigned long strsize;
80  unsigned long addr;
81  unsigned long reserved;
83 
84 /* The section header table for ELF. */
86 {
87  unsigned long num;
88  unsigned long size;
89  unsigned long addr;
90  unsigned long shndx;
92 
93 /* The Multiboot information. */
94 typedef struct multiboot_info
95 {
96  unsigned long flags;
97  unsigned long mem_lower;
98  unsigned long mem_upper;
99  unsigned long boot_device;
100  unsigned long cmdline;
101  unsigned long mods_count;
102  unsigned long mods_addr;
103  union
104  {
107  } u;
108  unsigned long mmap_length;
109  unsigned long mmap_addr;
110  unsigned long drives_length;
111  unsigned long drives_addr;
113 
114 /* The memory map. Be careful that the offset 0 is base_addr_low
115  but no size. */
116 typedef struct memory_map
117 {
118  //unsigned long size;
119  unsigned long base_addr_low;
120  unsigned long base_addr_high;
121  unsigned long length_low;
122  unsigned long length_high;
123  unsigned long type;
124  unsigned long reserved;
125 } memory_map_t;
126 
127 #endif /* ! __ASM__ */
struct elf_section_header_table elf_section_header_table_t
union multiboot_info::@173 u
unsigned long mods_count
Definition: multiboot.h:101
unsigned long mmap_addr
Definition: multiboot.h:109
unsigned long num
Definition: multiboot.h:87
unsigned long reserved
Definition: multiboot.h:124
unsigned long tabsize
Definition: multiboot.h:78
unsigned long drives_addr
Definition: multiboot.h:111
unsigned long addr
Definition: multiboot.h:89
unsigned long flags
Definition: multiboot.h:96
unsigned long cmdline
Definition: multiboot.h:100
unsigned long load_end_addr
Definition: multiboot.h:70
unsigned long strsize
Definition: multiboot.h:79
unsigned long magic
Definition: multiboot.h:65
unsigned long mem_upper
Definition: multiboot.h:98
elf_section_header_table_t elf_sec
Definition: multiboot.h:106
unsigned long drives_length
Definition: multiboot.h:110
unsigned long addr
Definition: multiboot.h:80
struct memory_map memory_map_t
unsigned long checksum
Definition: multiboot.h:67
unsigned long length_high
Definition: multiboot.h:122
struct multiboot_info multiboot_info_t
unsigned long mods_addr
Definition: multiboot.h:102
unsigned long header_addr
Definition: multiboot.h:68
unsigned long base_addr_low
Definition: multiboot.h:119
unsigned long boot_device
Definition: multiboot.h:99
unsigned long mmap_length
Definition: multiboot.h:108
aout_symbol_table_t aout_sym
Definition: multiboot.h:105
unsigned long load_addr
Definition: multiboot.h:69
unsigned long bss_end_addr
Definition: multiboot.h:71
unsigned long length_low
Definition: multiboot.h:121
unsigned long shndx
Definition: multiboot.h:90
unsigned long entry_addr
Definition: multiboot.h:72
unsigned long mem_lower
Definition: multiboot.h:97
struct multiboot_header multiboot_header_t
struct aout_symbol_table aout_symbol_table_t
unsigned long base_addr_high
Definition: multiboot.h:120
unsigned long size
Definition: multiboot.h:88
unsigned long type
Definition: multiboot.h:123
unsigned long reserved
Definition: multiboot.h:81
unsigned long flags
Definition: multiboot.h:66