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 | ␊ |
66 | kNVCAP nvidia.c, getValFK - key is declared as a "variable", char kNVCAP[12], on setup_nvidia_devprop().␊ |
67 | Check: 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.␊ |
69 | For 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>␊ |
72 | The NVCAP value is exactly 20 bytes long. You have to specify it using ASCII-HEX (0-9,a-f)."␊ |
73 | ␊ |
74 | ramdisk 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 | */␊ |
179 | extern int gBIOSDev;␊ |
180 | extern long gBootMode;␊ |
181 | extern bool sysConfigValid;␊ |
182 | extern char bootBanner[];␊ |
183 | extern char bootPrompt[];␊ |
184 | extern bool gOverrideKernel;␊ |
185 | //extern char *gPlatformName; disabled␊ |
186 | extern char gMKextName[];␊ |
187 | extern char gMacOSVersion[];␊ |
188 | extern char gRootDevice[];␊ |
189 | extern bool gEnableCDROMRescan;␊ |
190 | extern bool gScanSingleDrive;␊ |
191 | extern bool useGUI;␊ |
192 | ␊ |
193 | /*␊ |
194 | * Boot Modes␊ |
195 | */␊ |
196 | enum {␊ |
197 | kBootModeNormal = 0,␊ |
198 | kBootModeSafe = 1,␊ |
199 | kBootModeSecure = 2,␊ |
200 | kBootModeQuiet = 4␊ |
201 | };␊ |
202 | ␊ |
203 | extern void initialize_runtime();␊ |
204 | extern void common_boot(int biosdev);␊ |
205 | ␊ |
206 | /*␊ |
207 | * usb.c␊ |
208 | */␊ |
209 | extern int usb_loop();␊ |
210 | ␊ |
211 | /*␊ |
212 | * graphics.c␊ |
213 | */␊ |
214 | extern void printVBEModeInfo();␊ |
215 | extern void setVideoMode(int mode, int drawgraphics);␊ |
216 | extern int getVideoMode();␊ |
217 | extern void spinActivityIndicator();␊ |
218 | extern void clearActivityIndicator();␊ |
219 | extern void drawColorRectangle( unsigned short x,␊ |
220 | unsigned short y,␊ |
221 | unsigned short width,␊ |
222 | unsigned short height,␊ |
223 | unsigned char colorIndex );␊ |
224 | extern void drawDataRectangle( unsigned short x,␊ |
225 | unsigned short y,␊ |
226 | unsigned short width,␊ |
227 | unsigned short height,␊ |
228 | unsigned char * data );␊ |
229 | extern int␊ |
230 | convertImage( unsigned short width,␊ |
231 | unsigned short height,␊ |
232 | const unsigned char *imageData,␊ |
233 | unsigned char **newImageData );␊ |
234 | extern char * decodeRLE( const void * rleData, int rleBlocks, int outBytes );␊ |
235 | extern void drawBootGraphics(void);␊ |
236 | extern void drawPreview(void *src, uint8_t * saveunder);␊ |
237 | extern int getVideoMode(void);␊ |
238 | extern 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 | */␊ |
243 | extern long LoadDrivers(char * dirSpec);␊ |
244 | extern long DecodeKernel(void *binary, entry_t *rentry, char **raddr, int *rsize);␊ |
245 | ␊ |
246 | typedef 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 | */␊ |
251 | extern long (*LoadExtraDrivers_p)(FileLoadDrivers_t FileLoadDrivers_p);␊ |
252 | ␊ |
253 | /*␊ |
254 | * options.c␊ |
255 | */␊ |
256 | extern int getBootOptions(bool firstRun);␊ |
257 | extern int processBootOptions();␊ |
258 | extern int selectAlternateBootDevice(int bootdevice);␊ |
259 | extern bool promptForRescanOption(void);␊ |
260 | ␊ |
261 | void showHelp();␊ |
262 | void showTextFile();␊ |
263 | char *getMemoryInfoString();␊ |
264 | ␊ |
265 | typedef struct {␊ |
266 | char name[80];␊ |
267 | void * param;␊ |
268 | } MenuItem;␊ |
269 | ␊ |
270 | /*␊ |
271 | * lzss.c␊ |
272 | */␊ |
273 | extern int decompress_lzss(u_int8_t *dst, u_int8_t *src, u_int32_t srclen);␊ |
274 | ␊ |
275 | struct 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 | };␊ |
286 | typedef struct compressed_kernel_header compressed_kernel_header;␊ |
287 | ␊ |
288 | /* resume.c */␊ |
289 | void HibernateBoot(char *boot_device);␊ |
290 | ␊ |
291 | /* bmdecompress.c */␊ |
292 | void * DecompressData(void *srcbase, int *dw, int *dh, int *bytesPerPixel);␊ |
293 | ␊ |
294 | #endif /* !__BOOT2_BOOT_H */␊ |
295 | |