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 | ␊ |
71 | enum {␊ |
72 | ␉kBackspaceKey␉= 0x08,␊ |
73 | ␉kTabKey␉␉␉= 0x09,␊ |
74 | ␉kReturnKey␉␉= 0x0d,␊ |
75 | ␉kEscapeKey␉␉= 0x1b,␊ |
76 | ␉kUpArrowkey␉␉= 0x4800, ␊ |
77 | ␉kDownArrowkey␉= 0x5000,␊ |
78 | ␉kASCIIKeyMask␉= 0x7f,␊ |
79 | ␉kF5Key␉␉␉= 0x3f00,␊ |
80 | ␉kF10Key␉␉␉= 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 | */␊ |
106 | extern int gBIOSDev;␊ |
107 | extern long gBootMode;␊ |
108 | extern bool sysConfigValid;␊ |
109 | extern char bootBanner[];␊ |
110 | extern char bootPrompt[];␊ |
111 | extern bool gOverrideKernel;␊ |
112 | extern char gMKextName[];␊ |
113 | extern bool gEnableCDROMRescan;␊ |
114 | extern bool gScanSingleDrive;␊ |
115 | extern char *gPlatformName;␊ |
116 | //extern char gRootPath[];␊ |
117 | ␊ |
118 | extern char *gRootDevice;␊ |
119 | extern bool uuidSet;␊ |
120 | /*␊ |
121 | * Boot Modes␊ |
122 | */␊ |
123 | enum {␊ |
124 | kBootModeNormal = 0,␊ |
125 | kBootModeSafe = 1,␊ |
126 | kBootModeSecure = 2,␊ |
127 | kBootModeQuiet = 4␊ |
128 | };␊ |
129 | ␊ |
130 | extern void initialize_runtime();␊ |
131 | extern void common_boot(int biosdev);␊ |
132 | extern unsigned long␊ |
133 | local_adler32( unsigned char * buffer, long length );␊ |
134 | ␊ |
135 | ␊ |
136 | /*␊ |
137 | * graphics.c␊ |
138 | */␊ |
139 | extern void printVBEModeInfo();␊ |
140 | extern void setVideoMode(int mode, int drawgraphics);␊ |
141 | #if TEXT_SPINNER␊ |
142 | extern void spinActivityIndicator();␊ |
143 | extern void clearActivityIndicator();␊ |
144 | #endif␊ |
145 | extern void drawColorRectangle( unsigned short x,␊ |
146 | unsigned short y,␊ |
147 | unsigned short width,␊ |
148 | unsigned short height,␊ |
149 | unsigned char colorIndex );␊ |
150 | extern void drawDataRectangle( unsigned short x,␊ |
151 | unsigned short y,␊ |
152 | unsigned short width,␊ |
153 | unsigned short height,␊ |
154 | unsigned char * data );␊ |
155 | extern int␊ |
156 | convertImage( unsigned short width,␊ |
157 | unsigned short height,␊ |
158 | const unsigned char *imageData,␊ |
159 | unsigned char **newImageData );␊ |
160 | extern char * decodeRLE( const void * rleData, int rleBlocks, int outBytes );␊ |
161 | extern void drawBootGraphics(void);␊ |
162 | extern void drawPreview(void *src, uint8_t * saveunder);␊ |
163 | extern int getVideoMode(void);␊ |
164 | extern 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 | */␊ |
169 | extern long LoadDrivers(char * dirSpec);␊ |
170 | extern long DecodeKernel(void *binary, entry_t *rentry, char **raddr, int *rsize);␊ |
171 | ␊ |
172 | typedef 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 | */␊ |
177 | extern struct multiboot_info *gMI;␊ |
178 | /*␊ |
179 | * options.c␊ |
180 | */␊ |
181 | extern int getBootOptions(bool firstRun);␊ |
182 | extern int processBootOptions();␊ |
183 | extern bool promptForRescanOption(void);␊ |
184 | extern bool copyArgument(const char *argName, const char *val, int cnt, char **argP, int *cntRemainingP);␊ |
185 | ␊ |
186 | ␊ |
187 | void showHelp();␊ |
188 | void showTextFile();␊ |
189 | char *getMemoryInfoString();␊ |
190 | void showMessage(char * message);␊ |
191 | ␊ |
192 | typedef struct {␊ |
193 | char name[80];␊ |
194 | void * param;␊ |
195 | } MenuItem;␊ |
196 | ␊ |
197 | /*␊ |
198 | * lzss.c␊ |
199 | */␊ |
200 | extern int decompress_lzss(u_int8_t *dst, u_int8_t *src, u_int32_t srclen);␊ |
201 | ␊ |
202 | struct 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 | };␊ |
213 | typedef struct compressed_kernel_header compressed_kernel_header;␊ |
214 | ␊ |
215 | #endif /* !__BOOT2_BOOT_H */␊ |
216 | |