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 |
---|
15 | along with this program; if not, write to the Free Software |
---|
16 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ |
---|
17 | |
---|
18 | /* Macros. */ |
---|
19 | |
---|
20 | /* The magic number for the Multiboot header. */ |
---|
21 | #define MULTIBOOT_HEADER_MAGIC 0x1BADB002 |
---|
22 | |
---|
23 | /* The flags for the Multiboot header. */ |
---|
24 | #define MULTIBOOT_HEADER_FLAGS 0x00010003 |
---|
25 | |
---|
26 | /* The magic number passed by a Multiboot-compliant boot loader. */ |
---|
27 | #define MULTIBOOT_BOOTLOADER_MAGIC 0x2BADB002 |
---|
28 | |
---|
29 | /* The size of our stack (16KB). */ |
---|
30 | #define STACK_SIZE 0x4000 |
---|
31 | |
---|
32 | /* C symbol format. HAVE_ASM_USCORE is defined by configure. */ |
---|
33 | #ifdef HAVE_ASM_USCORE |
---|
34 | # define EXT_C(sym) _ ## sym |
---|
35 | #else |
---|
36 | # define EXT_C(sym) sym |
---|
37 | #endif |
---|
38 | |
---|
39 | #ifndef ASM |
---|
40 | /* Do not include here in boot.S. */ |
---|
41 | |
---|
42 | /* Types. */ |
---|
43 | |
---|
44 | /* The Multiboot header. */ |
---|
45 | typedef struct multiboot_header |
---|
46 | { |
---|
47 | unsigned long magic; |
---|
48 | unsigned long flags; |
---|
49 | unsigned long checksum; |
---|
50 | unsigned long header_addr; |
---|
51 | unsigned long load_addr; |
---|
52 | unsigned long load_end_addr; |
---|
53 | unsigned long bss_end_addr; |
---|
54 | unsigned long entry_addr; |
---|
55 | } multiboot_header_t; |
---|
56 | |
---|
57 | /* The symbol table for a.out. */ |
---|
58 | typedef struct aout_symbol_table |
---|
59 | { |
---|
60 | unsigned long tabsize; |
---|
61 | unsigned long strsize; |
---|
62 | unsigned long addr; |
---|
63 | unsigned long reserved; |
---|
64 | } aout_symbol_table_t; |
---|
65 | |
---|
66 | /* The section header table for ELF. */ |
---|
67 | typedef struct elf_section_header_table |
---|
68 | { |
---|
69 | unsigned long num; |
---|
70 | unsigned long size; |
---|
71 | unsigned long addr; |
---|
72 | unsigned long shndx; |
---|
73 | } elf_section_header_table_t; |
---|
74 | |
---|
75 | /* The Multiboot information. */ |
---|
76 | typedef struct multiboot_info |
---|
77 | { |
---|
78 | unsigned long flags; |
---|
79 | unsigned long mem_lower; |
---|
80 | unsigned long mem_upper; |
---|
81 | unsigned long boot_device; |
---|
82 | unsigned long cmdline; |
---|
83 | unsigned long mods_count; |
---|
84 | unsigned long mods_addr; |
---|
85 | union |
---|
86 | { |
---|
87 | aout_symbol_table_t aout_sym; |
---|
88 | elf_section_header_table_t elf_sec; |
---|
89 | } u; |
---|
90 | unsigned long mmap_length; |
---|
91 | unsigned long mmap_addr; |
---|
92 | } multiboot_info_t; |
---|
93 | |
---|
94 | /* The module structure. */ |
---|
95 | typedef struct module |
---|
96 | { |
---|
97 | unsigned long mod_start; |
---|
98 | unsigned long mod_end; |
---|
99 | unsigned long string; |
---|
100 | unsigned long reserved; |
---|
101 | } module_t; |
---|
102 | |
---|
103 | /* The memory map. Be careful that the offset 0 is base_addr_low |
---|
104 | but no size. */ |
---|
105 | typedef struct memory_map |
---|
106 | { |
---|
107 | unsigned long size; |
---|
108 | unsigned long base_addr_low; |
---|
109 | unsigned long base_addr_high; |
---|
110 | unsigned long length_low; |
---|
111 | unsigned long length_high; |
---|
112 | unsigned long type; |
---|
113 | } memory_map_t; |
---|
114 | |
---|
115 | #endif /* ! ASM */ |
---|