Chameleon

Chameleon Svn Source Tree

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

Source at commit 251 created 10 years 2 months ago.
By meklort, Make md0 image user selectable. Falls back to Postboot.img
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 kDropSSDT"DropSSDT"/* dsdt_patcher.c */
70#define kRestartFix"RestartFix"/* dsdt_patcher.c */
71#define kSMBIOS"SMBIOS"/* fake_efi.c */
72#define kSystemID"SystemId"/* fake_efi.c */
73#define kSystemType"SystemType"/* fake_efi.c */
74#define kUseNvidiaROM"UseNvidiaROM"/* nvidia.c */
75#define kVBIOS"VBIOS"/* nvidia.c */
76#define kPCIRootUID"PCIRootUID"/* pci_root.c */
77#define kEthernetBuiltIn"EthernetBuiltIn"/* pci_setup.c */
78#define kGraphicsEnabler"GraphicsEnabler"/* pci_setup.c */
79#define kUSBBusFix"USBBusFix"/* pci_setup.c */
80#define kEHCIacquire"EHCIacquire"/* pci_setup.c */
81#define kUHCIreset"UHCIreset"/* usb.c */
82#define kForceHPET"ForceHPET"/* usb.c */
83#define kLegacyOff"USBLegacyOff"/* usb.c */
84#define kSMBIOSdefaults"SMBIOSdefaults"/* smbios_patcher.c */
85#define kEHCIhard"EHCIhard"/* usb.c */
86#define kDefaultPartition"Default Partition"/* sys.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 kUseMemDetect "UseMemDetect" /* platform.c */
91#define kRestartFix "RestartFix" /* dsdt_patcher.c */
92#define kScreenWidth"ScreenWidth"/* edid.h */
93#define kScreenHeight"ScreenHeight"/* edid.h */
94
95#define kRecoveryFolder"RecoveryFolder"/* drivers.h */
96
97#define kMD0Image"md0"/* ramdisk.h */
98
99/*
100 * Flags to the booter or kernel
101 */
102#define kVerboseModeFlag"-v"
103#define kSafeModeFlag"-x"
104#define kOldSafeModeFlag"-f"
105#define kIgnoreBootFileFlag"-F"
106#define kSingleUserModeFlag"-s"
107#define k32BitModeFlag"-x32"
108
109/*
110 * Booter behavior control
111 */
112#define kBootTimeout -1
113#define kCDBootTimeout 8
114
115/*
116 * A global set by boot() to record the device that the booter
117 * was loaded from.
118 */
119extern int gBIOSDev;
120extern long gBootMode;
121extern bool sysConfigValid;
122extern char bootBanner[];
123extern char bootPrompt[];
124extern bool gOverrideKernel;
125extern char *gPlatformName;
126extern char gMKextName[];
127extern char gRootDevice[];
128extern bool gEnableCDROMRescan;
129extern bool gScanSingleDrive;
130extern bool useGUI;
131
132/*
133 * Boot Modes
134 */
135enum {
136 kBootModeNormal = 0,
137 kBootModeSafe = 1,
138 kBootModeSecure = 2,
139 kBootModeQuiet = 4
140};
141
142extern void initialize_runtime();
143extern void common_boot(int biosdev);
144
145/*
146 * usb.c
147 */
148extern int usb_loop();
149
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 * drivers.c
181 */
182extern long LoadDrivers(char * dirSpec);
183extern long DecodeKernel(void *binary, entry_t *rentry, char **raddr, int *rsize);
184
185typedef long (*FileLoadDrivers_t)(char *dirSpec, long plugin);
186/*!
187 Hookable function pointer called during the driver loading phase that
188 allows other code to cause additional drivers to be loaded.
189 */
190extern long (*LoadExtraDrivers_p)(FileLoadDrivers_t FileLoadDrivers_p);
191
192/*
193 * options.c
194 */
195extern int getBootOptions(bool firstRun);
196extern int processBootOptions();
197extern int selectAlternateBootDevice(int bootdevice);
198extern bool promptForRescanOption(void);
199
200void showHelp();
201void showTextFile();
202char *getMemoryInfoString();
203
204typedef struct {
205 char name[80];
206 void * param;
207} MenuItem;
208
209/*
210 * lzss.c
211 */
212extern int decompress_lzss(u_int8_t *dst, u_int8_t *src, u_int32_t srclen);
213
214struct compressed_kernel_header {
215 u_int32_t signature;
216 u_int32_t compress_type;
217 u_int32_t adler32;
218 u_int32_t uncompressed_size;
219 u_int32_t compressed_size;
220 u_int32_t reserved[11];
221 char platform_name[64];
222 char root_path[256];
223 u_int8_t data[0];
224};
225typedef struct compressed_kernel_header compressed_kernel_header;
226
227/* resume.c */
228void HibernateBoot(char *boot_device);
229
230/* bmdecompress.c */
231void * DecompressData(void *srcbase, int *dw, int *dh, int *bytesPerPixel);
232
233#endif /* !__BOOT2_BOOT_H */
234

Archive Download this file

Revision: 251