Chameleon

Chameleon Svn Source Tree

Root/branches/ErmaC/Modules/i386/boot2/boot.h

1/*
2 * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * Portions Copyright (c) 1999-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 * Copyright 1994 NeXT Computer, Inc.
26 * All rights reserved.
27 */
28
29#ifndef __BOOT2_BOOT_H
30#define __BOOT2_BOOT_H
31
32#include "libsaio.h"
33/*
34 * Paths used by chameleon
35 */
36
37//kernel cache
38#define kDefaultCachePathLeo "/System/Library/Caches/com.apple.kernelcaches/"
39#define kDefaultCachePathSnow "/System/Library/Caches/com.apple.kext.caches/Startup/"
40
41// Lion installer
42#define kLionInstallerDataFolder "/Mac OS X Install Data/"
43#define kLionInstallerPlist kLionInstallerDataFolder "com.apple.Boot.plist"
44
45/*
46 * Keys used in system Boot.plist
47 */
48#define kGraphicsModeKey"Graphics Mode"
49#define kTextModeKey"Text Mode"
50#define kQuietBootKey"Quiet Boot"
51#define kKernelFlagsKey"Kernel Flags"
52#define kKernelArchKey "Kernel Architecture"
53#define karch"arch"/* boot.c */
54#define kProductVersion"ProductVersion"/* boot.c */
55#define kMKextCacheKey"MKext Cache"
56#define kKernelNameKey"Kernel"
57#define kKernelCacheKey"Kernel Cache"
58#define kUseKernelCache"UseKernelCache"/* boot.c */
59#define kBootDeviceKey"Boot Device"
60#define kTimeoutKey"Timeout"
61#define kRootDeviceKey"rd"
62#define kBootUUIDKey"boot-uuid"
63#define kHelperRootUUIDKey"Root UUID"
64#define kPlatformKey"platform"
65#define kACPIKey"acpi"
66#define kCDROMPromptKey"CD-ROM Prompt"
67#define kCDROMOptionKey"CD-ROM Option Key"
68#define kRescanPromptKey"Rescan Prompt"
69#define kRescanKey "Rescan"
70#define kScanSingleDriveKey"Scan Single Drive"
71#define kInstantMenuKey"Instant Menu"
72#define kDefaultKernel"mach_kernel"
73#define kGUIKey"GUI"
74#define kBootBannerKey"Boot Banner"
75#define kShowInfoKey"ShowInfo"// gui.c
76#define kWaitForKeypressKey"Wait"
77
78#define kDSDT"DSDT"/* acpi_patcher.c */
79#define kDropSSDT"DropSSDT"/* acpi_patcher.c */
80#define kRestartFix"RestartFix"/* acpi_patcher.c */
81#define kGeneratePStates"GeneratePStates"/* acpi_patcher.c */
82#define kGenerateCStates"GenerateCStates"/* acpi_patcher.c */
83#define kCSTUsingSystemIO"CSTUsingSystemIO"/* acpi_patcher.c */
84#define kEnableC2State"EnableC2State"/* acpi_patcher.c */
85#define kEnableC3State"EnableC3State"/* acpi_patcher.c */
86#define kEnableC4State"EnableC4State"/* acpi_patcher.c */
87
88#define kWake"Wake"/* boot.c */
89#define kForceWake"ForceWake"/* boot.c */
90#define kWakeImage"WakeImage"/* boot.c */
91
92#define kbusratio"busratio"/* cpu.c */
93
94#define kDeviceProperties"device-properties"/* device_inject.c */
95
96#define kHidePartition"Hide Partition"/* disk.c */
97#define kRenamePartition"Rename Partition"/* disk.c */
98#define kDefaultPartition"Default Partition"/* sys.c */
99
100#define kSMBIOSKey"SMBIOS"/* fake_efi.c */
101#define kSMBIOSdefaults"SMBIOSdefaults"/* smbios_patcher.c */
102#define kSystemID"SystemId"/* fake_efi.c */
103#define kSystemType"SystemType"/* fake_efi.c */
104
105#define kUseMemDetect"UseMemDetect" /* platform.c */
106
107#define kPCIRootUID"PCIRootUID"/* pci_root.c */
108
109#define kEthernetBuiltIn"EthernetBuiltIn"/* pci_setup.c */
110#define kGraphicsEnabler"GraphicsEnabler"/* pci_setup.c */
111#define kForceHPET"ForceHPET"/* pci_setup.c */
112
113#define kMD0Image"md0"/* ramdisk.h */
114
115#define kUSBBusFix"USBBusFix"/* usb.c */
116#define kEHCIacquire"EHCIacquire"/* usb.c */
117#define kUHCIreset"UHCIreset"/* usb.c */
118#define kLegacyOff"USBLegacyOff"/* usb.c */
119#define kEHCIhard"EHCIhard"/* usb.c */
120
121/*
122 * Flags to the booter or kernel
123 */
124#define kVerboseModeFlag"-v"
125#define kSafeModeFlag"-x"
126#define kIgnoreCachesFlag"-f"
127#define kIgnoreBootFileFlag"-F"
128#define kSingleUserModeFlag"-s"
129
130/*
131 * Booter behavior control
132 */
133#define kBootTimeout -1
134#define kCDBootTimeout 8
135
136/*
137 * A global set by boot() to record the device that the booter
138 * was loaded from.
139 */
140#define ROOT_DEVICE_SIZE 512
141extern int gBIOSDev;
142extern long gBootMode;
143extern bool sysConfigValid;
144extern char bootBanner[];
145extern char bootPrompt[];
146extern bool gOverrideKernel;
147extern char *gPlatformName;
148extern char gMKextName[];
149extern char gRootDevice[];
150extern bool gEnableCDROMRescan;
151extern bool gScanSingleDrive;
152extern bool useGUI;
153
154/*
155 * Boot Modes
156 */
157enum {
158 kBootModeNormal = 0,
159 kBootModeSafe = 1,
160 kBootModeSecure = 2,
161 kBootModeQuiet = 4
162};
163
164extern void initialize_runtime();
165extern void common_boot(int biosdev);
166
167/*
168 * usb.c
169 */
170extern int usb_loop();
171
172/*
173 * graphics.c
174 */
175extern void printVBEModeInfo();
176extern void setVideoMode(int mode, int drawgraphics);
177extern int getVideoMode();
178extern void spinActivityIndicator();
179extern void clearActivityIndicator();
180extern void drawColorRectangle( unsigned short x,
181 unsigned short y,
182 unsigned short width,
183 unsigned short height,
184 unsigned char colorIndex );
185extern void drawDataRectangle( unsigned short x,
186 unsigned short y,
187 unsigned short width,
188 unsigned short height,
189 unsigned char * data );
190extern int
191convertImage( unsigned short width,
192 unsigned short height,
193 const unsigned char *imageData,
194 unsigned char **newImageData );
195extern char * decodeRLE( const void * rleData, int rleBlocks, int outBytes );
196extern void drawBootGraphics(void);
197extern void drawPreview(void *src, uint8_t * saveunder);
198extern int getVideoMode(void);
199extern void loadImageScale (void *input, int iw, int ih, int ip, void *output, int ow, int oh, int op, int or);
200
201/*
202 * drivers.c
203 */
204extern long LoadExtraDrivers(char * dirSpec);
205extern long LoadDrivers(char * dirSpec);
206extern long DecodeKernel(void *binary, entry_t *rentry, char **raddr, int *rsize);
207
208typedef long (*FileLoadDrivers_t)(char *dirSpec, long plugin);
209/*!
210 Hookable function pointer called during the driver loading phase that
211 allows other code to cause additional drivers to be loaded.
212 */
213extern long (*LoadExtraDrivers_p)(FileLoadDrivers_t FileLoadDrivers_p);
214
215/*
216 * options.c
217 */
218extern char gBootUUIDString[];
219
220extern int getBootOptions(bool firstRun);
221extern int processBootOptions();
222extern int selectAlternateBootDevice(int bootdevice);
223extern bool promptForRescanOption(void);
224
225void showHelp();
226void showTextFile();
227char *getMemoryInfoString();
228
229typedef struct {
230 char name[80];
231 void * param;
232} MenuItem;
233
234/*
235 * lzss.c
236 */
237extern int decompress_lzss(u_int8_t *dst, u_int8_t *src, u_int32_t srclen);
238
239struct compressed_kernel_header {
240 u_int32_t signature;
241 u_int32_t compress_type;
242 u_int32_t adler32;
243 u_int32_t uncompressed_size;
244 u_int32_t compressed_size;
245 u_int32_t reserved[11];
246 char platform_name[64];
247 char root_path[256];
248 u_int8_t data[0];
249};
250typedef struct compressed_kernel_header compressed_kernel_header;
251
252/* resume.c */
253void HibernateBoot(char *boot_device);
254
255/* bmdecompress.c */
256void * DecompressData(void *srcbase, int *dw, int *dh, int *bytesPerPixel);
257
258#endif /* !__BOOT2_BOOT_H */
259

Archive Download this file

Revision: 1651