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

Archive Download this file

Revision: 624