home *** CD-ROM | disk | FTP | other *** search
/ Brotikasten / BROTCD01.iso / cpm / format81.lbr / FORMAT81.DZC / FORMAT81.DOC
Text File  |  1995-08-31  |  8KB  |  176 lines

  1.  
  2.                  USING THE 1581 DRIVE WITH CP/M
  3.  
  4.                           Gene Pizzetta
  5.                        September 13, 1987
  6.  
  7.  
  8. I've been waiting almost two months for the new CP/M BIOS to
  9. arrive from West Chester, while my 1581 drive gathered dust on
  10. the shelf.  I'm sure the new system will be great when it finally
  11. gets here, but in the meantime I decided to do something to get
  12. the new drive working on my machine.
  13.  
  14. Using the format program included in this library you can get
  15. your 1581 in service under CP/M in about three minutes.  With
  16. about another half-hour of work you can get a full 800K on your
  17. 3-1/2 inch disks.
  18.  
  19. It should be emphasized that the format program creates a disk
  20. that you computer will think is an Epson QX-10 double-sided 5-1/4
  21. inch floppy.  This disk format is not likely to be compatible
  22. with the revised BIOS you will eventually get from Commodore, so
  23. you'll probably have to move everything to disks with the new
  24. format later.  In addition, you will not be able to boot CP/M
  25. from the 1581, so it should not be drive A.  In the meantime,
  26. though, you'll have a fast, high-capacity drive that will hold
  27. all of WordStar Release 4 with plenty of space to spare.
  28.  
  29.  
  30.                             FORMAT81
  31.                            Version 1.1
  32.  
  33.  
  34. This is an interim program to format a disk in the Commodore 1581
  35. disk drive for use under CP/M 3.0 on the C-128.  Disks formatted
  36. with this program are NOT likely to be compatible with the
  37. official BIOS upgrade, when it is finally delivered by Commodore
  38. Business Machines.
  39.  
  40. USAGE:
  41.  
  42.     FORMAT81 {d:}
  43.  
  44. This command will format the disk in the given drive.  If a drive
  45. specification is not supplied in the command tail, then the
  46. currently logged disk is assumed.  Only drives A, B, C, and D
  47. will be accepted; all others result in an 'invalid drive'
  48. message.  Permissible drives may be further restricted in the
  49. drive list.
  50.  
  51. When you first put a disk into the 1581, you will be unable to
  52. make that drive the default (current) drive.  If you try it, CP/M
  53. will make several attempts to log it in and then report a disk
  54. error.  Returning you to where you were.  Because of that you
  55. will have to use the command line drive designator to format your
  56. first disk (for example, "FORMAT81 B:".  After the disk is
  57. formatted, you can log in the drive and check your disk space
  58. with SHOW.COM, NEW-D.COM, XDIR, or some other favorite utility.
  59.  
  60. This format program will no doubt cause problems if you try to
  61. run it on a disk in a 1571 drive.  Frankly, I haven't tried it (I
  62. haven't had the guts!), so I won't make any predictions.  I think
  63. it would be best if you avoided the possibility by making a small
  64. change in the source code at the label DrvLst.  The comments
  65. explain the procedure.
  66.  
  67. If you don't want to bother with reassembly, you can make the
  68. patch directly to the .COM file using EDFILE or SID.  The drive
  69. list can be found at 103h-106h.  These four bytes are flags for
  70. drives A through D, respectively.  If the byte for a drive is non-
  71. zero then FORMAT81 will abort with an "invalid drive" message if
  72. by chance it is the drive you inadvertantly selected.  As
  73. distributed, the program will format a disk in any drive, but you
  74. should patch FFh (or any non-zero byte) into the flag bytes that
  75. do not correspond to a 1581 drive.
  76.  
  77. For example, if your 1581 is drive C, then patch FFh, FFh, 00h,
  78. FFh into the drive list.  The 00h at byte 105 corresponds to
  79. drive C.  After you've made the patch, FORMAT81 won't let you
  80. format a disk in any drive but C.
  81.  
  82. This program was developed with SLRMAC, a truly fantastic 8080
  83. assembler that has extended Intel Z80 mnemonics built-in (and
  84. it's only $49.95).  You can reassemble FORMAT81.MAC with MAC and
  85. HEXCOM, but first you will have to change the name to
  86. FORMAT81.ASM and then make sure Z80.LIB is on your default disk.
  87.  
  88. Version 1.0 (9/10/87) -- successfully formatted disks in 1581
  89.     drive under CP/M using Epson QX-10 format options.
  90.  
  91. Version 1.1 (9/12/87) -- added command line drive selection,
  92.     drive list, error checking, and drive reset.
  93.  
  94.  
  95.                        MODIFYING THE BIOS
  96.  
  97.  
  98. After you have formatted a disk with FORMAT81, you will notice
  99. that you have only around 390K of disk space.  That's because
  100. Epson QX-10 disks had only 40 tracks and your 1581 has 80.  You
  101. can't read and write to the full 800K of your 1581 unless you
  102. modify your BIOS.  But that's easy to do.  Here's how:
  103.  
  104. Making this patch will eliminate the possibility of reading and
  105. writing QX-10 double-sided disks (single-sided disks are
  106. unaffected), but I doubt many people do that with any regularity.
  107. Anyway, you will still have your original BIOS if you need it in
  108. a pinch.
  109.  
  110. (At this point everybody seems to feel obliged to issue a warning
  111. about not using your original disks.  I won't insult you. 
  112. Anybody that needs such a warning wouldn't be making patches,
  113. they'd be playing Face Maker on the 64 side.)
  114.  
  115. To make this patch you need the source code for your BIOS. 
  116. Commodore sends it out to those who return the card in the
  117. "System Guide".  If you're using a December 6 system that you got
  118. from another source, then the source code is available from
  119. Quantum-Link, most FOG boards (you may have to request it from
  120. the Sysop), and it may even be on CompuServe someplace.
  121.  
  122. Find the file CXDISK.ASM and call up your favorite editor (like
  123. VDE) to make two tiny changes.  Near the end of this rather long
  124. source file you will find the source for the disk parameter
  125. blocks.  The one you need is the SECOND one marked 'Epson QX10'. 
  126. The first QX-10 block is for single-sided disks.  The source
  127. block will look like this:
  128.  
  129.     db    80h+S512*2+(10*2-8)+1    ; 256 byte sect, 16 sec/trk
  130. ;    db    S256*2            ; track 0 is 256 bytes/sector
  131.     db    MFM+S512+Type0+C0+S1    ;    DSDD
  132.     dw    0            ; start on track 2 sect 1 (2 alc)
  133.     dpb    512,20,40,2048,128,2    ; sect# 1 to 10
  134.     db    10            ; (top and bottom numbered the same)
  135.     db    'Epson QX10'        ; 2
  136.  
  137. You only need to make two changes, both of them in the 5th line,
  138. that begins "dpb".  Change the "40" to "80".  Change the "2" to
  139. "0".  That tells CP/M that the disk has 80 tracks and it should
  140. start at track 0 (the Epson had two reserved tracks for booting
  141. the system, so it started on track 2).  You might also want to
  142. change the ASCII string in the last line to '   1581   ', so that
  143. there are exactly 10 letters and spaces between the single
  144. quotes.  The modified block should look like this:
  145.  
  146.     db    80h+S512*2+(10*2-8)+1    ; 256 byte sect, 16 sec/trk
  147. ;    db    S256*2            ; track 0 is 256 bytes/sector
  148.     db    MFM+S512+Type0+C0+S1    ;    DSDD
  149.     dw    0            ; start on track 2 sect 1 (2 alc)
  150.     dpb    512,20,80,2048,128,0    ; sect# 1 to 10
  151.     db    10            ; (top and bottom numbered the same)
  152.     db    '   1581   '        ; 2
  153.  
  154. Using the small doc file that comes with the source code as your
  155. guide, you will have to regenerate the CPM+.SYS file using the
  156. modified CXDISK.ASM file in place of the original.  Once you get
  157. the regeneration process going, go out to dinner.  It takes quite
  158. a while to do its work.
  159.  
  160. When you come back, reboot the system with your new CPM+.SYS file
  161. in drive A (along with a copy of CCP.COM, of course).  Then run
  162. SHOW.COM on your 1581.
  163.     "RW, Space     796k"
  164. That's 800K, minus 4K for the disk directory.  Enjoy!
  165.  
  166. Let me know if you experience any problems, find any bugs, or have
  167. any suggestions.
  168.  
  169.                     Gene Pizzetta
  170.                     481 Revere Street
  171.                     Revere, MA  02151
  172.  
  173.                     Voice (617) 284-0891
  174.                     CompuServe 72060,505
  175.                     Quantum-Link GeneP
  176.