Chameleon

Chameleon Svn Source Tree

Root/branches/JrCs/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#define kSystemID "SystemId" /* fake_efi.c */
62#define kRestartFix "RestartFix" /* dsdt_patcher.c */
63#define kSystemType "SystemType" /* fake_efi.c */
64#define kUseNvidiaROM "UseNvidiaROM" /* nvidia.c */
65#define kVBIOS "VBIOS" /* nvidia.c */
66
67/*
68 * Flags to the booter or kernel
69 *
70 */
71#define kVerboseModeFlag "-v"
72#define kSafeModeFlag "-x"
73#define kOldSafeModeFlag "-f"
74#define kIgnoreBootFileFlag "-F"
75#define kSingleUserModeFlag "-s"
76
77/*
78 * Booter behavior control
79 */
80#define kBootTimeout -1
81#define kCDBootTimeout 8
82
83/*
84 * A global set by boot() to record the device that the booter
85 * was loaded from.
86 */
87extern int gBIOSDev;
88extern long gBootMode;
89extern bool sysConfigValid;
90extern char bootBanner[];
91extern char bootPrompt[];
92extern bool gOverrideKernel;
93extern char *gPlatformName;
94extern char gMKextName[];
95extern char gRootDevice[];
96extern bool gEnableCDROMRescan;
97extern bool gScanSingleDrive;
98extern bool useGUI;
99
100// Boot Modes
101enum {
102 kBootModeNormal = 0,
103 kBootModeSafe = 1,
104 kBootModeSecure = 2,
105 kBootModeQuiet = 4
106};
107
108extern void initialize_runtime();
109extern void common_boot(int biosdev);
110
111/*
112 * graphics.c
113 */
114
115extern void printVBEModeInfo();
116extern void setVideoMode(int mode, int drawgraphics);
117extern int getVideoMode();
118extern void spinActivityIndicator();
119extern void clearActivityIndicator();
120extern void drawColorRectangle( unsigned short x,
121 unsigned short y,
122 unsigned short width,
123 unsigned short height,
124 unsigned char colorIndex );
125extern void drawDataRectangle( unsigned short x,
126 unsigned short y,
127 unsigned short width,
128 unsigned short height,
129 unsigned char * data );
130extern int
131convertImage( unsigned short width,
132 unsigned short height,
133 const unsigned char *imageData,
134 unsigned char **newImageData );
135extern char * decodeRLE( const void * rleData, int rleBlocks, int outBytes );
136extern void drawBootGraphics(void);
137extern void drawPreview(void *src, uint8_t * saveunder);
138extern int getVideoMode(void);
139extern void loadImageScale (void *input, int iw, int ih, int ip, void *output, int ow, int oh, int op, int or);
140/*
141 * drivers.c
142 */
143extern long LoadDrivers(char * dirSpec);
144extern long DecodeKernel(void *binary, entry_t *rentry, char **raddr, int *rsize);
145
146typedef long (*FileLoadDrivers_t)(char *dirSpec, long plugin);
147/*!
148 Hookable function pointer called during the driver loading phase that
149 allows other code to cause additional drivers to be loaded.
150 */
151extern long (*LoadExtraDrivers_p)(FileLoadDrivers_t FileLoadDrivers_p);
152
153/*
154 * options.c
155 */
156extern int getBootOptions(bool firstRun);
157extern int processBootOptions();
158extern int selectAlternateBootDevice(int bootdevice);
159extern bool promptForRescanOption(void);
160
161void showHelp();
162void showTextFile();
163char *getMemoryInfoString();
164
165typedef struct {
166 char name[80];
167 void * param;
168} MenuItem;
169
170/*
171 * lzss.c
172 */
173extern int decompress_lzss(u_int8_t *dst, u_int8_t *src, u_int32_t srclen);
174
175struct compressed_kernel_header {
176 u_int32_t signature;
177 u_int32_t compress_type;
178 u_int32_t adler32;
179 u_int32_t uncompressed_size;
180 u_int32_t compressed_size;
181 u_int32_t reserved[11];
182 char platform_name[64];
183 char root_path[256];
184 u_int8_t data[0];
185};
186typedef struct compressed_kernel_header compressed_kernel_header;
187
188/* resume.c */
189void HibernateBoot(char *boot_device);
190
191/* bmdecompress.c */
192void *
193DecompressData(void *srcbase, int *dw, int *dh, int *bytesPerPixel);
194
195#endif /* !__BOOT2_BOOT_H */
196

Archive Download this file

Revision: 122