Chameleon

Chameleon Svn Source Tree

Root/branches/cparm/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 kPrelinkKernelKey"Prelinked Kernel"
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 kCDROMPromptKey"CD-ROM Prompt"
51#define kCDROMOptionKey"CD-ROM Option Key"
52#define kRescanPromptKey"Rescan Prompt"
53#define kRescanKey "Rescan"
54#define kScanSingleDriveKey"Scan Single Drive"
55#define kInsantMenuKey"Instant Menu"
56#define kDefaultKernel"mach_kernel"
57#define kWaitForKeypressKey"Wait"
58/* AsereBLN: added the other keys */
59
60#define kProductVersion"ProductVersion"/* boot.c */
61#define karch"arch"/* boot.c */
62#define kDeviceProperties"device-properties"/* device_inject.c */
63#define kHidePartition"Hide Partition"/* disk.c */
64#define kRenamePartition"Rename Partition"/* disk.c */
65#define kSMBIOSKey"SMBIOS"/* fake_efi.c */
66#define kSystemID"SystemId"/* fake_efi.c */
67#define kSystemType"SystemType"/* fake_efi.c */
68#define kPCIRootUID"PCIRootUID"/* pci_root.c */
69#define kDefaultPartition"Default Partition"/* sys.c */
70
71enum {
72kBackspaceKey= 0x08,
73kTabKey= 0x09,
74kReturnKey= 0x0d,
75kEscapeKey= 0x1b,
76kUpArrowkey= 0x4800,
77kDownArrowkey= 0x5000,
78kASCIIKeyMask= 0x7f,
79kF5Key= 0x3f00,
80kF10Key= 0x4400
81};
82
83#define PLATFORM_NAME_LEN 64
84#define ROOT_PATH_LEN 256
85
86/*
87 * Flags to the booter or kernel
88 */
89#define kVerboseModeFlag"-v"
90#define kSafeModeFlag"-x"
91#define kIgnoreCachesFlag"-f"
92#define kSingleUserModeFlag"-s"
93#define kIgnorePrelinkKern "-F"
94#define kIgnoreBootFileFlag"-B"
95
96/*
97 * Booter behavior control
98 */
99#define kBootTimeout -1
100#define kCDBootTimeout 8
101
102/*
103 * A global set by boot() to record the device that the booter
104 * was loaded from.
105 */
106extern int gBIOSDev;
107extern long gBootMode;
108extern bool sysConfigValid;
109extern char bootBanner[];
110extern char bootPrompt[];
111extern bool gOverrideKernel;
112extern char gMKextName[];
113extern bool gEnableCDROMRescan;
114extern bool gScanSingleDrive;
115extern char *gPlatformName;
116extern char *gboardproduct;
117
118//extern char gRootPath[];
119
120extern char *gRootDevice;
121extern bool uuidSet;
122/*
123 * Boot Modes
124 */
125enum {
126 kBootModeNormal = 0,
127 kBootModeSafe = 1,
128 kBootModeSecure = 2,
129 kBootModeQuiet = 4
130};
131
132extern void initialize_runtime();
133extern void common_boot(int biosdev);
134extern unsigned long
135local_adler32( unsigned char * buffer, long length );
136
137
138/*
139 * graphics.c
140 */
141extern void printVBEModeInfo();
142#if UNUSED
143extern void setVideoMode(int mode, int drawgraphics);
144#else
145extern void setVideoMode(int mode);
146#endif
147#if TEXT_SPINNER
148extern void spinActivityIndicator();
149extern void clearActivityIndicator();
150#endif
151extern void drawColorRectangle( unsigned short x,
152 unsigned short y,
153 unsigned short width,
154 unsigned short height,
155 unsigned char colorIndex );
156extern void drawDataRectangle( unsigned short x,
157 unsigned short y,
158 unsigned short width,
159 unsigned short height,
160 unsigned char * data );
161extern int
162convertImage( unsigned short width,
163 unsigned short height,
164 const unsigned char *imageData,
165 unsigned char **newImageData );
166extern char * decodeRLE( const void * rleData, int rleBlocks, int outBytes );
167//extern void drawBootGraphics(void);
168extern void drawPreview(void *src, uint8_t * saveunder);
169extern int getVideoMode(void);
170extern void loadImageScale (void *input, int iw, int ih, int ip, void *output, int ow, int oh, int op, int or);
171
172/*
173 * drivers.c
174 */
175extern long LoadDrivers(char * dirSpec);
176extern long DecodeKernel(void *binary, entry_t *rentry, char **raddr, int *rsize);
177
178typedef long (*FileLoadDrivers_t)(char *dirSpec, long plugin);
179/*!
180 Hookable function pointer called during the driver loading phase that
181 allows other code to cause additional drivers to be loaded.
182 */
183extern struct multiboot_info *gMI;
184/*
185 * options.c
186 */
187extern int getBootOptions(bool firstRun);
188extern int processBootOptions();
189extern bool promptForRescanOption(void);
190extern bool copyArgument(const char *argName, const char *val, int cnt, char **argP, int *cntRemainingP);
191
192
193void showHelp();
194void showTextFile();
195char *getMemoryInfoString();
196void showMessage(char * message);
197
198typedef struct {
199 char name[80];
200 void * param;
201} MenuItem;
202
203/*
204 * lzss.c
205 */
206extern int decompress_lzss(u_int8_t *dst, u_int8_t *src, u_int32_t srclen);
207
208struct compressed_kernel_header {
209 u_int32_t signature;
210 u_int32_t compress_type;
211 u_int32_t adler32;
212 u_int32_t uncompressed_size;
213 u_int32_t compressed_size;
214 u_int32_t reserved[11];
215 char platform_name[PLATFORM_NAME_LEN];
216 char root_path[ROOT_PATH_LEN];
217 u_int8_t data[0];
218};
219typedef struct compressed_kernel_header compressed_kernel_header;
220
221#endif /* !__BOOT2_BOOT_H */
222

Archive Download this file

Revision: 1119