Chameleon

Chameleon Svn Source Tree

Root/trunk/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 kInsantMenuKey"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 kEnableC2States"EnableC2State"/* acpi_patcher.c */
84#define kEnableC3States"EnableC3State"/* acpi_patcher.c */
85#define kEnableC4States"EnableC4State"/* acpi_patcher.c */
86
87#define kWake"Wake"/* boot.c */
88#define kForceWake"ForceWake"/* boot.c */
89#define kWakeImage"WakeImage"/* boot.c */
90
91#define kbusratio"busratio"/* cpu.c */
92
93#define kDeviceProperties"device-properties"/* device_inject.c */
94
95#define kHidePartition"Hide Partition"/* disk.c */
96#define kRenamePartition"Rename Partition"/* disk.c */
97#define kDefaultPartition"Default Partition"/* sys.c */
98
99#define kSMBIOSKey"SMBIOS"/* fake_efi.c */
100#define kSMBIOSdefaults"SMBIOSdefaults"/* smbios_patcher.c */
101#define kSystemID"SystemId"/* fake_efi.c */
102#define kSystemType"SystemType"/* fake_efi.c */
103
104#define kUseMemDetect"UseMemDetect" /* platform.c */
105
106#define kPCIRootUID"PCIRootUID"/* pci_root.c */
107
108#define kUseAtiROM"UseAtiROM"/* ati.c */
109#define kAtiConfig"AtiConfig"/* ati.c */
110#define kATYbinimage"ATYbinimage"/* ati.c */
111
112#define kUseNvidiaROM"UseNvidiaROM"/* nvidia.c */
113#define kVBIOS"VBIOS"/* nvidia.c */
114#define kDcfg0"display_0"/* nvidia.c */
115#define kDcfg1"display_1"/* nvidia.c */
116
117#define kEthernetBuiltIn"EthernetBuiltIn"/* pci_setup.c */
118#define kGraphicsEnabler"GraphicsEnabler"/* pci_setup.c */
119#define kForceHPET"ForceHPET"/* pci_setup.c */
120
121#define kMD0Image"md0"/* ramdisk.h */
122
123#define kUSBBusFix"USBBusFix"/* usb.c */
124#define kEHCIacquire"EHCIacquire"/* usb.c */
125#define kUHCIreset"UHCIreset"/* usb.c */
126#define kLegacyOff"USBLegacyOff"/* usb.c */
127#define kEHCIhard"EHCIhard"/* usb.c */
128
129/*
130 * Flags to the booter or kernel
131 */
132#define kVerboseModeFlag"-v"
133#define kSafeModeFlag"-x"
134#define kIgnoreCachesFlag"-f"
135#define kIgnoreBootFileFlag"-F"
136#define kSingleUserModeFlag"-s"
137
138/*
139 * Booter behavior control
140 */
141#define kBootTimeout -1
142#define kCDBootTimeout 8
143
144/*
145 * A global set by boot() to record the device that the booter
146 * was loaded from.
147 */
148extern int gBIOSDev;
149extern long gBootMode;
150extern bool sysConfigValid;
151extern char bootBanner[];
152extern char bootPrompt[];
153extern bool gOverrideKernel;
154extern char *gPlatformName;
155extern char gMKextName[];
156extern char gRootDevice[];
157extern bool gEnableCDROMRescan;
158extern bool gScanSingleDrive;
159extern bool useGUI;
160
161/*
162 * Boot Modes
163 */
164enum {
165 kBootModeNormal = 0,
166 kBootModeSafe = 1,
167 kBootModeSecure = 2,
168 kBootModeQuiet = 4
169};
170
171extern void initialize_runtime();
172extern void common_boot(int biosdev);
173
174/*
175 * usb.c
176 */
177extern int usb_loop();
178
179/*
180 * graphics.c
181 */
182extern void printVBEModeInfo();
183extern void setVideoMode(int mode, int drawgraphics);
184extern int getVideoMode();
185extern void spinActivityIndicator();
186extern void clearActivityIndicator();
187extern void drawColorRectangle( unsigned short x,
188 unsigned short y,
189 unsigned short width,
190 unsigned short height,
191 unsigned char colorIndex );
192extern void drawDataRectangle( unsigned short x,
193 unsigned short y,
194 unsigned short width,
195 unsigned short height,
196 unsigned char * data );
197extern int
198convertImage( unsigned short width,
199 unsigned short height,
200 const unsigned char *imageData,
201 unsigned char **newImageData );
202extern char * decodeRLE( const void * rleData, int rleBlocks, int outBytes );
203extern void drawBootGraphics(void);
204extern void drawPreview(void *src, uint8_t * saveunder);
205extern int getVideoMode(void);
206extern void loadImageScale (void *input, int iw, int ih, int ip, void *output, int ow, int oh, int op, int or);
207
208/*
209 * drivers.c
210 */
211extern long LoadExtraDrivers(char * dirSpec);
212extern long LoadDrivers(char * dirSpec);
213extern long DecodeKernel(void *binary, entry_t *rentry, char **raddr, int *rsize);
214
215typedef long (*FileLoadDrivers_t)(char *dirSpec, long plugin);
216/*!
217 Hookable function pointer called during the driver loading phase that
218 allows other code to cause additional drivers to be loaded.
219 */
220extern long (*LoadExtraDrivers_p)(FileLoadDrivers_t FileLoadDrivers_p);
221
222/*
223 * options.c
224 */
225extern int getBootOptions(bool firstRun);
226extern int processBootOptions();
227extern int selectAlternateBootDevice(int bootdevice);
228extern bool promptForRescanOption(void);
229
230void showHelp();
231void showTextFile();
232char *getMemoryInfoString();
233
234typedef struct {
235 char name[80];
236 void * param;
237} MenuItem;
238
239/*
240 * lzss.c
241 */
242extern int decompress_lzss(u_int8_t *dst, u_int8_t *src, u_int32_t srclen);
243
244struct compressed_kernel_header {
245 u_int32_t signature;
246 u_int32_t compress_type;
247 u_int32_t adler32;
248 u_int32_t uncompressed_size;
249 u_int32_t compressed_size;
250 u_int32_t reserved[11];
251 char platform_name[64];
252 char root_path[256];
253 u_int8_t data[0];
254};
255typedef struct compressed_kernel_header compressed_kernel_header;
256
257/* resume.c */
258void HibernateBoot(char *boot_device);
259
260/* bmdecompress.c */
261void * DecompressData(void *srcbase, int *dw, int *dh, int *bytesPerPixel);
262
263#endif /* !__BOOT2_BOOT_H */
264

Archive Download this file

Revision: 1152