Chameleon

Chameleon Svn Source Tree

Root/trunk/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 * Paths used by chameleon
35 */
36
37//kernel cache
38#define kDefaultCachePathLeo "/System/Library/Caches/com.apple.kernelcaches/"
39#define kDefaultCachePathSnow "/System/Library/Caches/com.apple.kext.caches/Startup/"
40
41// Lion installer
42#define kLionInstallerDataFolder "/Mac OS X Install Data/"
43#define kLionInstallerPlist kLionInstallerDataFolder "com.apple.Boot.plist"
44
45/*
46 * Keys used in system Boot.plist
47 */
48#define kGraphicsModeKey"Graphics Mode"
49#define kTextModeKey"Text Mode"
50#define kQuietBootKey"Quiet Boot"
51#define kKernelFlagsKey"Kernel Flags"
52#define karch"arch"/* boot.c */
53#define kProductVersion"ProductVersion"/* boot.c */
54#define kMKextCacheKey"MKext Cache"
55#define kKernelNameKey"Kernel"
56#define kKernelCacheKey"Kernel Cache"
57#define kUseKernelCache"UseKernelCache"/* boot.c */
58#define kBootDeviceKey"Boot Device"
59#define kTimeoutKey"Timeout"
60#define kRootDeviceKey"rd"
61#define kBootUUIDKey"boot-uuid"
62#define kHelperRootUUIDKey"Root UUID"
63#define kPlatformKey"platform"
64#define kACPIKey"acpi"
65#define kCDROMPromptKey"CD-ROM Prompt"
66#define kCDROMOptionKey"CD-ROM Option Key"
67#define kRescanPromptKey"Rescan Prompt"
68#define kRescanKey "Rescan"
69#define kScanSingleDriveKey"Scan Single Drive"
70#define kInsantMenuKey"Instant Menu"
71#define kDefaultKernel"mach_kernel"
72#define kGUIKey"GUI"
73#define kBootBannerKey"Boot Banner"
74#define kShowInfoKey"ShowInfo"// gui.c
75#define kWaitForKeypressKey"Wait"
76
77#define kDSDT"DSDT"/* acpi_patcher.c */
78#define kDropSSDT"DropSSDT"/* acpi_patcher.c */
79#define kRestartFix"RestartFix"/* acpi_patcher.c */
80#define kGeneratePStates"GeneratePStates"/* acpi_patcher.c */
81#define kGenerateCStates"GenerateCStates"/* acpi_patcher.c */
82#define kEnableC2States"EnableC2State"/* acpi_patcher.c */
83#define kEnableC3States"EnableC3State"/* acpi_patcher.c */
84#define kEnableC4States"EnableC4State"/* acpi_patcher.c */
85
86#define kWake"Wake"/* boot.c */
87#define kForceWake"ForceWake"/* boot.c */
88#define kWakeImage"WakeImage"/* boot.c */
89
90#define kbusratio"busratio"/* cpu.c */
91
92#define kDeviceProperties"device-properties"/* device_inject.c */
93
94#define kHidePartition"Hide Partition"/* disk.c */
95#define kRenamePartition"Rename Partition"/* disk.c */
96#define kDefaultPartition"Default Partition"/* sys.c */
97
98#define kSMBIOSKey"SMBIOS"/* fake_efi.c */
99#define kSMBIOSdefaults"SMBIOSdefaults"/* smbios_patcher.c */
100#define kSystemID"SystemId"/* fake_efi.c */
101#define kSystemType"SystemType"/* fake_efi.c */
102
103#define kUseMemDetect"UseMemDetect" /* platform.c */
104
105#define kPCIRootUID"PCIRootUID"/* pci_root.c */
106
107#define kUseAtiROM"UseAtiROM"/* ati.c */
108#define kAtiConfig"AtiConfig"/* ati.c */
109#define kATYbinimage"ATYbinimage"/* ati.c */
110
111#define kUseNvidiaROM"UseNvidiaROM"/* nvidia.c */
112#define kVBIOS"VBIOS"/* nvidia.c */
113#define kdcfg0"display_0"/* nvidia.c */
114#define kdcfg1"display_1"/* nvidia.c */
115
116#define kEthernetBuiltIn"EthernetBuiltIn"/* pci_setup.c */
117#define kGraphicsEnabler"GraphicsEnabler"/* pci_setup.c */
118#define kForceHPET"ForceHPET"/* pci_setup.c */
119
120#define kMD0Image"md0"/* ramdisk.h */
121
122#define kUSBBusFix"USBBusFix"/* usb.c */
123#define kEHCIacquire"EHCIacquire"/* usb.c */
124#define kUHCIreset"UHCIreset"/* usb.c */
125#define kLegacyOff"USBLegacyOff"/* usb.c */
126#define kEHCIhard"EHCIhard"/* usb.c */
127
128/*
129 * Flags to the booter or kernel
130 */
131#define kVerboseModeFlag"-v"
132#define kSafeModeFlag"-x"
133#define kIgnoreCachesFlag"-f"
134#define kIgnoreBootFileFlag"-F"
135#define kSingleUserModeFlag"-s"
136
137/*
138 * Booter behavior control
139 */
140#define kBootTimeout -1
141#define kCDBootTimeout 8
142
143/*
144 * A global set by boot() to record the device that the booter
145 * was loaded from.
146 */
147extern int gBIOSDev;
148extern long gBootMode;
149extern bool sysConfigValid;
150extern char bootBanner[];
151extern char bootPrompt[];
152extern bool gOverrideKernel;
153extern char *gPlatformName;
154extern char gMKextName[];
155extern char gRootDevice[];
156extern bool gEnableCDROMRescan;
157extern bool gScanSingleDrive;
158extern bool useGUI;
159
160/*
161 * Boot Modes
162 */
163enum {
164 kBootModeNormal = 0,
165 kBootModeSafe = 1,
166 kBootModeSecure = 2,
167 kBootModeQuiet = 4
168};
169
170extern void initialize_runtime();
171extern void common_boot(int biosdev);
172
173/*
174 * usb.c
175 */
176extern int usb_loop();
177
178/*
179 * graphics.c
180 */
181extern void printVBEModeInfo();
182extern void setVideoMode(int mode, int drawgraphics);
183extern int getVideoMode();
184extern void spinActivityIndicator();
185extern void clearActivityIndicator();
186extern void drawColorRectangle( unsigned short x,
187 unsigned short y,
188 unsigned short width,
189 unsigned short height,
190 unsigned char colorIndex );
191extern void drawDataRectangle( unsigned short x,
192 unsigned short y,
193 unsigned short width,
194 unsigned short height,
195 unsigned char * data );
196extern int
197convertImage( unsigned short width,
198 unsigned short height,
199 const unsigned char *imageData,
200 unsigned char **newImageData );
201extern char * decodeRLE( const void * rleData, int rleBlocks, int outBytes );
202extern void drawBootGraphics(void);
203extern void drawPreview(void *src, uint8_t * saveunder);
204extern int getVideoMode(void);
205extern void loadImageScale (void *input, int iw, int ih, int ip, void *output, int ow, int oh, int op, int or);
206
207/*
208 * drivers.c
209 */
210extern long LoadExtraDrivers(char * dirSpec);
211extern long LoadDrivers(char * dirSpec);
212extern long DecodeKernel(void *binary, entry_t *rentry, char **raddr, int *rsize);
213
214typedef long (*FileLoadDrivers_t)(char *dirSpec, long plugin);
215/*!
216 Hookable function pointer called during the driver loading phase that
217 allows other code to cause additional drivers to be loaded.
218 */
219extern long (*LoadExtraDrivers_p)(FileLoadDrivers_t FileLoadDrivers_p);
220
221/*
222 * options.c
223 */
224extern int getBootOptions(bool firstRun);
225extern int processBootOptions();
226extern int selectAlternateBootDevice(int bootdevice);
227extern bool promptForRescanOption(void);
228
229void showHelp();
230void showTextFile();
231char *getMemoryInfoString();
232
233typedef struct {
234 char name[80];
235 void * param;
236} MenuItem;
237
238/*
239 * lzss.c
240 */
241extern int decompress_lzss(u_int8_t *dst, u_int8_t *src, u_int32_t srclen);
242
243struct compressed_kernel_header {
244 u_int32_t signature;
245 u_int32_t compress_type;
246 u_int32_t adler32;
247 u_int32_t uncompressed_size;
248 u_int32_t compressed_size;
249 u_int32_t reserved[11];
250 char platform_name[64];
251 char root_path[256];
252 u_int8_t data[0];
253};
254typedef struct compressed_kernel_header compressed_kernel_header;
255
256/* resume.c */
257void HibernateBoot(char *boot_device);
258
259/* bmdecompress.c */
260void * DecompressData(void *srcbase, int *dw, int *dh, int *bytesPerPixel);
261
262#endif /* !__BOOT2_BOOT_H */
263

Archive Download this file

Revision: 1103