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