💾 Archived View for mirrors.apple2.org.za › archive › ground.icaen.uiowa.edu › Faqs › R008SCSITUT.TX… captured on 2024-03-21 at 20:04:02.
⬅️ Previous capture (2023-01-29)
-=-=-=-=-=-=-
The comp.sys.apple2 Usenet newsgroup Apple II FAQs originate from the Ground Apple II archive. Administrator: Steve Nelson Csa2 FAQs-on-Ground resource file: R008SCSITUT.TXT Generic SCSI Tutorial Note: To correctly view tables and diagrams on a super-res display, use a mono-spaced Font such as CoPilot or PCMononspaced. ____________________________ Generic SCSI (pronounced scuzzy) Tutorial by Daniel L. Miller, MD, BSEE This article combines two interests in that it fits into both the advanced pc hardware series and the Texas computer firm series. 1 Operational Description The Small Computer Serial Interface is an input/output channel bus specification. The specification allows up to eight bus controllers to exchange control packets and bytes of data between any two pairs of controllers. 2 Examples of Data Exchange Workstation to hard disc, optical disc and high density floppy. Workstation is the bus master the peripheral devices are individually accessed. One initiator , 3 targets. Several workstations accessing a bank of hard discs for fast data retrieval with interleaved seeks and queed commands. Multiple initiators, multiple targets. Each drive disconnects from the bus during long seeks, while other drives transfer data and then reconnects when ready to transmit data. 3 Rates of data exchange Data rate of readily available bus interface chips 12 - 15 megabits per second. NCR 5380 / NCR 5385 Logic Devices L5380 32 megabits / sec 4 Controller Selection Bus controllers are free to access the bus to try to gain control to initiate a data exchange. Bus arbitration is according to a fixed priority 0 - 7 rating. If two devices request access the lower priority device must wait. 5 How many devices. The specification allows 8 controllers to be selected from 8 data lines -- one line per each device. Two additional lines select up to 4 devices for each controller. Up to eight bus controllers each controlling up to 4 devices totals 32 devices. A proposed extension allows binary decoding of the selection lines to allow 64 controllers. ( Ampro SCSI+ protocol, Ampro advertises in Byte ) 6 Accessing the Bus The scsi interface protocal may be implemented with a dedicated cpu and 4 input and 4 output data latches. (Novix Beta Board ) Scsi bus interface chips with data latches are readily available both in TTL and CMOS configuration. NCR, Toshiba 2nd source and similar purpose chips are available from Adaptec and Western digital. Emulex has announced a vlsi chip scsi processor which they claim can implement bus sequences without external microprocessor intervention. The NCR chip is programmed by addressing register select lines and storing a byte in the controll register and if appropriate in the data register. A programming manual lists the possible commands. The chip will perform aribitration logic and drive the bus and detect protocol errors ( called phase errors in the NCR literature ) and parity errors. Data ready and error conditions are flagged by an inerrupt line. A register holds a code to identify the type of error detected to be read by the host cpu for error interrupt handling routines. The interface chip has handshake signals to operate efficiently with a DMA controller to move blocks of data into or out of a section of memory. The dma is a dedicated cpu chip that generates addresses for moving data sequentially into or out of memory. 6.5 Terminology Initiator - the device that begins an interchange Target - The device that is selected by the initiator Host - In the configuration of a computer sending data to one or more disk drives, "host" refers to the main workstation computer. Controller - any device that connects to the scsi bus connects through a controller. Device - Each controller on the bus can control up to 4 devices. Each device can be individually addressed, so a device connected to one controller can specifically talk with a device on another controller. Devices connected to the same controller cannot talk to each other over the scsi bus. The devices are also called "Logical Units" or LUN's because they are addressed and specified by 2 bits in each command sent over the bus, rather than being selected by a hardware bus line. SASI - sasi stands for Sugart Associates System Interface, a single host multiple target ( non arbitrating ) interface which was the precursor to the SCSI specifications. SCSI - Small Computer System Interface, the current standard specification is the ANSI (American National Standards Institute) version X3.131, 1986. Embedded Controller- some drives have a scsi interface built into the drive electronics mounted in or on the drive itself. This will be referred to as a "scsi drive." SCSI controller - a scsi interface board that then connects with up to four devices like esdi drives or st412/506 drives or optical drives. (The scsi controller is made to talk to regular devices, like the drives in a xt or at computer.) Scsi controllers are made for optical drives, tape systems, ESDI and st412/506 hard discs. 7 Data Transfer Protocol The initiating controller first gains control of the bus and gets the attention of its target controller. The target then takes control of the data exchange and asks the initiator what it wants to do. ie give a command, send or receive data. The initiator responds and the target aknowleges receipt of command and transmits or recieves data, under control of the target controller. The target will indicate with a message that it has successfully completed its mission. Bus phases BUS FREE phase SELECTION phase COMMAND phase -- DATA phase |-----These are the information transfer STATUS phase | phases. MESSAGE phase --| ARBITRATION phase (optional) | |-for multiple hosts RESELECTION phase (optional) |---optional-| for multidrive high bus performance 7.5 DATA EXCHANGE WALKTHROUGH An example of a simple data interchange between an initiating host PC and a target hard disc drive. To send a block of data to a disk drive a pc first checks the bus busy line. When the line indicates the bus is free, the pc will send its identification code over the data lines and pull the bus control lines. If there is more than one device desiring to use the bus at the same time, the device with the highest priority always wins. There is no inherent mechanism to insure fairness or to force a round robin to prevent one device from tying up the bus. After gaining control of the bus the pc will select its target device by activating one of eight lines. The device selected then takes control of the data interchange, and will remain in control until the end of the exchange. The target asks the pc for a command. The pc responds with a command block to read 10 blocks beginning with block 5. The target acknowledges and translates the logical block numbers to absolute sectors, seeks and reads the sectors, performs error correction and transmits the data byte by byte with a handshake acknowlegement after each byte. When it is finished it requests to send its status and transmits a status report, if the status is good and the data does not have to be retransmitted the drive then requests to send a message and reports completion. 8 SCSI Command Format When the target requests a command, the initiator responds by sending out 5 bytes ( 40 bits ) of command information. These bits are used to specify the command and identify the logical device. There is a SCSI COMMON COMMAND SET specification. The purpose of the specification was to "Allow true second sourcing of SCSI hardware." However, because there are still multiple ways to do certain commands and vendor specific functions, hard disc interchangeability has not yet been achieved. From the end user point of view, one can't unplug one scsi drive and replace it with one from another manufacturer and expect it to work without rewriting the device driver software for formats and the message handling scsi driver routines. The set of 40 bits is called a command block. The first byte specifies the class of commands or opcode. Some Common Command Set Opcodes are the following: Opcode 00 (hex) TEST UNIT READY 03 FORMAT UNIT 08 READ 0A WRITE 0B SEEK Since the drive controller electronics is on the drive side of the SCSI BUS the data is organized by the drive controller and requested by block number. The controller translates the block number to the track and sector information used to step to the data. This permits flexibility for the drive manufacturer. A drive with an embedded SCSI controller can reallocate bad blocks internally and substitute blocks automatically from a spare track. The meaning of the remaining bits varies for each opcode. The Write Command, opcode 0A, for example BYTE 0 opcode 1A (00001010) BYTE 1 Logical unit number in bits 5-6, bits 1-4 specify logical block address BYTE 2 logical block address BYTE 3 logical block address BYTE 4 Bits 2 to 5 specify the transfer length BYTE 5 Bits 7 and 6 are vendor unique, bit one is a flag, bit 0 a link 9 SCSI Hardware Bus Specification 25 signal lines; 25 ground lines Signals may assume true or false. Signal assertion true is 0 v. Signal negation (false) is 2.5 to 5.25 V dc ( Bus driver chips typically invert the signal so bus voltage levels are typically the reverse of normal logic levels input to the on chip or input to the bus drivers where +5 V is true.) SCSI BUS SIGNALS Busy indicates the bus is in use Select used by the host to select the drive Control/Data This signal is driven by the target (like a disc drive and indicates whether CONTROL or DATA information is on the DATA bus. A true value indicates a control signal is on the bus. Input/Output This signal is driven by the target (disc drive) and controls the direction of data movement on the DATA bus with respect to the host. A true value indicates input to the host. Message This signal is driven by the target (disc drive) during the message phase. Request This signal is driven by the target (disc drive) and indictes a request for a data transfer handsake acknowlegement. Acknowledge This signal is driven by the host and acknowleges a a data transfer handshake. Attention This signal is driven by the host to indicate a condition needing attention. Reset This forces a reset of devices on the bus. Data lines (8) Parity line (1) This line may be used by the devices to signal a parity error in the received data or command. Bus Power lines ________________