]>
Commit | Line | Data |
---|---|---|
1c79356b A |
1 | /* |
2 | * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. | |
3 | * | |
4 | * @APPLE_LICENSE_HEADER_START@ | |
5 | * | |
43866e37 | 6 | * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. |
1c79356b | 7 | * |
43866e37 A |
8 | * This file contains Original Code and/or Modifications of Original Code |
9 | * as defined in and that are subject to the Apple Public Source License | |
10 | * Version 2.0 (the 'License'). You may not use this file except in | |
11 | * compliance with the License. Please obtain a copy of the License at | |
12 | * http://www.opensource.apple.com/apsl/ and read it before using this | |
13 | * file. | |
14 | * | |
15 | * The Original Code and all software distributed under the License are | |
16 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | |
1c79356b A |
17 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, |
18 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
43866e37 A |
19 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. |
20 | * Please see the License for the specific language governing rights and | |
21 | * limitations under the License. | |
1c79356b A |
22 | * |
23 | * @APPLE_LICENSE_HEADER_END@ | |
24 | */ | |
25 | /* | |
26 | * kernBootStruct.h | |
27 | * What the booter leaves behind for the kernel. | |
28 | */ | |
29 | ||
0b4e3aa0 A |
30 | /* |
31 | * Maximum number of boot drivers that can be loaded. | |
1c79356b | 32 | */ |
0b4e3aa0 | 33 | #define NDRIVERS 500 |
1c79356b | 34 | |
0b4e3aa0 A |
35 | /* |
36 | * Types of boot driver that may be loaded by the booter. | |
1c79356b | 37 | */ |
0b4e3aa0 A |
38 | enum { |
39 | kBootDriverTypeInvalid = 0, | |
40 | kBootDriverTypeKEXT = 1, | |
41 | kBootDriverTypeMKEXT = 2 | |
42 | }; | |
1c79356b A |
43 | |
44 | typedef struct { | |
0b4e3aa0 A |
45 | unsigned long address; // address where driver was loaded |
46 | unsigned long size; // number of bytes | |
47 | unsigned long type; // driver type | |
1c79356b A |
48 | } driver_config_t; |
49 | ||
0b4e3aa0 A |
50 | /* |
51 | * APM BIOS information. | |
52 | */ | |
1c79356b | 53 | typedef struct { |
0b4e3aa0 A |
54 | unsigned short major_vers; // == 0 if not present |
55 | unsigned short minor_vers; | |
56 | unsigned long cs32_base; | |
57 | unsigned long cs16_base; | |
58 | unsigned long ds_base; | |
59 | unsigned long cs_length; | |
60 | unsigned long ds_length; | |
61 | unsigned long entry_offset; | |
1c79356b | 62 | union { |
0b4e3aa0 A |
63 | struct { |
64 | unsigned long mode_16 :1; | |
65 | unsigned long mode_32 :1; | |
66 | unsigned long idle_slows_cpu :1; | |
67 | unsigned long reserved :29; | |
68 | } f; | |
69 | unsigned long data; | |
1c79356b | 70 | } flags; |
0b4e3aa0 | 71 | unsigned long connected; |
1c79356b A |
72 | } APM_config_t; |
73 | ||
0b4e3aa0 A |
74 | /* |
75 | * PCI bus information. | |
76 | */ | |
1c79356b A |
77 | typedef struct _PCI_bus_info_t { |
78 | union { | |
0b4e3aa0 A |
79 | struct { |
80 | unsigned char configMethod1 :1; | |
81 | unsigned char configMethod2 :1; | |
82 | unsigned char :2; | |
83 | unsigned char specialCycle1 :1; | |
84 | unsigned char specialCycle2 :1; | |
85 | } s; | |
86 | unsigned char d; | |
1c79356b A |
87 | } u_bus; |
88 | unsigned char maxBusNum; | |
89 | unsigned char majorVersion; | |
90 | unsigned char minorVersion; | |
91 | unsigned char BIOSPresent; | |
92 | } PCI_bus_info_t; | |
93 | ||
94 | /* | |
0b4e3aa0 | 95 | * Video information. |
1c79356b | 96 | */ |
1c79356b | 97 | struct boot_video { |
0b4e3aa0 A |
98 | unsigned long v_baseAddr; // Base address of video memory |
99 | unsigned long v_display; // Display Code (if Applicable | |
100 | unsigned long v_rowBytes; // Number of bytes per pixel row | |
101 | unsigned long v_width; // Width | |
102 | unsigned long v_height; // Height | |
103 | unsigned long v_depth; // Pixel Depth | |
1c79356b A |
104 | }; |
105 | ||
0b4e3aa0 | 106 | typedef struct boot_video boot_video; |
1c79356b | 107 | |
0b4e3aa0 A |
108 | #define GRAPHICS_MODE 1 |
109 | #define TEXT_MODE 0 | |
1c79356b | 110 | |
0b4e3aa0 A |
111 | #define BOOT_STRING_LEN 160 |
112 | #define CONFIG_SIZE (12 * 4096) | |
1c79356b | 113 | |
0b4e3aa0 A |
114 | typedef struct { |
115 | short version; | |
116 | char bootString[BOOT_STRING_LEN]; // boot arguments | |
117 | int magicCookie; // KERNBOOTMAGIC | |
118 | int numIDEs; // number of IDE drives | |
119 | int rootdev; // root device | |
120 | int convmem; // conventional memory | |
121 | int extmem; // extended memory | |
122 | char bootFile[128]; // kernel file name | |
123 | int firstAddr0; // first address for kern convmem | |
124 | int diskInfo[4]; // info for bios dev 80-83 | |
125 | int graphicsMode; // booted in graphics mode? | |
126 | int kernDev; // device kernel was fetched from | |
127 | int numBootDrivers; // number of drivers loaded | |
128 | char * configEnd; // pointer to end of config files | |
129 | int kaddr; // kernel load address | |
130 | int ksize; // size of kernel | |
131 | driver_config_t driverConfig[NDRIVERS]; | |
132 | char _reserved[2052]; | |
133 | boot_video video; | |
134 | PCI_bus_info_t pciInfo; | |
135 | APM_config_t apmConfig; | |
136 | char config[CONFIG_SIZE]; | |
1c79356b A |
137 | } KERNBOOTSTRUCT; |
138 | ||
0b4e3aa0 A |
139 | #define KERNSTRUCT_ADDR ((KERNBOOTSTRUCT *) 0x11000) |
140 | #define KERNBOOTMAGIC 0xa7a7a7a7 | |
1c79356b A |
141 | |
142 | #ifndef KERNEL | |
0b4e3aa0 | 143 | extern KERNBOOTSTRUCT * kernBootStruct; |
1c79356b | 144 | #endif |