Chameleon

Chameleon Svn Source Tree

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

Archive Download this file

Revision: 1169