Root/
Source at commit 1085 created 13 years 1 month ago. By azimutz, Runaway "min"; fixes build. | |
---|---|
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 karch␉␉␉␉"arch"␉␉␉␉/* boot.c */␊ |
42 | #define kProductVersion␉␉"ProductVersion"␉/* boot.c */␊ |
43 | #define kMKextCacheKey␉␉"MKext Cache"␊ |
44 | #define kKernelNameKey␉␉"Kernel"␊ |
45 | #define kKernelCacheKey␉␉"Kernel Cache"␊ |
46 | #define kUseKernelCache␉␉"UseKernelCache"␉/* boot.c */␊ |
47 | #define kBootDeviceKey␉␉"Boot Device"␊ |
48 | #define kTimeoutKey␉␉␉"Timeout"␊ |
49 | #define kRootDeviceKey␉␉"rd"␊ |
50 | #define kBootUUIDKey␉␉"boot-uuid"␊ |
51 | #define kHelperRootUUIDKey␉"Root UUID"␊ |
52 | #define kPlatformKey␉␉"platform"␊ |
53 | #define kACPIKey␉␉␉"acpi"␊ |
54 | #define kCDROMPromptKey␉␉"CD-ROM Prompt"␊ |
55 | #define kCDROMOptionKey␉␉"CD-ROM Option Key"␊ |
56 | #define kRescanPromptKey␉"Rescan Prompt"␊ |
57 | #define kRescanKey␉␉ "Rescan"␊ |
58 | #define kScanSingleDriveKey␉"Scan Single Drive"␊ |
59 | #define kInsantMenuKey␉␉"Instant Menu"␊ |
60 | #define kDefaultKernel␉␉"mach_kernel"␊ |
61 | #define kGUIKey␉␉␉␉"GUI"␊ |
62 | #define kBootBannerKey␉␉"Boot Banner"␊ |
63 | #define kWaitForKeypressKey␉"Wait"␊ |
64 | ␊ |
65 | #define kDSDT␉␉␉␉"DSDT"␉␉␉␉/* acpi_patcher.c */␊ |
66 | #define kDropSSDT␉␉␉"DropSSDT"␉␉␉/* acpi_patcher.c */␊ |
67 | #define kRestartFix␉␉␉"RestartFix"␉␉/* acpi_patcher.c */␊ |
68 | #define kGeneratePStates␉"GeneratePStates"␉/* acpi_patcher.c */␊ |
69 | #define kGenerateCStates␉"GenerateCStates"␉/* acpi_patcher.c */␊ |
70 | #define kEnableC2States␉␉"EnableC2State"␉␉/* acpi_patcher.c */␊ |
71 | #define kEnableC3States␉␉"EnableC3State"␉␉/* acpi_patcher.c */␊ |
72 | #define kEnableC4States␉␉"EnableC4State"␉␉/* acpi_patcher.c */␊ |
73 | ␊ |
74 | #define kWake␉␉␉␉"Wake"␉␉␉␉/* boot.c */␊ |
75 | #define kForceWake␉␉␉"ForceWake"␉␉␉/* boot.c */␊ |
76 | #define kWakeImage␉␉␉"WakeImage"␉␉␉/* boot.c */␊ |
77 | ␊ |
78 | #define kbusratio␉␉␉"busratio"␉␉␉/* cpu.c */␊ |
79 | ␊ |
80 | #define kDeviceProperties␉"device-properties"␉/* device_inject.c */␊ |
81 | ␊ |
82 | #define kHidePartition␉␉"Hide Partition"␉/* disk.c */␊ |
83 | #define kRenamePartition␉"Rename Partition"␉/* disk.c */␊ |
84 | #define kDefaultPartition␉"Default Partition"␉/* sys.c */␊ |
85 | ␊ |
86 | #define kSMBIOSKey␉␉␉"SMBIOS"␉␉␉/* fake_efi.c */␊ |
87 | #define kSMBIOSdefaults␉␉"SMBIOSdefaults"␉/* smbios_patcher.c */␊ |
88 | #define kSystemID␉␉␉"SystemId"␉␉␉/* fake_efi.c */␊ |
89 | #define kSystemType␉␉␉"SystemType"␉␉/* fake_efi.c */␊ |
90 | ␊ |
91 | #define kUseMemDetect␉␉"UseMemDetect"␉ /* platform.c */␊ |
92 | ␊ |
93 | #define kPCIRootUID␉␉␉"PCIRootUID"␉␉/* pci_root.c */␊ |
94 | ␊ |
95 | #define kUseAtiROM␉␉␉"UseAtiROM"␉␉␉/* ati.c */␊ |
96 | #define kAtiConfig␉␉␉"AtiConfig"␉␉␉/* ati.c */␊ |
97 | #define kATYbinimage␉␉"ATYbinimage"␉␉/* ati.c */␊ |
98 | ␊ |
99 | #define kUseNvidiaROM␉␉"UseNvidiaROM"␉␉/* nvidia.c */␊ |
100 | #define kVBIOS␉␉␉␉"VBIOS"␉␉␉␉/* nvidia.c */␊ |
101 | #define kdcfg0␉␉␉␉"display_0"␉␉␉/* nvidia.c */␊ |
102 | #define kdcfg1␉␉␉␉"display_1"␉␉␉/* nvidia.c */␊ |
103 | ␊ |
104 | #define kEthernetBuiltIn␉"EthernetBuiltIn"␉/* pci_setup.c */␊ |
105 | #define kGraphicsEnabler␉"GraphicsEnabler"␉/* pci_setup.c */␊ |
106 | #define kForceHPET␉␉␉"ForceHPET"␉␉␉/* pci_setup.c */␊ |
107 | ␊ |
108 | #define kMD0Image␉␉␉"md0"␉␉␉␉/* ramdisk.h */␊ |
109 | ␊ |
110 | #define kUSBBusFix␉␉␉"USBBusFix"␉␉␉/* usb.c */␊ |
111 | #define kEHCIacquire␉␉"EHCIacquire"␉␉/* usb.c */␊ |
112 | #define kUHCIreset␉␉␉"UHCIreset"␉␉␉/* usb.c */␊ |
113 | #define kLegacyOff␉␉␉"USBLegacyOff"␉␉/* usb.c */␊ |
114 | #define kEHCIhard␉␉␉"EHCIhard"␉␉␉/* usb.c */␊ |
115 | ␊ |
116 | /*␊ |
117 | * Flags to the booter or kernel␊ |
118 | */␊ |
119 | #define kVerboseModeFlag␉"-v"␊ |
120 | #define kSafeModeFlag␉␉"-x"␊ |
121 | #define kIgnoreCachesFlag␉"-f"␊ |
122 | #define kIgnoreBootFileFlag␉"-F"␊ |
123 | #define kSingleUserModeFlag␉"-s"␊ |
124 | ␊ |
125 | /*␊ |
126 | * Booter behavior control␊ |
127 | */␊ |
128 | #define kBootTimeout -1␊ |
129 | #define kCDBootTimeout 8␊ |
130 | ␊ |
131 | /*␊ |
132 | * A global set by boot() to record the device that the booter␊ |
133 | * was loaded from.␊ |
134 | */␊ |
135 | extern int gBIOSDev;␊ |
136 | extern long gBootMode;␊ |
137 | extern bool sysConfigValid;␊ |
138 | extern char bootBanner[];␊ |
139 | extern char bootPrompt[];␊ |
140 | extern bool gOverrideKernel;␊ |
141 | extern char *gPlatformName;␊ |
142 | extern char gMKextName[];␊ |
143 | extern char gRootDevice[];␊ |
144 | extern bool gEnableCDROMRescan;␊ |
145 | extern bool gScanSingleDrive;␊ |
146 | extern bool useGUI;␊ |
147 | ␊ |
148 | /*␊ |
149 | * Boot Modes␊ |
150 | */␊ |
151 | enum {␊ |
152 | kBootModeNormal = 0,␊ |
153 | kBootModeSafe = 1,␊ |
154 | kBootModeSecure = 2,␊ |
155 | kBootModeQuiet = 4␊ |
156 | };␊ |
157 | ␊ |
158 | extern void initialize_runtime();␊ |
159 | extern void common_boot(int biosdev);␊ |
160 | ␊ |
161 | /*␊ |
162 | * usb.c␊ |
163 | */␊ |
164 | extern int usb_loop();␊ |
165 | ␊ |
166 | /*␊ |
167 | * graphics.c␊ |
168 | */␊ |
169 | extern void printVBEModeInfo();␊ |
170 | extern void setVideoMode(int mode, int drawgraphics);␊ |
171 | extern int getVideoMode();␊ |
172 | extern void spinActivityIndicator();␊ |
173 | extern void clearActivityIndicator();␊ |
174 | extern void drawColorRectangle( unsigned short x,␊ |
175 | unsigned short y,␊ |
176 | unsigned short width,␊ |
177 | unsigned short height,␊ |
178 | unsigned char colorIndex );␊ |
179 | extern void drawDataRectangle( unsigned short x,␊ |
180 | unsigned short y,␊ |
181 | unsigned short width,␊ |
182 | unsigned short height,␊ |
183 | unsigned char * data );␊ |
184 | extern int␊ |
185 | convertImage( unsigned short width,␊ |
186 | unsigned short height,␊ |
187 | const unsigned char *imageData,␊ |
188 | unsigned char **newImageData );␊ |
189 | extern char * decodeRLE( const void * rleData, int rleBlocks, int outBytes );␊ |
190 | extern void drawBootGraphics(void);␊ |
191 | extern void drawPreview(void *src, uint8_t * saveunder);␊ |
192 | extern int getVideoMode(void);␊ |
193 | extern void loadImageScale (void *input, int iw, int ih, int ip, void *output, int ow, int oh, int op, int or);␊ |
194 | ␊ |
195 | /*␊ |
196 | * drivers.c␊ |
197 | */␊ |
198 | extern long LoadExtraDrivers(char * dirSpec);␊ |
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 |