Chameleon

Chameleon Svn Source Tree

Root/branches/ErmaC/Enoch/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// Mountain Lion installer
44#define kMLionInstallerDataFolder "/OS X Install Data/"
45#define kMLionInstallerPlist kMLionInstallerDataFolder "com.apple.Boot.plist"
46
47/*
48 * Keys used in system Boot.plist
49 */
50#define kGraphicsModeKey"Graphics Mode"
51#define kTextModeKey"Text Mode"
52#define kQuietBootKey"Quiet Boot"
53#define kKernelFlagsKey"Kernel Flags"
54#define kKernelArchKey"Kernel Architecture"
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/* AsereBLN: added these keys */
79#define kUseAtiROM"UseAtiROM"/* ati.c */
80#define kWake"Wake"/* boot.c */
81#define kForceWake"ForceWake"/* boot.c */
82#define kWakeImage"WakeImage"/* boot.c */
83#define kProductVersion"ProductVersion"/* boot.c */
84#define karch"arch"/* boot.c */
85#define kDSDT"DSDT"/* acpi_patcher.c */
86#define kDropSSDT"DropSSDT"/* acpi_patcher.c */
87#define kDeviceProperties"device-properties"/* device_inject.c */
88#define kHidePartition"Hide Partition"/* disk.c */
89#define kRenamePartition"Rename Partition"/* disk.c */
90#define kSMBIOSKey"SMBIOS"/* fake_efi.c */
91#define kSystemID"SystemId"/* fake_efi.c */
92#define kSystemType"SystemType"/* fake_efi.c */
93#define kUseNvidiaROM"UseNvidiaROM"/* nvidia.c */
94#define kVBIOS"VBIOS"/* nvidia.c && ati.c */
95#define kPCIRootUID"PCIRootUID"/* pci_root.c */
96#define kEthernetBuiltIn"EthernetBuiltIn"/* pci_setup.c */
97#define kGraphicsEnabler"GraphicsEnabler"/* pci_setup.c */
98#define kForceHPET"ForceHPET"/* pci_setup.c */
99#define kUseMemDetect"UseMemDetect"/* platform.c */
100#define kSMBIOSdefaults"SMBIOSdefaults"/* smbios_patcher.c */
101#define kUSBBusFix"USBBusFix"/* usb.c */
102#define kEHCIacquire"EHCIacquire"/* usb.c */
103#define kUHCIreset"UHCIreset"/* usb.c */
104#define kEHCIhard"EHCIhard"/* usb.c */
105#define kDefaultPartition"Default Partition"/* sys.c */
106
107/* Duvel300: added this */
108#define kRestartFix"RestartFix"/* acpi_patcher.c */
109
110/* Slice: added this */
111#define kPS2RestartFix"PS2RestartFix"/* acpi_patcher.c */
112#define kInjectEDID"InjectEDID"/* ati.c*/
113#define kCustomEDID"CustomEDID"/* ati.c*/
114
115/* Signal64: added this key */
116#define kLegacyOff"USBLegacyOff"/* usb.c */
117
118/* Lebidou: added this key */
119
120/* Meklort: added this key */
121#define kMD0Image"md0"/* ramdisk.h */
122#define kEnableWifi"EnableWifi"/* pci_setup.c */
123
124/* Andyvand: added these keys */
125//#define kSSDT"SSDT"/* acpi_patcher.c */
126#define kHPET"HPET"/* acpi_patcher.c */
127#define kSBST"SBST"/* acpi_patcher.c */
128#define kECDT"ECDT"/* acpi_patcher.c */
129#define kASFT"ASFT"/* acpi_patcher.c */
130#define kDMAR"DMAR"/* acpi_patcher.c */
131#define kFADT"FADT"/* acpi_patcher.c */
132#define kAPIC"APIC"/* acpi_patcher.c */
133#define kMCFG"MCFG"/* acpi_patcher.c */
134#define kDropHPET"DropHPET"/* acpi_patcher.c */
135#define kDropSLIC"DropSLIC"/* acpi_patcher.c */
136#define kDropSBST"DropSBST"/* acpi_patcher.c */
137#define kDropECDT"DropECDT"/* acpi_patcher.c */
138#define kDropASFT"DropASFT"/* acpi_patcher.c */
139#define kDropDMAR"DropDMAR"/* acpi_patcher.c */
140#define kUpdateACPI"UpdateACPI"/* acpi_patcher.c */
141
142/* Mojodojo: added these keys */
143#define kGeneratePStates"GeneratePStates"/* acpi_patcher.c */
144#define kGenerateCStates"GenerateCStates"/* acpi_patcher.c */
145#define kCSTUsingSystemIO"CSTUsingSystemIO"/* acpi_patcher.c */
146#define kEnableC2State"EnableC2State"/* acpi_patcher.c */
147#define kEnableC3State"EnableC3State"/* acpi_patcher.c */
148#define kEnableC4State"EnableC4State"/* acpi_patcher.c */
149
150/* valv: added these keys */
151#define kbusratio"busratio"/* cpu.c */
152#define kDcfg0"display_0"/* nvidia.c */
153#define kDcfg1"display_1"/* nvidia.c */
154
155/* Marchrius: added these keys */
156#define kEnableBacklight"EnableBacklight"/* ati.c && nvidia.c */
157
158/* Kabyl: added these keys */
159#define kAtiConfig"AtiConfig"/* ati.c */
160#define kAtiPorts"AtiPorts"/* ati.c */
161#define kATYbinimage"ATYbinimage"/* ati.c */
162
163/* cosmo1: added these keys */
164#define kEnableHDMIAudio"EnableHDMIAudio"/* ati.c && nvidia.c */
165
166/* cparm: added these keys */
167#define kRebootOnPanic"RebootOnPanic"
168#define kEnableHiDPI"EnableHiDPI"/* enable High resolution display (aka Retina) */
169
170/* ErmaC: added these keys */
171#define kEnableDualLink"EnableDualLink"/* ati.c && nvidia.c && gma.c*/
172#define kSkipIntelGfx"SkipIntelGfx"/* pci_setup.c */
173#define kSkipNvidiaGfx"SkipNvidiaGfx"/* pci_setup.c */
174#define kSkipAtiGfx"SkipAtiGfx"/* pci_setup.c */
175#define kUsbInject"USBInject"/* usb.c */
176#define kIntelCapriFB"IntelCapriFB"/* gma.c was HD4K-ig */
177#define kIntelAzulFB"IntelAzulFB"/* gma.c was HD5K-ig */
178#define kAAPLCustomIG"InjectIntel-ig"/* gma.c */
179#define kHDAEnabler"HDAEnabler"/* pci_setup.c */
180#define kHDEFLayoutID"HDEFLayoutID"/* hda.c */
181#define kHDAULayoutID"HDAULayoutID"/* hda.c */
182//#define kHDAPinConf"HDEFPinConfiguration"/* hda.c */
183#define kBGRT"BGRT"/* acpi_patcher.c */
184#define kDropBGRT"DropBGRT"/* acpi_patcher.c */
185#define kDropMCFG"DropMCFG"/* acpi_patcher.c */
186#define kDropAPIC"DropAPIC"/* acpi_patcher.c */
187
188/* Karas: added these keys */
189#define kMemFullInfo"ForceFullMemInfo"/* smbios.c */
190
191/*
192 * Flags to the booter or kernel
193 */
194#define kVerboseModeFlag"-v"
195#define kSafeModeFlag"-x"
196#define kIgnoreCachesFlag"-f"
197#define kIgnoreBootFileFlag"-F"
198#define kSingleUserModeFlag"-s"
199
200/*
201 * Booter behavior control
202 */
203#define kBootTimeout -1
204#define kCDBootTimeout 8
205
206/*
207 * A global set by boot() to record the device that the booter was loaded from.
208 */
209#define ROOT_DEVICE_SIZE 512
210extern int gBIOSDev;
211extern long gBootMode;
212extern bool sysConfigValid;
213extern char bootBanner[];
214extern char bootPrompt[];
215extern bool gOverrideKernel;
216extern char *gPlatformName;
217extern char gMKextName[];
218extern char gRootDevice[];
219extern bool gEnableCDROMRescan;
220extern bool gScanSingleDrive;
221extern bool useGUI;
222
223/*
224 * Boot Modes
225 */
226enum {
227kBootModeNormal = 0,
228kBootModeSafe = 1,
229kBootModeSecure = 2,
230kBootModeQuiet = 4
231};
232
233extern void initialize_runtime();
234extern void common_boot(int biosdev);
235
236/*
237 * usb.c
238 */
239extern int usb_loop();
240
241/*
242 * graphics.c
243 */
244extern void printVBEModeInfo();
245extern void setVideoMode(int mode, int drawgraphics);
246extern int getVideoMode();
247extern void spinActivityIndicator();
248extern void clearActivityIndicator();
249extern void drawColorRectangle(
250 unsigned short x,
251 unsigned short y,
252 unsigned short width,
253 unsigned short height,
254 unsigned char colorIndex
255 );
256extern void drawDataRectangle(
257 unsigned short x,
258 unsigned short y,
259 unsigned short width,
260 unsigned short height,
261 unsigned char * data
262 );
263extern int
264convertImage( unsigned short width,
265 unsigned short height,
266 const unsigned char *imageData,
267 unsigned char **newImageData );
268extern char * decodeRLE( const void * rleData, int rleBlocks, int outBytes );
269extern void drawBootGraphics(void);
270extern void drawPreview(void *src, uint8_t * saveunder);
271extern int getVideoMode(void);
272extern void loadImageScale (void *input, int iw, int ih, int ip, void *output, int ow, int oh, int op, int or);
273
274/*
275 * drivers.c
276 */
277extern long LoadExtraDrivers(char * dirSpec);
278extern long LoadDrivers(char * dirSpec);
279extern long DecodeKernel(void *binary, entry_t *rentry, char **raddr, int *rsize);
280
281typedef long (*FileLoadDrivers_t)(char *dirSpec, long plugin);
282/*!
283 Hookable function pointer called during the driver loading phase that
284 allows other code to cause additional drivers to be loaded.
285 */
286extern long (*LoadExtraDrivers_p)(FileLoadDrivers_t FileLoadDrivers_p);
287
288/*
289 * options.c
290 */
291extern char gBootUUIDString[];
292
293extern int getBootOptions(bool firstRun);
294extern int processBootOptions();
295extern int selectAlternateBootDevice(int bootdevice);
296extern bool promptForRescanOption(void);
297
298void showHelp();
299void showTextFile();
300char *getMemoryInfoString();
301
302typedef struct {
303char name[80];
304void * param;
305} MenuItem;
306
307/*
308 * lzss.c
309 */
310extern int decompress_lzss(u_int8_t *dst, u_int8_t *src, u_int32_t srclen);
311
312struct compressed_kernel_header {
313u_int32_t signature;
314u_int32_t compress_type;
315u_int32_t adler32;
316u_int32_t uncompressed_size;
317u_int32_t compressed_size;
318u_int32_t reserved[11];
319char platform_name[64];
320char root_path[256];
321 u_int8_t data[0];
322};
323typedef struct compressed_kernel_header compressed_kernel_header;
324
325/* resume.c */
326void HibernateBoot(char *boot_device);
327
328/* bmdecompress.c */
329void * DecompressData(void *srcbase, int *dw, int *dh, int *bytesPerPixel);
330
331#endif /* !__BOOT2_BOOT_H */
332

Archive Download this file

Revision: 2323