Mercurial > hg > Members > kono > nitros9-code
annotate defs/rbfdefs @ 1200:0a678473d5cf
Major overhaul of headers to 'new' style
author | boisy |
---|---|
date | Mon, 02 Jun 2003 20:42:40 +0000 |
parents | 4e48403790f0 |
children | 383d5981c23f |
rev | line source |
---|---|
1199 | 1 IFEQ RBFDEFS |
373
c07686556109
Added ifeq statements at top to allow for multiple use's of same def
boisy
parents:
71
diff
changeset
|
2 |
c07686556109
Added ifeq statements at top to allow for multiple use's of same def
boisy
parents:
71
diff
changeset
|
3 RBFDEFS set 1 |
c07686556109
Added ifeq statements at top to allow for multiple use's of same def
boisy
parents:
71
diff
changeset
|
4 |
1200 | 5 ******************************************************************** |
6 * RBFDefs - Random Block File Manager Definitions | |
0 | 7 * |
1200 | 8 * $Id$ |
9 * | |
1199 | 10 * RBF stands for 'Random Block Filemanager' and is a package of subroutines |
11 * that define the logical structure of a disk and allows access to the files | |
12 * in that structure. | |
13 * | |
14 * The data structures in this file give RBF its 'personality' and are used | |
15 * by RBF itself, as well as applications that will require disk I/O. | |
1200 | 16 * |
17 * Edt/Rev YYYY/MM/DD Modified by | |
18 * Comment | |
19 * ------------------------------------------------------------------ | |
20 * 1982/07/13 Robert F. Doggett | |
21 * PD.Exten added to path descriptor and PE Entries defined. | |
22 * | |
23 * 1982/07/15 Robert F. Doggett | |
24 * V.FileHd inserted in driver static storage. | |
25 * | |
26 * 1982/09/10 WGP | |
27 * Level One/Level Two condionals added. | |
28 * | |
29 * 1982/09/17 WGP | |
30 * | |
31 * 1982/09/17 Robert F. Doggett | |
32 * PD.SLE renamed to PD.Creat. | |
33 * | |
34 * 1982/09/17 Robert F. Doggett | |
35 * V.DiskID, V.BMapSz, V.MapSct added for smart multi-sector bitmap searching. | |
36 * | |
37 * 1982/09/20 Robert F. Doggett | |
38 * Reserved areas added in static storage. | |
39 | |
40 * 1983/06/07 Robert F. Doggett | |
41 * Added InDriver flag in PD.SMF. | |
42 * | |
43 * 1983/06/13 Robert F. Doggett | |
44 * Added PE.Req tmp save for PE.Lock. | |
45 * | |
46 * 1983/08/08 Robert F. Doggett | |
47 * Reserved PD.SToff for Japanese. | |
48 * | |
49 * 1983/11/19 Robert F. Doggett | |
50 * Added V.ResBit in drive tables. | |
51 * | |
52 * 1983/12/12 Robert F. Doggett | |
53 * Added PE.Prior to save process priority. | |
54 * | |
55 * 1983/12/13 Robert F. Doggett | |
56 * Added BufBusy bit in state flag (PD.SMF). | |
57 * | |
58 * 1984/07/06 Mark G. Hawkins | |
59 * Added Bit Definitions for DD.FMT. | |
60 * | |
61 * 1987/06/23 Kevin K. Darling | |
62 * Updated with Dev Desc Info | |
63 * | |
64 * 2003/06/02 Boisy G. Pitre | |
65 * Updated comments for clarity. | |
66 | |
67 nam RBFDefs | |
68 ttl Random Block File Manager Definitions | |
1199 | 69 |
0 | 70 |
1200 | 71 pag |
0 | 72 ******************************* |
73 * RBF Device Descriptor Offsets | |
74 * | |
1199 | 75 * These definitions are for RBF device descriptors. |
76 | |
0 | 77 org M$DTyp |
1199 | 78 rmb 1 Device type (DT.RBF) |
0 | 79 IT.DRV rmb 1 Drive number |
80 IT.STP rmb 1 Step rate | |
1199 | 81 IT.TYP rmb 1 Disk device type information |
0 | 82 IT.DNS rmb 1 Density capability |
83 IT.CYL rmb 2 Number of cylinders | |
84 IT.SID rmb 1 Number of surfaces | |
1199 | 85 IT.VFY rmb 1 Verify disk writes (0 = verify, 1 = don't) |
0 | 86 IT.SCT rmb 2 Default sectors/track |
1199 | 87 IT.T0S rmb 2 Default sectors/track for track 0 sector 0 |
0 | 88 IT.ILV rmb 1 Sector interleave offset |
89 IT.SAS rmb 1 Segment allocation size | |
90 | |
1199 | 91 * IT.TYP/IT.DNS/IT.STP bit definitions |
0 | 92 * |
1199 | 93 TYP.FLP equ %00000000 Floppy disk |
94 TYP.HARD equ %10000000 Hard disk | |
95 | |
96 * The following TYP and DNS bit definitions are applicable | |
97 * only if the TYP.FLP bit is clear. | |
0 | 98 TYP.5 equ %00000000 5" media |
99 TYP.8 equ %00000001 8" media | |
100 TYP.CCF equ %00100000 CoCo format | |
101 TYP.NCCF equ %00000000 Non-CoCo format | |
102 TYP.SOF equ %00000000 Standard OS-9 format | |
103 TYP.NSF equ %01000000 Non-standard format | |
104 | |
1199 | 105 * Density bit definitions |
0 | 106 DNS.FM equ %00000000 Single-density (FM) |
107 DNS.MFM equ %00000001 Double-density (MFM) | |
108 DNS.STD equ %00000000 Single track density (48 tpi) | |
109 DNS.DTD equ %00000010 Single track density (96 tpi) | |
110 | |
1199 | 111 * Floppy disk step rate definitions |
480 | 112 IFEQ Level-1 |
113 STP.30ms equ 3 30ms step rate | |
114 STP.20ms equ 2 20ms step rate | |
115 STP.12ms equ 1 12ms step rate | |
116 STP.6ms equ 0 6ms step rate | |
117 ELSE | |
0 | 118 STP.30ms equ 0 30ms step rate |
119 STP.20ms equ 1 20ms step rate | |
120 STP.12ms equ 2 12ms step rate | |
121 STP.6ms equ 3 6ms step rate | |
480 | 122 ENDC |
0 | 123 |
1200 | 124 pag |
0 | 125 ************************************* |
126 * Random Block Path Descriptor Format | |
127 * | |
1199 | 128 * A path descriptor is created for every new path that is open |
129 * via the I$Open system call (processed by IOMan). Process | |
130 * descriptors track state information of a path. | |
131 * | |
0 | 132 org PD.FST |
133 PD.SMF rmb 1 State flags | |
134 PD.CP rmb 4 Current logical byte position | |
135 PD.SIZ rmb 4 File size | |
136 PD.SBL rmb 3 Segment beginning lsn | |
137 PD.SBP rmb 3 Segment beginning psn | |
138 PD.SSZ rmb 3 Segment size | |
139 PD.DSK rmb 2 Disk id | |
140 PD.DTB rmb 2 Drive table ptr | |
141 org PD.OPT | |
142 rmb 1 Device type | |
143 PD.DRV rmb 1 Drive number | |
144 PD.STP rmb 1 Step rate | |
145 PD.TYP rmb 1 Disk device type (5" 8" other) | |
146 PD.DNS rmb 1 Density capability | |
147 PD.CYL rmb 2 Number of cylinders | |
148 PD.SID rmb 1 Number of surfaces | |
149 PD.VFY rmb 1 0=verify disk writes | |
150 PD.SCT rmb 2 Default sectors/track | |
151 PD.T0S rmb 2 Default sectors/track tr00,s0 | |
152 PD.ILV rmb 1 Sector interleave offset | |
153 PD.SAS rmb 1 Segment allocation size | |
154 PD.TFM rmb 1 DMA Transfer Mode | |
155 PD.Exten rmb 2 Path Extension (PE) for record locking | |
156 PD.SToff rmb 1 Sector/Track offsets (for "foreign" disk formats) | |
157 PD.ATT rmb 1 File attributes | |
158 PD.FD rmb 3 File descriptor psn | |
159 PD.DFD rmb 3 Directory file descriptor psn | |
160 PD.DCP rmb 4 File directory entry ptr | |
161 PD.DVT rmb 2 User readable dev tbl ptr | |
162 | |
163 * State Flags | |
164 BUFMOD equ $01 Buffer modified | |
165 SINBUF equ $02 Sector in buffer | |
166 FDBUF equ $04 File descriptor in buffer | |
167 *EOFSEC equ $08 End of file sector | |
168 *EOF equ $10 End of file | |
169 InDriver equ $20 Currently in Disk Driver, or queued | |
170 BufBusy equ $40 Buffer is currently busy | |
171 | |
1199 | 172 IFNE Level-1 |
0 | 173 ************************************ |
174 * Random Block Path Extension Format | |
175 * | |
1199 | 176 * RBF paths under Level Two have additional information that |
177 * is referenced by the path extension area. | |
178 * | |
0 | 179 org 0 |
180 PE.PE rmb 1 PE path number | |
1199 | 181 PE.PDptr rmb 2 Back ptr to this PE's Path Descriptor |
0 | 182 PE.NxFil rmb 2 Drive Open-File list ptr |
1199 | 183 PE.Confl rmb 2 Circular File Conflict list |
0 | 184 PE.Lock rmb 1 Path lockout status |
185 PE.LoLck rmb 4 Low Locked Logical addr | |
186 PE.HiLck rmb 4 High Locked Logical addr | |
187 PE.Wait rmb 2 PE ptr to (next) locked-out PE | |
188 PE.TmOut rmb 2 Max ticks to wait for locked segment | |
189 PE.Owner rmb 1 Process ID of owner of locked segment | |
1199 | 190 PE.Req rmb 1 Temp for PE.Lock in GAIN when LockSeg fails |
191 PE.Prior rmb 1 Temp for process priority while in driver | |
192 PE.SigSg rmb 1 Signal code to send | |
193 PE.SigID rmb 1 Process ID to send the signal to | |
194 rmb 32-. Reserved | |
195 PE.FilNm rmb 32 Temp for filename during directory search | |
0 | 196 |
197 * PE.Lock status codes | |
1199 | 198 Unlocked equ 0 No portion of file is locked |
199 RcdLock equ 1 Record from LoLck to HiLck locked | |
200 FileLock equ 2 Entire file locked | |
0 | 201 EofLock equ 4 End of file is locked |
1199 | 202 ENDC |
203 | |
0 | 204 |
1200 | 205 pag |
0 | 206 *********************** |
207 * LSN0 Disk Data Format | |
208 * | |
1199 | 209 * Logical Sector Number 0 is the first sector on an RBF formatted device |
210 * and contains information about the device's size and format. | |
211 * | |
0 | 212 org 0 |
213 DD.TOT rmb 3 Total number of sectors | |
214 DD.TKS rmb 1 Track size in sectors | |
215 DD.MAP rmb 2 Number of bytes in allocation bit map | |
216 DD.BIT rmb 2 Number of sectors/bit | |
217 DD.DIR rmb 3 Address of root directory fd | |
218 DD.OWN rmb 2 Owner | |
219 DD.ATT rmb 1 Attributes | |
1199 | 220 DD.DSK rmb 2 Disk ID |
0 | 221 DD.FMT rmb 1 Disk format; density/sides |
222 DD.SPT rmb 2 Sectors/track | |
223 DD.RES rmb 2 Reserved for future use | |
224 DD.SIZ equ . Device descriptor minimum size | |
225 DD.BT rmb 3 System bootstrap sector | |
226 DD.BSZ rmb 2 Size of system bootstrap | |
227 DD.DAT rmb 5 Creation date | |
228 DD.NAM rmb 32 Volume name | |
1199 | 229 DD.OPT rmb 32 Option area |
0 | 230 |
1199 | 231 * DD.FMT Bit Definitions - valid only if device is a floppy disk |
0 | 232 FMT.SIDE equ %00000001 Single Side=0, Double Side=1 |
233 FMT.DNS equ %00000010 Single DNS=0, Double DNS=1 | |
234 FMT.TDNS equ %00000100 48tpi=0, 96tpi=1 | |
235 FMT.T0DN equ %00100000 Track 0 DNS, see FMT.DNS | |
236 | |
1199 | 237 |
1200 | 238 pag |
0 | 239 ************************ |
240 * File Descriptor Format | |
241 * | |
1199 | 242 * The file descriptor is a sector that is present for every file |
243 * on an RBF device. It contains attributes, modification dates, | |
244 * and segment information on a file. | |
245 * | |
0 | 246 org 0 |
247 FD.ATT rmb 1 Attributes | |
248 FD.OWN rmb 2 Owner | |
249 FD.DAT rmb 5 Date last modified | |
250 FD.LNK rmb 1 Link count | |
251 FD.SIZ rmb 4 File size | |
252 FD.Creat rmb 3 Segment list extension | |
253 FD.SEG equ . Beginning of segment list | |
254 * Segment List Entry Format | |
255 org 0 | |
256 FDSL.A rmb 3 Segment beginning physical sector number | |
257 FDSL.B rmb 2 Segment size | |
258 FDSL.S equ . Segment list entry size | |
259 FD.LS1 equ FD.SEG+((256-FD.SEG)/FDSL.S-1)*FDSL.S | |
260 FD.LS2 equ (256/FDSL.S-1)*FDSL.S | |
261 MINSEC set 16 | |
262 | |
1199 | 263 |
1200 | 264 pag |
0 | 265 ************************ |
266 * Directory Entry Format | |
267 * | |
1199 | 268 * Directory entries are part of a directory and define the name |
269 * of the file, as well as a pointer to its file descriptor. | |
270 * | |
0 | 271 org 0 |
272 DIR.NM rmb 29 File name | |
273 DIR.FD rmb 3 File descriptor physical sector number | |
274 DIR.SZ equ . Directory record size | |
275 | |
1199 | 276 |
1200 | 277 pag |
278 ******************** | |
279 * RBF Static Storage | |
0 | 280 * |
281 * Overall Disk Static Storage | |
282 * | |
1199 | 283 * Note: This does not reserve any memory for drive tables. Each |
284 * driver is responsible for reserving sufficient memory for | |
285 * the appropriate number of tables. | |
0 | 286 * |
287 org V.USER Reserve required ($06) | |
288 V.NDRV rmb 1 Number of drives ($07) | |
289 rmb 8 reserved ($08) | |
290 DRVBEG equ . Beginning of drive tables ($10) | |
1199 | 291 |
292 | |
1200 | 293 pag |
1199 | 294 **************** |
0 | 295 * Global Storage For Disk Drive Tables |
1199 | 296 * |
297 * Each table contains the first 'DD.SIZ' bytes from | |
298 * LSN 0, and the current track, stepping rate, | |
299 * bitmap use flag, and disk type. | |
0 | 300 * |
301 org 0 | |
1199 | 302 rmb DD.SIZ Device descriptor, LSN 0 |
0 | 303 V.TRAK rmb 2 Current track |
304 V.BMB rmb 1 Bit-map use flag | |
1199 | 305 V.FileHd rmb 2 Open file list for this drive |
0 | 306 V.DiskID rmb 2 Disk ID |
307 V.BMapSz rmb 1 Bitmap Size | |
1199 | 308 V.MapSct rmb 1 Lowest reasonable bitmap sector |
309 V.ResBit rmb 1 Reserved bitmap sector (for compaction) | |
0 | 310 V.ScTkOf rmb 1 Sector/Track byte (Combined from descriptor) |
311 V.ScOfst rmb 1 Sector offset split from byte above | |
312 V.TkOfst rmb 1 Track offset split from byte above | |
1199 | 313 rmb 4 Reserved |
0 | 314 DRVMEM equ . |
315 | |
1199 | 316 ENDC |
373
c07686556109
Added ifeq statements at top to allow for multiple use's of same def
boisy
parents:
71
diff
changeset
|
317 |