]> git.saurik.com Git - apple/boot.git/blob - i386/boot2/boot.h
dc7d3ab45a784447fa911760570ac771b557d231
[apple/boot.git] / 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 kBootGraphicsKey "Boot Graphics"
40 #define kQuietBootKey "Quiet Boot"
41 #define kKernelFlagsKey "Kernel Flags"
42 #define kMKextCacheKey "MKext Cache"
43 #define kKernelNameKey "Kernel"
44 #define kKernelCacheKey "Kernel Cache"
45 #define kBootDeviceKey "Boot Device"
46 #define kTimeoutKey "Timeout"
47 #define kRootDeviceKey "rd"
48 #define kPlatformKey "platform"
49 #define kACPIKey "acpi"
50 #define kDefaultKernel "mach_kernel"
51
52 /*
53 * Flags to the booter or kernel
54 *
55 */
56 #define kVerboseModeFlag "-v"
57 #define kSafeModeFlag "-f"
58 #define kIgnoreBootFileFlag "-F"
59 #define kSingleUserModeFlag "-s"
60
61 /*
62 * Booter behavior control
63 */
64 #define kBootTimeout 8
65
66 /*
67 * A global set by boot() to record the device that the booter
68 * was loaded from.
69 */
70 extern int gBIOSDev;
71 extern long gBootMode;
72 extern BOOL sysConfigValid;
73 extern char bootBanner[];
74 extern char bootPrompt[];
75 extern BOOL gOverrideKernel;
76 extern char *gPlatformName;
77 extern char gMKextName[];
78 extern BVRef gBootVolume;
79
80 // Boot Modes
81 enum {
82 kBootModeNormal = 0,
83 kBootModeSafe = 1,
84 kBootModeSecure = 2,
85 kBootModeQuiet = 4
86 };
87
88 /*
89 * graphics.c
90 */
91 extern void printVBEInfo();
92 extern void printVBEModeInfo();
93 extern void setVideoMode(int mode);
94 extern int getVideoMode();
95 extern void spinActivityIndicator();
96 extern void clearActivityIndicator();
97 extern void drawColorRectangle( unsigned short x,
98 unsigned short y,
99 unsigned short width,
100 unsigned short height,
101 unsigned char colorIndex );
102 extern void drawDataRectangle( unsigned short x,
103 unsigned short y,
104 unsigned short width,
105 unsigned short height,
106 unsigned char * data );
107 extern int
108 convertImage( unsigned short width,
109 unsigned short height,
110 const unsigned char *imageData,
111 unsigned char **newImageData );
112 extern char * decodeRLE( const void * rleData, int rleBlocks, int outBytes );
113 extern void drawBootGraphics(void);
114
115 /*
116 * drivers.c
117 */
118 extern long LoadDrivers(char * dirSpec);
119 extern long DecodeKernel(void *binary, entry_t *rentry, char **raddr, int *rsize);
120
121 /*
122 * options.c
123 */
124 extern int getBootOptions(BOOL firstRun);
125 extern int processBootOptions();
126
127 /*
128 * lzss.c
129 */
130 extern int decompress_lzss(u_int8_t *dst, u_int8_t *src, u_int32_t srclen);
131
132 struct compressed_kernel_header {
133 u_int32_t signature;
134 u_int32_t compress_type;
135 u_int32_t adler32;
136 u_int32_t uncompressed_size;
137 u_int32_t compressed_size;
138 u_int32_t reserved[11];
139 char platform_name[64];
140 char root_path[256];
141 u_int8_t data[0];
142 };
143 typedef struct compressed_kernel_header compressed_kernel_header;
144
145 #endif /* !__BOOT2_BOOT_H */