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 kBGRT"BGRT"/* acpi_patcher.c */
183#define kDropBGRT"DropBGRT"/* acpi_patcher.c */
184#define kDropMCFG"DropMCFG"/* acpi_patcher.c */
185#define kDropAPIC"DropAPIC"/* acpi_patcher.c */
186
187/* Karas: added these keys */
188#define kMemFullInfo"ForceFullMemInfo"/* smbios.c */
189
190/* Bungo: added these keys */
191// mask private data or no
192#define kPrivateData"PrivateData"/* smbios_decode.c */
193
194/*
195 * Flags to the booter or kernel
196 */
197#define kVerboseModeFlag"-v"
198#define kSafeModeFlag"-x"
199#define kIgnoreCachesFlag"-f"
200#define kIgnoreBootFileFlag"-F"
201#define kSingleUserModeFlag"-s"
202
203/*
204 * Booter behavior control
205 */
206#define kBootTimeout -1
207#define kCDBootTimeout 8
208
209/*
210 * A global set by boot() to record the device that the booter was loaded from.
211 */
212#define ROOT_DEVICE_SIZE 512
213extern int gBIOSDev;
214extern long gBootMode;
215extern bool sysConfigValid;
216extern char bootBanner[];
217extern char bootPrompt[];
218extern bool gOverrideKernel;
219extern char *gPlatformName;
220extern char gMKextName[];
221extern char gRootDevice[];
222extern bool gEnableCDROMRescan;
223extern bool gScanSingleDrive;
224extern bool useGUI;
225
226/*
227 * Boot Modes
228 */
229enum {
230kBootModeNormal = 0,
231kBootModeSafe = 1,
232kBootModeSecure = 2,
233kBootModeQuiet = 4
234};
235
236extern void initialize_runtime();
237extern void common_boot(int biosdev);
238
239/*
240 * usb.c
241 */
242extern int usb_loop();
243
244/*
245 * graphics.c
246 */
247extern void printVBEModeInfo();
248extern void setVideoMode(int mode, int drawgraphics);
249extern int getVideoMode();
250extern void spinActivityIndicator();
251extern void clearActivityIndicator();
252extern void drawColorRectangle(
253 unsigned short x,
254 unsigned short y,
255 unsigned short width,
256 unsigned short height,
257 unsigned char colorIndex
258 );
259extern void drawDataRectangle(
260 unsigned short x,
261 unsigned short y,
262 unsigned short width,
263 unsigned short height,
264 unsigned char * data
265 );
266extern int
267convertImage( unsigned short width,
268 unsigned short height,
269 const unsigned char *imageData,
270 unsigned char **newImageData );
271extern char * decodeRLE( const void * rleData, int rleBlocks, int outBytes );
272extern void drawBootGraphics(void);
273extern void drawPreview(void *src, uint8_t * saveunder);
274extern int getVideoMode(void);
275extern void loadImageScale (void *input, int iw, int ih, int ip, void *output, int ow, int oh, int op, int or);
276
277/*
278 * drivers.c
279 */
280extern long LoadExtraDrivers(char * dirSpec);
281extern long LoadDrivers(char * dirSpec);
282extern long DecodeKernel(void *binary, entry_t *rentry, char **raddr, int *rsize);
283
284typedef long (*FileLoadDrivers_t)(char *dirSpec, long plugin);
285/*!
286 Hookable function pointer called during the driver loading phase that
287 allows other code to cause additional drivers to be loaded.
288 */
289extern long (*LoadExtraDrivers_p)(FileLoadDrivers_t FileLoadDrivers_p);
290
291/*
292 * options.c
293 */
294extern char gBootUUIDString[];
295
296extern int getBootOptions(bool firstRun);
297extern int processBootOptions();
298extern int selectAlternateBootDevice(int bootdevice);
299extern bool promptForRescanOption(void);
300
301void showHelp();
302void showTextFile();
303char *getMemoryInfoString();
304
305typedef struct {
306char name[80];
307void * param;
308} MenuItem;
309
310/*
311 * lzss.c
312 */
313extern int decompress_lzss(u_int8_t *dst, u_int8_t *src, u_int32_t srclen);
314
315struct compressed_kernel_header {
316u_int32_t signature;
317u_int32_t compress_type;
318u_int32_t adler32;
319u_int32_t uncompressed_size;
320u_int32_t compressed_size;
321u_int32_t reserved[11];
322char platform_name[64];
323char root_path[256];
324 u_int8_t data[0];
325};
326typedef struct compressed_kernel_header compressed_kernel_header;
327
328/* resume.c */
329void HibernateBoot(char *boot_device);
330
331/* bmdecompress.c */
332void * DecompressData(void *srcbase, int *dw, int *dh, int *bytesPerPixel);
333
334#endif /* !__BOOT2_BOOT_H */
335

Archive Download this file

Revision: 2341