]>
Commit | Line | Data |
---|---|---|
14c7c974 | 1 | /* |
57c72a9a | 2 | * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved. |
14c7c974 A |
3 | * |
4 | * @APPLE_LICENSE_HEADER_START@ | |
5 | * | |
57c72a9a | 6 | * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights |
4f6e3300 A |
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 | |
57c72a9a | 9 | * Source License Version 2.0 (the "License"). You may not use this file |
4f6e3300 A |
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. | |
14c7c974 A |
13 | * |
14 | * The Original Code and all software distributed under the License are | |
4f6e3300 | 15 | * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER |
14c7c974 A |
16 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, |
17 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
4f6e3300 A |
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. | |
14c7c974 A |
21 | * |
22 | * @APPLE_LICENSE_HEADER_END@ | |
23 | */ | |
24 | ||
25 | #ifndef __LIBSAIO_SAIO_INTERNAL_H | |
26 | #define __LIBSAIO_SAIO_INTERNAL_H | |
27 | ||
28 | #include "saio_types.h" | |
29 | ||
30 | /* asm.s */ | |
75b89a82 A |
31 | extern void real_to_prot(void); |
32 | extern void prot_to_real(void); | |
33 | extern void halt(void); | |
f083c6c3 | 34 | extern void startprog(unsigned int address, void *arg); |
75b89a82 | 35 | extern void loader(UInt32 code, UInt32 cmdptr); |
14c7c974 A |
36 | |
37 | /* bios.s */ | |
75b89a82 | 38 | extern void bios(biosBuf_t *bb); |
14c7c974 A |
39 | |
40 | /* biosfn.c */ | |
41 | #ifdef EISA_SUPPORT | |
75b89a82 | 42 | extern BOOL eisa_present(void); |
14c7c974 | 43 | #endif |
75b89a82 A |
44 | extern int bgetc(void); |
45 | extern int biosread(int dev, int cyl, int head, int sec, int num); | |
46 | extern int ebiosread(int dev, long sec, int count); | |
57c72a9a | 47 | extern int ebioswrite(int dev, long sec, int count); |
f083c6c3 | 48 | extern int get_drive_info(int drive, struct driveInfo *dp); |
75b89a82 A |
49 | extern void putc(int ch); |
50 | extern void putca(int ch, int attr, int repeat); | |
51 | extern int getc(void); | |
52 | extern int readKeyboardStatus(void); | |
57c72a9a | 53 | extern int readKeyboardShiftFlags(void); |
75b89a82 | 54 | extern unsigned int time18(void); |
f083c6c3 | 55 | extern void delay(int ms); |
75b89a82 | 56 | extern unsigned int get_diskinfo(int dev); |
57c72a9a | 57 | #if APM_SUPPORT |
75b89a82 A |
58 | extern int APMPresent(void); |
59 | extern int APMConnect32(void); | |
57c72a9a | 60 | #endif |
75b89a82 A |
61 | extern int memsize(int i); |
62 | extern void video_mode(int mode); | |
63 | extern void setCursorPosition(int x, int y, int page); | |
64 | extern void setCursorType(int type); | |
65 | extern void getCursorPositionAndType(int *x, int *y, int *type); | |
66 | extern void scollPage(int x1, int y1, int x2, int y2, int attr, int rows, int dir); | |
67 | extern void clearScreenRows(int y1, int y2); | |
68 | extern void setActiveDisplayPage( int page ); | |
f083c6c3 A |
69 | extern unsigned long getMemoryMap(struct MemoryRange * rangeArray, unsigned long maxRangeCount, |
70 | unsigned long * conMemSizePtr, unsigned long * extMemSizePtr); | |
71 | extern unsigned long getExtendedMemorySize(); | |
72 | extern unsigned long getConventionalMemorySize(); | |
73 | extern void sleep(int n); | |
14c7c974 A |
74 | |
75 | /* bootstruct.c */ | |
75b89a82 | 76 | extern void initKernBootStruct(int biosdev); |
f083c6c3 A |
77 | extern void reserveKernBootStruct(void); |
78 | extern void copyKernBootStruct(void); | |
bba600dd | 79 | extern void finalizeBootStruct(void); |
75b89a82 A |
80 | |
81 | /* cache.c */ | |
82 | extern void CacheInit(CICell ih, long blockSize); | |
83 | extern long CacheRead(CICell ih, char *buffer, long long offset, | |
84 | long length, long cache); | |
14c7c974 A |
85 | |
86 | /* console.c */ | |
75b89a82 A |
87 | extern BOOL gVerboseMode; |
88 | extern BOOL gErrors; | |
89 | extern void putchar(int ch); | |
90 | extern int getchar(void); | |
91 | extern int printf(const char *format, ...); | |
92 | extern int error(const char *format, ...); | |
93 | extern int verbose(const char *format, ...); | |
bba600dd | 94 | extern void stop(const char *format, ...); |
14c7c974 A |
95 | |
96 | /* disk.c */ | |
75b89a82 A |
97 | extern BVRef diskScanBootVolumes(int biosdev, int *count); |
98 | extern void diskSeek(BVRef bvr, long long position); | |
99 | extern int diskRead(BVRef bvr, long addr, long length); | |
bba600dd | 100 | extern int diskIsCDROM(BVRef bvr); |
57c72a9a A |
101 | extern int rawDiskRead(BVRef bvr, unsigned int secno, void *buffer, unsigned int len); |
102 | extern int rawDiskWrite(BVRef bvr, unsigned int secno, void *buffer, unsigned int len); | |
75b89a82 | 103 | extern int readBootSector(int biosdev, unsigned int secno, void *buffer); |
f083c6c3 | 104 | extern void turnOffFloppy(void); |
14c7c974 | 105 | |
57c72a9a A |
106 | /* hfs_compare.c */ |
107 | extern void utf_encodestr( const u_int16_t * ucsp, int ucslen, | |
108 | u_int8_t * utf8p, u_int32_t bufsize, int byte_order ); | |
109 | extern void utf_decodestr(const u_int8_t *utf8p, u_int16_t *ucsp, | |
110 | u_int16_t *ucslen, u_int32_t bufsize, int byte_order ); | |
111 | ||
14c7c974 | 112 | /* load.c */ |
f083c6c3 A |
113 | extern char gHaveKernelCache; |
114 | extern long ThinFatFile(void **binary, unsigned long *length); | |
115 | extern long DecodeMachO(void *binary, entry_t *rentry, char **raddr, int *rsize); | |
116 | ||
117 | /* memory.c */ | |
118 | long AllocateKernelMemory( long inSize ); | |
119 | long AllocateMemoryRange(char * rangeName, long start, long length, long type); | |
14c7c974 A |
120 | |
121 | /* misc.c */ | |
75b89a82 | 122 | extern void enableA20(void); |
bba600dd A |
123 | extern int checkForSupportedHardware(); |
124 | extern void getPlatformName(char *nameBuf); | |
75b89a82 A |
125 | |
126 | /* nbp.c */ | |
127 | extern UInt32 nbpUnloadBaseCode(); | |
128 | extern BVRef nbpScanBootVolumes(int biosdev, int *count); | |
14c7c974 A |
129 | |
130 | /* stringTable.c */ | |
131 | extern char * newStringFromList(char **list, int *size); | |
75b89a82 | 132 | extern int stringLength(const char *table, int compress); |
bba600dd | 133 | extern BOOL getValueForConfigTableKey(const char *table, const char *key, const char **val, int *size); |
14c7c974 A |
134 | extern BOOL removeKeyFromTable(const char *key, char *table); |
135 | extern char * newStringForStringTableKey(char *table, char *key); | |
136 | extern char * newStringForKey(char *key); | |
75b89a82 A |
137 | extern BOOL getValueForBootKey(const char *line, const char *match, const char **matchval, int *len); |
138 | extern BOOL getValueForKey(const char *key, const char **val, int *size); | |
57c72a9a | 139 | extern BOOL getBoolForKey(const char *key, BOOL *val); |
75b89a82 | 140 | extern BOOL getIntForKey(const char *key, int *val); |
57c72a9a | 141 | extern int loadConfigFile(const char *configFile); |
75b89a82 | 142 | extern int loadSystemConfig(const char *which, int size); |
f083c6c3 | 143 | extern char * newString(const char *oldString); |
14c7c974 A |
144 | |
145 | /* sys.c */ | |
57c72a9a A |
146 | extern BVRef getBootVolumeRef( const char * path, const char ** outPath ); |
147 | extern long LoadVolumeFile(BVRef bvr, const char *fileSpec); | |
75b89a82 | 148 | extern long LoadFile(const char *fileSpec); |
57c72a9a A |
149 | extern long ReadFileAtOffset(const char * fileSpec, void *buffer, unsigned long offset, unsigned long length); |
150 | extern long LoadThinFatFile(const char *fileSpec, void **binary); | |
75b89a82 A |
151 | extern long GetDirEntry(const char *dirSpec, long *dirIndex, const char **name, |
152 | long *flags, long *time); | |
153 | extern long GetFileInfo(const char *dirSpec, const char *name, | |
154 | long *flags, long *time); | |
57c72a9a | 155 | extern long GetFileBlock(const char *fileSpec, unsigned long long *firstBlock); |
bba600dd A |
156 | extern long GetFSUUID(char *spec, char *uuidStr); |
157 | extern long CreateUUIDString(uint8_t uubytes[], int nbytes, char *uuidStr); | |
75b89a82 A |
158 | extern int openmem(char *buf, int len); |
159 | extern int open(const char *str, int how); | |
160 | extern int close(int fdesc); | |
161 | extern int file_size(int fdesc); | |
162 | extern int read(int fdesc, char *buf, int count); | |
163 | extern int b_lseek(int fdesc, int addr, int ptr); | |
164 | extern int tell(int fdesc); | |
165 | extern const char * usrDevices(void); | |
f083c6c3 | 166 | extern const char * systemConfigDir(void); |
75b89a82 | 167 | extern struct dirstuff * opendir(const char *path); |
57c72a9a | 168 | extern struct dirstuff * vol_opendir(BVRef bvr, const char *path); |
75b89a82 A |
169 | extern int closedir(struct dirstuff *dirp); |
170 | extern int readdir(struct dirstuff *dirp, const char **name, long *flags, long *time); | |
57c72a9a A |
171 | extern int readdir_ext(struct dirstuff * dirp, const char ** name, long * flags, |
172 | long * time, FinderInfo *finderInfo, long *infoValid); | |
75b89a82 A |
173 | extern void flushdev(void); |
174 | extern int currentdev(void); | |
175 | extern int switchdev(int dev); | |
176 | extern BVRef scanBootVolumes(int biosdev, int *count); | |
177 | extern BVRef selectBootVolume(BVRef chain); | |
57c72a9a | 178 | extern void getBootVolumeDescription(BVRef bvr, char *str, long strMaxLen, BOOL verbose); |
14c7c974 | 179 | |
f083c6c3 A |
180 | extern int gBIOSDev; |
181 | extern int gBootFileType; | |
182 | ||
14c7c974 | 183 | #endif /* !__LIBSAIO_SAIO_INTERNAL_H */ |