]>
git.saurik.com Git - apple/bootx.git/blob - bootx.tproj/include.subproj/sl.h
952ff4cc9adc5fb0deb3c77f2dffbc4483d7caed
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-2003 Apple Computer, Inc.
36 #define kFailToBoot (1)
40 Memory Map: assumes 96 MB
44 Open Firmware Version 3x, 4x, ...
45 00000000 - 00003FFF : Exception Vectors
46 00004000 - 057FFFFF : Free Memory
47 05800000 - 05FFFFFF : OF Image
52 00000000 - 00003FFF : Exception Vectors
53 00004000 - 03FFFFFF : Kernel Image, Boot Struct and Drivers
54 04000000 - 04FFFFFF : File Load Area
55 05000000 - 053FFFFF : FS Cache
56 05400000 - 055FFFFF : Malloc Zone
57 05600000 - 057FFFFF : BootX Image
58 05800000 - 05FFFFFF : Unused
62 #define kVectorAddr (0x00000000)
63 #define kVectorSize (0x00004000)
66 #define kImageAddr (0x00004000)
67 #define kImageSize (0x03FFC000)
70 #define kImageAddr0 (0x00004000)
71 #define kImageSize0 (0x002FC000)
72 #define kImageAddr1 (0x00300000)
73 #define kImageSize1 (0x00200000)
74 #define kImageAddr1Phys (0x05800000)
75 #define kImageAddr2 (0x00500000)
76 #define kImageSize2 (0x03B00000)
78 #define kLoadAddr (0x04000000)
79 #define kLoadSize (0x01000000)
81 #define kFSCacheAddr (0x05000000)
82 #define kFSCacheSize (0x00400000)
84 #define kMallocAddr (0x05400000)
85 #define kMallocSize (0x00200000)
87 // Default Output Level
88 #define kOutputLevelOff (0)
89 #define kOutputLevelFull (16)
92 #define kOFVersion1x (0x01000000)
93 #define kOFVersion2x (0x02000000)
94 #define kOFVersion3x (0x03000000)
95 #define kOFVersion4x (0x04000000)
99 kUnknownDeviceType
= 0,
104 // File Permissions and Types
106 kPermOtherExecute
= 1 << 0,
107 kPermOtherWrite
= 1 << 1,
108 kPermOtherRead
= 1 << 2,
109 kPermGroupExecute
= 1 << 3,
110 kPermGroupWrite
= 1 << 4,
111 kPermGroupRead
= 1 << 5,
112 kPermOwnerExecute
= 1 << 6,
113 kPermOwnerWrite
= 1 << 7,
114 kPermOwnerRead
= 1 << 8,
116 kOwnerNotRoot
= 1 << 9,
117 kFileTypeUnknown
= 0x0 << 16,
118 kFileTypeFlat
= 0x1 << 16,
119 kFileTypeDirectory
= 0x2 << 16,
120 kFileTypeLink
= 0x3 << 16,
121 kFileTypeMask
= 0x3 << 16
125 #define kCommandKey (0x200)
126 #define kOptKey (0x201)
127 #define kShiftKey (0x202)
128 #define kControlKey (0x203)
130 // Mac OS X Booter Signature 'MOSX'
131 #define kMacOSXSignature (0x4D4F5358)
140 #include <sys/stat.h>
141 #include <sys/types.h>
144 #include <sl_words.h>
145 #include <libclite.h>
147 #include <boot_args.h>
149 // Externs for main.c
150 extern char *gVectorSaveAddr
;
151 extern long gKernelEntryPoint
;
152 extern long gDeviceTreeAddr
;
153 extern long gDeviceTreeSize
;
154 extern long gBootArgsAddr
;
155 extern long gBootArgsSize
;
156 extern long gSymbolTableAddr
;
157 extern long gSymbolTableSize
;
159 extern long gBootMode
;
160 extern long gBootDeviceType
;
161 extern long gBootFileType
;
162 extern char gBootDevice
[256];
163 extern char gBootFile
[256];
164 extern char gRootDir
[256];
166 extern char gTempStr
[4096];
168 extern long *gDeviceTreeMMTmp
;
170 extern long gOFVersion
;
172 extern char *gKeyMap
;
174 extern long gRootAddrCells
;
175 extern long gRootSizeCells
;
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 ThinFatBinary(void **binary
, unsigned long *length
);
189 extern long GetDeviceType(char *devSpec
);
190 extern long ConvertFileSpec(char *fileSpec
, char *devSpec
, char **filePath
);
191 extern long MatchThis(CICell phandle
, char *string
);
192 extern void *AllocateBootXMemory(long size
);
193 extern long AllocateKernelMemory(long size
);
194 extern long AllocateMemoryRange(char *rangeName
, long start
, long length
);
195 extern unsigned long Alder32(unsigned char *buffer
, long length
);
197 // Externs for macho.c
198 extern long ThinFatBinaryMachO(void **binary
, unsigned long *length
);
199 extern long DecodeMachO(void *binary
);
202 extern long ThinFatBinaryElf(void **binary
, unsigned long *length
);
203 extern long DecodeElf(void *binary
);
205 // Externs for device_tree.c
206 extern long FlattenDeviceTree(void);
207 extern CICell
SearchForNode(CICell ph
, long top
, char *prop
, char *value
);
208 extern CICell
SearchForNodeMatching(CICell ph
, long top
, char *value
);
210 // Externs for display.c
211 extern long InitDisplays(void);
212 extern long DrawSplashScreen(long stage
);
213 extern long DrawFailedBootPicture(void);
214 extern void GetMainScreenPH(Boot_Video_Ptr video
);
216 // Externs for drivers.c
217 extern long LoadDrivers(char *dirPath
);
219 // Externs for config.c
220 extern long InitConfig(void);
221 extern long ParseConfigFile(char *addr
);
223 #endif /* ! _BOOTX_SL_H_ */