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

Archive Download this file

Revision: 2385