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.
30 * Maximum number of boot drivers that can be loaded.
35 * Types of boot driver that may be loaded by the booter.
38 kBootDriverTypeInvalid
= 0,
39 kBootDriverTypeKEXT
= 1,
40 kBootDriverTypeMKEXT
= 2
44 unsigned long address
; // address where driver was loaded
45 unsigned long size
; // number of bytes
46 unsigned long type
; // driver type
50 * APM BIOS information.
53 unsigned short major_vers
; // == 0 if not present
54 unsigned short minor_vers
;
55 unsigned long cs32_base
;
56 unsigned long cs16_base
;
57 unsigned long ds_base
;
58 unsigned long cs_length
;
59 unsigned long ds_length
;
60 unsigned long entry_offset
;
63 unsigned long mode_16
:1;
64 unsigned long mode_32
:1;
65 unsigned long idle_slows_cpu
:1;
66 unsigned long reserved
:29;
70 unsigned long connected
;
74 * PCI bus information.
76 typedef struct _PCI_bus_info_t
{
79 unsigned char configMethod1
:1;
80 unsigned char configMethod2
:1;
82 unsigned char specialCycle1
:1;
83 unsigned char specialCycle2
:1;
87 unsigned char maxBusNum
;
88 unsigned char majorVersion
;
89 unsigned char minorVersion
;
90 unsigned char BIOSPresent
;
97 unsigned long v_baseAddr
; // Base address of video memory
98 unsigned long v_display
; // Display Code (if Applicable
99 unsigned long v_rowBytes
; // Number of bytes per pixel row
100 unsigned long v_width
; // Width
101 unsigned long v_height
; // Height
102 unsigned long v_depth
; // Pixel Depth
105 typedef struct boot_video boot_video
;
107 #define GRAPHICS_MODE 1
110 #define BOOT_STRING_LEN 160
111 #define CONFIG_SIZE (12 * 4096)
115 char bootString
[BOOT_STRING_LEN
]; // boot arguments
116 int magicCookie
; // KERNBOOTMAGIC
117 int numIDEs
; // number of IDE drives
118 int rootdev
; // root device
119 int convmem
; // conventional memory
120 int extmem
; // extended memory
121 char bootFile
[128]; // kernel file name
122 int firstAddr0
; // first address for kern convmem
123 int diskInfo
[4]; // info for bios dev 80-83
124 int graphicsMode
; // booted in graphics mode?
125 int kernDev
; // device kernel was fetched from
126 int numBootDrivers
; // number of drivers loaded
127 char * configEnd
; // pointer to end of config files
128 int kaddr
; // kernel load address
129 int ksize
; // size of kernel
130 driver_config_t driverConfig
[NDRIVERS
];
131 char _reserved
[2052];
133 PCI_bus_info_t pciInfo
;
134 APM_config_t apmConfig
;
135 char config
[CONFIG_SIZE
];
138 #define KERNSTRUCT_ADDR ((KERNBOOTSTRUCT *) 0x11000)
139 #define KERNBOOTMAGIC 0xa7a7a7a7
142 extern KERNBOOTSTRUCT
* kernBootStruct
;
145 #define BOOT_LINE_LENGTH 256
148 * Video information..
152 unsigned long v_baseAddr
; /* Base address of video memory */
153 unsigned long v_display
; /* Display Code (if Applicable */
154 unsigned long v_rowBytes
; /* Number of bytes per pixel row */
155 unsigned long v_width
; /* Width */
156 unsigned long v_height
; /* Height */
157 unsigned long v_depth
; /* Pixel Depth */
160 typedef struct Boot_Video Boot_Video
;
162 /* DRAM Bank definitions - describes physical memory layout.
164 #define kMaxDRAMBanks 26 /* maximum number of DRAM banks */
168 unsigned long base
; /* physical base of DRAM bank */
169 unsigned long size
; /* size of bank */
171 typedef struct DRAMBank DRAMBank
;
174 /* Boot argument structure - passed into Mach kernel at boot time.
176 #define kBootArgsVersion 1
177 #define kBootArgsRevision 1
179 typedef struct boot_args
{
180 unsigned short Revision
; /* Revision of boot_args structure */
181 unsigned short Version
; /* Version of boot_args structure */
182 char CommandLine
[BOOT_LINE_LENGTH
]; /* Passed in command line */
183 DRAMBank PhysicalDRAM
[kMaxDRAMBanks
]; /* base and range pairs for the 26 DRAM banks */
184 Boot_Video Video
; /* Video Information */
185 unsigned long machineType
; /* Machine Type (gestalt) */
186 void *deviceTreeP
; /* Base of flattened device tree */
187 unsigned long deviceTreeLength
;/* Length of flattened tree */
188 unsigned long topOfKernelData
;/* Highest address used in kernel data area */
191 extern boot_args passed_args
;
193 #endif /* _PEXPERT_I386_BOOT_H */