Chameleon

Chameleon Svn Source Tree

Root/branches/azimutz/trunkGraphicsEnablerModules/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 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
104#define kUSBBusFix"USBBusFix"/* usb.c */
105#define kEHCIacquire"EHCIacquire"/* usb.c */
106#define kUHCIreset"UHCIreset"/* usb.c */
107#define kLegacyOff"USBLegacyOff"/* usb.c */
108#define kEHCIhard"EHCIhard"/* usb.c */
109#define kDefaultPartition"Default Partition"/* sys.c */
110
111#define kMD0Image"md0"/* ramdisk.h */
112#define kbusratio"busratio"/* cpu.c */
113
114/*
115 * Flags to the booter or kernel
116 */
117#define kVerboseModeFlag"-v"
118#define kSafeModeFlag"-x"
119#define kIgnoreCachesFlag"-f"
120#define kIgnoreBootFileFlag"-F"
121#define kSingleUserModeFlag"-s"
122
123/*
124 * Booter behavior control
125 */
126#define kBootTimeout -1
127#define kCDBootTimeout 8
128
129/*
130 * A global set by boot() to record the device that the booter
131 * was loaded from.
132 */
133extern int gBIOSDev;
134extern long gBootMode;
135extern bool sysConfigValid;
136extern char bootBanner[];
137extern char bootPrompt[];
138extern bool gOverrideKernel;
139extern char *gPlatformName;
140extern char gMKextName[];
141extern char gRootDevice[];
142extern bool gEnableCDROMRescan;
143extern bool gScanSingleDrive;
144extern bool useGUI;
145
146/*
147 * Boot Modes
148 */
149enum {
150 kBootModeNormal = 0,
151 kBootModeSafe = 1,
152 kBootModeSecure = 2,
153 kBootModeQuiet = 4
154};
155
156extern void initialize_runtime();
157extern void common_boot(int biosdev);
158
159/*
160 * usb.c
161 */
162extern int usb_loop();
163
164/*
165 * graphics.c
166 */
167extern void printVBEModeInfo();
168extern void setVideoMode(int mode, int drawgraphics);
169extern int getVideoMode();
170extern void spinActivityIndicator();
171extern void clearActivityIndicator();
172extern void drawColorRectangle( unsigned short x,
173 unsigned short y,
174 unsigned short width,
175 unsigned short height,
176 unsigned char colorIndex );
177extern void drawDataRectangle( unsigned short x,
178 unsigned short y,
179 unsigned short width,
180 unsigned short height,
181 unsigned char * data );
182extern int
183convertImage( unsigned short width,
184 unsigned short height,
185 const unsigned char *imageData,
186 unsigned char **newImageData );
187extern char * decodeRLE( const void * rleData, int rleBlocks, int outBytes );
188extern void drawBootGraphics(void);
189extern void drawPreview(void *src, uint8_t * saveunder);
190extern int getVideoMode(void);
191extern void loadImageScale (void *input, int iw, int ih, int ip, void *output, int ow, int oh, int op, int or);
192
193/*
194 * drivers.c
195 */
196extern long LoadExtraDrivers(char * dirSpec);
197extern long LoadDrivers(char * dirSpec);
198extern long DecodeKernel(void *binary, entry_t *rentry, char **raddr, int *rsize);
199
200typedef long (*FileLoadDrivers_t)(char *dirSpec, long plugin);
201/*!
202 Hookable function pointer called during the driver loading phase that
203 allows other code to cause additional drivers to be loaded.
204 */
205extern long (*LoadExtraDrivers_p)(FileLoadDrivers_t FileLoadDrivers_p);
206
207/*
208 * options.c
209 */
210extern int getBootOptions(bool firstRun);
211extern int processBootOptions();
212extern int selectAlternateBootDevice(int bootdevice);
213extern bool promptForRescanOption(void);
214
215void showHelp();
216void showTextFile();
217char *getMemoryInfoString();
218
219typedef struct {
220 char name[80];
221 void * param;
222} MenuItem;
223
224/*
225 * lzss.c
226 */
227extern int decompress_lzss(u_int8_t *dst, u_int8_t *src, u_int32_t srclen);
228
229struct compressed_kernel_header {
230 u_int32_t signature;
231 u_int32_t compress_type;
232 u_int32_t adler32;
233 u_int32_t uncompressed_size;
234 u_int32_t compressed_size;
235 u_int32_t reserved[11];
236 char platform_name[64];
237 char root_path[256];
238 u_int8_t data[0];
239};
240typedef struct compressed_kernel_header compressed_kernel_header;
241
242/* resume.c */
243void HibernateBoot(char *boot_device);
244
245/* bmdecompress.c */
246void * DecompressData(void *srcbase, int *dw, int *dh, int *bytesPerPixel);
247
248#endif /* !__BOOT2_BOOT_H */
249

Archive Download this file

Revision: 993