Chameleon

Chameleon Svn Source Tree

Root/branches/azimutz/Chazi/i386/boot2/boot.h

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 "saio_internal.h" // the only one needed by boot.h it self.
33#include "bootstruct.h"
34
35/*
36 * Default names - these end with "Name" (easier to sort them).
37 */
38#define kDefaultKernelName"mach_kernel"
39#define kDefaultThemeName"Default" // revert?
40/*
41#define kDefaultBootPlistName"com.apple.Boot.plist"
42#define kDefaultDSDTName"dsdt.aml"
43#define kDefaultSMBIOSName"smbios.plist"
44#define kDefaultRamdiskName"Preboot.dmg"
45???*/
46
47/*
48 * Default paths?????
49 */
50
51/*
52 * Undeclared (or undeclared here)
53
54"ProductVersion" - options.c (boot.c on trunk) - getValFK
55
56"biosdev" mboot.c, getValFBK
57"timeout" mboot.c, getValFBK
58"partno" mboot.c, getValFBK
59
60"-checkers" gui.c, getValFK;
61
62"DumpSPD" spd.c, getBollFK - seems unsed***
63*/
64
65/*
66 * gone to modules:
67
68//#define kGraphicsEnablerKey"GraphicsEnabler"// GraphicsEnabler.cgetBoolFK
69//#define kUseAtiROMKey"UseAtiROM"// ati.cgetBoolFK ?? modules
70//#define kAtiConfigKey"AtiConfig"// ati.cgetStringFK
71//#define kATYbinimageKey"ATYbinimage"// ati.cgetBoolFK
72//#define kUseNvidiaROMKey"UseNvidiaROM"// nvidia.cgetBoolFK
73//#define kVBIOSKey"VBIOS"// nvidia.cgetBoolFK
74
75//#define kUseMemDetectKey"UseMemDetect"// platform.cgetBoolFK
76*/
77
78/*
79separate into:
80- internal use (change these to "blablabla")
81
82- kernel & booter flags/arguments
83- no good at boot prompt
84- good at boot prompt
85
86- booter options/patches
87*/
88
89/*
90 * Keys used in system Boot.plist - these end with "Key".
91 */
92//identifier string locationtypecomment
93#define kTextModeKey "Text Mode" // graphics.cgetNumberArraiFP- default 80x25 - kFlag - does it work??
94
95#define kDefaultPartitionKey "Default Partition" // sys.cgetStringFK
96#define kHidePartitionKey "Hide Partition" // disk.cgetValFK
97#define kRenamePartitionKey "Rename Partition" // disk.cgetStringFK
98
99#define kInstantMenuKey "Instant Menu" // boot.cgetBoolFK
100#define kQuietBootKey "Quiet Boot" // boot.cgetBoolFK- kFlag
101#define kTimeoutKey "Timeout" // options.cgetIntFK
102#define kThemeNameKey "Theme" // gui.cgetValFK
103#define kGUIKey "GUI" // boot.cgetBoolFK
104#define kBootBannerKey "Boot Banner" // options.cgetBoolFK
105#define kLegacyLogoKey "Legacy Logo" // gui.cgetBoolFK- revert?
106#define kDebugInfoKey "DebugInfo" // gui.c, graphics.cgetBoolFK
107#define kRescanPromptKey "Rescan Prompt" // boot.cgetBoolFK- cdrom only - firstrun
108#define kRescanKey "Rescan" // boot.cgetBoolFK- cdrom only?? - firstrun
109#define kCDROMPromptKey "CD-ROM Prompt" // options.cgetValFK- internal??
110#define kCDROMOptionKey "CD-ROM Option Key" // options.cgetIntFK- internal?? (F8)
111#define kScanSingleDriveKey "Scan Single Drive" // boot.cgetBoolFK
112#define kDevicePropertiesKey "device-properties" // device_inject.cgetValFK
113#define kWaitForKeypressKey "Wait" // boot.cgetBoolFK
114#define kAltConfigKey "config" // stringTable.cgetValFK- kFlag - hum.. handle like kFlag??
115#define kCanOverrideKey "CanOverride" // stringTable.cgetBoolFK- remember -F ***
116#define kRootDeviceKey "rd" // options.cprocessBootArg- kFlag
117#define kBootDeviceKey "Boot Device" // options.cgetValFK- kFlag/option??????
118#define kBootUUIDKey "boot-uuid" // options.cprocessBootArg- kFlag
119#define kHelperRootUUIDKey "Root UUID" // options.cgetValFK- kFlag
120#define kArchKey "arch" // boot.cgetValFK- kFlag - after all,
121// it's to be passed via "kernel Flags" ?? - "man com.apple.Boot.plist"
122#define kKernelNameKey "Kernel" // options.cgetValFK- kFlag*** bFlag ?
123#define kKernelCacheKey "Kernel Cache" // boot.cgetValFK- kFlag
124#define kKernelFlagsKey "Kernel Flags" // options.cgetValFK- kFlags***
125#define kUseKCKey "UseKC" // boot.cgetBoolFK- testing***
126
127#define kKPatcherKey "PatchKernel" // kernel_patcher.cgetBoolFK
128#define kAltExtensionsKey "kext" // drivers.cgetValFK
129#define kMKextCacheKey "MKext Cache" // options.cgetValFK- kFlag
130#define kMD0ImageKey "md0" // ramdisk.cgetValFK
131#define kWakeKey "Wake" // boot.cgetBoolFK
132#define kForceWakeKey "ForceWake" // boot.cgetBoolFK
133#define kWakeKeyImageKey "WakeImage" // boot.cgetValFK- location???
134#define kGraphicsModeKey "Graphics Mode" // graphics.cgetNumberArraiFP- kFlag
135#define kAutoResolutionKey "AutoResolution" // boot.cgetBoolFK
136
137#define kDSDTKey "DSDT" // acpi_patcher.cgetValFK
138#define kDropSSDTKey "DropSSDT" // acpi_patcher.cgetBoolFK
139#define kRestartFixKey "RestartFix" // acpi_patcher.cgetBoolFK- revert to true?
140#define kGeneratePStatesKey "GeneratePStates" // acpi_patcher.cgetBoolFK
141#define kGenerateCStatesKey "GenerateCStates" // acpi_patcher.cgetBoolFK
142#define kEnableC2StatesKey "EnableC2State" // acpi_patcher.cgetBoolFK
143#define kEnableC3StatesKey "EnableC3State" // acpi_patcher.cgetBoolFK
144#define kEnableC4StatesKey "EnableC4State" // acpi_patcher.cgetBoolFK
145
146#define kSMBIOSdefaultsKey "SMBIOSdefaults" // smbios_patcher.cgetBoolFK
147#define kSMBIOSKey "SMBIOS" // fake_efi.cgetValFK
148//Azi: should this be changed to "SystemID"? BootHelp.txt matches SystemId
149// cleaned obsolete comments on fake_efi.c, lines 500/508 & 608.
150// fixed CHANGES file, lines 39/40.
151#define kSystemIDKey "SystemId" // fake_efi.cgetStringFK
152#define kSystemTypeKey "SystemType" // fake_efi.cgetStringFK
153#define kPCIRootUIDKey "PciRoot" // pci_root.cgetValFK
154#define kEthernetBuiltInKey "EthernetBuiltIn" // pci_setup.cgetBoolFK
155#define kForceHPETKey "ForceHPET" // pci_setup.cgetBoolFK
156#define kUSBBusFixKey "USBBusFix" // usb.cgetBoolFK- trouble! - USBLegacyOff + the other = hang
157#define kEHCIacquireKey "EHCIacquire" // usb.cgetBoolFK
158#define kEHCIhardKey "EHCIhard" // usb.cgetBoolFK- ??
159#define kUHCIresetKey "UHCIreset" // usb.cgetBoolFK
160#define kLegacyOffKey "USBLegacyOff" // usb.cgetBoolFK
161#define kBusRatioKey "busratio" // cpu.cgetValFK
162
163/*
164 * Flags to the booter and/or kernel - these end with "Flag".
165 */
166//identifier string locationtypecomment
167#define kVerboseModeFlag "-v" // options.cgetValFK- kFlag
168#define kSafeModeFlag "-x" // options.cgetValFBootK & getValFK - ?? - kFlag
169#define kIgnoreCachesFlag "-f" // options.cgetValFK- kFlag
170#define kIgnoreBootFileFlag "-F" // options.cgetValFBootK- kFlag
171#define kSingleUserModeFlag "-s" // options.cgetValFK- kFlag
172
173/*
174 * Booter behavior control
175 */
176#define kBootTimeout -1
177#define kCDBootTimeout 8
178
179enum {
180kBackspaceKey= 0x08,
181kTabKey= 0x09,
182kReturnKey= '\r',
183kEscapeKey= 0x1b,
184kUpArrowkey= 0x4800,
185kDownArrowkey= 0x5000,
186kASCIIKeyMask= 0x7f,
187kF2Key= 0x3c00, //Azi:autoresolution
188kF5Key= 0x3f00,
189kF10Key= 0x4400
190};
191
192/*
193 * A global set by boot() to record the device that the booter
194 * was loaded from.
195 */
196extern int gBIOSDev;
197extern long gBootMode;
198extern bool sysConfigValid;
199extern char bootBanner[];
200extern char bootLogBanner[];
201extern char bootPrompt[];
202extern bool gOverrideKernel;
203extern char *gPlatformName; // disabled ??
204extern char gMKextName[];
205extern char gRootDevice[];
206extern bool gEnableCDROMRescan;
207extern bool gScanSingleDrive;
208extern bool useGUI;
209
210/*
211 * Boot Modes
212 */
213enum {
214 kBootModeNormal = 0,
215 kBootModeSafe = 1,
216 kBootModeSecure = 2,
217 kBootModeQuiet = 4
218};
219
220extern void initialize_runtime();
221extern void common_boot(int biosdev);
222
223/*
224 * usb.c
225 */
226extern int usb_loop();
227
228/*
229 * graphics.c
230 */
231extern void printVBEModeInfo();
232extern void setVideoMode(int mode, int drawgraphics);
233extern int getVideoMode();
234extern void spinActivityIndicator();
235extern void clearActivityIndicator();
236extern void drawColorRectangle( unsigned short x,
237 unsigned short y,
238 unsigned short width,
239 unsigned short height,
240 unsigned char colorIndex );
241extern void drawDataRectangle( unsigned short x,
242 unsigned short y,
243 unsigned short width,
244 unsigned short height,
245 unsigned char * data );
246extern int
247convertImage( unsigned short width,
248 unsigned short height,
249 const unsigned char *imageData,
250 unsigned char **newImageData );
251extern char * decodeRLE( const void * rleData, int rleBlocks, int outBytes );
252extern void drawBootGraphics(void);
253extern void drawPreview(void *src, uint8_t * saveunder);
254extern int getVideoMode(void);
255extern void loadImageScale (void *input, int iw, int ih, int ip, void *output, int ow, int oh, int op, int or);
256
257/*
258 * drivers.c
259 */
260extern long LoadDrivers(char * dirSpec);
261extern long DecodeKernel(void *binary, entry_t *rentry, char **raddr, int *rsize);
262
263typedef long (*FileLoadDrivers_t)(char *dirSpec, long plugin);
264/*!
265 Hookable function pointer called during the driver loading phase that
266 allows other code to cause additional drivers to be loaded.
267 */
268extern long (*LoadExtraDrivers_p)(FileLoadDrivers_t FileLoadDrivers_p);
269
270/*
271 * options.c
272 */
273extern int getBootOptions(bool firstRun);
274extern int processBootOptions();
275extern int selectAlternateBootDevice(int bootdevice);
276extern bool promptForRescanOption(void);
277
278void showHelp();
279void showTextFile();
280char *getMemoryInfoString();
281
282typedef struct {
283 char name[80];
284 void * param;
285} MenuItem;
286
287/*
288 * lzss.c
289 */
290extern int decompress_lzss(u_int8_t *dst, u_int8_t *src, u_int32_t srclen);
291
292struct compressed_kernel_header {
293 u_int32_t signature;
294 u_int32_t compress_type;
295 u_int32_t adler32;
296 u_int32_t uncompressed_size;
297 u_int32_t compressed_size;
298 u_int32_t reserved[11];
299 char platform_name[64];
300 char root_path[256];
301 u_int8_t data[0];
302};
303typedef struct compressed_kernel_header compressed_kernel_header;
304
305/* resume.c */
306void HibernateBoot(char *boot_device);
307
308/* bmdecompress.c */
309void * DecompressData(void *srcbase, int *dw, int *dh, int *bytesPerPixel);
310
311#endif /* !__BOOT2_BOOT_H */
312

Archive Download this file

Revision: 1047