]> git.saurik.com Git - apple/xnu.git/blob - osfmk/i386/AT386/kernBootStruct.h
xnu-344.49.tar.gz
[apple/xnu.git] / osfmk / i386 / AT386 / kernBootStruct.h
1 /*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
7 *
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
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
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.
22 *
23 * @APPLE_LICENSE_HEADER_END@
24 */
25 /*
26 * kernBootStruct.h
27 * What the booter leaves behind for the kernel.
28 */
29
30 /*
31 * Maximum number of boot drivers that can be loaded.
32 */
33 #define NDRIVERS 500
34
35 /*
36 * Types of boot driver that may be loaded by the booter.
37 */
38 enum {
39 kBootDriverTypeInvalid = 0,
40 kBootDriverTypeKEXT = 1,
41 kBootDriverTypeMKEXT = 2
42 };
43
44 typedef struct {
45 unsigned long address; // address where driver was loaded
46 unsigned long size; // number of bytes
47 unsigned long type; // driver type
48 } driver_config_t;
49
50 /*
51 * APM BIOS information.
52 */
53 typedef struct {
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;
62 union {
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;
70 } flags;
71 unsigned long connected;
72 } APM_config_t;
73
74 /*
75 * PCI bus information.
76 */
77 typedef struct _PCI_bus_info_t {
78 union {
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;
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 /*
95 * Video information.
96 */
97 struct boot_video {
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
104 };
105
106 typedef struct boot_video boot_video;
107
108 #define GRAPHICS_MODE 1
109 #define TEXT_MODE 0
110
111 #define BOOT_STRING_LEN 160
112 #define CONFIG_SIZE (12 * 4096)
113
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];
137 } KERNBOOTSTRUCT;
138
139 #define KERNSTRUCT_ADDR ((KERNBOOTSTRUCT *) 0x11000)
140 #define KERNBOOTMAGIC 0xa7a7a7a7
141
142 #ifndef KERNEL
143 extern KERNBOOTSTRUCT * kernBootStruct;
144 #endif