home *** CD-ROM | disk | FTP | other *** search
/ Compu-Fix / Compu-Fix.iso / referenz / text / scsi.txt < prev    next >
Encoding:
Text File  |  1993-03-01  |  17.0 KB  |  333 lines

  1.  
  2.  
  3.  
  4.                         SCSI (pronounced scuzzy) TUTORIAL
  5.                         *********************************
  6.                           By Daniel L. Miller, MD, BSEE
  7.  
  8.  
  9.  
  10. 11 West Wedgewood Glen
  11. The Woodlands, TX 77381
  12. copyright 9-5-87 daniel l. miller
  13. HAL PC MEMBER
  14.  
  15.  
  16.  
  17. This article combines two interests in that it fits into both the
  18. advanced pc hardware series and the Texas computer firm series.
  19. The article format is an expanded outline to save printed space.
  20.  
  21. 1  Operational Description
  22.     The Small Computer Serial Interface is an input/output channel
  23.     bus specification.  The specification allows up to eight bus
  24.     controllers to exchange control packets and bytes of data between
  25.     any two pairs of controllers.
  26.  
  27. 2  Examples of Data Exchange
  28.     Workstation to hard disc, optical disc and high density floppy.
  29.       Workstation is the bus master the peripheral devices are
  30.       individually accessed.  One initiator , 3 targets.
  31.     Several workstations accessing a bank of hard discs for fast
  32.       data retrieval with interleaved seeks and queed commands.
  33.       Multiple initiators, multiple targets. Each drive disconnects
  34.       from the bus during long seeks, while other drives transfer
  35.       data and then reconnects when ready to transmit data.
  36.  
  37. 3   Rates of data exchange
  38.       Data rate of readily available bus interface chips  12 - 15
  39.       megabits per second.  NCR 5380 / NCR 5385
  40.       Logic Devices L5380 32 megabits / sec
  41.  
  42. 4   Controller Selection
  43.       Bus controllers are free to access the bus to try to gain
  44.       control to initiate a data exchange. Bus arbitration is
  45.       according to a fixed priority 0 - 7 rating.  If two devices
  46.       request access the lower priority device must wait.
  47.  
  48. 5   How many devices.  The specification allows 8 controllers
  49.       to be selected from 8 data lines -- one line per each device.
  50.       Two additional lines select up to 4 devices for each controller.
  51.       Up to eight bus controllers each controlling up to 4 devices
  52.       totals 32 devices.
  53.       A proposed extension allows binary decoding of the selection
  54.       lines to allow 64 controllers.  ( Ampro SCSI+ protocol, Ampro advertises in
  55.       Byte )
  56.  
  57. 6   Accessing the Bus
  58.       The scsi interface protocal may be implemented with a dedicated
  59.      cpu and 4 input and 4 output data latches. ( Novix Beta Board )
  60.      However, scsi bus interface chips with data latches are readily available
  61.      both in TTL and CMOS configuration.  NCR, Toshiba 2nd source and
  62.      similar purpose chips are available from Adaptec and Western digital.
  63.      Emulex has announced a vlsi chip scsi processor which they claim can
  64.      implement bus sequences without external microprocessor intervention.
  65.         The NCR chip is programmed by addressing register select lines and
  66.      storing a byte in the controll register and if appropriate in the
  67.      data register.  A programming manual lists the possible commands.
  68.      The chip will perform aribitration logic and drive the bus and
  69.      detect protocol errors ( called phase errors in the NCR literature )
  70.      and parity errors.  Data ready and error conditions are flagged
  71.      by an inerrupt line.  A register holds a code to identify the type
  72.      of error detected to be read by the host cpu for error interrupt
  73.      handling routines.
  74.         The interface chip has handshake signals to operate efficiently
  75.      with a DMA controller to move blocks of data into or out of a
  76.      section of memory.  The dma is a dedicated cpu chip that generates
  77.      addresses for moving data sequentially into or out of memory.
  78.  
  79. 6.5  Terminology
  80.      Initiator - the device that begins an interchange
  81.      Target - The device that is selected by the initiator
  82.      Host - In the configuration of a computer sending data to
  83.             one or more disk drives, "host" refers to the main workstation
  84.             computer.
  85.      Controller - any device that connects to the scsi bus
  86.           connects through a controller.
  87.      Device -  Each controller on the bus can control up to 4 devices.
  88.           Each device can be individually addressed, so a device connected
  89.          to one controller can specifically talk with a device on another
  90.          controller.  Devices connected to the same controller cannot
  91.          talk to each other over the scsi bus.  The devices are also
  92.          called "Logical Units" or LUN's because they are addressed and
  93.          specified
  94.          by 2 bits in each command sent over the bus, rather than being
  95.          selected by a hardware bus line.
  96.      SASI - sasi stands for Sugart Associates System Interface, a single
  97.          host multiple target ( non arbitrating ) interface which was the
  98.          precursor to the SCSI specifications.
  99.      SCSI - Small Computer System Interface, the current standard
  100.          specification is the ANSI (American National Standards Institute)
  101.          version X3.131, 1986.
  102.      Embedded Controller- some drives have a scsi interface built into
  103.          the drive electronics mounted in or on the drive itself.  This
  104.          will be referred to as a "scsi drive."
  105.      SCSI controller - a scsi interface board that then connects with up
  106.          to four devices like esdi drives or st412/506 drives or optical drives.
  107.         ( The scsi controller is made to talk to regular devices, like the
  108.          drives in a xt or at computer.)  Scsi controllers are made for
  109.          optical drives, tape systems, ESDI and st412/506 hard discs.
  110.  
  111. 7   Data Transfer Protocol
  112.        The initiating controller first gains control of the bus and
  113.     gets the attention of its target controller.  The target then
  114.     takes control of the data exchange and asks the initiator what
  115.     it wants to do.  ie give a command, send or receive data.  The
  116.     initiator responds and the target aknowleges receipt of command
  117.     and transmits or recieves data, under control of the target controller.
  118.     The target will indicate with a message that it has successfully
  119.     completed its mission.
  120.  
  121.         Bus phases
  122.         BUS FREE phase
  123.  
  124.         SELECTION phase
  125.  
  126.         COMMAND phase   --
  127.         DATA phase        |-----These are the information transfer
  128.         STATUS phase      |       phases.
  129.         MESSAGE phase   --|
  130.  
  131.         ARBITRATION phase  (optional)   |            |-for multiple hosts
  132.         RESELECTION phase  (optional)   |---optional-| for multidrive high
  133.                                                        bus performance
  134.  
  135. 7.5  DATA EXCHANGE WALKTHROUGH
  136.      An example of a simple data interchange between an initiating host
  137.      PC and a target hard disc drive.
  138.      To send a block of data to a disk drive a pc first checks the bus
  139.      busy line.  When the line indicates the bus is free,  the pc will
  140.      send its identification code over the data lines and pull the bus
  141.      control lines.  If there is more than one device desiring to use
  142.      the bus at the same time, the device with the highest priority
  143.      always wins.  There is no inherent mechanism to insure fairness
  144.      or to force a round robin to prevent one device from tying up the
  145.      bus.
  146.         After gaining control of the bus the pc will select its target
  147.      device by activating one of eight lines.  The device selected
  148.      then takes control of the data interchange, and will remain in
  149.      control until the end of the exchange.  The target asks the pc
  150.      for a command.  The pc responds with a command block to read
  151.      10 blocks beginning with block 5.  The target acknowledges and
  152.      translates the logical block numbers to absolute sectors, seeks and
  153.      reads the sectors, performs error correction and  transmits the
  154.      data byte by byte with a handshake acknowlegement after each byte.
  155.      When it is finished it requests to send its status and transmits
  156.      a status report, if the status is good and the data does not have
  157.      to be retransmitted the drive then requests to send a message  and
  158.      reports  completion.
  159.  
  160. 8   SCSI Command Format
  161.         When the target requests a command, the initiator responds by
  162.         sending out 5 bytes ( 40 bits ) of command information.  These
  163.         bits are used to specify the command and identify the logical
  164.         device.  There is a SCSI COMMON COMMAND SET specification
  165.         The purpose of the specification was to
  166.         "Allow true second sourcing of SCSI hardware."  However,
  167.         because there are still multiple ways to do certain commands
  168.         and vendor specific functions, hard disc interchangeability
  169.         has not yet been achieved. From the end user point of view,
  170.         one can't unplug one scsi drive and replace it with one
  171.         from another manufacturer and expect it to work without
  172.         rewriting the device driver software for formats and the message
  173.         handling scsi driver routines.
  174.         The set of 40 bits is called a command block.  The first byte
  175.         specifies the class of commands or opcode.
  176.         Some Common Command Set Opcodes are the following:
  177.                 Opcode 00 (hex)  TEST UNIT READY
  178.                        03        FORMAT UNIT
  179.                        08        READ
  180.                        0A        WRITE
  181.                        0B        SEEK
  182.  
  183.         Since the drive controller electronics is on the drive side of
  184.         the SCSI BUS the data is organized by the drive controller and
  185.         requested by block number.  The controller translates the block
  186.         number to the track and sector information used to step to the
  187.         data.  This permits flexibility for the drive manufacturer.  A
  188.         drive with an embedded SCSI controller can reallocate bad blocks
  189.         internally and substitute blocks automatically from a spare track.
  190.         The meaning of the remaining bits varies for each opcode.
  191.                 The Write Command, opcode 0A, for example
  192.   BYTE 0       opcode  1A    (00001010)
  193.   BYTE 1       Logical unit number in bits 5-6, bits 1-4 specify logical
  194.                  block address
  195.   BYTE 2       logical block address
  196.   BYTE 3       logical block address
  197.   BYTE 4       Bits 2 to 5 specify the transfer length
  198.   BYTE 5       Bits 7 and 6 are vendor unique, bit one is a flag, bit 0 a link
  199.  
  200.  
  201. 9   SCSI Hardware Bus Specification
  202.         25 signal lines; 25 ground lines
  203.         Signals may assume true or false values. Signal assertion (true)is 0 v.
  204.         Signal negation (false) is 2.5 to 5.25 V dc
  205.         ( Bus driver chips typically invert the signal so bus voltage
  206.         levels are typically the reverse of normal logic levels input to the
  207.         on chip or input to the bus drivers where
  208.         +5 V is true.)
  209.         SCSI BUS SIGNALS
  210.         Busy            indicates the bus is in use
  211.         Select          used by the host to select the drive
  212.         Control/Data    This signal is driven by the target (like a disc drive
  213.                         and indicates whetehr CONTROL or DATA information is
  214.                         on the DATA bus.  A true value indicates a control
  215.                         signal is on the bus.
  216.         Input/Output
  217.                         This signal is driven by the target (disc drive) and
  218.                         controls the direction of data movement on the DATA
  219.                         bus with respect to the host.
  220.                         A true value indicates input to the host.
  221.         Message         This signal is driven by the target (disc drive)
  222.                         during the message phase.
  223.         Request         This signal is driven by the target (disc drive) and
  224.                         indictes  a request for a data transfer handsake acknowlegement.
  225.         Acknowledge     This signal is driven by the host and acknowleges a
  226.                         a data transfer handshake.
  227.         Attention       This signal is driven by the host to indicate a
  228.                         condition needing attention.
  229.         Reset           This forces a reset of devices on the bus.
  230.         Data lines (8)
  231.         Parity line (1) This line may be used by the devices to signal a
  232.                         parity error in the received data or command.
  233.         Bus Power lines
  234.  
  235. 10 SCSI CATALOG
  236.  
  237.        HOST BOARDS for the IBM PC, XT, AT, ... IBMetc...COMPAC... CLONES...
  238.         Drop in boards for the pc,xt,at and 386 IBM, Intel, Compac and close
  239.         clones are available from Advanced Storage Concepts
  240.         and Hudson and Supinger and Future Domain.
  241.         Hudson and Supinger is of interest in
  242.         that they supply an
  243.         example dos driver program in C language although  their prom routines
  244.         remain proprietary.
  245.  
  246.         ADVANCED STORAGE CONCEPTS (The Houston based company in this
  247.         article.)
  248.         sources a board that just drops into the pc
  249.         XT AT or 386 and uses an included self installing device driver
  250.         to configure the board and install itself as a DOS device
  251.         driver.   I have had one operating in my XT for a year with
  252.         no problem.  Included software functions set up drives of any
  253.         size and get around the dos 32 megabyte max drive size "limit".
  254.         Operation is transparent.  And from my keyboard and application programs I
  255.         can't tell that I'm using a scsi disc.  The short slot size
  256.         board has a eeprom that remembers the configuration so there
  257.         are no jumpers or switches to set.  The proms and driver source
  258.         code are proprietary.   Many ( 30+ ) scsi drives are supported.
  259.         The installation program has the data on file for the drives
  260.         like the number of logical blocks and the message codes returned
  261.         and the format commands so the user only has to pick the drive
  262.         name and model from a menu and the program does all the work.
  263.         The installation program has nice colors and jazz and looks like
  264.         something well done in Turbo Pascal and has a good feel to it.
  265.         Advanced Storage Concepts does systems integration for large
  266.         oem's and drive manufacturers and systems suppliers, but did not
  267.         seem to mind my bothering them. At one time they had advertised
  268.         in PC Tech magazine.
  269.  
  270.         National Memory Systems  sells scsi drive systems and boards
  271.         primarily for minicomputers and super micros and IBM
  272.         comptible scsi systems.
  273.  
  274.         SCSI drives are available from a variety of commercial
  275.              electronics suppliers including Arrow and Hallmark  and
  276.              Dallas Digital and Quality Components in Richardson.
  277.              Integrated scsi controllers built into disc drives are made
  278.              by many drive manufactureres including
  279.              Quantum, Maxtor, Rodime, Teac, Kodak, Fujitsu,
  280.              C. Itoh, NEC, Seagate, Shugart Associates (who originated the
  281.              SCSI specifications in conjunction with NCR and Ampro), and
  282.              Connor Periferals.
  283.              A partial list of devices with scsi interfaces include
  284.              5 1/4 inch drives up to 760 meg from Maxtor, Quantum, NEC
  285.              Toshiba, Fujitsu, Connor Periferals, plus about 10 others.
  286.              5 1/4 inch floppy drives up to 12 (twelve is correct !) megabytes
  287.                from Verbatim (now a Kodak data division).
  288.              3  1/4 inch drives up to 170 meg from Maxtor.
  289.              Miniature lightweight Connor Periferal 40 and 80 meg drives.
  290.              Optical Write once read many time discs from ( 5 1/4) Optotech in Denver
  291.              200 meg per side and Kodak at 1.2 gigabytes in a 12 inch disc.
  292.  
  293.         SCSI controllers made to connect a scsi bus to up to 4 drives
  294.              using the esdi or 502 interface are available.  These controller
  295.              boards would be used to hook the hundreds of cheap drives
  296.              available for the pc xt or ps2 computers to a scsi bus.
  297.              Manufactureres of these controller boards include Adaptec,
  298.              Emulex, and OMTI.
  299.  
  300.         SCSI computer motheroards with a built in
  301.              scsi chip set and the system
  302.              proms or operating system has the software, interrupt handlers,
  303.              and message handlers to talk to at least one brand of scsi drive.
  304.              These computers include the Macintosh Plus, The Amiga,
  305.              Steve Ciarcia's Micromint's SB180FX, PC TECH SUPER
  306.              10 MHZ AT clone and their 386 machine, The Slicer, The Semidisc
  307.              64180, Chicago Computer's 68000 machine.
  308.  
  309.  
  310.          Drop me a note if you need a commercial address or telephone
  311.              number.
  312.  
  313.  
  314.  
  315.  
  316.  
  317.       indictes  a request for a data transfer handsake acknowlegement.
  318.         Acknowledge     This signal is driven by the host and acknowleges a
  319.                         a data transfer handshake.
  320.         Attention       This signal is driven by the host to indicate a
  321.                         condition needing attention.
  322.         Reset           This forces a reset of devices on the bus.
  323.         Data lines (8)
  324.         Parity line (1) This line may be used by the devices to signal a
  325.                         parity error in the received data or comma.
  326.  
  327.  
  328.                -------------------- END --------------------
  329.  
  330.  
  331.  
  332.  
  333.