]> git.saurik.com Git - apple/xnu.git/blob - osfmk/i386/AT386/kernBootStruct.h
xnu-344.23.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 * 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.
11 *
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
18 * under the License.
19 *
20 * @APPLE_LICENSE_HEADER_END@
21 */
22 /*
23 * kernBootStruct.h
24 * What the booter leaves behind for the kernel.
25 */
26
27 /*
28 * Maximum number of boot drivers that can be loaded.
29 */
30 #define NDRIVERS 500
31
32 /*
33 * Types of boot driver that may be loaded by the booter.
34 */
35 enum {
36 kBootDriverTypeInvalid = 0,
37 kBootDriverTypeKEXT = 1,
38 kBootDriverTypeMKEXT = 2
39 };
40
41 typedef struct {
42 unsigned long address; // address where driver was loaded
43 unsigned long size; // number of bytes
44 unsigned long type; // driver type
45 } driver_config_t;
46
47 /*
48 * APM BIOS information.
49 */
50 typedef struct {
51 unsigned short major_vers; // == 0 if not present
52 unsigned short minor_vers;
53 unsigned long cs32_base;
54 unsigned long cs16_base;
55 unsigned long ds_base;
56 unsigned long cs_length;
57 unsigned long ds_length;
58 unsigned long entry_offset;
59 union {
60 struct {
61 unsigned long mode_16 :1;
62 unsigned long mode_32 :1;
63 unsigned long idle_slows_cpu :1;
64 unsigned long reserved :29;
65 } f;
66 unsigned long data;
67 } flags;
68 unsigned long connected;
69 } APM_config_t;
70
71 /*
72 * PCI bus information.
73 */
74 typedef struct _PCI_bus_info_t {
75 union {
76 struct {
77 unsigned char configMethod1 :1;
78 unsigned char configMethod2 :1;
79 unsigned char :2;
80 unsigned char specialCycle1 :1;
81 unsigned char specialCycle2 :1;
82 } s;
83 unsigned char d;
84 } u_bus;
85 unsigned char maxBusNum;
86 unsigned char majorVersion;
87 unsigned char minorVersion;
88 unsigned char BIOSPresent;
89 } PCI_bus_info_t;
90
91 /*
92 * Video information.
93 */
94 struct boot_video {
95 unsigned long v_baseAddr; // Base address of video memory
96 unsigned long v_display; // Display Code (if Applicable
97 unsigned long v_rowBytes; // Number of bytes per pixel row
98 unsigned long v_width; // Width
99 unsigned long v_height; // Height
100 unsigned long v_depth; // Pixel Depth
101 };
102
103 typedef struct boot_video boot_video;
104
105 #define GRAPHICS_MODE 1
106 #define TEXT_MODE 0
107
108 #define BOOT_STRING_LEN 160
109 #define CONFIG_SIZE (12 * 4096)
110
111 typedef struct {
112 short version;
113 char bootString[BOOT_STRING_LEN]; // boot arguments
114 int magicCookie; // KERNBOOTMAGIC
115 int numIDEs; // number of IDE drives
116 int rootdev; // root device
117 int convmem; // conventional memory
118 int extmem; // extended memory
119 char bootFile[128]; // kernel file name
120 int firstAddr0; // first address for kern convmem
121 int diskInfo[4]; // info for bios dev 80-83
122 int graphicsMode; // booted in graphics mode?
123 int kernDev; // device kernel was fetched from
124 int numBootDrivers; // number of drivers loaded
125 char * configEnd; // pointer to end of config files
126 int kaddr; // kernel load address
127 int ksize; // size of kernel
128 driver_config_t driverConfig[NDRIVERS];
129 char _reserved[2052];
130 boot_video video;
131 PCI_bus_info_t pciInfo;
132 APM_config_t apmConfig;
133 char config[CONFIG_SIZE];
134 } KERNBOOTSTRUCT;
135
136 #define KERNSTRUCT_ADDR ((KERNBOOTSTRUCT *) 0x11000)
137 #define KERNBOOTMAGIC 0xa7a7a7a7
138
139 #ifndef KERNEL
140 extern KERNBOOTSTRUCT * kernBootStruct;
141 #endif