]> git.saurik.com Git - apple/boot.git/blob - i386/libsa/kernBootStruct.h
e4c2403daade13698e85dd71be6c67cbc0a91bc9
[apple/boot.git] / i386 / libsa / kernBootStruct.h
1 /*
2 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights
7 * Reserved. This file contains Original Code and/or Modifications of
8 * Original Code as defined in and that are subject to the Apple Public
9 * Source License Version 1.1 (the "License"). You may not use this file
10 * except in compliance with the License. Please obtain a copy of the
11 * License at http://www.apple.com/publicsource and read it before using
12 * this file.
13 *
14 * The Original Code and all software distributed under the License are
15 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
16 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
17 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the
19 * License for the specific language governing rights and limitations
20 * under the License.
21 *
22 * @APPLE_LICENSE_HEADER_END@
23 */
24 /*
25 * kernBootStruct.h
26 * What the booter leaves behind for the kernel.
27 */
28
29 #ifndef __BOOT_KERNBOOTSTRUCT_H
30 #define __BOOT_KERNBOOTSTRUCT_H
31
32 /* The config table has room for 13 drivers if their config files
33 * are the maximum size allowed.
34 */
35 #define CONFIG_SIZE (13 * 4096)
36
37 /* Maximum number of boot drivers supported, assuming their
38 * config files fit in the bootstruct.
39 */
40 #define NDRIVERS 64
41
42 typedef struct {
43 char * address; // address where driver was loaded
44 int size; // entry point for driver
45 } driver_config_t;
46
47 typedef struct {
48 unsigned short major_vers; // == 0 if not present
49 unsigned short minor_vers;
50 unsigned long cs32_base;
51 unsigned long cs16_base;
52 unsigned long ds_base;
53 unsigned long cs_length;
54 unsigned long ds_length;
55 unsigned long entry_offset;
56 union {
57 struct {
58 unsigned long mode_16 :1;
59 unsigned long mode_32 :1;
60 unsigned long idle_slows_cpu :1;
61 unsigned long reserved :29;
62 } f;
63 unsigned long data;
64 } flags;
65 unsigned long connected;
66 } APM_config_t;
67
68 typedef struct _EISA_slot_info_t {
69 union {
70 struct {
71 unsigned char duplicateID :4;
72 unsigned char slotType :1;
73 unsigned char prodIDPresent :1;
74 unsigned char dupIDPresent :1;
75 } s;
76 unsigned char d;
77 } u_ID;
78 unsigned char configMajor;
79 unsigned char configMinor;
80 unsigned short checksum;
81 unsigned char numFunctions;
82 union {
83 struct {
84 unsigned char fnTypesPresent :1;
85 unsigned char memoryPresent :1;
86 unsigned char irqPresent :1;
87 unsigned char dmaPresent :1;
88 unsigned char portRangePresent :1;
89 unsigned char portInitPresent :1;
90 unsigned char freeFormPresent :1;
91 unsigned char reserved :1;
92 } s;
93 unsigned char d;
94 } u_resources;
95 unsigned char id[8];
96 } EISA_slot_info_t;
97
98 typedef struct _EISA_func_info_t {
99 unsigned char slot;
100 unsigned char function;
101 unsigned char reserved[2];
102 unsigned char data[320];
103 } EISA_func_info_t;
104
105 #define NUM_EISA_SLOTS 64
106
107 typedef struct _PCI_bus_info_t {
108 union {
109 struct {
110 unsigned char configMethod1 :1;
111 unsigned char configMethod2 :1;
112 unsigned char :2;
113 unsigned char specialCycle1 :1;
114 unsigned char specialCycle2 :1;
115 } s;
116 unsigned char d;
117 } u_bus;
118 unsigned char maxBusNum;
119 unsigned char majorVersion;
120 unsigned char minorVersion;
121 unsigned char BIOSPresent;
122 } PCI_bus_info_t;
123
124 /*
125 * Video information..
126 */
127 struct boot_video {
128 unsigned long v_baseAddr; /* Base address of video memory */
129 unsigned long v_display; /* Display Code (if Applicable */
130 unsigned long v_rowBytes; /* Number of bytes per pixel row */
131 unsigned long v_width; /* Width */
132 unsigned long v_height; /* Height */
133 unsigned long v_depth; /* Pixel Depth */
134 };
135
136 typedef struct boot_video boot_video;
137
138 #define BOOT_STRING_LEN 160
139
140 typedef struct {
141 short version;
142 char bootString[BOOT_STRING_LEN]; // string we booted with
143 int magicCookie; // KERNBOOTMAGIC if struct valid
144 int numIDEs; // how many IDE drives
145 int rootdev; // booters guess as to rootdev
146 int convmem; // conventional memory
147 int extmem; // extended memory
148 char boot_file[128]; // name of the kernel we booted
149 int first_addr0; // first address for kern convmem
150 int diskInfo[4]; // bios info for bios dev 80-83
151 int graphicsMode; // did we boot in graphics mode?
152 int kernDev; // device kernel was fetched from
153 int numBootDrivers; // number of drivers loaded by booter
154 char * configEnd; // pointer to end of config files
155 int kaddr; // kernel load address
156 int ksize; // size of kernel
157 void * rld_entry; // entry point for standalone rld
158
159 driver_config_t driverConfig[NDRIVERS];
160 APM_config_t apm_config;
161
162 char _reserved[7500];
163
164 boot_video video;
165
166 PCI_bus_info_t pciInfo;
167
168 int eisaConfigFunctions;
169 EISA_slot_info_t eisaSlotInfo[NUM_EISA_SLOTS];
170
171 char config[CONFIG_SIZE]; // the config file contents
172 } KERNBOOTSTRUCT;
173
174 #define GRAPHICS_MODE 1
175 #define TEXT_MODE 0
176
177 #define KERNSTRUCT_ADDR ((KERNBOOTSTRUCT *) 0x11000)
178 #define KERNBOOTMAGIC 0xa7a7a7a7
179
180 #if 0
181 #ifndef EISA_CONFIG_ADDR
182 #define EISA_CONFIG_ADDR 0x20000
183 #define EISA_CONFIG_LEN 0x10000
184 #endif
185 #endif
186
187 #ifndef KERNEL
188 extern KERNBOOTSTRUCT * kernBootStruct;
189 #endif
190
191 #endif /* !__BOOT_KERNBOOTSTRUCT_H */