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