]> git.saurik.com Git - apple/boot.git/blame - i386/boot2/boot.h
boot-132.tar.gz
[apple/boot.git] / i386 / boot2 / boot.h
CommitLineData
14c7c974 1/*
57c72a9a 2 * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved.
14c7c974
A
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
57c72a9a 6 * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights
4f6e3300
A
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
57c72a9a 9 * Source License Version 2.0 (the "License"). You may not use this file
4f6e3300
A
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.
14c7c974
A
13 *
14 * The Original Code and all software distributed under the License are
4f6e3300 15 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14c7c974
A
16 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
17 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
4f6e3300
A
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.
14c7c974
A
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
75b89a82
A
32#include "libsaio.h"
33
14c7c974 34/*
57c72a9a 35 * Keys used in system Boot.plist
14c7c974 36 */
47b0a8bd 37#define kGraphicsModeKey "Graphics Mode"
75b89a82 38#define kTextModeKey "Text Mode"
47b0a8bd
A
39#define kBootGraphicsKey "Boot Graphics"
40#define kQuietBootKey "Quiet Boot"
41#define kKernelFlagsKey "Kernel Flags"
57c72a9a 42#define kMKextCacheKey "MKext Cache"
47b0a8bd 43#define kKernelNameKey "Kernel"
f083c6c3 44#define kKernelCacheKey "Kernel Cache"
57c72a9a
A
45#define kBootDeviceKey "Boot Device"
46#define kTimeoutKey "Timeout"
47#define kRootDeviceKey "rd"
bba600dd 48#define kBootUUIDKey "boot-uuid"
57c72a9a
A
49#define kPlatformKey "platform"
50#define kACPIKey "acpi"
bba600dd
A
51#define kCDROMPromptKey "CD-ROM Prompt"
52#define kCDROMOptionKey "CD-ROM Option Key"
53
57c72a9a
A
54#define kDefaultKernel "mach_kernel"
55
56/*
57 * Flags to the booter or kernel
58 *
59 */
60#define kVerboseModeFlag "-v"
bba600dd
A
61#define kSafeModeFlag "-x"
62#define kOldSafeModeFlag "-f"
57c72a9a
A
63#define kIgnoreBootFileFlag "-F"
64#define kSingleUserModeFlag "-s"
65
66/*
67 * Booter behavior control
68 */
bba600dd
A
69#define kBootTimeout -1
70#define kCDBootTimeout 8
14c7c974 71
14c7c974
A
72/*
73 * A global set by boot() to record the device that the booter
74 * was loaded from.
75 */
75b89a82 76extern int gBIOSDev;
75b89a82
A
77extern long gBootMode;
78extern BOOL sysConfigValid;
79extern char bootBanner[];
80extern char bootPrompt[];
57c72a9a
A
81extern BOOL gOverrideKernel;
82extern char *gPlatformName;
83extern char gMKextName[];
bba600dd 84extern char gRootDevice[];
57c72a9a 85extern BVRef gBootVolume;
75b89a82
A
86
87// Boot Modes
88enum {
89 kBootModeNormal = 0,
57c72a9a
A
90 kBootModeSafe = 1,
91 kBootModeSecure = 2,
92 kBootModeQuiet = 4
75b89a82 93};
14c7c974
A
94
95/*
47b0a8bd 96 * graphics.c
14c7c974 97 */
75b89a82 98extern void printVBEInfo();
57c72a9a 99extern void printVBEModeInfo();
75b89a82
A
100extern void setVideoMode(int mode);
101extern int getVideoMode();
14c7c974
A
102extern void spinActivityIndicator();
103extern void clearActivityIndicator();
57c72a9a
A
104extern void drawColorRectangle( unsigned short x,
105 unsigned short y,
106 unsigned short width,
107 unsigned short height,
108 unsigned char colorIndex );
109extern void drawDataRectangle( unsigned short x,
110 unsigned short y,
111 unsigned short width,
112 unsigned short height,
113 unsigned char * data );
114extern int
115convertImage( unsigned short width,
116 unsigned short height,
117 const unsigned char *imageData,
118 unsigned char **newImageData );
119extern char * decodeRLE( const void * rleData, int rleBlocks, int outBytes );
120extern void drawBootGraphics(void);
bba600dd 121extern int getVideoMode(void);
14c7c974 122
47b0a8bd
A
123/*
124 * drivers.c
125 */
126extern long LoadDrivers(char * dirSpec);
f083c6c3 127extern long DecodeKernel(void *binary, entry_t *rentry, char **raddr, int *rsize);
47b0a8bd 128
75b89a82
A
129/*
130 * options.c
131 */
57c72a9a 132extern int getBootOptions(BOOL firstRun);
75b89a82
A
133extern int processBootOptions();
134
f083c6c3
A
135/*
136 * lzss.c
137 */
138extern int decompress_lzss(u_int8_t *dst, u_int8_t *src, u_int32_t srclen);
139
140struct compressed_kernel_header {
141 u_int32_t signature;
142 u_int32_t compress_type;
143 u_int32_t adler32;
144 u_int32_t uncompressed_size;
145 u_int32_t compressed_size;
146 u_int32_t reserved[11];
147 char platform_name[64];
148 char root_path[256];
149 u_int8_t data[0];
150};
151typedef struct compressed_kernel_header compressed_kernel_header;
152
14c7c974 153#endif /* !__BOOT2_BOOT_H */