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;
116//extern char gRootPath[];
117
118extern char *gRootDevice;
119extern bool uuidSet;
120/*
121 * Boot Modes
122 */
123enum {
124 kBootModeNormal = 0,
125 kBootModeSafe = 1,
126 kBootModeSecure = 2,
127 kBootModeQuiet = 4
128};
129
130extern void initialize_runtime();
131extern void common_boot(int biosdev);
132extern unsigned long
133local_adler32( unsigned char * buffer, long length );
134
135
136/*
137 * graphics.c
138 */
139extern void printVBEModeInfo();
140extern void setVideoMode(int mode, int drawgraphics);
141#if TEXT_SPINNER
142extern void spinActivityIndicator();
143extern void clearActivityIndicator();
144#endif
145extern void drawColorRectangle( unsigned short x,
146 unsigned short y,
147 unsigned short width,
148 unsigned short height,
149 unsigned char colorIndex );
150extern void drawDataRectangle( unsigned short x,
151 unsigned short y,
152 unsigned short width,
153 unsigned short height,
154 unsigned char * data );
155extern int
156convertImage( unsigned short width,
157 unsigned short height,
158 const unsigned char *imageData,
159 unsigned char **newImageData );
160extern char * decodeRLE( const void * rleData, int rleBlocks, int outBytes );
161extern void drawBootGraphics(void);
162extern void drawPreview(void *src, uint8_t * saveunder);
163extern int getVideoMode(void);
164extern void loadImageScale (void *input, int iw, int ih, int ip, void *output, int ow, int oh, int op, int or);
165
166/*
167 * drivers.c
168 */
169extern long LoadDrivers(char * dirSpec);
170extern long DecodeKernel(void *binary, entry_t *rentry, char **raddr, int *rsize);
171
172typedef long (*FileLoadDrivers_t)(char *dirSpec, long plugin);
173/*!
174 Hookable function pointer called during the driver loading phase that
175 allows other code to cause additional drivers to be loaded.
176 */
177extern struct multiboot_info *gMI;
178/*
179 * options.c
180 */
181extern int getBootOptions(bool firstRun);
182extern int processBootOptions();
183extern bool promptForRescanOption(void);
184extern bool copyArgument(const char *argName, const char *val, int cnt, char **argP, int *cntRemainingP);
185
186
187void showHelp();
188void showTextFile();
189char *getMemoryInfoString();
190void showMessage(char * message);
191
192typedef struct {
193 char name[80];
194 void * param;
195} MenuItem;
196
197/*
198 * lzss.c
199 */
200extern int decompress_lzss(u_int8_t *dst, u_int8_t *src, u_int32_t srclen);
201
202struct compressed_kernel_header {
203 u_int32_t signature;
204 u_int32_t compress_type;
205 u_int32_t adler32;
206 u_int32_t uncompressed_size;
207 u_int32_t compressed_size;
208 u_int32_t reserved[11];
209 char platform_name[PLATFORM_NAME_LEN];
210 char root_path[ROOT_PATH_LEN];
211 u_int8_t data[0];
212};
213typedef struct compressed_kernel_header compressed_kernel_header;
214
215#endif /* !__BOOT2_BOOT_H */
216

Archive Download this file

Revision: 789