Chameleon

Chameleon Svn Source Tree

Root/branches/ErmaC/Trunk/i386/libsaio/bootstruct.h

1/*
2 * Copyright (c) 2002-2003 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * Portions Copyright (c) 2002-2003 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 2.0 (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#ifndef __BOOTSTRUCT_H
26#define __BOOTSTRUCT_H
27
28#include "bootargs.h"
29#include "saio_types.h"
30#include "bios.h"
31#include "device_tree.h"
32
33/*!
34 Kernel boot args global also used by booter for its own data.
35 */
36extern boot_args *bootArgs;
37extern boot_args_pre_lion *bootArgsPreLion;
38extern Node *gMemoryMapNode;
39
40#define VGA_TEXT_MODE 0
41//defined in /usr/../boot.h
42
43//#define GRAPHICS_MODE 1
44//#define FB_TEXT_MODE 2
45
46
47
48/*
49 * Maximum number of boot drivers that can be loaded.
50 */
51#define NDRIVERS 500
52
53#define CONFIG_SIZE (40 * 4096)
54
55/*
56 * Max size for config data array, in bytes.
57 */
58#define IO_CONFIG_DATA_SIZE163840
59
60#define kMemoryMapCountMax 40
61
62/*
63 * PCI bus information.
64 */
65typedef struct _PCI_bus_info_t
66{
67union
68{
69struct
70{
71unsigned char configMethod1 :1;
72unsigned char configMethod2 :1;
73unsigned char :2;
74unsigned char specialCycle1 :1;
75unsigned char specialCycle2 :1;
76} s;
77unsigned char d;
78} u_bus;
79
80unsigned char maxBusNum;
81unsigned char majorVersion;
82unsigned char minorVersion;
83unsigned char BIOSPresent;
84} PCI_bus_info_t;
85
86
87typedef struct
88{
89unsigned long address; // address where driver was loaded
90unsigned long size; // number of bytes
91unsigned long type; // driver type
92} driver_config_t;
93
94/*
95 * INT15, E820h - Query System Address Map.
96 *
97 * Documented in ACPI Specification Rev 2.0,
98 * Chapter 15 (System Address Map Interfaces).
99 */
100
101/*
102 * ACPI defined memory range types.
103 */
104enum {
105 kMemoryRangeUsable = 1, // RAM usable by the OS.
106 kMemoryRangeReserved = 2, // Reserved. (Do not use)
107 kMemoryRangeACPI = 3, // ACPI tables. Can be reclaimed.
108 kMemoryRangeNVS = 4, // ACPI NVS memory. (Do not use)
109
110 /* Undefined types should be treated as kMemoryRangeReserved */
111};
112
113/*!
114 PrivateBootInfo has fields used by the booter that used to be part of
115 KernelBootArgs_t *bootArgs. When the switch was made to EFI the structure
116 completely changed to boot_args *bootArgs. This (new to boot-132) structure
117 contains the fields the kernel no longer cares about but the booter still
118 uses internally. Some fields (e.g. the video information) remain interesting
119 to the kernel and are thus located in bootArgs although with different field names.
120 */
121typedef struct PrivateBootInfo {
122 int convmem; // conventional memory
123 int extmem; // extended memory
124#if 0
125 int numBootDrivers; // number of drivers loaded
126#endif
127 char bootFile[128]; // kernel file name
128
129 unsigned long memoryMapCount;
130 MemoryRange memoryMap[kMemoryMapCountMax];
131
132 PCI_bus_info_t pciInfo;
133
134#if 0
135 driver_config_t driverConfig[NDRIVERS];
136#endif
137 char * configEnd;// pointer to end of config files
138 char config[CONFIG_SIZE];
139
140 config_file_t bootConfig;// com.apple.Boot.plist
141 config_file_t chameleonConfig;// org.chameleon.Boot.plist which can override bootConfig keys
142 config_file_t themeConfig;// theme.plist
143 config_file_t smbiosConfig;// smbios.plist
144 config_file_t helperConfig;// boot helper partition's boot.plist
145 config_file_t ramdiskConfig;// RAMDisk.plist
146
147bool memDetect;
148} PrivateBootInfo_t;
149
150extern PrivateBootInfo_t *bootInfo;
151
152#endif /* __BOOTSTRUCT_H */
153

Archive Download this file

Revision: 2037