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

Archive Download this file

Revision: 2255