]> git.saurik.com Git - apple/bootx.git/blame - bootx.tproj/include.subproj/sl.h
BootX-34.tar.gz
[apple/bootx.git] / bootx.tproj / include.subproj / sl.h
CommitLineData
04fee52e
A
1/*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
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.
11 *
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
18 * under the License.
19 *
20 * @APPLE_LICENSE_HEADER_END@
21 */
22/*
23 * sl.h - Headers for configuring the Secondary Loader
24 *
25 * Copyright (c) 1998-2000 Apple Computer, Inc.
26 *
27 * DRI: Josh de Cesare
28 */
29
30#ifndef _BOOTX_SL_H_
31#define _BOOTX_SL_H_
32
33#define kFailToBoot (1)
34
35#if ! defined(kMacOSXServer)
36#define kMacOSXServer (0)
37#endif
38
39/*
40
41Memory Map... Assumes 32 MB
42
43Physical Address
44
45Open Firmware Version 1x, 2x 3x
4600000000 - 00003FFF : Exception Vectors
4700004000 - 002FFFFF : Free Memory
4800300000 - 004FFFFF : OF Image / Free Memory
4900500000 - 01DFFFFF : Free Memory
5001E00000 - 01FFFFFF : Free Memory / OF Image
51
52
53Logical Address
54
5500000000 - 00003FFF : Exception Vectors
5600004000 - 013FFFFF : Kernal Image, Boot Struct and Drivers
5701400000 - 01BFFFFF : File Load Area
5801C00000 - 01CFFFFF : Secondary Loader Image
5901D00000 - 01DFFFFF : Malloc Area
6001E00000 - 01FFFFFF : Unused
61
62To provide a consistant Logical Memory Usage between OF 1,2 and OF 3
63the Logical Addresses 0x00300000 - 0x004FFFFF will be mapped to
64Physical Address 0x01E00000 - 0x01FFFFFF and will be copied back
65just before the kernel is loaded.
66
67
68*/
69
70#define kVectorAddr (0x00000000)
71#define kVectorSize (0x00004000)
72
73// OF 3.x
74#define kImageAddr (0x00004000)
75#define kImageSize (0x013FC000)
76
77// OF 1.x 2.x
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)
85
86#define kLoadAddr (0x01400000)
87#define kLoadSize (0x00800000)
88
89#define kMallocAddr (0x01D00000)
90#define kMallocSize (0x00100000)
91
92// Default Output Level
93#define kOutputLevelOff (0)
94#define kOutputLevelFull (16)
95
96// OF versions
97#define kOFVersion1x (0x01000000)
98#define kOFVersion2x (0x02000000)
99#define kOFVersion3x (0x03000000)
100
101// Device Types
102enum {
103 kUnknownDeviceType = 0,
104 kNetworkDeviceType,
105 kBlockDeviceType
106};
107
108// File Type
109enum {
110 kUnknownFileType = 0,
111 kFlatFileType,
112 kDirectoryFileType,
113 kLinkFileType
114};
115
116// Key Numbers
117#define kCommandKey (0x200)
118#define kOptKey (0x201)
119#define kShiftKey (0x202)
120#define kControlKey (0x203)
121
122// Mac OS X Booter Signature 'MOSX'
123#define kMacOSXSignature (0x4D4F5358)
124
125
126#include <bsd/sys/types.h>
127
128#include <ci.h>
129#include <sl_words.h>
130#include <libclite.h>
131#include <fs.h>
132#include <boot_args.h>
133
134// Externs for main.c
135extern char *gVectorSaveAddr;
136extern long gKernelEntryPoint;
137extern long gDeviceTreeAddr;
138extern long gDeviceTreeSize;
139extern long gBootArgsAddr;
140extern long gBootArgsSize;
141extern long gSymbolTableAddr;
142extern long gSymbolTableSize;
143
144extern long gBootDeviceType;
145extern long gBootFileType;
146extern char gBootDevice[256];
147extern char gBootFile[256];
148extern char gRootDir[256];
149
150extern char gTempStr[4096];
151
152extern long *gDeviceTreeMMTmp;
153
154extern long gOFVersion;
155
156extern char *gKeyMap;
157
158extern CICell gChosenPH;
159extern CICell gOptionsPH;
160extern CICell gScreenPH;
161extern CICell gMemoryMapPH;
162extern CICell gStdOutPH;
163
164extern CICell gMMUIH;
165extern CICell gMemoryIH;
166extern CICell gStdOutIH;
167extern CICell gKeyboardIH;
168
169extern long GetDeviceType(char *devSpec);
170extern long ConvertFileSpec(char *fileSpec, char *devSpec, char **filePath);
171extern long MatchThis(CICell phandle, char *string);
172extern void *AllocateBootXMemory(long size);
173extern long AllocateKernelMemory(long size);
174extern long AllocateMemoryRange(char *rangeName, long start, long length);
175extern unsigned long Alder32(unsigned char *buffer, long length);
176
177// Externs for macho.c
178extern long DecodeMachO(void);
179
180// Externs for elf.c
181extern long DecodeElf(void);
182
183// Externs for device_tree.c
184extern long FlattenDeviceTree(void);
185extern CICell SearchForNode(CICell ph, long top, char *prop, char *value);
186extern CICell SearchForNodeMatching(CICell ph, long top, char *value);
187
188// Externs for display.c
189extern long InitDisplays(void);
190extern long LoadDisplayDrivers(void);
191extern long DrawSplashScreen(void);
192extern long DrawBrokenSystemFolder(void);
193extern void GetMainScreenPH(Boot_Video_Ptr video);
194
195// Externs for drivers.c
196extern long LoadDrivers(char *dirPath);
197
198// Externs for config.c
199extern long InitConfig(void);
200extern long ParseConfigFile(char *addr);
201
202// Externs for PEFSupport.c
203extern unsigned long GetSymbolFromPEF(char *name, char *pef,
204 void *desc, long descSize);
205
206#endif /* ! _BOOTX_SL_H_ */