home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 14 / CDACTUAL.iso / cdactual / demobin / share / program / asm / SCSIDRV.ZIP / HISTORY.TXT < prev    next >
Encoding:
Text File  |  1991-11-06  |  7.0 KB  |  134 lines

  1. Scsi Version 1.0
  2.  
  3.      The code you received with this file is a very simple SCSI device
  4. driver that uses the Seagate ST-01 interface card.  As this driver is
  5. my first PC assembler project other then "hello world", please don't
  6. snicker to loudly.
  7.  
  8.      The package includes the source for a device driver that will scan
  9. the SCSI bus for disk drives and partition any drives found into chunks
  10. of 32Meg plus any leftovers.  As soon as I discover a way to get DOS to
  11. let me use > 512 byte sectors, It will just allocate the entire disk to
  12. a single logical drive.  It also includes a utility to access the low
  13. level SCSI format function for any disk found.  You may specify the
  14. interleave when the low level format is done and the version of the
  15. driver here seems to work fine at 1:1 with my 8Mhz NEC.
  16.  
  17.      Some of the things to look out for are:
  18.  
  19. #1 The receive_data and send_data functions in subs.asm use polled I/O
  20.    to transfer data to/from the card.  I would have loved to just use
  21.    the I/O Channel Ready line that the card is suppose to support, but
  22.    my NEC does not seem to use that line.  Hence the polling of the REQ
  23.    bit in the status port.
  24.  
  25. #2 I did not know how to do clock speed independent timing loops, so there
  26.    is a wait100us function in subs.asm that is very processor speed
  27.    dependent :-(
  28.  
  29. #3 In ioctl.asm there is a commented out call to scsi_verify.  This is
  30.    used by the DOS format utility to scan for errors.  You may want to
  31.    enable the call after you get everything setup.  I shut it off while
  32.    I was testing as I didn't want to wait for the verify everytime I
  33.    changed the interleave.
  34.  
  35.      To bring up the driver.  Assemble and link scsi.sys and add it to
  36. your config.sys file.  After rebooting, you may optionaly do a low level
  37. format of each disk found using sformat.exe.  You then use the DOS format
  38. utility on each logical drive.  I did figure out just what format needed
  39. in the way of ioctl support to get it to do the high level format for me.
  40. At this point you should have fully functional DOS drives.  In testing
  41. I found that with multi_sector support (subs.asm) enabled, the SCSI drives
  42. were just about as fast as the ST-412 C: that came with the machine.  I
  43. am sure that the speed problem is basic to the inner loop of the data
  44. transfer routines, but I'm at a loss to figure out how to speed it up.
  45.  
  46.      Anyway, maybe someone can find some use for the code.  I got the
  47. card for free, so I can't really complain about the speed or cost too
  48. much :-)
  49.  
  50.      Also thanks to the people that sent me samples of other device drivers
  51. for the PC.  I lost the names to a disk crash, but here is the result of
  52. your help and my thanks.
  53.  
  54. Scsi Version 1.1
  55.  
  56.      This version of the driver add support for a single tape drive, and
  57. cleans up some of the code a little.  It also adds a file that has equates
  58. to customize some of the major areas of the driver.
  59.  
  60.      When the driver is initialized it does a scan of the SCSI bus for
  61. devices.  The FIRST tape device found is assigned to a char device with the
  62. name "SCSITAPE".  If no tape drive is found, the char device is still valid
  63. but will generate a "bad unit" error when accessed.
  64.  
  65.      The SCSITAPE device expects reads and writes to be done in some variation
  66. of 512 bytes.  I/O done where (size mod 512) is non-zero will generate an
  67. error.  Tape access must be done in RAW mode, and this is where I had to
  68. some code in the driver that I'm not sure is very pretty.  The problem is
  69. that DOS insists on opening char devices in cooked mode.  It does give you
  70. the ability to switch to RAW mode, but only by using 'intdos()' to access
  71. the ioctl interface.  The MSC 'setmode()' call for binary will not effect
  72. char devices, nor will opening the file with O_BINARY.  So I had two choices.
  73. I could modify every program that expected to talk to the tape so that it
  74. also issued the ioctl stuff (see binmode.c), or I could kludge the driver
  75. to issue the required calls.
  76.  
  77.      In the end, I punted and did both.  The code in binmode.c is the function
  78. that along with 'setmode()', will make sure that ANYTHING you open is accessed
  79. in RAW mode.  Simply check for any call to 'setmode()' that is switching to
  80. O_BINARY, and add another call to 'binmode()'.  This assumes that you have
  81. the source to the utility in question.  For those who are don't mind a little
  82. kludge amount friends.  The file options.inc has an equate called 'use_kludge'
  83. that when enabled turns on some code in kludge.asm.  This code links into the
  84. INT 21h vector and waits for a DOS open request to go by.  When it sees an
  85. open request, it 'calls' rather then 'jmps' to the normal vector.  This allows
  86. the driver to get the 'handle' returned by DOS.  Because the SCSITAPE device
  87. enables the driver_open function, I can tell from the fact that an open is
  88. in progress and wether the driver just got an open request, wether any
  89. particular open was for me.  When the open was in fact for the SCSITAPE device,
  90. I take the 'handle' returned by DOS and forge the required ioctl calls to
  91. switch to RAW mode.
  92.  
  93.      With the addition of tape support.  I now use GNU Tar to swap tapes with
  94. my normal UN*X system at work.  The driver works well enough that I have yet
  95. to have a format problem with the different systems.  It is also a lot faster
  96. when doing backups on the PC.  Using 'fastback' I would get about 1 Meg a
  97. minute thruput on my 8 Mhz AT.  Using GNU Tar and the SCSITAPE device I get
  98. > 2.5 Meg a minute to the tape and don't have to swap disks quite so often :-)
  99.  
  100.      Anyway, I hope that someone out there actually gets some use out of this
  101. code.  It has been a real adventure for me.
  102.  
  103. Scsi Version 1.2
  104.  
  105.      This version of the driver enhances the tape drive support by adding
  106. a program to control the action of the tape drive, and move around within
  107. multiple containers on the tape.  As I used the Bezerkley 'mt' command for
  108. ideas, the program is naturally called 'mt'.  You can tell the driver to:
  109.  
  110. #1 Rewind/No Rewind on close.
  111. #2 Erase the tape.
  112. #3 Step forwards or backwards X tape marks.
  113.    Note: the command 'mt -s 0' steps to End Of Data.
  114.  
  115.      I also did a little more work on the routines that actually transfer
  116. date to/from the card.  I found that I had left out a check for timeout
  117. in the inner loops of the the data xfer routines.  When the random parity
  118. error or other glitch occured.  The driver would hang forever.  Not very
  119. friendly...  The added code does not seem to slow the driver any, or at
  120. least the disk thru-put tester I use shows no difference.
  121.  
  122.      As the driver seems to be stable now, and it does about everything
  123. I started out to do.  I'm going to post this to comp.sources.misc instead
  124. of alt.sources in the hopes that more people will see it.  Hopefully this
  125. will be usefull to someone else (at least they might get a good chuckle).
  126.  
  127. Scsi Version 2.0
  128.  
  129.      This is release 2.0 of my SCSI driver for the Seagate ST-01 card.
  130. It major feature is support for large drives under DOS 4.0 and higher.
  131. It also refines the support for the tape driver and handles multiple
  132. containers per tape now.  It also includes a simple remap utility for
  133. mapping out bad sectors on hard disks.
  134.