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 | void boot(int biosdev);␊ |
35 | ␊ |
36 | enum {␊ |
37 | ␉kBackspaceKey␉= 0x08,␊ |
38 | ␉kTabKey␉␉␉= 0x09,␊ |
39 | ␉kReturnKey␉␉= 0x0d,␊ |
40 | ␉kEscapeKey␉␉= 0x1b,␊ |
41 | ␉kUpArrowkey␉␉= 0x4800, ␊ |
42 | ␉kDownArrowkey␉= 0x5000,␊ |
43 | ␉kASCIIKeyMask␉= 0x7f,␊ |
44 | ␉kF5Key␉␉␉= 0x3f00,␊ |
45 | ␉kF10Key␉␉␉= 0x4400␊ |
46 | };␊ |
47 | ␊ |
48 | ␊ |
49 | ␊ |
50 | /*␊ |
51 | * Flags to the booter or kernel␊ |
52 | */␊ |
53 | #define kVerboseModeFlag␉"-v"␊ |
54 | #define kSafeModeFlag␉␉"-x"␊ |
55 | #define kIgnoreCachesFlag␉"-f"␊ |
56 | #define kSingleUserModeFlag␉"-s"␊ |
57 | #define kIgnorePrelinkKern "-F"␊ |
58 | #define kIgnoreBootFileFlag␉"-B"␊ |
59 | ␊ |
60 | /*␊ |
61 | * Booter behavior control␊ |
62 | */␊ |
63 | #define kBootTimeout -1␊ |
64 | #define kCDBootTimeout 8␊ |
65 | ␊ |
66 | /*␊ |
67 | * A global set by boot() to record the device that the booter␊ |
68 | * was loaded from.␊ |
69 | */␊ |
70 | #define Cache_len_name 512␊ |
71 | ␊ |
72 | /*␊ |
73 | * Boot Modes␊ |
74 | */␊ |
75 | enum {␊ |
76 | kBootModeNormal = 0,␊ |
77 | kBootModeSafe = 1,␊ |
78 | kBootModeSecure = 2,␊ |
79 | kBootModeQuiet = 4␊ |
80 | };␊ |
81 | ␊ |
82 | extern void initialize_runtime(void);␊ |
83 | extern void common_boot(int biosdev);␊ |
84 | extern BVRef getBvChain(void);␊ |
85 | ␊ |
86 | /*␊ |
87 | * drivers.c␊ |
88 | */␊ |
89 | extern long LoadDrivers(char * dirSpec);␊ |
90 | extern long DecodeKernel(void *binary, entry_t *rentry, char **raddr, int *rsize);␊ |
91 | ␊ |
92 | typedef long (*FileLoadDrivers_t)(char *dirSpec, long plugin);␊ |
93 | /*!␊ |
94 | Hookable function pointer called during the driver loading phase that␊ |
95 | allows other code to cause additional drivers to be loaded.␊ |
96 | */␊ |
97 | //extern struct multiboot_info *gMI;␊ |
98 | ␊ |
99 | ␊ |
100 | struct compressed_kernel_header {␊ |
101 | u_int32_t signature;␊ |
102 | u_int32_t compress_type;␊ |
103 | u_int32_t adler32;␊ |
104 | u_int32_t uncompressed_size;␊ |
105 | u_int32_t compressed_size;␊ |
106 | u_int32_t reserved[11];␊ |
107 | char platform_name[PLATFORM_NAME_LEN];␊ |
108 | char root_path[ROOT_PATH_LEN];␊ |
109 | u_int8_t data[0];␊ |
110 | };␊ |
111 | typedef struct compressed_kernel_header compressed_kernel_header;␊ |
112 | ␊ |
113 | /*␊ |
114 | * prompt.c␊ |
115 | */␊ |
116 | extern void InitBootPrompt(void);␊ |
117 | ␊ |
118 | #endif /* !__BOOT2_BOOT_H */␊ |
119 | |