Chameleon

Chameleon Svn Source Tree

Root/branches/meklort/i386/boot2/boot.h

Source at commit 606 created 13 years 5 months ago.
By meklort, Kext patcher update. Can now patch both the gma950 binary and plist in mem. Will add error detections and device id detection to determine if a patch is required
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"/* acpi_patcher.c */
69#define kDropSSDT"DropSSDT"/* acpi_patcher.c */
70#define kRestartFix"RestartFix" /* acpi_patcher.c */
71#define kGeneratePStates"GeneratePStates"/* acpi_patcher.c */
72#define kGenerateCStates"GenerateCStates"/* acpi_patcher.c */
73#define kEnableC4States"EnableC4State"/* acpi_patcher.c */
74#define kDeviceProperties"device-properties"/* device_inject.c */
75#define kHidePartition"Hide Partition"/* disk.c */
76#define kRenamePartition"Rename Partition"/* disk.c */
77#define kSMBIOSKey"SMBIOS"/* fake_efi.c */
78#define kSystemID"SystemId"/* fake_efi.c */
79#define kSystemType"SystemType"/* fake_efi.c */
80#define kUseNvidiaROM"UseNvidiaROM"/* nvidia.c */
81#define kVBIOS"VBIOS"/* nvidia.c */
82#define kPCIRootUID"PCIRootUID"/* pci_root.c */
83#define kEthernetBuiltIn"EthernetBuiltIn"/* pci_setup.c */
84#define kForceHPET"ForceHPET"/* pci_setup.c */
85#define kUseMemDetect"UseMemDetect" /* platform.c */
86#define kSMBIOSdefaults"SMBIOSdefaults"/* smbios_patcher.c */
87#define kUSBBusFix"USBBusFix"/* usb.c */
88#define kEHCIacquire"EHCIacquire"/* usb.c */
89#define kUHCIreset"UHCIreset"/* usb.c */
90#define kLegacyOff"USBLegacyOff"/* usb.c */
91#define kEHCIhard"EHCIhard"/* usb.c */
92#define kDefaultPartition"Default Partition"/* sys.c */
93#define kMD0Image"md0"/* ramdisk.h */
94#define kScreenWidth"ScreenWidth"/* edid.h */
95#define kScreenHeight"ScreenHeight"/* edid.h */
96
97#define kRecoveryFolder"RecoveryFolder"/* drivers.h */
98
99#define kMD0Image"md0"/* ramdisk.h */
100
101
102enum {
103kBackspaceKey= 0x08,
104kTabKey= 0x09,
105kReturnKey= 0x0d,
106kEscapeKey= 0x1b,
107kUpArrowkey= 0x4800,
108kDownArrowkey= 0x5000,
109kASCIIKeyMask= 0x7f,
110kF5Key= 0x3f00,
111kF10Key= 0x4400
112};
113
114
115/*
116 * Flags to the booter or kernel
117 */
118#define kVerboseModeFlag"-v"
119#define kSafeModeFlag"-x"
120#define kIgnoreCachesFlag"-f"
121#define kIgnoreBootFileFlag"-F"
122#define kSingleUserModeFlag"-s"
123
124/*
125 * Booter behavior control
126 */
127#define kBootTimeout -1
128#define kCDBootTimeout 8
129
130/*
131 * A global set by boot() to record the device that the booter
132 * was loaded from.
133 */
134extern int gBIOSDev;
135extern long gBootMode;
136extern bool sysConfigValid;
137extern char bootBanner[];
138extern char bootPrompt[];
139extern bool gOverrideKernel;
140extern char *gPlatformName;
141extern char gMKextName[];
142extern char gRootDevice[];
143extern bool gEnableCDROMRescan;
144extern bool gScanSingleDrive;
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
159extern char* updateBooter;
160/*
161 * graphics.c
162 */
163extern void printVBEModeInfo();
164extern void setVideoMode(int mode, int drawgraphics);
165extern int getVideoMode();
166extern void spinActivityIndicator();
167extern void clearActivityIndicator();
168extern void drawColorRectangle( unsigned short x,
169 unsigned short y,
170 unsigned short width,
171 unsigned short height,
172 unsigned char colorIndex );
173extern void drawDataRectangle( unsigned short x,
174 unsigned short y,
175 unsigned short width,
176 unsigned short height,
177 unsigned char * data );
178extern int
179convertImage( unsigned short width,
180 unsigned short height,
181 const unsigned char *imageData,
182 unsigned char **newImageData );
183extern char * decodeRLE( const void * rleData, int rleBlocks, int outBytes );
184extern void drawBootGraphics(void);
185extern void drawPreview(void *src, uint8_t * saveunder);
186extern int getVideoMode(void);
187extern void loadImageScale (void *input, int iw, int ih, int ip, void *output, int ow, int oh, int op, int or);
188
189/*
190 * drivers.c
191 */
192extern long LoadDrivers(char * dirSpec);
193extern long DecodeKernel(void *binary, entry_t *rentry, char **raddr, int *rsize);
194
195typedef long (*FileLoadDrivers_t)(char *dirSpec, long plugin);
196/*!
197 Hookable function pointer called during the driver loading phase that
198 allows other code to cause additional drivers to be loaded.
199 */
200extern long (*LoadExtraDrivers_p)(FileLoadDrivers_t FileLoadDrivers_p);
201
202/*
203 * options.c
204 */
205extern int getBootOptions(bool firstRun);
206extern int processBootOptions();
207extern int selectAlternateBootDevice(int bootdevice);
208extern bool promptForRescanOption(void);
209
210void showHelp();
211void showTextFile();
212char *getMemoryInfoString();
213
214typedef struct {
215 char name[80];
216 void * param;
217} MenuItem;
218
219/*
220 * lzss.c
221 */
222extern int decompress_lzss(u_int8_t *dst, u_int8_t *src, u_int32_t srclen);
223
224struct compressed_kernel_header {
225 u_int32_t signature;
226 u_int32_t compress_type;
227 u_int32_t adler32;
228 u_int32_t uncompressed_size;
229 u_int32_t compressed_size;
230 u_int32_t reserved[11];
231 char platform_name[64];
232 char root_path[256];
233 u_int8_t data[0];
234};
235typedef struct compressed_kernel_header compressed_kernel_header;
236
237/* resume.c */
238void HibernateBoot(char *boot_device);
239
240/* bmdecompress.c */
241void * DecompressData(void *srcbase, int *dw, int *dh, int *bytesPerPixel);
242
243#endif /* !__BOOT2_BOOT_H */
244

Archive Download this file

Revision: 606