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