Chameleon

Chameleon Svn Source Tree

Root/branches/azimutz/Chazi/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//Azi: keep it minimal for now.
33// Todo: don't include headers like boot.h on other headers, unless...!
34// move keys to the headers of the files they're in, if they have it!?
35// check header wrappers...
36
37//#include "saio_internal.h" // the only one needed by boot.h it self, afaics.
38#include "bootstruct.h"
39
40/*
41 * Default names - these end with "Name" (easier to sort them).
42 */
43#define kDefaultKernelName"mach_kernel"
44#define kDefaultThemeName"Default"
45/*
46#define kDefaultBootPlistName"com.apple.Boot.plist"
47#define kDefaultDSDTName"dsdt.aml"
48#define kDefaultSMBIOSName"smbios.plist"
49#define kDefaultRamdiskName"Preboot.dmg"
50???*/
51
52/*
53 * Default paths?????
54 */
55
56/*
57 * Undeclared (or undeclared here) keys.
58 */
59/*
60"-checkers" gui.c, getValFK;
61"biosdev" mboot.c, getValFBK
62"timeout" mboot.c, getValFBK
63"partno" mboot.c, getValFBK
64"DumpSPD" spd.c, getBollFK
65
66kNVCAP nvidia.c, getValFK - key is declared as a "variable", char kNVCAP[12], on setup_nvidia_devprop().
67Check: http://efixusers.com/showthread.php?t=644, Update Version 1.1.9 (Asere's booter).
68"If you want to override the NVCAP value, you must determine the PCI DeviceID of your graphic card.
69For instance: my new GTX260 has the DeviceID 0×05e2. Knowing the DeviceID add this to your com.apple.Boot.plist:
70<key>NVCAP_05e2</key>
71<string>0000000000000000000000000000000000000000</string>
72The NVCAP value is exactly 20 bytes long. You have to specify it using ASCII-HEX (0-9,a-f)."
73
74ramdisk specific:
75"Info" // ramdisk.c, getValFK
76"BTAlias" // ramdisk.c, getBollFK
77*/
78
79/*
80 * Internal or "default" Boot.plist only keys (firstrun) - these end with "Key".
81 *
82 * keys that make no sense on "override" Boot.plist or at boot prompt;
83 * like so, they won't be present on BootHelp.txt.
84 *
85 */
86//identifier string location
87#define kTextModeKey "Text Mode" // graphics.c
88#define kProductVersionKey "ProductVersion" // options.c (boot.c on trunk)
89#define kDefaultPartitionKey "Default Partition" // sys.c
90#define kHidePartitionKey "Hide Partition" // disk.c
91#define kRenamePartitionKey "Rename Partition" // disk.c
92#define kInstantMenuKey "Instant Menu" // boot.c
93#define kQuietBootKey "Quiet Boot" // boot.c
94#define kTimeoutKey "Timeout" // options.c
95#define kThemeNameKey "Theme" // gui.c
96#define kGUIKey "GUI" // boot.c
97#define kBootBannerKey "Boot Banner" // options.c
98#define kDebugInfoKey "DebugInfo" // gui.c, graphics.c
99#define kCDROMPromptKey "CD-ROM Prompt" // options.c
100#define kCDROMOptionKey "CD-ROM Option Key" // options.c
101#define kRescanPromptKey "Rescan Prompt" // boot.c
102#define kRescanKey "Rescan" // boot.c
103#define kScanSingleDriveKey "Scan Single Drive" // boot.c
104#define kDevicePropertiesKey "device-properties" // device_inject.c
105
106
107/*
108 * Prompt or Boot.plist keys (secondrun) - these end with "Key".
109 *
110 * Keys that make some/all sense at boot prompt or any Boot.plist.
111 *
112 */
113#define kWaitForKeypressKey "Wait" // boot.c
114#define kTestConfigKey "config" // stringTable.c
115#define kCanOverrideKey "CanOverride" // stringTable.c
116#define kRootDeviceKey "rd" // options.c
117#define kBootDeviceKey "Boot Device" // options.c - ????? internal
118#define kBootUUIDKey "boot-uuid" // options.c
119#define kHelperRootUUIDKey "Root UUID" // options.c
120#define kKernelNameKey "Kernel" // options.c
121#define kKernelCacheKey "Kernel Cache" // boot.c
122#define kKernelFlagsKey "Kernel Flags" // options.c
123#define kKPatcherKey "PatchKernel" // kernel_patcher.c
124#define kExtensionsKey "kext" // drivers.c
125#define kMKextCacheKey "MKext Cache" // options.c
126#define kMD0ImageKey "md0" // ramdisk.c
127#define kWakeKey "Wake" // boot.c
128#define kForceWakeKey "ForceWake" // boot.c
129#define kWakeKeyImageKey "WakeImage" // boot.c
130#define kUseAtiROMKey "UseAtiROM" // ati.c
131#define kUseNvidiaROMKey "UseNvidiaROM" // nvidia.c
132#define kVBIOSKey "VBIOS" // nvidia.c
133#define kGraphicsModeKey "Graphics Mode" // graphics.c - here because of AutoResolution patch, which uses it + F2!!
134#define kAutoResolutionKey "AutoResolution" // boot.c
135#define kGraphicsEnablerKey "GraphicsEnabler" // pci_setup.c
136#define kLegacyLogoKey "Legacy Logo" // gui.c
137#define kDSDTKey "DSDT" // acpi_patcher.c
138#define kDropSSDTKey "DropSSDT" // acpi_patcher.c
139#define kRestartFixKey "RestartFix" // acpi_patcher.c
140#define kGeneratePStatesKey "GeneratePStates" // acpi_patcher.c
141#define kGenerateCStatesKey "GenerateCStates" // acpi_patcher.c
142#define kEnableC4StatesKey "EnableC4State" // acpi_patcher.c
143#define kUseMemDetectKey "UseMemDetect" // platform.c
144#define kSMBIOSdefaultsKey "SMBIOSdefaults" // smbios_patcher.c
145#define kSMBIOSKey "SMBIOS" // fake_efi.c
146#define kSystemIDKey "SystemId" // fake_efi.c
147#define kSystemTypeKey "SystemType" // fake_efi.c
148#define kPCIRootUIDKey "PciRoot" // pci_root.c
149#define kEthernetBuiltInKey "EthernetBuiltIn" // pci_setup.c
150#define kForceHPETKey "ForceHPET" // pci_setup.c
151#define kUSBBusFixKey "USBBusFix" // usb.c
152#define kEHCIacquireKey "EHCIacquire" // usb.c
153#define kEHCIhardKey "EHCIhard" // usb.c - ????? internal
154#define kUHCIresetKey "UHCIreset" // usb.c
155#define kLegacyOffKey "USBLegacyOff" // usb.c
156
157/*
158 * Flags to the booter and/or kernel - these end with "Flag".
159 */
160#define kVerboseModeFlag "-v" // options.c
161#define kSafeModeFlag "-x" // options.c
162#define kIgnoreCachesFlag "-f" // options.c
163#define kIgnoreBootFileFlag "-F" // options.c
164#define kSingleUserModeFlag "-s" // options.c
165#define kLegacyModeFlag "-legacy" // boot.c
166#define kArchI386Flag "32" // boot.c - to be reverted!?
167#define kArchX86_64Flag "64" // boot.c - to be reverted!?
168
169/*
170 * Booter behavior control
171 */
172#define kBootTimeout -1
173#define kCDBootTimeout 8
174
175/*
176 * A global set by boot() to record the device that the booter
177 * was loaded from.
178 */
179extern int gBIOSDev;
180extern long gBootMode;
181extern bool sysConfigValid;
182extern char bootBanner[];
183extern char bootPrompt[];
184extern bool gOverrideKernel;
185//extern char *gPlatformName; disabled
186extern char gMKextName[];
187extern char gMacOSVersion[];
188extern char gRootDevice[];
189extern bool gEnableCDROMRescan;
190extern bool gScanSingleDrive;
191extern bool useGUI;
192
193/*
194 * Boot Modes
195 */
196enum {
197 kBootModeNormal = 0,
198 kBootModeSafe = 1,
199 kBootModeSecure = 2,
200 kBootModeQuiet = 4
201};
202
203extern void initialize_runtime();
204extern void common_boot(int biosdev);
205
206/*
207 * usb.c
208 */
209extern int usb_loop();
210
211/*
212 * graphics.c
213 */
214extern void printVBEModeInfo();
215extern void setVideoMode(int mode, int drawgraphics);
216extern int getVideoMode();
217extern void spinActivityIndicator();
218extern void clearActivityIndicator();
219extern void drawColorRectangle( unsigned short x,
220 unsigned short y,
221 unsigned short width,
222 unsigned short height,
223 unsigned char colorIndex );
224extern void drawDataRectangle( unsigned short x,
225 unsigned short y,
226 unsigned short width,
227 unsigned short height,
228 unsigned char * data );
229extern int
230convertImage( unsigned short width,
231 unsigned short height,
232 const unsigned char *imageData,
233 unsigned char **newImageData );
234extern char * decodeRLE( const void * rleData, int rleBlocks, int outBytes );
235extern void drawBootGraphics(void);
236extern void drawPreview(void *src, uint8_t * saveunder);
237extern int getVideoMode(void);
238extern void loadImageScale (void *input, int iw, int ih, int ip, void *output, int ow, int oh, int op, int or);
239
240/*
241 * drivers.c
242 */
243extern long LoadDrivers(char * dirSpec);
244extern long DecodeKernel(void *binary, entry_t *rentry, char **raddr, int *rsize);
245
246typedef long (*FileLoadDrivers_t)(char *dirSpec, long plugin);
247/*!
248 Hookable function pointer called during the driver loading phase that
249 allows other code to cause additional drivers to be loaded.
250 */
251extern long (*LoadExtraDrivers_p)(FileLoadDrivers_t FileLoadDrivers_p);
252
253/*
254 * options.c
255 */
256extern int getBootOptions(bool firstRun);
257extern int processBootOptions();
258extern int selectAlternateBootDevice(int bootdevice);
259extern bool promptForRescanOption(void);
260
261void showHelp();
262void showTextFile();
263char *getMemoryInfoString();
264
265typedef struct {
266 char name[80];
267 void * param;
268} MenuItem;
269
270/*
271 * lzss.c
272 */
273extern int decompress_lzss(u_int8_t *dst, u_int8_t *src, u_int32_t srclen);
274
275struct compressed_kernel_header {
276 u_int32_t signature;
277 u_int32_t compress_type;
278 u_int32_t adler32;
279 u_int32_t uncompressed_size;
280 u_int32_t compressed_size;
281 u_int32_t reserved[11];
282 char platform_name[64];
283 char root_path[256];
284 u_int8_t data[0];
285};
286typedef struct compressed_kernel_header compressed_kernel_header;
287
288/* resume.c */
289void HibernateBoot(char *boot_device);
290
291/* bmdecompress.c */
292void * DecompressData(void *srcbase, int *dw, int *dh, int *bytesPerPixel);
293
294#endif /* !__BOOT2_BOOT_H */
295

Archive Download this file

Revision: 515