1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13:
14:
15: 16: 17: 18: 19:
20:
21: #ifndef __DEVICE_DISK_H__
22: #define __DEVICE_DISK_H__
23:
24: #include <basic.h>
25: #include <tk/devmgr.h>
26:
27: #ifdef __cplusplus
28: extern "C" {
29: #endif
30:
31:
32: typedef enum {
33: DN_DISKEVENT = TDN_EVENT, 34:
35: DN_DISKINFO = TDN_DISKINFO, 36:
37: DN_DISKINFO_D = TDN_DISKINFO_D, 38:
39: DN_DISKFORMAT = -100, 40:
41: DN_DISKINIT = -101, 42:
43: DN_DISKCMD = -102, 44:
45: DN_DISKMEMADR = -103, 46:
47: DN_DISKPARTINFO = -104, 48:
49: DN_DISKCHSINFO = -105, 50:
51: DN_DISKIDINFO = -106 52:
53: } DiskDataNo;
54:
55:
56: typedef enum {
57: DiskFmt_MEMINIT = -2,
58: DiskFmt_MEM = -1,
59: DiskFmt_STD = 0,
60: DiskFmt_2DD = 1,
61: DiskFmt_2HD = 2,
62: DiskFmt_VHD = 3,
63: DiskFmt_CDROM = 4,
64: DiskFmt_2HD12 = 0x12
65: } DiskFormat;
66:
67:
68: struct diskinfo {
69: DiskFormat format;
70: unsigned int protect:1;
71: unsigned int removable:1;
72: unsigned int rsv:30;
73: W blocksize;
74: W blockcont;
75: };
76: #ifndef __diskinfo__
77: #define __diskinfo__
78: typedef struct diskinfo DiskInfo;
79: #endif
80:
81:
82: struct diskinfo_d {
83: DiskFormat format;
84: unsigned int protect:1;
85: unsigned int removable:1;
86: unsigned int rsv:30;
87: W blocksize;
88: D blockcont_d;
89: };
90: #ifndef __diskinfo_d__
91: #define __diskinfo_d__
92: typedef struct diskinfo_d DiskInfo_D;
93: #endif
94:
95:
96: typedef enum {
97: DISKINIT = 1
98: } DiskInit;
99:
100:
101: typedef struct {
102: B clen;
103: UB cdb[12];
104: W dlen;
105: UB *data;
106: } DiskCmd;
107:
108:
109: typedef enum {
110: DSID_NONE = 0x00,
111: DSID_DOS1 = 0x01,
112: DSID_STDFS_X = 0x03,
113: DSID_DOS2 = 0x04,
114: DSID_DOSE = 0x05,
115: DSID_DOS3 = 0x06,
116: DSID_HPFS = 0x07,
117: DSID_FS = 0x08,
118: DSID_AIX = 0x09,
119: DSID_OS2 = 0x0A,
120: DSID_WIN95 = 0x0B,
121: DSID_WIN95L = 0x0C,
122: DSID_DOS3L = 0x0E,
123: DSID_DOS3E = 0x0F,
124: DSID_STDFS = 0x13,
125: DSID_VENIX = 0x40,
126: DSID_CPM1 = 0x52,
127: DSID_UNIX = 0x63,
128: DSID_NOVELL1 = 0x64,
129: DSID_NOVELL2 = 0x65,
130: DSID_PCIX = 0x75,
131: DSID_MINIX1 = 0x80,
132: DSID_MINIX2 = 0x81,
133: DSID_LINUX1 = 0x82,
134: DSID_LINUX2 = 0x83,
135: DSID_AMOEBA = 0x93,
136: DSID_BSDI = 0x9F,
137: DSID_386BSD = 0xA5,
138: DSID_CPM2 = 0xDB,
139: DSID_DOSSEC = 0xF2
140: } DiskSystemId;
141:
142: #define isSTDFS_SID(id) (((id) == DSID_STDFS )||( (id) == DSID_STDFS_X))
143:
144: typedef struct {
145: DiskSystemId systemid;
146: W startblock;
147: W endblock;
148: } DiskPartInfo;
149:
150:
151: typedef struct {
152: W cylinder;
153: W head;
154: W sector;
155: } DiskCHSInfo;
156:
157:
158: typedef struct {
159: T_DEVEVT_ID h;
160: UW info;
161: } DiskEvt;
162:
163:
164: typedef struct {
165: UB BootInd;
166: UB StartHead;
167: UB StartSec;
168: UB StartCyl;
169: UB SysInd;
170: UB EndHead;
171: UB EndSec;
172: UB EndCyl;
173: UH StartBlock[2];
174: UH BlockCnt[2];
175: } PartInfo;
176:
177: #define MAX_PARTITION 4
178:
179:
180: typedef struct {
181: VB boot_prog[0x1be];
182: PartInfo part[MAX_PARTITION];
183: UH signature;
184: } DiskBlock0;
185:
186: #ifdef __cplusplus
187: }
188: #endif
189: #endif