Chameleon

Chameleon Svn Source Tree

Root/branches/valv/i386/boot2/boot.h

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

Archive Download this file

Revision: 705