]> git.saurik.com Git - apple/boot.git/blame - i386/libsaio/saio_internal.h
boot-132.tar.gz
[apple/boot.git] / i386 / libsaio / saio_internal.h
CommitLineData
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
31extern void real_to_prot(void);
32extern void prot_to_real(void);
33extern void halt(void);
f083c6c3 34extern void startprog(unsigned int address, void *arg);
75b89a82 35extern void loader(UInt32 code, UInt32 cmdptr);
14c7c974
A
36
37/* bios.s */
75b89a82 38extern void bios(biosBuf_t *bb);
14c7c974
A
39
40/* biosfn.c */
41#ifdef EISA_SUPPORT
75b89a82 42extern BOOL eisa_present(void);
14c7c974 43#endif
75b89a82
A
44extern int bgetc(void);
45extern int biosread(int dev, int cyl, int head, int sec, int num);
46extern int ebiosread(int dev, long sec, int count);
57c72a9a 47extern int ebioswrite(int dev, long sec, int count);
f083c6c3 48extern int get_drive_info(int drive, struct driveInfo *dp);
75b89a82
A
49extern void putc(int ch);
50extern void putca(int ch, int attr, int repeat);
51extern int getc(void);
52extern int readKeyboardStatus(void);
57c72a9a 53extern int readKeyboardShiftFlags(void);
75b89a82 54extern unsigned int time18(void);
f083c6c3 55extern void delay(int ms);
75b89a82 56extern unsigned int get_diskinfo(int dev);
57c72a9a 57#if APM_SUPPORT
75b89a82
A
58extern int APMPresent(void);
59extern int APMConnect32(void);
57c72a9a 60#endif
75b89a82
A
61extern int memsize(int i);
62extern void video_mode(int mode);
63extern void setCursorPosition(int x, int y, int page);
64extern void setCursorType(int type);
65extern void getCursorPositionAndType(int *x, int *y, int *type);
66extern void scollPage(int x1, int y1, int x2, int y2, int attr, int rows, int dir);
67extern void clearScreenRows(int y1, int y2);
68extern void setActiveDisplayPage( int page );
f083c6c3
A
69extern unsigned long getMemoryMap(struct MemoryRange * rangeArray, unsigned long maxRangeCount,
70 unsigned long * conMemSizePtr, unsigned long * extMemSizePtr);
71extern unsigned long getExtendedMemorySize();
72extern unsigned long getConventionalMemorySize();
73extern void sleep(int n);
14c7c974
A
74
75/* bootstruct.c */
75b89a82 76extern void initKernBootStruct(int biosdev);
f083c6c3
A
77extern void reserveKernBootStruct(void);
78extern void copyKernBootStruct(void);
bba600dd 79extern void finalizeBootStruct(void);
75b89a82
A
80
81/* cache.c */
82extern void CacheInit(CICell ih, long blockSize);
83extern long CacheRead(CICell ih, char *buffer, long long offset,
84 long length, long cache);
14c7c974
A
85
86/* console.c */
75b89a82
A
87extern BOOL gVerboseMode;
88extern BOOL gErrors;
89extern void putchar(int ch);
90extern int getchar(void);
91extern int printf(const char *format, ...);
92extern int error(const char *format, ...);
93extern int verbose(const char *format, ...);
bba600dd 94extern void stop(const char *format, ...);
14c7c974
A
95
96/* disk.c */
75b89a82
A
97extern BVRef diskScanBootVolumes(int biosdev, int *count);
98extern void diskSeek(BVRef bvr, long long position);
99extern int diskRead(BVRef bvr, long addr, long length);
bba600dd 100extern int diskIsCDROM(BVRef bvr);
57c72a9a
A
101extern int rawDiskRead(BVRef bvr, unsigned int secno, void *buffer, unsigned int len);
102extern int rawDiskWrite(BVRef bvr, unsigned int secno, void *buffer, unsigned int len);
75b89a82 103extern int readBootSector(int biosdev, unsigned int secno, void *buffer);
f083c6c3 104extern void turnOffFloppy(void);
14c7c974 105
57c72a9a
A
106/* hfs_compare.c */
107extern void utf_encodestr( const u_int16_t * ucsp, int ucslen,
108 u_int8_t * utf8p, u_int32_t bufsize, int byte_order );
109extern 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
113extern char gHaveKernelCache;
114extern long ThinFatFile(void **binary, unsigned long *length);
115extern long DecodeMachO(void *binary, entry_t *rentry, char **raddr, int *rsize);
116
117/* memory.c */
118long AllocateKernelMemory( long inSize );
119long AllocateMemoryRange(char * rangeName, long start, long length, long type);
14c7c974
A
120
121/* misc.c */
75b89a82 122extern void enableA20(void);
bba600dd
A
123extern int checkForSupportedHardware();
124extern void getPlatformName(char *nameBuf);
75b89a82
A
125
126/* nbp.c */
127extern UInt32 nbpUnloadBaseCode();
128extern BVRef nbpScanBootVolumes(int biosdev, int *count);
14c7c974
A
129
130/* stringTable.c */
131extern char * newStringFromList(char **list, int *size);
75b89a82 132extern int stringLength(const char *table, int compress);
bba600dd 133extern BOOL getValueForConfigTableKey(const char *table, const char *key, const char **val, int *size);
14c7c974
A
134extern BOOL removeKeyFromTable(const char *key, char *table);
135extern char * newStringForStringTableKey(char *table, char *key);
136extern char * newStringForKey(char *key);
75b89a82
A
137extern BOOL getValueForBootKey(const char *line, const char *match, const char **matchval, int *len);
138extern BOOL getValueForKey(const char *key, const char **val, int *size);
57c72a9a 139extern BOOL getBoolForKey(const char *key, BOOL *val);
75b89a82 140extern BOOL getIntForKey(const char *key, int *val);
57c72a9a 141extern int loadConfigFile(const char *configFile);
75b89a82 142extern int loadSystemConfig(const char *which, int size);
f083c6c3 143extern char * newString(const char *oldString);
14c7c974
A
144
145/* sys.c */
57c72a9a
A
146extern BVRef getBootVolumeRef( const char * path, const char ** outPath );
147extern long LoadVolumeFile(BVRef bvr, const char *fileSpec);
75b89a82 148extern long LoadFile(const char *fileSpec);
57c72a9a
A
149extern long ReadFileAtOffset(const char * fileSpec, void *buffer, unsigned long offset, unsigned long length);
150extern long LoadThinFatFile(const char *fileSpec, void **binary);
75b89a82
A
151extern long GetDirEntry(const char *dirSpec, long *dirIndex, const char **name,
152 long *flags, long *time);
153extern long GetFileInfo(const char *dirSpec, const char *name,
154 long *flags, long *time);
57c72a9a 155extern long GetFileBlock(const char *fileSpec, unsigned long long *firstBlock);
bba600dd
A
156extern long GetFSUUID(char *spec, char *uuidStr);
157extern long CreateUUIDString(uint8_t uubytes[], int nbytes, char *uuidStr);
75b89a82
A
158extern int openmem(char *buf, int len);
159extern int open(const char *str, int how);
160extern int close(int fdesc);
161extern int file_size(int fdesc);
162extern int read(int fdesc, char *buf, int count);
163extern int b_lseek(int fdesc, int addr, int ptr);
164extern int tell(int fdesc);
165extern const char * usrDevices(void);
f083c6c3 166extern const char * systemConfigDir(void);
75b89a82 167extern struct dirstuff * opendir(const char *path);
57c72a9a 168extern struct dirstuff * vol_opendir(BVRef bvr, const char *path);
75b89a82
A
169extern int closedir(struct dirstuff *dirp);
170extern int readdir(struct dirstuff *dirp, const char **name, long *flags, long *time);
57c72a9a
A
171extern int readdir_ext(struct dirstuff * dirp, const char ** name, long * flags,
172 long * time, FinderInfo *finderInfo, long *infoValid);
75b89a82
A
173extern void flushdev(void);
174extern int currentdev(void);
175extern int switchdev(int dev);
176extern BVRef scanBootVolumes(int biosdev, int *count);
177extern BVRef selectBootVolume(BVRef chain);
57c72a9a 178extern void getBootVolumeDescription(BVRef bvr, char *str, long strMaxLen, BOOL verbose);
14c7c974 179
f083c6c3
A
180extern int gBIOSDev;
181extern int gBootFileType;
182
14c7c974 183#endif /* !__LIBSAIO_SAIO_INTERNAL_H */