Subversion Repositories shark

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
42 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
  /* Drive Info buffer */
139
  unsigned long drives_length;
140
  unsigned long drives_addr;
141
 
142
  /* ROM configuration table */
143
  unsigned long config_table;
144
 
145
  /* Boot Loader Name */
146
  unsigned long boot_loader_name;
147
 
148
  /* APM table */
149
  unsigned long apm_table;
150
 
151
  /* Video */
152
  unsigned long vbe_control_info;
153
  unsigned long vbe_mode_info;
154
  unsigned short vbe_mode;
155
  unsigned short vbe_interface_seg;
156
  unsigned short vbe_interface_off;
157
  unsigned short vbe_interface_len;
158
#ifndef __OLD_MB__
159
  /*
160
     Gerardo: I need to add also the phisical address base for
161
     both low ( < 1MB) & upper ( > 1MB) memory, as X starts from DOS
162
     which could have preallocated some of this memory...
163
     For example, GRUB assumes that mem_lowbase = 0x0 &
164
     mem_upbase = 0x100000
165
  */
166
  unsigned long mem_lowbase;
167
  unsigned long mem_upbase;
168
#endif /* __OLD_MB__ */
169
};
170
 
171
/*
172
 *  Flags to be set in the 'flags' parameter above
173
 */
174
 
175
/* is there basic lower/upper memory information? */
176
#define MB_INFO_MEMORY          0x1
177
/* is there a boot device set? */
178
#define MB_INFO_BOOTDEV         0x2
179
/* is the command-line defined? */
180
#define MB_INFO_CMDLINE         0x4
181
/* are there modules to do something with? */
182
#define MB_INFO_MODS            0x8
183
 
184
/* These next two are mutually exclusive */
185
 
186
/* is there a symbol table loaded? */
187
#define MB_INFO_AOUT_SYMS       0x10
188
/* is there an ELF section header table? */
189
#define MB_INFO_ELF_SHDR        0x20
190
 
191
/* is there a full memory map? */
192
#define MB_INFO_MEM_MAP         0x40
193
 
194
/* Is there drive info?  */
195
#define MB_INFO_DRIVE_INFO              0x00000080
196
 
197
/* Is there a config table?  */
198
#define MB_INFO_CONFIG_TABLE            0x00000100
199
 
200
/* Is there a boot loader name?  */
201
#define MB_INFO_BOOT_LOADER_NAME        0x00000200
202
 
203
/* Is there a APM table?  */
204
#define MB_INFO_APM_TABLE               0x00000400
205
 
206
/* Is there video information?  */
207
#define MB_INFO_VIDEO_INFO              0x00000800
208
 
209
#if 0
210
/* Gerardo: Added this!
211
   --------------------
212
   The idea is that the BootLoader provides an interface
213
   to return back to it; this is useful to implement a DOS
214
   boot-loader, in order to use DOS as development environment.
215
*/
216
#define MB_INFO_USEGDT          0x80
217
#endif
218
/*
219
 *  The following value must be present in the EAX register.
220
 */
221
 
222
#define MULTIBOOT_VALID         0x2BADB002
223
 
224
struct multiboot_info * mbi_address(void);
225
 
226
END_DEF
227
 
228
#endif