2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
22 #ifndef _PEXPERT_I386_BOOT_H
23 #define _PEXPERT_I386_BOOT_H
26 * What the booter leaves behind for the kernel.
29 /* The config table has room for 13 drivers if their config files
30 * are the maximum size allowed.
32 #define CONFIG_SIZE (13 * 4096)
34 /* Maximum number of boot drivers supported, assuming their
35 * config files fit in the bootstruct.
40 char *address
; // address where driver was loaded
41 int size
; // entry point for driver
45 unsigned short major_vers
; // == 0 if not present
46 unsigned short minor_vers
;
47 unsigned long cs32_base
;
48 unsigned long cs16_base
;
49 unsigned long ds_base
;
50 unsigned long cs_length
;
51 unsigned long ds_length
;
52 unsigned long entry_offset
;
55 unsigned long mode_16
:1;
56 unsigned long mode_32
:1;
57 unsigned long idle_slows_cpu
:1;
58 unsigned long reserved
:29;
62 unsigned long connected
;
65 typedef struct _EISA_slot_info_t
{
68 unsigned char duplicateID
:4;
69 unsigned char slotType
:1;
70 unsigned char prodIDPresent
:1;
71 unsigned char dupIDPresent
:1;
75 unsigned char configMajor
;
76 unsigned char configMinor
;
77 unsigned short checksum
;
78 unsigned char numFunctions
;
81 unsigned char fnTypesPresent
:1;
82 unsigned char memoryPresent
:1;
83 unsigned char irqPresent
:1;
84 unsigned char dmaPresent
:1;
85 unsigned char portRangePresent
:1;
86 unsigned char portInitPresent
:1;
87 unsigned char freeFormPresent
:1;
88 unsigned char reserved
:1;
95 typedef struct _EISA_func_info_t
{
97 unsigned char function
;
98 unsigned char reserved
[2];
99 unsigned char data
[320];
102 #define NUM_EISA_SLOTS 64
104 typedef struct _PCI_bus_info_t
{
107 unsigned char configMethod1
:1;
108 unsigned char configMethod2
:1;
110 unsigned char specialCycle1
:1;
111 unsigned char specialCycle2
:1;
115 unsigned char maxBusNum
;
116 unsigned char majorVersion
;
117 unsigned char minorVersion
;
118 unsigned char BIOSPresent
;
122 * Video information..
126 unsigned long v_baseAddr
; /* Base address of video memory */
127 unsigned long v_display
; /* Display Code (if Applicable */
128 unsigned long v_rowBytes
; /* Number of bytes per pixel row */
129 unsigned long v_width
; /* Width */
130 unsigned long v_height
; /* Height */
131 unsigned long v_depth
; /* Pixel Depth */
134 typedef struct boot_video boot_video
;
136 #define BOOT_STRING_LEN 160
140 char bootString
[BOOT_STRING_LEN
];// string we booted with
141 int magicCookie
; // KERNBOOTMAGIC if struct valid
142 int numIDEs
; // how many IDE drives
143 int rootdev
; // booters guess as to rootdev
144 int convmem
; // conventional memory
145 int extmem
; // extended memory
146 char boot_file
[128]; // name of the kernel we booted
147 int first_addr0
; // first address for kern convmem
148 int diskInfo
[4]; // bios info for bios dev 80-83
149 int graphicsMode
; // did we boot in graphics mode?
150 int kernDev
; // device kernel was fetched from
151 int numBootDrivers
; // number of drivers loaded by booter
152 char *configEnd
; // pointer to end of config files
153 int kaddr
; // kernel load address
154 int ksize
; // size of kernel
155 void *rld_entry
; // entry point for standalone rld
157 driver_config_t driverConfig
[NDRIVERS
];
158 APM_config_t apm_config
;
160 char _reserved
[7500];
164 PCI_bus_info_t pciInfo
;
166 int eisaConfigFunctions
;
167 EISA_slot_info_t eisaSlotInfo
[NUM_EISA_SLOTS
];// EISA slot information
169 char config
[CONFIG_SIZE
]; // the config file contents
172 #define GRAPHICS_MODE 1
175 #define KERNSTRUCT_ADDR ((KERNBOOTSTRUCT *)0x11000)
176 #define KERNBOOTMAGIC 0xa7a7a7a7
178 #ifndef EISA_CONFIG_ADDR
179 #define EISA_CONFIG_ADDR 0x20000
180 #define EISA_CONFIG_LEN 0x10000
184 extern KERNBOOTSTRUCT
*kernBootStruct
;
187 #define BOOT_LINE_LENGTH 256
190 * Video information..
194 unsigned long v_baseAddr
; /* Base address of video memory */
195 unsigned long v_display
; /* Display Code (if Applicable */
196 unsigned long v_rowBytes
; /* Number of bytes per pixel row */
197 unsigned long v_width
; /* Width */
198 unsigned long v_height
; /* Height */
199 unsigned long v_depth
; /* Pixel Depth */
202 typedef struct Boot_Video Boot_Video
;
204 /* DRAM Bank definitions - describes physical memory layout.
206 #define kMaxDRAMBanks 26 /* maximum number of DRAM banks */
210 unsigned long base
; /* physical base of DRAM bank */
211 unsigned long size
; /* size of bank */
213 typedef struct DRAMBank DRAMBank
;
216 /* Boot argument structure - passed into Mach kernel at boot time.
218 #define kBootArgsVersion 1
219 #define kBootArgsRevision 1
221 typedef struct boot_args
{
222 unsigned short Revision
; /* Revision of boot_args structure */
223 unsigned short Version
; /* Version of boot_args structure */
224 char CommandLine
[BOOT_LINE_LENGTH
]; /* Passed in command line */
225 DRAMBank PhysicalDRAM
[kMaxDRAMBanks
]; /* base and range pairs for the 26 DRAM banks */
226 Boot_Video Video
; /* Video Information */
227 unsigned long machineType
; /* Machine Type (gestalt) */
228 void *deviceTreeP
; /* Base of flattened device tree */
229 unsigned long deviceTreeLength
;/* Length of flattened tree */
230 unsigned long topOfKernelData
;/* Highest address used in kernel data area */
233 extern boot_args passed_args
;
235 #endif /* _PEXPERT_I386_BOOT_H */