How SCSI Works
- Small computer systems interface (SCSI) is a interface cable used to transfer data between devices on both internal and external computer buses. It is the fastest way of communicating between servers or between computers and peripheral devices like scanners and printers.
- Each SCSI controller will allow limited number of devices connected in series refered to as daisy chain to communicate(upto 8 devices).With the 32 bit wide data transfer option, data rates of up to 40 megabytes per second are possible
- A SCSI controller, communicates with the operating system across a SCSI bus. Each SCSI bus has a unique identifying number from 0 to 7. A device ID is assigned when the device is installed. Signals pass from one device to another along the SCSI bus consisting of wires. Each wire or line is insulated in cables to protect from electrical interference. The data lines are in green and control lines are in red. The SCSI use 16 lines to send data but only 2 devices can communicate with each other at a time.
- When the operating system initiates the communication the SCSI controller becomes an initiator and the other devices on daisy chain becomes targets. To access the bus the SCSI controller waits till there is a stop in traffic (bus free phase) and gains control of bus by sending a burst of current on 36th wire called the BSY or busy line and in parallel sending the signal on the 7th wire. This tells the bus that the device 7 wants to control the bus. If another device tries to gain control then the bus goes into arbitration phase, in which the devices compete for control by looking for the highest priority number. After 2.4 micro seconds the device with the highest ID number gains control by sensing a signal on line 44.
- A single transaction between an “initiator” and a `target” can involve up to 8 distinct `phases.’ In next phase, known as selection phase the arbitrating device (now called the initiator) asserts the SCSI ID of the target on the DATA BUS by turning on line 32 or the ANT Line or attention line. The target will acknowledge the selection by raising the –REQ line or request line.
- The target reads the data and turns off the current on the REQ line by telling the initiator that it got the data. The initiator in turn switches off the ACK line to acknowledge the target’s acknowledgment.
- The SCSI protocol allows a device to disconnect from the bus while processing a request so that SCSI devices can communicate with the controller.
- The data in and data out process repeats between initiator and target. For example, the DATA OUT phase transfers data from the host adapter to the disk drive. The DATA IN phase transfers data from the disk drive to the host adapter.
- Upon completion, it enters the the final phase with the output status. If the communication was successful it is GOOD status (value, 0x00). There are 9 total status codes:
CHECK CONDITION (value, 0x02), CONDITION MET (0x04), BUSY(0x08), INTERMEDIATE(0x10), INTERMEDIATE-CONDITION MET (0x14), RESERVATION CONFLICT (0x18), COMMAND TERMINATED (0x22), QUEUE FULL (0x28)