2 * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
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
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
22 * @APPLE_LICENSE_HEADER_END@
25 * Copyright 1994 NeXT Computer, Inc.
26 * All rights reserved.
29 #ifndef __BOOT2_BOOT_H
30 #define __BOOT2_BOOT_H
35 * Keys used in system Boot.plist
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 kBootUUIDKey "boot-uuid"
49 #define kPlatformKey "platform"
50 #define kACPIKey "acpi"
51 #define kCDROMPromptKey "CD-ROM Prompt"
52 #define kCDROMOptionKey "CD-ROM Option Key"
54 #define kDefaultKernel "mach_kernel"
57 * Flags to the booter or kernel
60 #define kVerboseModeFlag "-v"
61 #define kSafeModeFlag "-x"
62 #define kOldSafeModeFlag "-f"
63 #define kIgnoreBootFileFlag "-F"
64 #define kSingleUserModeFlag "-s"
67 * Booter behavior control
69 #define kBootTimeout -1
70 #define kCDBootTimeout 8
73 * A global set by boot() to record the device that the booter
77 extern long gBootMode
;
78 extern BOOL sysConfigValid
;
79 extern char bootBanner
[];
80 extern char bootPrompt
[];
81 extern BOOL gOverrideKernel
;
82 extern char *gPlatformName
;
83 extern char gMKextName
[];
84 extern char gRootDevice
[];
85 extern BVRef gBootVolume
;
98 extern void printVBEInfo();
99 extern void printVBEModeInfo();
100 extern void setVideoMode(int mode
);
101 extern int getVideoMode();
102 extern void spinActivityIndicator();
103 extern void clearActivityIndicator();
104 extern void drawColorRectangle( unsigned short x
,
106 unsigned short width
,
107 unsigned short height
,
108 unsigned char colorIndex
);
109 extern void drawDataRectangle( unsigned short x
,
111 unsigned short width
,
112 unsigned short height
,
113 unsigned char * data
);
115 convertImage( unsigned short width
,
116 unsigned short height
,
117 const unsigned char *imageData
,
118 unsigned char **newImageData
);
119 extern char * decodeRLE( const void * rleData
, int rleBlocks
, int outBytes
);
120 extern void drawBootGraphics(void);
121 extern int getVideoMode(void);
126 extern long LoadDrivers(char * dirSpec
);
127 extern long DecodeKernel(void *binary
, entry_t
*rentry
, char **raddr
, int *rsize
);
132 extern int getBootOptions(BOOL firstRun
);
133 extern int processBootOptions();
138 extern int decompress_lzss(u_int8_t
*dst
, u_int8_t
*src
, u_int32_t srclen
);
140 struct compressed_kernel_header
{
142 u_int32_t compress_type
;
144 u_int32_t uncompressed_size
;
145 u_int32_t compressed_size
;
146 u_int32_t reserved
[11];
147 char platform_name
[64];
151 typedef struct compressed_kernel_header compressed_kernel_header
;
153 #endif /* !__BOOT2_BOOT_H */