Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2 | pj | 1 | /* Project: OSLib |
2 | * Description: The OS Construction Kit |
||
3 | * Date: 1.6.2000 |
||
4 | * Idea by: Luca Abeni & Gerardo Lamastra |
||
5 | * |
||
6 | * OSLib is an SO project aimed at developing a common, easy-to-use |
||
7 | * low-level infrastructure for developing OS kernels and Embedded |
||
8 | * Applications; it partially derives from the HARTIK project but it |
||
9 | * currently is independently developed. |
||
10 | * |
||
11 | * OSLib is distributed under GPL License, and some of its code has |
||
12 | * been derived from the Linux kernel source; also some important |
||
13 | * ideas come from studying the DJGPP go32 extender. |
||
14 | * |
||
15 | * We acknowledge the Linux Community, Free Software Foundation, |
||
16 | * D.J. Delorie and all the other developers who believe in the |
||
17 | * freedom of software and ideas. |
||
18 | * |
||
19 | * For legalese, check out the included GPL license. |
||
20 | */ |
||
21 | |||
22 | /* |
||
23 | * GRUB -- GRand Unified Bootloader |
||
24 | * Copyright (C) 1996 Erich Boleyn <erich@uruk.org> |
||
25 | * |
||
26 | * This program is free software; you can redistribute it and/or modify |
||
27 | * it under the terms of the GNU General Public License as published by |
||
28 | * the Free Software Foundation; either version 2 of the License, or |
||
29 | * (at your option) any later version. |
||
30 | * |
||
31 | * This program is distributed in the hope that it will be useful, |
||
32 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
33 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||
34 | * GNU General Public License for more details. |
||
35 | * |
||
36 | * You should have received a copy of the GNU General Public License |
||
37 | * along with this program; if not, write to the Free Software |
||
38 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
||
39 | */ |
||
40 | |||
41 | #ifndef __LL_I386_MB_INFO_H__ |
||
42 | #define __LL_I386_MB_INFO_H__ |
||
43 | |||
44 | #include <ll/i386/defs.h> |
||
45 | BEGIN_DEF |
||
46 | |||
47 | |||
48 | /* |
||
49 | * The structure type "mod_list" is used by the "multiboot_info" structure. |
||
50 | */ |
||
51 | |||
52 | struct mod_list |
||
53 | { |
||
54 | /* the memory used goes from bytes 'mod_start' to 'mod_end-1' inclusive */ |
||
55 | unsigned long mod_start; |
||
56 | unsigned long mod_end; |
||
57 | |||
58 | /* Module command line */ |
||
59 | unsigned long cmdline; |
||
60 | |||
61 | /* padding to take it to 16 bytes (must be zero) */ |
||
62 | unsigned long pad; |
||
63 | }; |
||
64 | |||
65 | |||
66 | /* |
||
67 | * INT-15, AX=E820 style "AddressRangeDescriptor" |
||
68 | * ...with a "size" parameter on the front which is the structure size - 4, |
||
69 | * pointing to the next one, up until the full buffer length of the memory |
||
70 | * map has been reached. |
||
71 | */ |
||
72 | |||
73 | struct AddrRangeDesc |
||
74 | { |
||
75 | unsigned long size; |
||
76 | unsigned long BaseAddrLow; |
||
77 | unsigned long BaseAddrHigh; |
||
78 | unsigned long LengthLow; |
||
79 | unsigned long LengthHigh; |
||
80 | unsigned long Type; |
||
81 | |||
82 | /* unspecified optional padding... */ |
||
83 | }; |
||
84 | |||
85 | /* usable memory "Type", all others are reserved. */ |
||
86 | #define MB_ARD_MEMORY 1 |
||
87 | |||
88 | /* |
||
89 | * MultiBoot Info description |
||
90 | * |
||
91 | * This is the struct passed to the boot image. This is done by placing |
||
92 | * its address in the EAX register. |
||
93 | */ |
||
94 | |||
95 | struct multiboot_info |
||
96 | { |
||
97 | /* MultiBoot info version number */ |
||
98 | unsigned long flags; |
||
99 | |||
100 | /* Available memory from BIOS */ |
||
101 | unsigned long mem_lower; |
||
102 | unsigned long mem_upper; |
||
103 | /* "root" partition */ |
||
104 | unsigned long boot_device; |
||
105 | |||
106 | /* Kernel command line */ |
||
107 | unsigned long cmdline; |
||
108 | |||
109 | /* Boot-Module list */ |
||
110 | unsigned long mods_count; |
||
111 | unsigned long mods_addr; |
||
112 | |||
113 | union |
||
114 | { |
||
115 | struct |
||
116 | { |
||
117 | /* (a.out) Kernel symbol table info */ |
||
118 | unsigned long tabsize; |
||
119 | unsigned long strsize; |
||
120 | unsigned long addr; |
||
121 | unsigned long pad; |
||
122 | } a; |
||
123 | |||
124 | struct |
||
125 | { |
||
126 | /* (ELF) Kernel section header table */ |
||
127 | unsigned long num; |
||
128 | unsigned long size; |
||
129 | unsigned long addr; |
||
130 | unsigned long shndx; |
||
131 | } e; |
||
132 | } syms; |
||
133 | |||
134 | /* Memory Mapping buffer */ |
||
135 | unsigned long mmap_length; |
||
136 | unsigned long mmap_addr; |
||
137 | |||
138 | #ifndef __OLD_MB__ |
||
139 | /* |
||
140 | Gerardo: I need to add also the phisical address base for |
||
141 | both low ( < 1MB) & upper ( > 1MB) memory, as X starts from DOS |
||
142 | which could have preallocated some of this memory... |
||
143 | For example, GRUB assumes that mem_lowbase = 0x0 & |
||
144 | mem_upbase = 0x100000 |
||
145 | */ |
||
146 | unsigned long mem_lowbase; |
||
147 | unsigned long mem_upbase; |
||
148 | #endif /* __OLD_MB__ */ |
||
149 | }; |
||
150 | |||
151 | /* |
||
152 | * Flags to be set in the 'flags' parameter above |
||
153 | */ |
||
154 | |||
155 | /* is there basic lower/upper memory information? */ |
||
156 | #define MB_INFO_MEMORY 0x1 |
||
157 | /* is there a boot device set? */ |
||
158 | #define MB_INFO_BOOTDEV 0x2 |
||
159 | /* is the command-line defined? */ |
||
160 | #define MB_INFO_CMDLINE 0x4 |
||
161 | /* are there modules to do something with? */ |
||
162 | #define MB_INFO_MODS 0x8 |
||
163 | |||
164 | /* These next two are mutually exclusive */ |
||
165 | |||
166 | /* is there a symbol table loaded? */ |
||
167 | #define MB_INFO_AOUT_SYMS 0x10 |
||
168 | /* is there an ELF section header table? */ |
||
169 | #define MB_INFO_ELF_SHDR 0x20 |
||
170 | |||
171 | /* is there a full memory map? */ |
||
172 | #define MB_INFO_MEM_MAP 0x40 |
||
173 | |||
174 | /* Gerardo: Added this! |
||
175 | -------------------- |
||
176 | The idea is that the BootLoader provides an interface |
||
177 | to return back to it; this is useful to implement a DOS |
||
178 | boot-loader, in order to use DOS as development environment. |
||
179 | */ |
||
180 | #define MB_INFO_USEGDT 0x80 |
||
181 | |||
182 | /* |
||
183 | * The following value must be present in the EAX register. |
||
184 | */ |
||
185 | |||
186 | #define MULTIBOOT_VALID 0x2BADB002 |
||
187 | |||
188 | struct multiboot_info * mbi_address(void); |
||
189 | |||
190 | END_DEF |
||
191 | |||
192 | #endif |