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