2 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights
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
9 * Source License Version 1.1 (the "License"). You may not use this file
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
14 * The Original Code and all software distributed under the License are
15 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
16 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
17 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the
19 * License for the specific language governing rights and limitations
22 * @APPLE_LICENSE_HEADER_END@
26 #ifndef __LIBSAIO_SAIO_TYPES_H
27 #define __LIBSAIO_SAIO_TYPES_H
29 #include <sys/reboot.h>
30 #include <sys/types.h>
35 #define DEBUG_DISK(x) printf x
44 typedef unsigned long entry_t
;
47 unsigned int sectors
:8;
49 unsigned int cylinders
:16;
52 struct driveParameters
{
60 typedef struct BootVolume
* BVRef
;
61 typedef struct BootVolume
* CICell
;
63 typedef long (*FSInit
)(CICell ih
);
64 typedef long (*FSLoadFile
)(CICell ih
, char * filePath
);
65 typedef long (*FSGetDirEntry
)(CICell ih
, char * dirPath
, long * dirIndex
,
66 char ** name
, long * flags
, long * time
);
67 typedef void (*BVGetDescription
)(CICell ih
, char * str
, long strMaxLen
);
70 unsigned int i_flgs
; /* see F_* below */
71 unsigned int i_offset
; /* seek byte offset in file */
72 int i_filesize
; /* size of file */
73 char * i_buf
; /* file load address */
76 #define F_READ 0x1 /* file opened for reading */
77 #define F_WRITE 0x2 /* file opened for writing */
78 #define F_ALLOC 0x4 /* buffer allocated */
79 #define F_FILE 0x8 /* file instead of device */
80 #define F_NBSF 0x10 /* no bad sector forwarding */
81 #define F_SSI 0x40 /* set skip sector inhibit */
82 #define F_MEM 0x80 /* memory instead of file or device */
85 char * dir_path
; /* directory path */
86 long dir_index
; /* directory entry index */
87 BVRef dir_bvr
; /* volume reference */
91 BVRef next
; /* list linkage pointer */
92 int biosdev
; /* BIOS device number */
93 unsigned int flags
; /* attribute flags */
94 BVGetDescription description
; /* BVGetDescription function */
95 int part_no
; /* partition number (1 based) */
96 unsigned int part_boff
; /* partition block offset */
97 unsigned int part_type
; /* partition type */
98 unsigned int fs_boff
; /* 1st block # of next read */
99 FSLoadFile fs_loadfile
; /* FSLoadFile function */
100 FSGetDirEntry fs_getdirentry
; /* FSGetDirEntry function */
104 kBVFlagPrimary
= 0x01,
105 kBVFlagNativeBoot
= 0x02,
106 kBVFlagForeignBoot
= 0x04
110 kBIOSDevTypeFloppy
= 0x00,
111 kBIOSDevTypeHardDrive
= 0x80,
112 kBIOSDevTypeNetwork
= 0xE0,
113 kBIOSDevUnitMask
= 0x0F,
114 kBIOSDevTypeMask
= 0xF0,
118 #define BIOS_DEV_TYPE(d) ((d) & kBIOSDevTypeMask)
119 #define BIOS_DEV_UNIT(d) ((d) & kBIOSDevUnitMask)
122 * KernBootStruct device types.
132 #define max(a,b) ((a) > (b) ? (a) : (b))
136 #define min(a,b) ((a) < (b) ? (a) : (b))
139 #define MAKEKERNDEV(t, u, p) MAKEBOOTDEV(t, 0, 0, u, p)
141 #endif /* !__LIBSAIO_SAIO_TYPES_H */