]>
git.saurik.com Git - apple/bootx.git/blob - bootx.tproj/include.subproj/sl.h
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
23 * @APPLE_LICENSE_HEADER_END@
26 * sl.h - Headers for configuring the Secondary Loader
28 * Copyright (c) 1998-2002 Apple Computer, Inc.
36 #define kFailToBoot (1)
40 Memory Map... Assumes 32 MB
44 Open Firmware Version 1x, 2x 3x
45 00000000 - 00003FFF : Exception Vectors
46 00004000 - 002FFFFF : Free Memory
47 00300000 - 004FFFFF : OF Image / Free Memory
48 00500000 - 01DFFFFF : Free Memory
49 01E00000 - 01FFFFFF : Free Memory / OF Image
54 00000000 - 00003FFF : Exception Vectors
55 00004000 - 013FFFFF : Kernel Image, Boot Struct and Drivers
56 01400000 - 01BFFFFF : File Load Area
57 01C00000 - 01CFFFFF : Secondary Loader Image
58 01D00000 - 01DFFFFF : Malloc Area
59 01E00000 - 01FFFFFF : Unused
61 To provide a consistant Logical Memory Usage between OF 1,2 and OF 3
62 the Logical Addresses 0x00300000 - 0x004FFFFF will be mapped to
63 Physical Address 0x01E00000 - 0x01FFFFFF and will be copied back
64 just before the kernel is loaded.
69 #define kVectorAddr (0x00000000)
70 #define kVectorSize (0x00004000)
73 #define kImageAddr (0x00004000)
74 #define kImageSize (0x013FC000)
77 #define kImageAddr0 (0x00004000)
78 #define kImageSize0 (0x002FC000)
79 #define kImageAddr1 (0x00300000)
80 #define kImageSize1 (0x00200000)
81 #define kImageAddr1Phys (0x01E00000)
82 #define kImageAddr2 (0x00500000)
83 #define kImageSize2 (0x00F00000)
85 #define kLoadAddr (0x01400000)
86 #define kLoadSize (0x00800000)
88 #define kMallocAddr (0x01D00000)
89 #define kMallocSize (0x00100000)
91 // Default Output Level
92 #define kOutputLevelOff (0)
93 #define kOutputLevelFull (16)
96 #define kOFVersion1x (0x01000000)
97 #define kOFVersion2x (0x02000000)
98 #define kOFVersion3x (0x03000000)
102 kUnknownDeviceType
= 0,
107 // File Permissions and Types
109 kPermOtherExecute
= 1 << 0,
110 kPermOtherWrite
= 1 << 1,
111 kPermOtherRead
= 1 << 2,
112 kPermGroupExecute
= 1 << 3,
113 kPermGroupWrite
= 1 << 4,
114 kPermGroupRead
= 1 << 5,
115 kPermOwnerExecute
= 1 << 6,
116 kPermOwnerWrite
= 1 << 7,
117 kPermOwnerRead
= 1 << 8,
119 kOwnerNotRoot
= 1 << 9,
120 kFileTypeUnknown
= 0x0 << 16,
121 kFileTypeFlat
= 0x1 << 16,
122 kFileTypeDirectory
= 0x2 << 16,
123 kFileTypeLink
= 0x3 << 16,
124 kFileTypeMask
= 0x3 << 16
128 #define kCommandKey (0x200)
129 #define kOptKey (0x201)
130 #define kShiftKey (0x202)
131 #define kControlKey (0x203)
133 // Mac OS X Booter Signature 'MOSX'
134 #define kMacOSXSignature (0x4D4F5358)
143 #include <sys/stat.h>
144 #include <sys/types.h>
147 #include <sl_words.h>
148 #include <libclite.h>
150 #include <boot_args.h>
152 // Externs for main.c
153 extern char *gVectorSaveAddr
;
154 extern long gKernelEntryPoint
;
155 extern long gDeviceTreeAddr
;
156 extern long gDeviceTreeSize
;
157 extern long gBootArgsAddr
;
158 extern long gBootArgsSize
;
159 extern long gSymbolTableAddr
;
160 extern long gSymbolTableSize
;
162 extern long gBootMode
;
163 extern long gBootDeviceType
;
164 extern long gBootFileType
;
165 extern char gBootDevice
[256];
166 extern char gBootFile
[256];
167 extern char gRootDir
[256];
169 extern char gTempStr
[4096];
171 extern long *gDeviceTreeMMTmp
;
173 extern long gOFVersion
;
175 extern char *gKeyMap
;
177 extern CICell gChosenPH
;
178 extern CICell gOptionsPH
;
179 extern CICell gScreenPH
;
180 extern CICell gMemoryMapPH
;
181 extern CICell gStdOutPH
;
183 extern CICell gMMUIH
;
184 extern CICell gMemoryIH
;
185 extern CICell gStdOutIH
;
186 extern CICell gKeyboardIH
;
188 extern long GetDeviceType(char *devSpec
);
189 extern long ConvertFileSpec(char *fileSpec
, char *devSpec
, char **filePath
);
190 extern long MatchThis(CICell phandle
, char *string
);
191 extern void *AllocateBootXMemory(long size
);
192 extern long AllocateKernelMemory(long size
);
193 extern long AllocateMemoryRange(char *rangeName
, long start
, long length
);
194 extern unsigned long Alder32(unsigned char *buffer
, long length
);
196 // Externs for macho.c
197 extern long DecodeMachO(void);
200 extern long DecodeElf(void);
202 // Externs for device_tree.c
203 extern long FlattenDeviceTree(void);
204 extern CICell
SearchForNode(CICell ph
, long top
, char *prop
, char *value
);
205 extern CICell
SearchForNodeMatching(CICell ph
, long top
, char *value
);
207 // Externs for display.c
208 extern long InitDisplays(void);
209 extern long DrawSplashScreen(long stage
);
210 extern long DrawFailedBootPicture(void);
211 extern void GetMainScreenPH(Boot_Video_Ptr video
);
213 // Externs for drivers.c
214 extern long LoadDrivers(char *dirPath
);
216 // Externs for config.c
217 extern long InitConfig(void);
218 extern long ParseConfigFile(char *addr
);
220 #endif /* ! _BOOTX_SL_H_ */