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