Sync to trunk (r46918)
[reactos.git] / boot / freeldr / freeldr / include / multiboot.h
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 #pragma once
20
21 /* Macros. */
22
23 /* The magic number for the Multiboot header. */
24 #define MULTIBOOT_HEADER_MAGIC 0x1BADB002
25
26 /* The flags for the Multiboot header. */
27 #define MULTIBOOT_HEADER_FLAGS 0x00010003
28
29 /* The magic number passed by a Multiboot-compliant boot loader. */
30 #define MULTIBOOT_BOOTLOADER_MAGIC 0x2BADB002
31
32 /* The size of our stack (16KB). */
33 #define STACK_SIZE 0x4000
34
35 /* C symbol format. HAVE_ASM_USCORE is defined by configure. */
36 #ifdef HAVE_ASM_USCORE
37 # define EXT_C(sym) _ ## sym
38 #else
39 # define EXT_C(sym) sym
40 #endif
41
42 #define MB_INFO_FLAG_MEM_SIZE 0x00000001
43 #define MB_INFO_FLAG_BOOT_DEVICE 0x00000002
44 #define MB_INFO_FLAG_COMMAND_LINE 0x00000004
45 #define MB_INFO_FLAG_MODULES 0x00000008
46 #define MB_INFO_FLAG_AOUT_SYMS 0x00000010
47 #define MB_INFO_FLAG_ELF_SYMS 0x00000020
48 #define MB_INFO_FLAG_MEMORY_MAP 0x00000040
49 #define MB_INFO_FLAG_DRIVES 0x00000080
50 #define MB_INFO_FLAG_CONFIG_TABLE 0x00000100
51 #define MB_INFO_FLAG_BOOT_LOADER_NAME 0x00000200
52 #define MB_INFO_FLAG_APM_TABLE 0x00000400
53 #define MB_INFO_FLAG_GRAPHICS_TABLE 0x00000800
54
55 #ifndef ASM
56 /* Do not include here in boot.S. */
57
58 /* Types. */
59
60 /* The Multiboot header. */
61 typedef struct multiboot_header
62 {
63 unsigned long magic;
64 unsigned long flags;
65 unsigned long checksum;
66 unsigned long header_addr;
67 unsigned long load_addr;
68 unsigned long load_end_addr;
69 unsigned long bss_end_addr;
70 unsigned long entry_addr;
71 } multiboot_header_t;
72
73 /* The symbol table for a.out. */
74 typedef struct aout_symbol_table
75 {
76 unsigned long tabsize;
77 unsigned long strsize;
78 unsigned long addr;
79 unsigned long reserved;
80 } aout_symbol_table_t;
81
82 /* The section header table for ELF. */
83 typedef struct elf_section_header_table
84 {
85 unsigned long num;
86 unsigned long size;
87 unsigned long addr;
88 unsigned long shndx;
89 } elf_section_header_table_t;
90
91 /* The memory map. Be careful that the offset 0 is base_addr_low
92 but no size. */
93 typedef struct memory_map
94 {
95 //unsigned long size;
96 unsigned long base_addr_low;
97 unsigned long base_addr_high;
98 unsigned long length_low;
99 unsigned long length_high;
100 unsigned long type;
101 unsigned long reserved;
102 } memory_map_t;
103
104 #endif /* ! ASM */