]>
git.saurik.com Git - apple/bootx.git/blob - bootx.tproj/include.subproj/sl.h
ecaba857261a1064a3ecaedda12b2b072f6a692c
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
23 * sl.h - Headers for configuring the Secondary Loader
25 * Copyright (c) 1998-2000 Apple Computer, Inc.
33 #define kFailToBoot (1)
35 #if ! defined(kMacOSXServer)
36 #define kMacOSXServer (0)
41 Memory Map... Assumes 32 MB
45 Open Firmware Version 1x, 2x 3x
46 00000000 - 00003FFF : Exception Vectors
47 00004000 - 002FFFFF : Free Memory
48 00300000 - 004FFFFF : OF Image / Free Memory
49 00500000 - 01DFFFFF : Free Memory
50 01E00000 - 01FFFFFF : Free Memory / OF Image
55 00000000 - 00003FFF : Exception Vectors
56 00004000 - 013FFFFF : Kernal Image, Boot Struct and Drivers
57 01400000 - 01BFFFFF : File Load Area
58 01C00000 - 01CFFFFF : Secondary Loader Image
59 01D00000 - 01DFFFFF : Malloc Area
60 01E00000 - 01FFFFFF : Unused
62 To provide a consistant Logical Memory Usage between OF 1,2 and OF 3
63 the Logical Addresses 0x00300000 - 0x004FFFFF will be mapped to
64 Physical Address 0x01E00000 - 0x01FFFFFF and will be copied back
65 just before the kernel is loaded.
70 #define kVectorAddr (0x00000000)
71 #define kVectorSize (0x00004000)
74 #define kImageAddr (0x00004000)
75 #define kImageSize (0x013FC000)
78 #define kImageAddr0 (0x00004000)
79 #define kImageSize0 (0x002FC000)
80 #define kImageAddr1 (0x00300000)
81 #define kImageSize1 (0x00200000)
82 #define kImageAddr1Phys (0x01E00000)
83 #define kImageAddr2 (0x00500000)
84 #define kImageSize2 (0x00F00000)
86 #define kLoadAddr (0x01400000)
87 #define kLoadSize (0x00800000)
89 #define kMallocAddr (0x01D00000)
90 #define kMallocSize (0x00100000)
92 // Default Output Level
93 #define kOutputLevelOff (0)
94 #define kOutputLevelFull (16)
97 #define kOFVersion1x (0x01000000)
98 #define kOFVersion2x (0x02000000)
99 #define kOFVersion3x (0x03000000)
103 kUnknownDeviceType
= 0,
110 kUnknownFileType
= 0,
117 #define kCommandKey (0x200)
118 #define kOptKey (0x201)
119 #define kShiftKey (0x202)
120 #define kControlKey (0x203)
122 // Mac OS X Booter Signature 'MOSX'
123 #define kMacOSXSignature (0x4D4F5358)
126 #include <bsd/sys/types.h>
129 #include <sl_words.h>
130 #include <libclite.h>
132 #include <boot_args.h>
134 // Externs for main.c
135 extern char *gVectorSaveAddr
;
136 extern long gKernelEntryPoint
;
137 extern long gDeviceTreeAddr
;
138 extern long gDeviceTreeSize
;
139 extern long gBootArgsAddr
;
140 extern long gBootArgsSize
;
141 extern long gSymbolTableAddr
;
142 extern long gSymbolTableSize
;
144 extern long gBootDeviceType
;
145 extern long gBootFileType
;
146 extern char gBootDevice
[256];
147 extern char gBootFile
[256];
148 extern char gRootDir
[256];
150 extern char gTempStr
[4096];
152 extern long *gDeviceTreeMMTmp
;
154 extern long gOFVersion
;
156 extern char *gKeyMap
;
158 extern CICell gChosenPH
;
159 extern CICell gOptionsPH
;
160 extern CICell gScreenPH
;
161 extern CICell gMemoryMapPH
;
162 extern CICell gStdOutPH
;
164 extern CICell gMMUIH
;
165 extern CICell gMemoryIH
;
166 extern CICell gStdOutIH
;
167 extern CICell gKeyboardIH
;
169 extern long GetDeviceType(char *devSpec
);
170 extern long ConvertFileSpec(char *fileSpec
, char *devSpec
, char **filePath
);
171 extern long MatchThis(CICell phandle
, char *string
);
172 extern void *AllocateBootXMemory(long size
);
173 extern long AllocateKernelMemory(long size
);
174 extern long AllocateMemoryRange(char *rangeName
, long start
, long length
);
175 extern unsigned long Alder32(unsigned char *buffer
, long length
);
177 // Externs for macho.c
178 extern long DecodeMachO(void);
181 extern long DecodeElf(void);
183 // Externs for device_tree.c
184 extern long FlattenDeviceTree(void);
185 extern CICell
SearchForNode(CICell ph
, long top
, char *prop
, char *value
);
186 extern CICell
SearchForNodeMatching(CICell ph
, long top
, char *value
);
188 // Externs for display.c
189 extern long InitDisplays(void);
190 extern long LoadDisplayDrivers(void);
191 extern long DrawSplashScreen(void);
192 extern long DrawBrokenSystemFolder(void);
193 extern void GetMainScreenPH(Boot_Video_Ptr video
);
195 // Externs for drivers.c
196 extern long LoadDrivers(char *dirPath
);
198 // Externs for config.c
199 extern long InitConfig(void);
200 extern long ParseConfigFile(char *addr
);
202 // Externs for PEFSupport.c
203 extern unsigned long GetSymbolFromPEF(char *name
, char *pef
,
204 void *desc
, long descSize
);
206 #endif /* ! _BOOTX_SL_H_ */