Mercurial > hg > Members > kono > nitros9-code
annotate defs/rbfdefs @ 1868:cba8a54bc509
Slowly but surely
author | boisy |
---|---|
date | Fri, 29 Jul 2005 19:40:14 +0000 |
parents | 87865128c951 |
children | 34868794d297 |
rev | line source |
---|---|
1541 | 1 IFNE RBFDEFS-1 |
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. | |
1205
383d5981c23f
Updated for anticipation of 256-2048 byte sector support
boisy
parents:
1200
diff
changeset
|
66 * Added TYP.256-TYP.2048 definitions for future expansion. |
1530
a02b18bfc376
New 'Old' fields added from OS-9 Level One V2.00.00 Addendum
boisy
parents:
1377
diff
changeset
|
67 * |
a02b18bfc376
New 'Old' fields added from OS-9 Level One V2.00.00 Addendum
boisy
parents:
1377
diff
changeset
|
68 * 2004/04/14 Boisy G. Pitre |
a02b18bfc376
New 'Old' fields added from OS-9 Level One V2.00.00 Addendum
boisy
parents:
1377
diff
changeset
|
69 * Added new entries to device descriptor as per OS-9 Level One V2.00.00 |
a02b18bfc376
New 'Old' fields added from OS-9 Level One V2.00.00 Addendum
boisy
parents:
1377
diff
changeset
|
70 * addendum. Pointed out by Rodney Hamilton. |
1834
87865128c951
Added defines for bit 2 of IT.DNS, which is track 0 density flag for format
afra
parents:
1718
diff
changeset
|
71 * |
87865128c951
Added defines for bit 2 of IT.DNS, which is track 0 density flag for format
afra
parents:
1718
diff
changeset
|
72 * 2005/05/31 P.Harvey-Smith. |
87865128c951
Added defines for bit 2 of IT.DNS, which is track 0 density flag for format
afra
parents:
1718
diff
changeset
|
73 * Added defines for bit 2 of IT.DNS, which the format command uses to |
87865128c951
Added defines for bit 2 of IT.DNS, which is track 0 density flag for format
afra
parents:
1718
diff
changeset
|
74 * determine if a drive should have it's track 0 as single or double density |
87865128c951
Added defines for bit 2 of IT.DNS, which is track 0 density flag for format
afra
parents:
1718
diff
changeset
|
75 * |
1200 | 76 |
77 nam RBFDefs | |
78 ttl Random Block File Manager Definitions | |
1199 | 79 |
0 | 80 |
1200 | 81 pag |
0 | 82 ******************************* |
83 * RBF Device Descriptor Offsets | |
84 * | |
1199 | 85 * These definitions are for RBF device descriptors. |
86 | |
0 | 87 org M$DTyp |
1199 | 88 rmb 1 Device type (DT.RBF) |
0 | 89 IT.DRV rmb 1 Drive number |
90 IT.STP rmb 1 Step rate | |
1199 | 91 IT.TYP rmb 1 Disk device type information |
0 | 92 IT.DNS rmb 1 Density capability |
93 IT.CYL rmb 2 Number of cylinders | |
94 IT.SID rmb 1 Number of surfaces | |
1199 | 95 IT.VFY rmb 1 Verify disk writes (0 = verify, 1 = don't) |
0 | 96 IT.SCT rmb 2 Default sectors/track |
1199 | 97 IT.T0S rmb 2 Default sectors/track for track 0 sector 0 |
0 | 98 IT.ILV rmb 1 Sector interleave offset |
99 IT.SAS rmb 1 Segment allocation size | |
1530
a02b18bfc376
New 'Old' fields added from OS-9 Level One V2.00.00 Addendum
boisy
parents:
1377
diff
changeset
|
100 * The following fields are from the OS-9 Level One V2.00.00 Addendum |
a02b18bfc376
New 'Old' fields added from OS-9 Level One V2.00.00 Addendum
boisy
parents:
1377
diff
changeset
|
101 IT.TFM rmb 1 DMA Transfer Mode |
a02b18bfc376
New 'Old' fields added from OS-9 Level One V2.00.00 Addendum
boisy
parents:
1377
diff
changeset
|
102 IT.Exten rmb 2 Path Extension (PE) for record locking |
a02b18bfc376
New 'Old' fields added from OS-9 Level One V2.00.00 Addendum
boisy
parents:
1377
diff
changeset
|
103 IT.SToff rmb 1 Sector/Track offsets (for "foreign" disk formats) |
a02b18bfc376
New 'Old' fields added from OS-9 Level One V2.00.00 Addendum
boisy
parents:
1377
diff
changeset
|
104 * The following fields are not copied to the path descriptor |
a02b18bfc376
New 'Old' fields added from OS-9 Level One V2.00.00 Addendum
boisy
parents:
1377
diff
changeset
|
105 IT.WPC rmb 1 Write precomp cyl/4 (HD) |
a02b18bfc376
New 'Old' fields added from OS-9 Level One V2.00.00 Addendum
boisy
parents:
1377
diff
changeset
|
106 IT.OFS rmb 2 Starting cylinder offset (HD) |
a02b18bfc376
New 'Old' fields added from OS-9 Level One V2.00.00 Addendum
boisy
parents:
1377
diff
changeset
|
107 IT.RWC rmb 2 Reduced write current cylinder (HD) |
a02b18bfc376
New 'Old' fields added from OS-9 Level One V2.00.00 Addendum
boisy
parents:
1377
diff
changeset
|
108 |
0 | 109 |
1609 | 110 * IT.TYP Definitions |
0 | 111 * |
1626 | 112 TYP.HARD equ %10000000 Hard disk |
1199 | 113 TYP.FLP equ %00000000 Floppy disk |
1626 | 114 TYP.NSF equ %01000000 Non-standard format |
115 TYP.SOF equ %00000000 Standard NitrOS-9 format | |
1199 | 116 |
1609 | 117 * IT.TYP bit definitions if bit 7 of IT.TYP is set (hard disk) |
1626 | 118 TYPH.256 equ %00000000 256 byte sector media |
119 TYPH.512 equ %00000001 512 byte sector media | |
120 TYPH.1024 equ %00000010 1024 byte sector media | |
121 TYPH.2048 equ %00000011 2048 byte sector media | |
122 TYPH.SSM equ %00000011 Sector size mask | |
1637 | 123 TYPH.DRSV equ %00001100 Driver-reserved bits |
124 TYPH.DSQ equ %00010000 Drive size query flag | |
1609 | 125 |
126 * IT.TYP bit definitions if bit 7 of IT.TYP is clear (floppy disk) | |
0 | 127 TYP.5 equ %00000000 5" media |
1676 | 128 TYP.3 equ %00000001 3.5" media |
1693 | 129 TYP.SBO equ %00000010 Sector base offset (clear = 0; sect = 1) |
1609 | 130 TYP.256 equ %00000000 256 byte sector media |
131 TYP.512 equ %00000100 512 byte sector media | |
0 | 132 TYP.CCF equ %00100000 CoCo format |
133 TYP.NCCF equ %00000000 Non-CoCo format | |
134 | |
1609 | 135 * IT.DNS Definitions |
136 * | |
1626 | 137 |
138 * If bit 7 of IT.TYP is set, IT.DNS is driver-dependent | |
139 | |
1609 | 140 * IT.DNS bit definitions if bit 7 of IT.TYP is clear (floppy disk) |
0 | 141 DNS.FM equ %00000000 Single-density (FM) |
142 DNS.MFM equ %00000001 Double-density (MFM) | |
1708
823c651e7dcd
Updated DNS.STD and DNS.DTD definitions based on Gene Heskett's explanation:
boisy
parents:
1693
diff
changeset
|
143 DNS.STD equ %00000000 Single track distance (48/135 tpi) |
823c651e7dcd
Updated DNS.STD and DNS.DTD definitions based on Gene Heskett's explanation:
boisy
parents:
1693
diff
changeset
|
144 DNS.DTD equ %00000010 Double track distance (96 tpi) |
0 | 145 |
1834
87865128c951
Added defines for bit 2 of IT.DNS, which is track 0 density flag for format
afra
parents:
1718
diff
changeset
|
146 * Added PHS,2005-05-31, as format seems to use these |
87865128c951
Added defines for bit 2 of IT.DNS, which is track 0 density flag for format
afra
parents:
1718
diff
changeset
|
147 DNS.FM0 equ %00000000 Single density track 0 |
87865128c951
Added defines for bit 2 of IT.DNS, which is track 0 density flag for format
afra
parents:
1718
diff
changeset
|
148 DNS.MFM0 equ %00000100 Double density track 0 |
87865128c951
Added defines for bit 2 of IT.DNS, which is track 0 density flag for format
afra
parents:
1718
diff
changeset
|
149 |
1199 | 150 * Floppy disk step rate definitions |
0 | 151 STP.30ms equ 0 30ms step rate |
152 STP.20ms equ 1 20ms step rate | |
153 STP.12ms equ 2 12ms step rate | |
154 STP.6ms equ 3 6ms step rate | |
155 | |
1200 | 156 pag |
0 | 157 ************************************* |
158 * Random Block Path Descriptor Format | |
159 * | |
1199 | 160 * A path descriptor is created for every new path that is open |
161 * via the I$Open system call (processed by IOMan). Process | |
162 * descriptors track state information of a path. | |
163 * | |
0 | 164 org PD.FST |
165 PD.SMF rmb 1 State flags | |
166 PD.CP rmb 4 Current logical byte position | |
167 PD.SIZ rmb 4 File size | |
168 PD.SBL rmb 3 Segment beginning lsn | |
169 PD.SBP rmb 3 Segment beginning psn | |
170 PD.SSZ rmb 3 Segment size | |
171 PD.DSK rmb 2 Disk id | |
172 PD.DTB rmb 2 Drive table ptr | |
173 org PD.OPT | |
174 rmb 1 Device type | |
175 PD.DRV rmb 1 Drive number | |
176 PD.STP rmb 1 Step rate | |
177 PD.TYP rmb 1 Disk device type (5" 8" other) | |
178 PD.DNS rmb 1 Density capability | |
179 PD.CYL rmb 2 Number of cylinders | |
180 PD.SID rmb 1 Number of surfaces | |
181 PD.VFY rmb 1 0=verify disk writes | |
182 PD.SCT rmb 2 Default sectors/track | |
183 PD.T0S rmb 2 Default sectors/track tr00,s0 | |
184 PD.ILV rmb 1 Sector interleave offset | |
185 PD.SAS rmb 1 Segment allocation size | |
186 PD.TFM rmb 1 DMA Transfer Mode | |
187 PD.Exten rmb 2 Path Extension (PE) for record locking | |
188 PD.SToff rmb 1 Sector/Track offsets (for "foreign" disk formats) | |
189 PD.ATT rmb 1 File attributes | |
190 PD.FD rmb 3 File descriptor psn | |
191 PD.DFD rmb 3 Directory file descriptor psn | |
192 PD.DCP rmb 4 File directory entry ptr | |
193 PD.DVT rmb 2 User readable dev tbl ptr | |
194 | |
195 * State Flags | |
196 BUFMOD equ $01 Buffer modified | |
197 SINBUF equ $02 Sector in buffer | |
198 FDBUF equ $04 File descriptor in buffer | |
199 *EOFSEC equ $08 End of file sector | |
200 *EOF equ $10 End of file | |
201 InDriver equ $20 Currently in Disk Driver, or queued | |
202 BufBusy equ $40 Buffer is currently busy | |
203 | |
1199 | 204 IFNE Level-1 |
0 | 205 ************************************ |
206 * Random Block Path Extension Format | |
207 * | |
1199 | 208 * RBF paths under Level Two have additional information that |
209 * is referenced by the path extension area. | |
210 * | |
0 | 211 org 0 |
212 PE.PE rmb 1 PE path number | |
1199 | 213 PE.PDptr rmb 2 Back ptr to this PE's Path Descriptor |
0 | 214 PE.NxFil rmb 2 Drive Open-File list ptr |
1199 | 215 PE.Confl rmb 2 Circular File Conflict list |
0 | 216 PE.Lock rmb 1 Path lockout status |
217 PE.LoLck rmb 4 Low Locked Logical addr | |
218 PE.HiLck rmb 4 High Locked Logical addr | |
219 PE.Wait rmb 2 PE ptr to (next) locked-out PE | |
220 PE.TmOut rmb 2 Max ticks to wait for locked segment | |
221 PE.Owner rmb 1 Process ID of owner of locked segment | |
1199 | 222 PE.Req rmb 1 Temp for PE.Lock in GAIN when LockSeg fails |
223 PE.Prior rmb 1 Temp for process priority while in driver | |
224 PE.SigSg rmb 1 Signal code to send | |
225 PE.SigID rmb 1 Process ID to send the signal to | |
226 rmb 32-. Reserved | |
227 PE.FilNm rmb 32 Temp for filename during directory search | |
0 | 228 |
229 * PE.Lock status codes | |
1199 | 230 Unlocked equ 0 No portion of file is locked |
231 RcdLock equ 1 Record from LoLck to HiLck locked | |
232 FileLock equ 2 Entire file locked | |
0 | 233 EofLock equ 4 End of file is locked |
1199 | 234 ENDC |
235 | |
0 | 236 |
1200 | 237 pag |
0 | 238 *********************** |
239 * LSN0 Disk Data Format | |
240 * | |
1199 | 241 * Logical Sector Number 0 is the first sector on an RBF formatted device |
242 * and contains information about the device's size and format. | |
243 * | |
0 | 244 org 0 |
245 DD.TOT rmb 3 Total number of sectors | |
246 DD.TKS rmb 1 Track size in sectors | |
247 DD.MAP rmb 2 Number of bytes in allocation bit map | |
248 DD.BIT rmb 2 Number of sectors/bit | |
249 DD.DIR rmb 3 Address of root directory fd | |
250 DD.OWN rmb 2 Owner | |
251 DD.ATT rmb 1 Attributes | |
1199 | 252 DD.DSK rmb 2 Disk ID |
0 | 253 DD.FMT rmb 1 Disk format; density/sides |
254 DD.SPT rmb 2 Sectors/track | |
255 DD.RES rmb 2 Reserved for future use | |
256 DD.SIZ equ . Device descriptor minimum size | |
257 DD.BT rmb 3 System bootstrap sector | |
258 DD.BSZ rmb 2 Size of system bootstrap | |
259 DD.DAT rmb 5 Creation date | |
260 DD.NAM rmb 32 Volume name | |
1199 | 261 DD.OPT rmb 32 Option area |
0 | 262 |
1199 | 263 * DD.FMT Bit Definitions - valid only if device is a floppy disk |
1618 | 264 FMT.SIDE equ %00000001 Single Sided=0, Double Sided=1 |
265 FMT.DNS equ %00000010 Single Density=0, Double Density=1 | |
1718 | 266 FMT.TDNS equ %00000100 Track Density: 48/135 TPI=0, 96 TPI=1 |
1618 | 267 FMT.T0DN equ %00100000 Track 0 Density, see FMT.DNS |
0 | 268 |
1199 | 269 |
1200 | 270 pag |
0 | 271 ************************ |
272 * File Descriptor Format | |
273 * | |
1199 | 274 * The file descriptor is a sector that is present for every file |
275 * on an RBF device. It contains attributes, modification dates, | |
276 * and segment information on a file. | |
277 * | |
0 | 278 org 0 |
279 FD.ATT rmb 1 Attributes | |
280 FD.OWN rmb 2 Owner | |
281 FD.DAT rmb 5 Date last modified | |
282 FD.LNK rmb 1 Link count | |
283 FD.SIZ rmb 4 File size | |
284 FD.Creat rmb 3 Segment list extension | |
285 FD.SEG equ . Beginning of segment list | |
286 * Segment List Entry Format | |
287 org 0 | |
288 FDSL.A rmb 3 Segment beginning physical sector number | |
289 FDSL.B rmb 2 Segment size | |
290 FDSL.S equ . Segment list entry size | |
291 FD.LS1 equ FD.SEG+((256-FD.SEG)/FDSL.S-1)*FDSL.S | |
292 FD.LS2 equ (256/FDSL.S-1)*FDSL.S | |
293 MINSEC set 16 | |
294 | |
1199 | 295 |
1200 | 296 pag |
0 | 297 ************************ |
298 * Directory Entry Format | |
299 * | |
1199 | 300 * Directory entries are part of a directory and define the name |
301 * of the file, as well as a pointer to its file descriptor. | |
302 * | |
0 | 303 org 0 |
304 DIR.NM rmb 29 File name | |
305 DIR.FD rmb 3 File descriptor physical sector number | |
306 DIR.SZ equ . Directory record size | |
307 | |
1199 | 308 |
1200 | 309 pag |
310 ******************** | |
311 * RBF Static Storage | |
0 | 312 * |
313 * Overall Disk Static Storage | |
314 * | |
1199 | 315 * Note: This does not reserve any memory for drive tables. Each |
316 * driver is responsible for reserving sufficient memory for | |
317 * the appropriate number of tables. | |
0 | 318 * |
319 org V.USER Reserve required ($06) | |
320 V.NDRV rmb 1 Number of drives ($07) | |
321 rmb 8 reserved ($08) | |
322 DRVBEG equ . Beginning of drive tables ($10) | |
1199 | 323 |
324 | |
1200 | 325 pag |
1199 | 326 **************** |
0 | 327 * Global Storage For Disk Drive Tables |
1199 | 328 * |
329 * Each table contains the first 'DD.SIZ' bytes from | |
330 * LSN 0, and the current track, stepping rate, | |
331 * bitmap use flag, and disk type. | |
0 | 332 * |
333 org 0 | |
1199 | 334 rmb DD.SIZ Device descriptor, LSN 0 |
0 | 335 V.TRAK rmb 2 Current track |
336 V.BMB rmb 1 Bit-map use flag | |
1199 | 337 V.FileHd rmb 2 Open file list for this drive |
0 | 338 V.DiskID rmb 2 Disk ID |
339 V.BMapSz rmb 1 Bitmap Size | |
1199 | 340 V.MapSct rmb 1 Lowest reasonable bitmap sector |
341 V.ResBit rmb 1 Reserved bitmap sector (for compaction) | |
0 | 342 V.ScTkOf rmb 1 Sector/Track byte (Combined from descriptor) |
343 V.ScOfst rmb 1 Sector offset split from byte above | |
344 V.TkOfst rmb 1 Track offset split from byte above | |
1199 | 345 rmb 4 Reserved |
0 | 346 DRVMEM equ . |
347 | |
1199 | 348 ENDC |
373
c07686556109
Added ifeq statements at top to allow for multiple use's of same def
boisy
parents:
71
diff
changeset
|
349 |