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 | #include "libsaio.h"␊ |
33 | ␊ |
34 | /*␊ |
35 | * Keys used in system Boot.plist␊ |
36 | */␊ |
37 | #define kGraphicsModeKey␉"Graphics Mode"␊ |
38 | #define kTextModeKey␉␉"Text Mode"␊ |
39 | #define kQuietBootKey␉␉"Quiet Boot"␊ |
40 | #define kKernelFlagsKey␉␉"Kernel Flags"␊ |
41 | #define kMKextCacheKey␉␉"MKext Cache"␊ |
42 | #define kKernelNameKey␉␉"Kernel"␊ |
43 | #define kKernelCacheKey␉␉"Kernel Cache"␊ |
44 | #define kBootDeviceKey␉␉"Boot Device"␊ |
45 | #define kTimeoutKey␉␉"Timeout"␊ |
46 | #define kRootDeviceKey␉␉"rd"␊ |
47 | #define kBootUUIDKey␉␉"boot-uuid"␊ |
48 | #define kHelperRootUUIDKey␉"Root UUID"␊ |
49 | #define kPlatformKey␉␉"platform"␊ |
50 | #define kACPIKey␉␉"acpi"␊ |
51 | #define kCDROMPromptKey␉␉"CD-ROM Prompt"␊ |
52 | #define kCDROMOptionKey␉␉"CD-ROM Option Key"␊ |
53 | #define kRescanPromptKey␉"Rescan Prompt"␊ |
54 | #define kRescanKey␉␉"Rescan"␊ |
55 | #define kScanSingleDriveKey␉"Scan Single Drive"␊ |
56 | #define kInsantMenuKey␉␉"Instant Menu"␊ |
57 | #define kDefaultKernel␉␉"mach_kernel"␊ |
58 | #define kGUIKey␉␉␉"GUI"␊ |
59 | #define kBootBannerKey␉␉"Boot Banner"␊ |
60 | #define kWaitForKeypressKey␉"Wait"␊ |
61 | /* AsereBLN: added these keys */␊ |
62 | #define kUseAtiROM␉␉"UseAtiROM"␉␉/* ati.c */␊ |
63 | #define kWake␉␉␉"Wake"␉␉␉/* boot.c */␊ |
64 | #define kForceWake␉␉"ForceWake"␉␉/* boot.c */␊ |
65 | #define kWakeImage␉␉"WakeImage"␉␉/* boot.c */␊ |
66 | #define kProductVersion␉␉"ProductVersion"␉/* boot.c */␊ |
67 | #define karch␉␉␉"arch"␉␉␉/* boot.c */␊ |
68 | #define kDSDT␉␉␉"DSDT"␉␉␉/* dsdt_patcher.c */␊ |
69 | #define kSSDT␉␉␉"SSDT"␉␉␉/* dsdt_patcher.c */␊ |
70 | #define kHPET␉␉␉"HPET"␉␉␉/* dsdt_patcher.c */␊ |
71 | #define kSBST␉␉␉"SBST"␉␉␉/* dsdt_patcher.c */␊ |
72 | #define kECDT␉␉␉"ECDT"␉␉␉/* dsdt_patcher.c */␊ |
73 | #define kASFT␉␉␉"ASFT"␉␉␉/* dsdt_patcher.c */␊ |
74 | #define kDMAR␉␉␉"DMAR"␉␉␉/* dsdt_patcher.c */␊ |
75 | #define kFADT␉␉␉"FADT"␉␉␉/* dsdt_patcher.c */␊ |
76 | #define kAPIC␉␉␉"APIC"␉␉␉/* dsdt_patcher.c */␊ |
77 | #define kMCFG␉␉␉"MCFG"␉␉␉/* dsdt_patcher.c */␊ |
78 | #define kOEMDSDT␉␉"oemDSDT"␉␉/* dsdt_patcher.c */␊ |
79 | #define kOEMSSDT␉␉"oemSSDT"␉␉/* dsdt_patcher.c */␊ |
80 | #define kOEMHPET␉␉"oemHPET"␉␉/* dsdt_patcher.c */␊ |
81 | #define kOEMSBST␉␉"oemSBST"␉␉/* dsdt_patcher.c */␊ |
82 | #define kOEMECDT␉␉"oemECDT"␉␉/* dsdt_patcher.c */␊ |
83 | #define kOEMASFT␉␉"oemASFT"␉␉/* dsdt_patcher.c */␊ |
84 | #define kOEMDMAR␉␉"oemDMAR"␉␉/* dsdt_patcher.c */␊ |
85 | #define kOEMFADT␉␉"oemFADT"␉␉/* dsdt_patcher.c */␊ |
86 | #define kOEMAPIC␉␉"oemAPIC"␉␉/* dsdt_patcher.c */␊ |
87 | #define kOEMMCFG␉␉"oemMCFG"␉␉/* dsdt_patcher.c */␊ |
88 | #define kDropSSDT␉␉"DropSSDT"␉␉/* dsdt_patcher.c */␊ |
89 | #define kDropHPET␉␉"DropHPET"␉␉/* dsdt_patcher.c */␊ |
90 | #define kDropSLIC␉␉"DropSLIC"␉␉/* dsdt_patcher.c */␊ |
91 | #define kDropSBST␉␉"DropSBST"␉␉/* dsdt_patcher.c */␊ |
92 | #define kDropECDT␉␉"DropECDT"␉␉/* dsdt_patcher.c */␊ |
93 | #define kDropASFT␉␉"DropASFT"␉␉/* dsdt_patcher.c */␊ |
94 | #define kDropDMAR␉␉"DropDMAR"␉␉/* dsdt_patcher.c */␊ |
95 | #define kUpdateACPI␉␉"UpdateACPI"␉/* dsdt_patcher.c */␊ |
96 | #define kRestartFix␉␉"RestartFix"␉␉/* dsdt_patcher.c */␊ |
97 | #define kSMBIOS␉␉␉"SMBIOS"␉␉/* fake_efi.c */␊ |
98 | #define kSystemID␉␉"SystemId"␉␉/* fake_efi.c */␊ |
99 | #define kSystemType␉␉"SystemType"␉␉/* fake_efi.c */␊ |
100 | #define kUseNvidiaROM␉␉"UseNvidiaROM"␉␉/* nvidia.c */␊ |
101 | #define kVBIOS␉␉␉"VBIOS"␉␉␉/* nvidia.c */␊ |
102 | #define kPCIRootUID␉␉"PCIRootUID"␉␉/* pci_root.c */␊ |
103 | #define kEthernetBuiltIn␉"EthernetBuiltIn"␉/* pci_setup.c */␊ |
104 | #define kGraphicsEnabler␉"GraphicsEnabler"␉/* pci_setup.c */␊ |
105 | #define kUSBBusFix␉␉"USBBusFix"␉␉/* pci_setup.c */␊ |
106 | #define kUSBLegacyOff␉"USBLegacyOff"␉/* pci_setup.c */␊ |
107 | #define kEHCIacquire␉␉"EHCIacquire"␉␉/* pci_setup.c */␊ |
108 | #define kUHCIreset␉␉"UHCIreset"␉␉/* pci_setup.c */␊ |
109 | #define kForceHPET␉␉"ForceHPET"␉␉/* pci_setup.c */␊ |
110 | #define kSMBIOSdefaults␉␉"SMBIOSdefaults"␉/* smbios_patcher.c */␊ |
111 | #define kEHCIhard␉␉"EHCIhard"␉␉/* usb.c */␊ |
112 | #define kDefaultPartition␉"Default Partition"␉/* sys.c */␊ |
113 | #define kDeviceProperties␉"device-properties"␉/* device_inject.c */␊ |
114 | #define kHidePartition␉␉"Hide Partition"␉/* disk.c */␊ |
115 | #define kRenamePartition␉"Rename Partition"␉/* disk.c */␊ |
116 | #define kUseMemDetect␉␉"UseMemDetect"␉␉/* platform.c */␊ |
117 | /* valv: added those keys */␊ |
118 | #define kFixFSB␉␉"FixFSB"␉␉/* cpu.c */␊ |
119 | #define kbusratio␉␉"busratio"␉␉/* cpu.c */␊ |
120 | ␊ |
121 | /*␊ |
122 | * Flags to the booter or kernel␊ |
123 | */␊ |
124 | #define kVerboseModeFlag␉"-v"␊ |
125 | #define kSafeModeFlag␉␉"-x"␊ |
126 | #define kOldSafeModeFlag␉"-f"␊ |
127 | #define kIgnoreBootFileFlag␉"-F"␊ |
128 | #define kSingleUserModeFlag␉"-s"␊ |
129 | #define k32BitModeFlag␉␉"-x32"␊ |
130 | #define k64BitModeFlag␉␉"-x64"␊ |
131 | ␊ |
132 | /*␊ |
133 | * Booter behavior control␊ |
134 | */␊ |
135 | #define kBootTimeout -1␊ |
136 | #define kCDBootTimeout 8␊ |
137 | ␊ |
138 | /*␊ |
139 | * A global set by boot() to record the device that the booter␊ |
140 | * was loaded from.␊ |
141 | */␊ |
142 | extern int gBIOSDev;␊ |
143 | extern long gBootMode;␊ |
144 | extern bool sysConfigValid;␊ |
145 | extern char bootBanner[];␊ |
146 | extern char bootPrompt[];␊ |
147 | extern bool gOverrideKernel;␊ |
148 | extern char *gPlatformName;␊ |
149 | extern char gMKextName[];␊ |
150 | extern char gRootDevice[];␊ |
151 | extern bool gEnableCDROMRescan;␊ |
152 | extern bool gScanSingleDrive;␊ |
153 | extern bool useGUI;␊ |
154 | ␊ |
155 | /*␊ |
156 | * Boot Modes␊ |
157 | */␊ |
158 | enum {␊ |
159 | kBootModeNormal = 0,␊ |
160 | kBootModeSafe = 1,␊ |
161 | kBootModeSecure = 2,␊ |
162 | kBootModeQuiet = 4␊ |
163 | };␊ |
164 | ␊ |
165 | extern void initialize_runtime();␊ |
166 | extern void common_boot(int biosdev);␊ |
167 | ␊ |
168 | /*␊ |
169 | * graphics.c␊ |
170 | */␊ |
171 | extern void printVBEModeInfo();␊ |
172 | extern void setVideoMode(int mode, int drawgraphics);␊ |
173 | extern int getVideoMode();␊ |
174 | extern void spinActivityIndicator();␊ |
175 | extern void clearActivityIndicator();␊ |
176 | extern void drawColorRectangle( unsigned short x,␊ |
177 | unsigned short y,␊ |
178 | unsigned short width,␊ |
179 | unsigned short height,␊ |
180 | unsigned char colorIndex );␊ |
181 | extern void drawDataRectangle( unsigned short x,␊ |
182 | unsigned short y,␊ |
183 | unsigned short width,␊ |
184 | unsigned short height,␊ |
185 | unsigned char * data );␊ |
186 | extern int␊ |
187 | convertImage( unsigned short width,␊ |
188 | unsigned short height,␊ |
189 | const unsigned char *imageData,␊ |
190 | unsigned char **newImageData );␊ |
191 | extern char * decodeRLE( const void * rleData, int rleBlocks, int outBytes );␊ |
192 | extern void drawBootGraphics(void);␊ |
193 | extern void drawPreview(void *src, uint8_t * saveunder);␊ |
194 | extern int getVideoMode(void);␊ |
195 | extern void loadImageScale (void *input, int iw, int ih, int ip, void *output, int ow, int oh, int op, int or);␊ |
196 | /*␊ |
197 | * drivers.c␊ |
198 | */␊ |
199 | extern long LoadDrivers(char * dirSpec);␊ |
200 | extern long DecodeKernel(void *binary, entry_t *rentry, char **raddr, int *rsize);␊ |
201 | ␊ |
202 | typedef long (*FileLoadDrivers_t)(char *dirSpec, long plugin);␊ |
203 | /*!␊ |
204 | Hookable function pointer called during the driver loading phase that␊ |
205 | allows other code to cause additional drivers to be loaded.␊ |
206 | */␊ |
207 | extern long (*LoadExtraDrivers_p)(FileLoadDrivers_t FileLoadDrivers_p);␊ |
208 | ␊ |
209 | /*␊ |
210 | * options.c␊ |
211 | */␊ |
212 | extern int getBootOptions(bool firstRun);␊ |
213 | extern int processBootOptions();␊ |
214 | extern int selectAlternateBootDevice(int bootdevice);␊ |
215 | extern bool promptForRescanOption(void);␊ |
216 | ␊ |
217 | void showHelp();␊ |
218 | void showTextFile();␊ |
219 | char *getMemoryInfoString();␊ |
220 | ␊ |
221 | typedef struct {␊ |
222 | char name[80];␊ |
223 | void * param;␊ |
224 | } MenuItem;␊ |
225 | ␊ |
226 | /*␊ |
227 | * lzss.c␊ |
228 | */␊ |
229 | extern int decompress_lzss(u_int8_t *dst, u_int8_t *src, u_int32_t srclen);␊ |
230 | ␊ |
231 | struct compressed_kernel_header {␊ |
232 | u_int32_t signature;␊ |
233 | u_int32_t compress_type;␊ |
234 | u_int32_t adler32;␊ |
235 | u_int32_t uncompressed_size;␊ |
236 | u_int32_t compressed_size;␊ |
237 | u_int32_t reserved[11];␊ |
238 | char platform_name[64];␊ |
239 | char root_path[256];␊ |
240 | u_int8_t data[0];␊ |
241 | };␊ |
242 | typedef struct compressed_kernel_header compressed_kernel_header;␊ |
243 | ␊ |
244 | /* resume.c */␊ |
245 | void HibernateBoot(char *boot_device);␊ |
246 | ␊ |
247 | /* bmdecompress.c */␊ |
248 | void * DecompressData(void *srcbase, int *dw, int *dh, int *bytesPerPixel);␊ |
249 | ␊ |
250 | #endif /* !__BOOT2_BOOT_H */␊ |
251 | |