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

Archive Download this file

Revision: 2258