Chameleon

Chameleon Svn Source Tree

Root/branches/azimutz/trunkAutoResolution/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 "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 kShowInfoKey"ShowInfo"// gui.c
64#define kWaitForKeypressKey"Wait"
65
66#define kDSDT"DSDT"/* acpi_patcher.c */
67#define kDropSSDT"DropSSDT"/* acpi_patcher.c */
68#define kRestartFix"RestartFix"/* acpi_patcher.c */
69#define kGeneratePStates"GeneratePStates"/* acpi_patcher.c */
70#define kGenerateCStates"GenerateCStates"/* acpi_patcher.c */
71#define kEnableC2States"EnableC2State"/* acpi_patcher.c */
72#define kEnableC3States"EnableC3State"/* acpi_patcher.c */
73#define kEnableC4States"EnableC4State"/* acpi_patcher.c */
74
75#define kWake"Wake"/* boot.c */
76#define kForceWake"ForceWake"/* boot.c */
77#define kWakeImage"WakeImage"/* boot.c */
78
79#define kbusratio"busratio"/* cpu.c */
80
81#define kDeviceProperties"device-properties"/* device_inject.c */
82
83#define kHidePartition"Hide Partition"/* disk.c */
84#define kRenamePartition"Rename Partition"/* disk.c */
85#define kDefaultPartition"Default Partition"/* sys.c */
86
87#define kSMBIOSKey"SMBIOS"/* fake_efi.c */
88#define kSMBIOSdefaults"SMBIOSdefaults"/* smbios_patcher.c */
89#define kSystemID"SystemId"/* fake_efi.c */
90#define kSystemType"SystemType"/* fake_efi.c */
91
92#define kUseMemDetect"UseMemDetect" /* platform.c */
93
94#define kPCIRootUID"PCIRootUID"/* pci_root.c */
95
96#define kUseAtiROM"UseAtiROM"/* ati.c */
97#define kAtiConfig"AtiConfig"/* ati.c */
98#define kATYbinimage"ATYbinimage"/* ati.c */
99
100#define kUseNvidiaROM"UseNvidiaROM"/* nvidia.c */
101#define kVBIOS"VBIOS"/* nvidia.c */
102#define kdcfg0"display_0"/* nvidia.c */
103#define kdcfg1"display_1"/* nvidia.c */
104
105#define kEthernetBuiltIn"EthernetBuiltIn"/* pci_setup.c */
106#define kGraphicsEnabler"GraphicsEnabler"/* pci_setup.c */
107#define kForceHPET"ForceHPET"/* pci_setup.c */
108
109#define kMD0Image"md0"/* ramdisk.h */
110
111#define kUSBBusFix"USBBusFix"/* usb.c */
112#define kEHCIacquire"EHCIacquire"/* usb.c */
113#define kUHCIreset"UHCIreset"/* usb.c */
114#define kLegacyOff"USBLegacyOff"/* usb.c */
115#define kEHCIhard"EHCIhard"/* usb.c */
116
117#define kAutoResolutionKey"AutoResolution"/* boot.c */
118
119/*
120 * Flags to the booter or kernel
121 */
122#define kVerboseModeFlag"-v"
123#define kSafeModeFlag"-x"
124#define kIgnoreCachesFlag"-f"
125#define kIgnoreBootFileFlag"-F"
126#define kSingleUserModeFlag"-s"
127
128/*
129 * Booter behavior control
130 */
131#define kBootTimeout -1
132#define kCDBootTimeout 8
133
134/*
135 * A global set by boot() to record the device that the booter
136 * was loaded from.
137 */
138extern int gBIOSDev;
139extern long gBootMode;
140extern bool sysConfigValid;
141extern char bootBanner[];
142extern char bootPrompt[];
143extern bool gOverrideKernel;
144extern char *gPlatformName;
145extern char gMKextName[];
146extern char gRootDevice[];
147extern bool gEnableCDROMRescan;
148extern bool gScanSingleDrive;
149extern bool useGUI;
150
151/*
152 * Boot Modes
153 */
154enum {
155 kBootModeNormal = 0,
156 kBootModeSafe = 1,
157 kBootModeSecure = 2,
158 kBootModeQuiet = 4
159};
160
161extern void initialize_runtime();
162extern void common_boot(int biosdev);
163
164/*
165 * usb.c
166 */
167extern int usb_loop();
168
169/*
170 * graphics.c
171 */
172extern void printVBEModeInfo();
173extern void setVideoMode(int mode, int drawgraphics);
174extern int getVideoMode();
175extern void spinActivityIndicator();
176extern void clearActivityIndicator();
177extern void drawColorRectangle( unsigned short x,
178 unsigned short y,
179 unsigned short width,
180 unsigned short height,
181 unsigned char colorIndex );
182extern void drawDataRectangle( unsigned short x,
183 unsigned short y,
184 unsigned short width,
185 unsigned short height,
186 unsigned char * data );
187extern int
188convertImage( unsigned short width,
189 unsigned short height,
190 const unsigned char *imageData,
191 unsigned char **newImageData );
192extern char * decodeRLE( const void * rleData, int rleBlocks, int outBytes );
193extern void drawBootGraphics(void);
194extern void drawPreview(void *src, uint8_t * saveunder);
195extern int getVideoMode(void);
196extern void loadImageScale (void *input, int iw, int ih, int ip, void *output, int ow, int oh, int op, int or);
197
198/*
199 * drivers.c
200 */
201extern long LoadExtraDrivers(char * dirSpec);
202extern long LoadDrivers(char * dirSpec);
203extern long DecodeKernel(void *binary, entry_t *rentry, char **raddr, int *rsize);
204
205typedef long (*FileLoadDrivers_t)(char *dirSpec, long plugin);
206/*!
207 Hookable function pointer called during the driver loading phase that
208 allows other code to cause additional drivers to be loaded.
209 */
210extern long (*LoadExtraDrivers_p)(FileLoadDrivers_t FileLoadDrivers_p);
211
212/*
213 * options.c
214 */
215extern int getBootOptions(bool firstRun);
216extern int processBootOptions();
217extern int selectAlternateBootDevice(int bootdevice);
218extern bool promptForRescanOption(void);
219
220void showHelp();
221void showTextFile();
222char *getMemoryInfoString();
223
224typedef struct {
225 char name[80];
226 void * param;
227} MenuItem;
228
229/*
230 * lzss.c
231 */
232extern int decompress_lzss(u_int8_t *dst, u_int8_t *src, u_int32_t srclen);
233
234struct compressed_kernel_header {
235 u_int32_t signature;
236 u_int32_t compress_type;
237 u_int32_t adler32;
238 u_int32_t uncompressed_size;
239 u_int32_t compressed_size;
240 u_int32_t reserved[11];
241 char platform_name[64];
242 char root_path[256];
243 u_int8_t data[0];
244};
245typedef struct compressed_kernel_header compressed_kernel_header;
246
247/* resume.c */
248void HibernateBoot(char *boot_device);
249
250/* bmdecompress.c */
251void * DecompressData(void *srcbase, int *dw, int *dh, int *bytesPerPixel);
252
253#endif /* !__BOOT2_BOOT_H */
254

Archive Download this file

Revision: 1081