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 the other 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 kDropSSDT␉␉"DropSSDT"␉␉/* dsdt_patcher.c */␊ |
70 | #define kRestartFix␉␉"RestartFix"␉␉/* dsdt_patcher.c */␊ |
71 | #define kSMBIOS␉␉␉"SMBIOS"␉␉/* fake_efi.c */␊ |
72 | #define kSystemID␉␉"SystemId"␉␉/* fake_efi.c */␊ |
73 | #define kSystemType␉␉"SystemType"␉␉/* fake_efi.c */␊ |
74 | #define kUseNvidiaROM␉␉"UseNvidiaROM"␉␉/* nvidia.c */␊ |
75 | #define kVBIOS␉␉␉"VBIOS"␉␉␉/* nvidia.c */␊ |
76 | #define kPCIRootUID␉␉"PCIRootUID"␉␉/* pci_root.c */␊ |
77 | #define kEthernetBuiltIn␉"EthernetBuiltIn"␉/* pci_setup.c */␊ |
78 | #define kGraphicsEnabler␉"GraphicsEnabler"␉/* pci_setup.c */␊ |
79 | #define kUSBBusFix␉␉"USBBusFix"␉␉/* pci_setup.c */␊ |
80 | #define kEHCIacquire␉␉"EHCIacquire"␉␉/* pci_setup.c */␊ |
81 | #define kUHCIreset␉␉"UHCIreset"␉␉/* pci_setup.c */␊ |
82 | #define kForceHPET␉␉"ForceHPET"␉␉/* pci_setup.c */␊ |
83 | #define kSMBIOSdefaults␉␉"SMBIOSdefaults"␉/* smbios_patcher.c */␊ |
84 | #define kEHCIhard␉␉"EHCIhard"␉␉/* usb.c */␊ |
85 | #define kDefaultPartition␉"Default Partition"␉/* sys.c */␊ |
86 | #define kDeviceProperties␉"device-properties"␉/* device_inject.c */␊ |
87 | #define kHidePartition␉␉"Hide Partition"␉/* disk.c */␊ |
88 | #define kRenamePartition␉"Rename Partition"␉/* disk.c */␊ |
89 | #define kUseMemDetect␉ "UseMemDetect"␉ /* platform.c */␊ |
90 | #define kRestartFix "RestartFix" /* dsdt_patcher.c */␊ |
91 | #define kAutoResolutionKey␉"AutoResolution" /* Azi: not present on lebibou diff */␊ |
92 | ␊ |
93 | /*␊ |
94 | * Flags to the booter or kernel␊ |
95 | */␊ |
96 | #define kVerboseModeFlag␉"-v"␊ |
97 | #define kSafeModeFlag␉␉"-x"␊ |
98 | #define kOldSafeModeFlag␉"-f"␊ |
99 | #define kIgnoreBootFileFlag␉"-F"␊ |
100 | #define kSingleUserModeFlag␉"-s"␊ |
101 | #define k32BitModeFlag␉␉"-x32"␊ |
102 | ␊ |
103 | /*␊ |
104 | * Booter behavior control␊ |
105 | */␊ |
106 | #define kBootTimeout -1␊ |
107 | #define kCDBootTimeout 8␊ |
108 | ␊ |
109 | /*␊ |
110 | * A global set by boot() to record the device that the booter␊ |
111 | * was loaded from.␊ |
112 | */␊ |
113 | extern int gBIOSDev;␊ |
114 | extern long gBootMode;␊ |
115 | extern bool sysConfigValid;␊ |
116 | extern char bootBanner[];␊ |
117 | extern char bootPrompt[];␊ |
118 | extern bool gOverrideKernel;␊ |
119 | extern char *gPlatformName;␊ |
120 | extern char gMKextName[];␊ |
121 | extern char gRootDevice[];␊ |
122 | extern bool gEnableCDROMRescan;␊ |
123 | extern bool gScanSingleDrive;␊ |
124 | extern bool useGUI;␊ |
125 | extern bool autoResolution;␊ |
126 | ␊ |
127 | /*␊ |
128 | * Boot Modes␊ |
129 | */␊ |
130 | enum {␊ |
131 | kBootModeNormal = 0,␊ |
132 | kBootModeSafe = 1,␊ |
133 | kBootModeSecure = 2,␊ |
134 | kBootModeQuiet = 4␊ |
135 | };␊ |
136 | ␊ |
137 | extern void initialize_runtime();␊ |
138 | extern void common_boot(int biosdev);␊ |
139 | ␊ |
140 | /*␊ |
141 | * graphics.c␊ |
142 | */␊ |
143 | extern void printVBEModeInfo();␊ |
144 | extern void setVideoMode(int mode, int drawgraphics);␊ |
145 | extern int getVideoMode();␊ |
146 | extern void spinActivityIndicator();␊ |
147 | extern void clearActivityIndicator();␊ |
148 | extern void drawColorRectangle( unsigned short x,␊ |
149 | unsigned short y,␊ |
150 | unsigned short width,␊ |
151 | unsigned short height,␊ |
152 | unsigned char colorIndex );␊ |
153 | extern void drawDataRectangle( unsigned short x,␊ |
154 | unsigned short y,␊ |
155 | unsigned short width,␊ |
156 | unsigned short height,␊ |
157 | unsigned char * data );␊ |
158 | extern int␊ |
159 | convertImage( unsigned short width,␊ |
160 | unsigned short height,␊ |
161 | const unsigned char *imageData,␊ |
162 | unsigned char **newImageData );␊ |
163 | extern char * decodeRLE( const void * rleData, int rleBlocks, int outBytes );␊ |
164 | extern void drawBootGraphics(void);␊ |
165 | extern void drawPreview(void *src, uint8_t * saveunder);␊ |
166 | extern int getVideoMode(void);␊ |
167 | extern void loadImageScale (void *input, int iw, int ih, int ip, void *output, int ow, int oh, int op, int or);␊ |
168 | /*␊ |
169 | * drivers.c␊ |
170 | */␊ |
171 | extern long LoadDrivers(char * dirSpec);␊ |
172 | extern long DecodeKernel(void *binary, entry_t *rentry, char **raddr, int *rsize);␊ |
173 | ␊ |
174 | typedef long (*FileLoadDrivers_t)(char *dirSpec, long plugin);␊ |
175 | /*!␊ |
176 | Hookable function pointer called during the driver loading phase that␊ |
177 | allows other code to cause additional drivers to be loaded.␊ |
178 | */␊ |
179 | extern long (*LoadExtraDrivers_p)(FileLoadDrivers_t FileLoadDrivers_p);␊ |
180 | ␊ |
181 | /*␊ |
182 | * options.c␊ |
183 | */␊ |
184 | extern int getBootOptions(bool firstRun);␊ |
185 | extern int processBootOptions();␊ |
186 | extern int selectAlternateBootDevice(int bootdevice);␊ |
187 | extern bool promptForRescanOption(void);␊ |
188 | ␊ |
189 | void showHelp();␊ |
190 | void showTextFile();␊ |
191 | char *getMemoryInfoString();␊ |
192 | ␊ |
193 | typedef struct {␊ |
194 | char name[80];␊ |
195 | void * param;␊ |
196 | } MenuItem;␊ |
197 | ␊ |
198 | /*␊ |
199 | * lzss.c␊ |
200 | */␊ |
201 | extern int decompress_lzss(u_int8_t *dst, u_int8_t *src, u_int32_t srclen);␊ |
202 | ␊ |
203 | struct compressed_kernel_header {␊ |
204 | u_int32_t signature;␊ |
205 | u_int32_t compress_type;␊ |
206 | u_int32_t adler32;␊ |
207 | u_int32_t uncompressed_size;␊ |
208 | u_int32_t compressed_size;␊ |
209 | u_int32_t reserved[11];␊ |
210 | char platform_name[64];␊ |
211 | char root_path[256];␊ |
212 | u_int8_t data[0];␊ |
213 | };␊ |
214 | typedef struct compressed_kernel_header compressed_kernel_header;␊ |
215 | ␊ |
216 | /* resume.c */␊ |
217 | void HibernateBoot(char *boot_device);␊ |
218 | ␊ |
219 | /* bmdecompress.c */␊ |
220 | void * DecompressData(void *srcbase, int *dw, int *dh, int *bytesPerPixel);␊ |
221 | ␊ |
222 | #endif /* !__BOOT2_BOOT_H */␊ |
223 | |