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 *
5 * Portions Copyright (c) 2002-2003 Apple Computer, Inc. All Rights
6 * Reserved. This file contains Original Code and/or Modifications of
7 * Original Code as defined in and that are subject to the Apple Public
8 * Source License Version 2.0 (the "License"). You may not use this file
9 * except in compliance with the License. Please obtain a copy of the
10 * License at http://www.apple.com/publicsource and read it before using
11 * this file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the
18 * License for the specific language governing rights and limitations
19 * under the License.
20 *
21 */
22
23#ifndef __BOOTSTRUCT_H
24#define __BOOTSTRUCT_H
25
26#include "bootargs.h"
27#include "saio_types.h"
28#include "bios.h"
29#include "device_tree.h"
30
31/*
32 * Kernel boot args global also used by booter for its own data.
33 */
34extern boot_args *bootArgs;
35extern boot_args_pre_lion *bootArgsPreLion;
36extern Node *gMemoryMapNode;
37
38#define VGA_TEXT_MODE 0
39//defined in /usr/../boot.h
40
41//#define GRAPHICS_MODE 1
42//#define FB_TEXT_MODE 2
43
44
45/*
46 * Maximum number of boot drivers that can be loaded.
47 */
48#define NDRIVERS 500
49
50#define CONFIG_SIZE (40 * 4096)
51
52#define kMemoryMapCountMax 40
53
54/*
55 * PCI bus information.
56 */
57typedef struct _PCI_bus_info_t
58{
59union
60{
61struct
62{
63unsigned char configMethod1 :1;
64unsigned char configMethod2 :1;
65unsigned char :2;
66unsigned char specialCycle1 :1;
67unsigned char specialCycle2 :1;
68} s;
69unsigned char d;
70} u_bus;
71
72unsigned char maxBusNum;
73unsigned char majorVersion;
74unsigned char minorVersion;
75unsigned char BIOSPresent;
76} PCI_bus_info_t;
77
78
79typedef struct
80{
81unsigned long address; // address where driver was loaded
82unsigned long size; // number of bytes
83unsigned long type; // driver type
84} driver_config_t;
85
86/*
87 * INT15, E820h - Query System Address Map.
88 *
89 * Documented in ACPI Specification Rev 2.0,
90 * Chapter 15 (System Address Map Interfaces).
91 */
92
93/*
94 * ACPI defined memory range types.
95 */
96enum
97{
98kMemoryRangeUsable = 1, // RAM usable by the OS.
99kMemoryRangeReserved = 2, // Reserved. (Do not use)
100kMemoryRangeACPI = 3, // ACPI tables. Can be reclaimed.
101kMemoryRangeNVS = 4, // ACPI NVS memory. (Do not use)
102
103/* Undefined types should be treated as kMemoryRangeReserved */
104};
105
106/*!
107 PrivateBootInfo has fields used by the booter that used to be part of
108 KernelBootArgs_t *bootArgs. When the switch was made to EFI the structure
109 completely changed to boot_args *bootArgs. This (new to boot-132) structure
110 contains the fields the kernel no longer cares about but the booter still
111 uses internally. Some fields (e.g. the video information) remain interesting
112 to the kernel and are thus located in bootArgs although with different field names.
113 */
114typedef struct PrivateBootInfo
115{
116int convmem; // conventional memory
117int extmem; // extended memory
118#if 0
119int numBootDrivers; // number of drivers loaded
120#endif
121char bootFile[128]; // kernel file name
122
123unsigned long memoryMapCount;
124MemoryRange memoryMap[kMemoryMapCountMax];
125
126PCI_bus_info_t pciInfo;
127
128#if 0
129driver_config_t driverConfig[NDRIVERS];
130#endif
131char * configEnd;// pointer to end of config files
132char config[CONFIG_SIZE];
133
134config_file_t bootConfig;// com.apple.Boot.plist
135config_file_t chameleonConfig;// org.chameleon.Boot.plist which can override bootConfig keys
136config_file_t themeConfig;// theme.plist
137config_file_t smbiosConfig;// smbios.plist
138config_file_t helperConfig;// boot helper partition's boot.plist
139config_file_t ramdiskConfig;// RAMDisk.plist
140
141bool memDetect;
142} PrivateBootInfo_t;
143
144extern PrivateBootInfo_t *bootInfo;
145
146#endif /* __BOOTSTRUCT_H */
147

Archive Download this file

Revision: 2060