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