Chameleon

Chameleon Svn Source Tree

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

Archive Download this file

Revision: 321