+Lee Stewart Posted September 1, 2011 Share Posted September 1, 2011 (edited) Pardon my naiveté, but I have a question about the transfer block for the diskette level 1 formatting subprogram (11h). The docs (GPL Interface Specs for 99/4 Disk Peripheral) say the MSN of 834Ch for the DSR version should be 1 for double-sided formatting, but are a little confusing for when 2 should be used, in particular, for density. Is that any density greater than single? More generally, does anyone from experience reading this have detailed advice about exactly what diskette formats can be written with which DSR version numbers in this nybble (presuming, of course, an appropriate version of the DSR is in place)? For example, what happens if the transfer block has DSR version = 0, Density = 2 and No. of Sides = 2? ...lee Edited May 21, 2012 by Lee Stewart Quote Link to comment Share on other sites More sharing options...
+InsaneMultitasker Posted September 1, 2011 Share Posted September 1, 2011 (edited) The Myarc HFDC manual is a good, partial reference. However, Fred Kaal's level 2 DSR info may be just what the doctor ordered: http://members.ziggo.nl/fgkaal/level2subprograms.html Disk formats vary by controller and capability. A TI Controller, for example, has less capability than a Myarc floppy controller. Something that may not be apparent in either the specification or Fred's doc is that the PAB (Peripheral Access Block) and buffers reside in VDP. Some controllers can utilize CPU RAM but for compatibility, most people stick with the former. It is common practice to construct the PAB in CPU memory then transfer to VDP prior to calling DSRLNK. For level 1/2 operations, scratchpad RAM is used for status and parameter passing; sometimes documentation will only indicate the LSByte, assuming you know scratchad resides in the 0x8300-0x83ff, 256 byte range. Lastly, these PABs are constructed as two byteS: a length byte (0x01) and the operation. To format a disk, your PAB would look like this: 0x0111. FORMAT BYTE >01,>11 * or FORMAT DATA >0111 You would load the PAB into VDP RAM at some point. DSRLNK then expects you to point to the data (PAB, length byte, etc) where it resides in VDP and/or CPU RAM before-hand. Don't make the mistake of pointing to CPU RAM if you should be pointing to VDP RAM I don't recall off-hand if the format routine will set the disk volume name or if you must perform a sector read/write operation to do so. Edited September 1, 2011 by InsaneMultitasker Quote Link to comment Share on other sites More sharing options...
+Lee Stewart Posted September 1, 2011 Author Share Posted September 1, 2011 I understand what you are saying. But, if the DSR can handle a particular format, do you need to bother with the DSR version nybble, i.e., leave it at 0? I would presume that if you leave it at 0, you would get an error related to the DSR's inability to do more than SSSD (for example) and that putting it at, say, 2, would be cleaner if the DSR could not handle a higher format like DSDD? ...lee Quote Link to comment Share on other sites More sharing options...
RXB Posted September 1, 2011 Share Posted September 1, 2011 The references I use are TI GPL Interface specs for disk, TI File management specs, Myarc WDS manual, and SCSI manual from Horizion. When I wrote full support for SCSI and WDS in RXB I learned more from the Hard Drive manuals then I ever learned from the others. Now that I have more space in RXB I will include Format Drives, even for Hard Drives. (SCSI or MYARC) Already support stuff no one else has like CUT Directory or SCSI Device. My 2 cents, good luck to you. Quote Link to comment Share on other sites More sharing options...
+InsaneMultitasker Posted September 2, 2011 Share Posted September 2, 2011 I understand what you are saying. But, if the DSR can handle a particular format, do you need to bother with the DSR version nybble, i.e., leave it at 0? I would presume that if you leave it at 0, you would get an error related to the DSR's inability to do more than SSSD (for example) and that putting it at, say, 2, would be cleaner if the DSR could not handle a higher format like DSDD? ...lee Good point, I didn't even directly answer your question Here's the best I can give: I don't recall a need to set the version nibble to format disks. I would simply use version 0 and try the routine with the parameters necessary to format the disk as you see fit. If Tony is lurking he may know the "definitive" answer. I recommend you download the Myarc Disk Manager 5 and Disk Manager 1000 source code from the WHT FTP site. If nothing else, it may give you some ideas Quote Link to comment Share on other sites More sharing options...
Gazoo Posted September 2, 2011 Share Posted September 2, 2011 ... If Tony is lurking he may know the "definitive" answer. He just might be lurking somewhere. Quote Link to comment Share on other sites More sharing options...
+Lee Stewart Posted September 2, 2011 Author Share Posted September 2, 2011 Thanks, Guys. Quote Link to comment Share on other sites More sharing options...
Gazoo Posted September 2, 2011 Share Posted September 2, 2011 When setting up the input parameters for a floppy disk format routine, here's what needs to be included: >834C - This byte will be the drive number. Drive numbers start at 1, not 0. >834D - This byte is the number of tracks to format, either 40 (>28) or 80 (>50). >8350 - This byte's left-most 6 bits contain the sector interleave number. If the value is zero, it will use the default setting of the DSR (recommended). The right-most 2 bits contain the density setting: 0 or 1 are single density, 2 is double density, and 3 is high density (high density with Geneve and HFDC combination only). After the format routine is called, the number of sectors formatted is returned in the word at >834A and error codes in the word at >8350. Note also that the format routine does not place the required information in sectors 0 and 1 to make the disk useable. The data written to all the other sectors remains there, either all >E5 or >E7 depending on the DSR and controller. It is normal practice to verify all sectors with the sector read routine before writing the sector bit map to sector 0. The sector 0 information can then be manually constructed and written to the disk. Sector 1 should then be written as all zeros to indicate no files are present. Only after all these steps are complete will the disk be read/writable at the user level. I think that about covers it. Let me know if I've missed something. Quote Link to comment Share on other sites More sharing options...
+Lee Stewart Posted September 2, 2011 Author Share Posted September 2, 2011 Note also that the format routine does not place the required information in sectors 0 and 1 to make the disk useable. The data written to all the other sectors remains there, either all >E5 or >E7 depending on the DSR and controller. It is normal practice to verify all sectors with the sector read routine before writing the sector bit map to sector 0. The sector 0 information can then be manually constructed and written to the disk. Sector 1 should then be written as all zeros to indicate no files are present. Only after all these steps are complete will the disk be read/writable at the user level. Not to take you too far back <grin>; but, does that mean that TI FORTH's FORMAT-DISK could only be used by TI FORTH (and that only for FORTH screens) unless DISK-HEAD was also invoked? ...and thanks for your input. ...lee Quote Link to comment Share on other sites More sharing options...
Gazoo Posted September 2, 2011 Share Posted September 2, 2011 Not to take you too far back <grin>; but, does that mean that TI FORTH's FORMAT-DISK could only be used by TI FORTH (and that only for FORTH screens) unless DISK-HEAD was also invoked? ...and thanks for your input. ...lee Never dallied in Forth, perhaps someone else can answer that. If no response is forthcoming, an explanation of the two things you mention might provide some insight into an answer. Quote Link to comment Share on other sites More sharing options...
+Lee Stewart Posted September 3, 2011 Author Share Posted September 3, 2011 Well, without boring you too much with details you may not want, FORMAT-DISK just sets up and runs subroutine 11h of DSRLNK and returns with no error handling or additional writing to sectors 0 and 1 that I can see from perusing the assembly source of the TI FORTH kernel. TI FORTH screens (1 KB/screen = 4 256-byte sectors) are managed by direct sector reads and writes (DSRLNK subroutine 10h), so the sector bitmap in sector 0, the FDIR in sector 1 and FDRs elsewhere are irrelevant until actual file access is desired. Then, of course, one is probably using a normal DM-formatted disk---but, there are reasons to access the FORTH-screen disks via normal file access methods. That's where DISK-HEAD comes in. Basically, all DISK-HEAD does is clear sector 0, putting all required information in sector 0 to make it file-accessible: naming the disk "FORTH", putting "DSK" where appropriate, setting the sector bitmap to all ones; set up one file named "SCREENS" to occupy all the remaining space on the disk with the FDIR set up with the proper pointer block and the one-and-only FDR set up in sector 2. ...lee Quote Link to comment Share on other sites More sharing options...
RXB Posted September 3, 2011 Share Posted September 3, 2011 Has anyone written any TI Forth Hard Drive access. I can imagine the nightmare of wiping out my hard drive by Forth writing to sector 0 or 1. Quote Link to comment Share on other sites More sharing options...
+InsaneMultitasker Posted September 3, 2011 Share Posted September 3, 2011 Has anyone written any TI Forth Hard Drive access. I can imagine the nightmare of wiping out my hard drive by Forth writing to sector 0 or 1. You don't need FORTH to accomplish that feat, Rich. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.