Chameleon Applications

Chameleon Applications Svn Source Tree

Root/branches/iFabio/Chameleon/i386/boot2/boot.h

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

Archive Download this file

Revision: 307