Chameleon

Chameleon Svn Source Tree

Root/branches/rekursor/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/* AsereBLN: added the other keys */
62#define kUseAtiROM"UseAtiROM"/* ati.c */
63#define kWake"Wake"/* boot.c */
64#define kForceWake"ForceWake"/* boot.c */
65#define kWakeImage"WakeImage"/* boot.c */
66#define kProductVersion"ProductVersion"/* boot.c */
67#define karch"arch"/* boot.c */
68#define kDSDT"DSDT"/* dsdt_patcher.c */
69#define kSSDT"SSDT"/* dsdt_patcher.c */
70#define kHPET"HPET"/* dsdt_patcher.c */
71#define kSBST"SBST"/* dsdt_patcher.c */
72#define kECDT"ECDT"/* dsdt_patcher.c */
73#define kASFT"ASFT"/* dsdt_patcher.c */
74#define kDMAR"DMAR"/* dsdt_patcher.c */
75#define kFADT"FADT"/* dsdt_patcher.c */
76#define kAPIC"APIC"/* dsdt_patcher.c */
77#define kMCFG"MCFG"/* dsdt_patcher.c */
78#define kOEMDSDT"oemDSDT"/* dsdt_patcher.c */
79#define kOEMSSDT"oemSSDT"/* dsdt_patcher.c */
80#define kOEMHPET"oemHPET"/* dsdt_patcher.c */
81#define kOEMSBST"oemSBST"/* dsdt_patcher.c */
82#define kOEMECDT"oemECDT"/* dsdt_patcher.c */
83#define kOEMASFT"oemASFT"/* dsdt_patcher.c */
84#define kOEMDMAR"oemDMAR"/* dsdt_patcher.c */
85#define kOEMFADT"oemFADT"/* dsdt_patcher.c */
86#define kOEMAPIC"oemAPIC"/* dsdt_patcher.c */
87#define kOEMMCFG"oemMCFG"/* dsdt_patcher.c */
88#define kDrop "Drop" /* dsdt_patcher.c */
89#define kUpdateACPI"UpdateACPI"/* dsdt_patcher.c */
90#define kRestartFix"RestartFix"/* dsdt_patcher.c */
91#define kSMBIOS"SMBIOS"/* fake_efi.c */
92#define kSystemID"SystemId"/* fake_efi.c */
93#define kSystemType"SystemType"/* fake_efi.c */
94#define kUseNvidiaROM"UseNvidiaROM"/* nvidia.c */
95#define kVBIOS"VBIOS"/* nvidia.c */
96#define kPCIRootUID"PCIRootUID"/* pci_root.c */
97#define kEthernetBuiltIn"EthernetBuiltIn"/* pci_setup.c */
98#define kGraphicsEnabler"GraphicsEnabler"/* pci_setup.c */
99#define kUSBBusFix"USBBusFix"/* pci_setup.c */
100#define kUSBLegacyOff"USBLegacyOff"/* pci_setup.c */
101#define kEHCIacquire"EHCIacquire"/* pci_setup.c */
102#define kUHCIreset"UHCIreset"/* pci_setup.c */
103#define kForceHPET"ForceHPET"/* pci_setup.c */
104#define kSMBIOSdefaults"SMBIOSdefaults"/* smbios_patcher.c */
105#define kEHCIhard"EHCIhard"/* usb.c */
106#define kDefaultPartition"Default Partition"/* sys.c */
107#define kDeviceProperties"device-properties"/* device_inject.c */
108#define kHidePartition"Hide Partition"/* disk.c */
109#define kRenamePartition"Rename Partition"/* disk.c */
110#define kRestartFix "RestartFix" /* dsdt_patcher.c */
111
112/*
113 * Flags to the booter or kernel
114 */
115#define kVerboseModeFlag"-v"
116#define kSafeModeFlag"-x"
117#define kOldSafeModeFlag"-f"
118#define kIgnoreBootFileFlag"-F"
119#define kSingleUserModeFlag"-s"
120#define k32BitModeFlag"-x32"
121#define k64BitModeFlag"-x64"
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 * graphics.c
161 */
162extern void printVBEModeInfo();
163extern void setVideoMode(int mode, int drawgraphics);
164extern int getVideoMode();
165extern void spinActivityIndicator();
166extern void clearActivityIndicator();
167extern void drawColorRectangle( unsigned short x,
168 unsigned short y,
169 unsigned short width,
170 unsigned short height,
171 unsigned char colorIndex );
172extern void drawDataRectangle( unsigned short x,
173 unsigned short y,
174 unsigned short width,
175 unsigned short height,
176 unsigned char * data );
177extern int
178convertImage( unsigned short width,
179 unsigned short height,
180 const unsigned char *imageData,
181 unsigned char **newImageData );
182extern char * decodeRLE( const void * rleData, int rleBlocks, int outBytes );
183extern void drawBootGraphics(void);
184extern void drawPreview(void *src, uint8_t * saveunder);
185extern int getVideoMode(void);
186extern void loadImageScale (void *input, int iw, int ih, int ip, void *output, int ow, int oh, int op, int or);
187/*
188 * drivers.c
189 */
190extern long LoadDrivers(char * dirSpec);
191extern long DecodeKernel(void *binary, entry_t *rentry, char **raddr, int *rsize);
192
193typedef long (*FileLoadDrivers_t)(char *dirSpec, long plugin);
194/*!
195 Hookable function pointer called during the driver loading phase that
196 allows other code to cause additional drivers to be loaded.
197 */
198extern long (*LoadExtraDrivers_p)(FileLoadDrivers_t FileLoadDrivers_p);
199
200/*
201 * options.c
202 */
203extern int getBootOptions(bool firstRun);
204extern int processBootOptions();
205extern int selectAlternateBootDevice(int bootdevice);
206extern bool promptForRescanOption(void);
207
208void showHelp();
209void showTextFile();
210char *getMemoryInfoString();
211
212typedef struct {
213 char name[80];
214 void * param;
215} MenuItem;
216
217/*
218 * lzss.c
219 */
220extern int decompress_lzss(u_int8_t *dst, u_int8_t *src, u_int32_t srclen);
221
222struct compressed_kernel_header {
223 u_int32_t signature;
224 u_int32_t compress_type;
225 u_int32_t adler32;
226 u_int32_t uncompressed_size;
227 u_int32_t compressed_size;
228 u_int32_t reserved[11];
229 char platform_name[64];
230 char root_path[256];
231 u_int8_t data[0];
232};
233typedef struct compressed_kernel_header compressed_kernel_header;
234
235/* resume.c */
236void HibernateBoot(char *boot_device);
237
238/* bmdecompress.c */
239void * DecompressData(void *srcbase, int *dw, int *dh, int *bytesPerPixel);
240
241#endif /* !__BOOT2_BOOT_H */
242

Archive Download this file

Revision: 63