Mercurial > hg > Members > kono > nitros9-code
annotate defs/rbf.d @ 2817:5c6b71612ce4 lwtools-port
Added low level CoCo SDC driver and made makefile changes for coco3 and coco3_6309 to build boot disks for this new driver.
Fixed up shellplus labels.
author | Boisy Pitre <boisy.pitre@nuance.com> |
---|---|
date | Wed, 01 May 2013 08:38:04 -0500 |
parents | bfe3de781ddf |
children | 28ed72477814 |
rev | line source |
---|---|
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 | |
2770
bfe3de781ddf
Added Arduino dwread/dwwrite changes
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
276 ************************* |
bfe3de781ddf
Added Arduino dwread/dwwrite changes
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
277 * 2012/11/09 Gene Heskett - Some additions for bootlink etc use. |
bfe3de781ddf
Added Arduino dwread/dwwrite changes
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
278 ORG $60 More options from device descriptor |
bfe3de781ddf
Added Arduino dwread/dwwrite changes
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
279 VD.STP RMB 1 This is for the /sh and /ih virtual disks in HDBDOS |
bfe3de781ddf
Added Arduino dwread/dwwrite changes
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
280 VD.OFS RMB 3 This is DT.WPC and DT.OSF combined, might be more |
bfe3de781ddf
Added Arduino dwread/dwwrite changes
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2624
diff
changeset
|
281 |
2624 | 282 * DD.FMT Bit Definitions - valid only if device is a floppy disk |
283 FMT.SIDE EQU %00000001 Single Sided=0, Double Sided=1 | |
284 FMT.DNS EQU %00000010 Single Density=0, Double Density=1 | |
285 FMT.TDNS EQU %00000100 Track Density: 48/135 TPI=0, 96 TPI=1 | |
286 FMT.T0DN EQU %00100000 Track 0 Density, see FMT.DNS | |
287 | |
288 | |
289 PAG | |
290 ************************ | |
291 * File Descriptor Format | |
292 * | |
293 * The file descriptor is a sector that is present for every file | |
294 * on an RBF device. It contains attributes, modification dates, | |
295 * and segment information on a file. | |
296 * | |
297 ORG 0 | |
298 FD.ATT RMB 1 Attributes | |
299 FD.OWN RMB 2 Owner | |
300 FD.DAT RMB 5 Date last modified | |
301 FD.LNK RMB 1 Link count | |
302 FD.SIZ RMB 4 File size | |
303 FD.Creat RMB 3 File creation date (YY/MM/DD) | |
304 FD.SEG EQU . Beginning of segment list | |
305 * Segment List Entry Format | |
306 ORG 0 | |
307 FDSL.A RMB 3 Segment beginning physical sector number | |
308 FDSL.B RMB 2 Segment size | |
309 FDSL.S EQU . Segment list entry size | |
310 FD.LS1 EQU FD.SEG+((256-FD.SEG)/FDSL.S-1)*FDSL.S | |
311 FD.LS2 EQU (256/FDSL.S-1)*FDSL.S | |
312 MINSEC SET 16 | |
313 | |
314 | |
315 PAG | |
316 ************************ | |
317 * Directory Entry Format | |
318 * | |
319 * Directory entries are part of a directory and define the name | |
320 * of the file, as well as a pointer to its file descriptor. | |
321 * | |
322 ORG 0 | |
323 DIR.NM RMB 29 File name | |
324 DIR.FD RMB 3 File descriptor physical sector number | |
325 DIR.SZ EQU . Directory record size | |
326 | |
327 | |
328 PAG | |
329 ******************** | |
330 * RBF Static Storage | |
331 * | |
332 * Overall Disk Static Storage | |
333 * | |
334 * Note: This does not reserve any memory for drive tables. Each | |
335 * driver is responsible for reserving sufficient memory for | |
336 * the appropriate number of tables. | |
337 * | |
338 ORG V.USER Reserve required ($06) | |
339 V.NDRV RMB 1 Number of drives ($07) | |
340 RMB 8 reserved ($08) | |
341 DRVBEG EQU . Beginning of drive tables ($10) | |
342 | |
343 | |
344 PAG | |
345 **************** | |
346 * Global Storage For Disk Drive Tables | |
347 * | |
348 * Each table contains the first 'DD.SIZ' bytes from | |
349 * LSN 0, and the current track, stepping rate, | |
350 * bitmap use flag, and disk type. | |
351 * | |
352 ORG 0 | |
353 RMB DD.SIZ Device descriptor, LSN 0 | |
354 V.TRAK RMB 2 Current track | |
355 V.BMB RMB 1 Bit-map use flag | |
356 V.FileHd RMB 2 Open file list for this drive | |
357 V.DiskID RMB 2 Disk ID | |
358 V.BMapSz RMB 1 Bitmap Size | |
359 V.MapSct RMB 1 Lowest reasonable bitmap sector | |
360 V.ResBit RMB 1 Reserved bitmap sector (for compaction) | |
361 V.ScTkOf RMB 1 Sector/Track byte (Combined from descriptor) | |
362 V.ScOfst RMB 1 Sector offset split from byte above | |
363 V.TkOfst RMB 1 Track offset split from byte above | |
364 RMB 4 Reserved | |
365 DRVMEM EQU . | |
366 | |
367 ENDC | |
368 |