0
|
1 nam RBFDefs
|
|
2 ttl Random Block File Manager Definitions
|
|
3
|
|
4 **********************
|
|
5 * Modification History
|
|
6 *
|
|
7 * Date Changes Made by
|
|
8 * -------- ------------------------------------------------------------ ---
|
|
9 * 82/07/13 PD.Exten added to path descriptor rfd
|
|
10 * 82/07/13 PE entries defined rfd
|
|
11 * 82/07/15 V.FileHd inserted in drive static rfd
|
|
12 * 82/09/10 Level One/ Level two cond added WGP
|
|
13 * 82/09/17 Record Lock cond added WGP
|
|
14 * 82/09/17 PD.SLE renamed to PD.Creat rfd
|
|
15 * 82/09/17 V.DiskID, V.BMapSz, V.MapSct added for
|
|
16 * smart multi-sector bitmap searching rfd
|
|
17 * 82/09/20 reserved areas added in static storage.
|
|
18 * 83/06/07 Added InDriver flag in PD.SMF. rfd
|
|
19 * 83/06/13 Added PE.Req tmp save for PE.Lock rfd
|
|
20 * 83/08/08 reserved PD.SToff for Japanese rfd
|
|
21 * 83/11/19 Added V.ResBit in drive tables. rfd
|
|
22 * 83/12/12 Added PE.Prior to save process priority. rfd
|
|
23 * 83/12/13 Added BufBusy bit in state flag (PD.SMF) rfd
|
|
24 * 84/07/06 Added Bit Definitions for DD.FMT MGH
|
|
25 * 87/06/23 Updated with Dev Desc Info KKD
|
|
26
|
|
27 *******************************
|
|
28 * RBF Device Descriptor Offsets
|
|
29 *
|
|
30 org M$DTyp
|
|
31 rmb 1 Device type (IT.DTP) (1=RBF)
|
|
32 IT.DRV rmb 1 Drive number
|
|
33 IT.STP rmb 1 Step rate
|
|
34 IT.TYP rmb 1 Disk device type (5" 8" other)
|
|
35 IT.DNS rmb 1 Density capability
|
|
36 IT.CYL rmb 2 Number of cylinders
|
|
37 IT.SID rmb 1 Number of surfaces
|
|
38 IT.VFY rmb 1 0=verify disk writes
|
|
39 IT.SCT rmb 2 Default sectors/track
|
|
40 IT.T0S rmb 2 Default sectors/track tr00,s0
|
|
41 IT.ILV rmb 1 Sector interleave offset
|
|
42 IT.SAS rmb 1 Segment allocation size
|
|
43
|
|
44 *************************************
|
|
45 * IT.TYP/IT.DNS/IT.STP definitions
|
|
46 *
|
|
47 TYP.5 equ %00000000 5" media
|
|
48 TYP.8 equ %00000001 8" media
|
|
49 TYP.CCF equ %00100000 CoCo format
|
|
50 TYP.NCCF equ %00000000 Non-CoCo format
|
|
51 TYP.SOF equ %00000000 Standard OS-9 format
|
|
52 TYP.NSF equ %01000000 Non-standard format
|
|
53 TYP.FLP equ %00000000 Floppy disk
|
|
54 TYP.HARD equ %10000000 Hard disk
|
|
55
|
|
56 DNS.FM equ %00000000 Single-density (FM)
|
|
57 DNS.MFM equ %00000001 Double-density (MFM)
|
|
58 DNS.STD equ %00000000 Single track density (48 tpi)
|
|
59 DNS.DTD equ %00000010 Single track density (96 tpi)
|
|
60
|
|
61 STP.30ms equ 0 30ms step rate
|
|
62 STP.20ms equ 1 20ms step rate
|
|
63 STP.12ms equ 2 12ms step rate
|
|
64 STP.6ms equ 3 6ms step rate
|
|
65
|
|
66 *************************************
|
|
67 * Random Block Path Descriptor Format
|
|
68 *
|
|
69 org PD.FST
|
|
70 PD.SMF rmb 1 State flags
|
|
71 PD.CP rmb 4 Current logical byte position
|
|
72 PD.SIZ rmb 4 File size
|
|
73 PD.SBL rmb 3 Segment beginning lsn
|
|
74 PD.SBP rmb 3 Segment beginning psn
|
|
75 PD.SSZ rmb 3 Segment size
|
|
76 PD.DSK rmb 2 Disk id
|
|
77 PD.DTB rmb 2 Drive table ptr
|
|
78 org PD.OPT
|
|
79 rmb 1 Device type
|
|
80 PD.DRV rmb 1 Drive number
|
|
81 PD.STP rmb 1 Step rate
|
|
82 PD.TYP rmb 1 Disk device type (5" 8" other)
|
|
83 PD.DNS rmb 1 Density capability
|
|
84 PD.CYL rmb 2 Number of cylinders
|
|
85 PD.SID rmb 1 Number of surfaces
|
|
86 PD.VFY rmb 1 0=verify disk writes
|
|
87 PD.SCT rmb 2 Default sectors/track
|
|
88 PD.T0S rmb 2 Default sectors/track tr00,s0
|
|
89 PD.ILV rmb 1 Sector interleave offset
|
|
90 PD.SAS rmb 1 Segment allocation size
|
|
91 PD.TFM rmb 1 DMA Transfer Mode
|
|
92 PD.Exten rmb 2 Path Extension (PE) for record locking
|
|
93 PD.SToff rmb 1 Sector/Track offsets (for "foreign" disk formats)
|
|
94 PD.ATT rmb 1 File attributes
|
|
95 PD.FD rmb 3 File descriptor psn
|
|
96 PD.DFD rmb 3 Directory file descriptor psn
|
|
97 PD.DCP rmb 4 File directory entry ptr
|
|
98 PD.DVT rmb 2 User readable dev tbl ptr
|
|
99
|
|
100 * State Flags
|
|
101 BUFMOD equ $01 Buffer modified
|
|
102 SINBUF equ $02 Sector in buffer
|
|
103 FDBUF equ $04 File descriptor in buffer
|
|
104 *EOFSEC equ $08 End of file sector
|
|
105 *EOF equ $10 End of file
|
|
106 InDriver equ $20 Currently in Disk Driver, or queued
|
|
107 BufBusy equ $40 Buffer is currently busy
|
|
108
|
|
109 ifne Level-1
|
|
110 ************************************
|
|
111 * Random Block Path Extension Format
|
|
112 *
|
|
113 org 0
|
|
114 PE.PE rmb 1 PE path number
|
|
115 PE.PDptr rmb 2 back ptr to this PE's Path Descriptor
|
|
116 PE.NxFil rmb 2 Drive Open-File list ptr
|
|
117 PE.Confl rmb 2 circular File Conflict list
|
|
118 PE.Lock rmb 1 Path lockout status
|
|
119 PE.LoLck rmb 4 Low Locked Logical addr
|
|
120 PE.HiLck rmb 4 High Locked Logical addr
|
|
121 PE.Wait rmb 2 PE ptr to (next) locked-out PE
|
|
122 PE.TmOut rmb 2 Max ticks to wait for locked segment
|
|
123 PE.Owner rmb 1 Process ID of owner of locked segment
|
|
124 PE.Req rmb 1 temp for PE.Lock in GAIN when LockSeg fails
|
|
125 PE.Prior rmb 1 tmp for process priority while in driver
|
|
126 rmb 32-. reserved
|
|
127 PE.FilNm rmb 32 temp for filename during directory search
|
|
128
|
|
129 * PE.Lock status codes
|
|
130 Unlocked equ 0 no portion of file is locked
|
|
131 RcdLock equ 1 record from LoLck to HiLck locked
|
|
132 FileLock equ 2 entire file locked
|
|
133 EofLock equ 4 End of file is locked
|
|
134 endc
|
|
135
|
|
136 ***********************
|
|
137 * LSN0 Disk Data Format
|
|
138 *
|
|
139 org 0
|
|
140 DD.TOT rmb 3 Total number of sectors
|
|
141 DD.TKS rmb 1 Track size in sectors
|
|
142 DD.MAP rmb 2 Number of bytes in allocation bit map
|
|
143 DD.BIT rmb 2 Number of sectors/bit
|
|
144 DD.DIR rmb 3 Address of root directory fd
|
|
145 DD.OWN rmb 2 Owner
|
|
146 DD.ATT rmb 1 Attributes
|
|
147 DD.DSK rmb 2 Disk id
|
|
148 DD.FMT rmb 1 Disk format; density/sides
|
|
149 DD.SPT rmb 2 Sectors/track
|
|
150 DD.RES rmb 2 Reserved for future use
|
|
151 DD.SIZ equ . Device descriptor minimum size
|
|
152 DD.BT rmb 3 System bootstrap sector
|
|
153 DD.BSZ rmb 2 Size of system bootstrap
|
|
154 DD.DAT rmb 5 Creation date
|
|
155 DD.NAM rmb 32 Volume name
|
|
156 DD.OPT rmb 32 option area
|
|
157
|
|
158 * DD.FMT Bit Definitions
|
|
159 FMT.SIDE equ %00000001 Single Side=0, Double Side=1
|
|
160 FMT.DNS equ %00000010 Single DNS=0, Double DNS=1
|
|
161 FMT.TDNS equ %00000100 48tpi=0, 96tpi=1
|
|
162 FMT.T0DN equ %00100000 Track 0 DNS, see FMT.DNS
|
|
163
|
|
164 ************************
|
|
165 * File Descriptor Format
|
|
166 *
|
|
167 org 0
|
|
168 FD.ATT rmb 1 Attributes
|
|
169 FD.OWN rmb 2 Owner
|
|
170 FD.DAT rmb 5 Date last modified
|
|
171 FD.LNK rmb 1 Link count
|
|
172 FD.SIZ rmb 4 File size
|
|
173 FD.Creat rmb 3 Segment list extension
|
|
174 FD.SEG equ . Beginning of segment list
|
|
175 * Segment List Entry Format
|
|
176 org 0
|
|
177 FDSL.A rmb 3 Segment beginning physical sector number
|
|
178 FDSL.B rmb 2 Segment size
|
|
179 FDSL.S equ . Segment list entry size
|
|
180 FD.LS1 equ FD.SEG+((256-FD.SEG)/FDSL.S-1)*FDSL.S
|
|
181 FD.LS2 equ (256/FDSL.S-1)*FDSL.S
|
|
182 MINSEC set 16
|
|
183
|
|
184 ************************
|
|
185 * Directory Entry Format
|
|
186 *
|
|
187 org 0
|
|
188 DIR.NM rmb 29 File name
|
|
189 DIR.FD rmb 3 File descriptor physical sector number
|
|
190 DIR.SZ equ . Directory record size
|
|
191
|
|
192 ****************
|
|
193 * Static Storage
|
|
194 *
|
|
195 * Overall Disk Static Storage
|
|
196 *
|
|
197 * Note: This does not reserve any memory for drive tables. Each Driver is
|
|
198 * responsible for reserving sufficient memory for the appropriate
|
|
199 * number of tables.
|
|
200 *
|
|
201 org V.USER Reserve required ($06)
|
|
202 V.NDRV rmb 1 Number of drives ($07)
|
|
203 rmb 8 reserved ($08)
|
|
204 DRVBEG equ . Beginning of drive tables ($10)
|
|
205 *
|
|
206 * Global Storage For Disk Drive Tables
|
|
207 * Each Table Contains The First 'DD.Siz' Bytes
|
|
208 * From Sector 0, And The Current Track, Stepping Rate,
|
|
209 * Bit-Map Use Flag, And Disk Type
|
|
210 *
|
|
211 org 0
|
|
212 rmb DD.SIZ Device descriptor, sector 0
|
|
213 V.TRAK rmb 2 Current track
|
|
214 V.BMB rmb 1 Bit-map use flag
|
|
215 V.FileHd rmb 2 open file list for this drive
|
|
216 V.DiskID rmb 2 Disk ID
|
|
217 V.BMapSz rmb 1 Bitmap Size
|
|
218 V.MapSct rmb 1 lowest reasonable bitmap sector
|
|
219 V.ResBit rmb 1 reserved bitmap sector (for compaction)
|
|
220 V.ScTkOf rmb 1 Sector/Track byte (Combined from descriptor)
|
|
221 V.ScOfst rmb 1 Sector offset split from byte above
|
|
222 V.TkOfst rmb 1 Track offset split from byte above
|
|
223 rmb 4 reserved
|
|
224 DRVMEM equ .
|
|
225
|