This document outlines the Linux SCSI Generic (sg) driver interface as found in the 2.4 series kernels. The driver's purpose is to allow SCSI commands to be sent directly to SCSI devices. The responses of those commands can then be obtained. This type of driver is sometimes termed as a "pass through". In the case of SCSI disks, the block subsystem which is normally used to mount and access a disk, is bypassed permitting low level operations such as formatting to be performed. Various specialized applications for writing CD-Rs and document scanning use the sg driver.
Many devices that use other physical buses (e.g. ATAPI cdroms, USB mass storage devices and IEEE 1394 sbp2 devices) utilize the SCSI command set. By using Linux pseudo SCSI device drivers which bridge between the native protocol stack and the SCSI subsystem, the upper level SCSI device drivers, including sg, can be used to control "non-SCSI" devices.
This is the third major version of the sg driver. A summary of the sg driver history is as follows:
sg version 1 (original) from 1992 to early 1999 (lk 2.2.5) . A copy of the original HOWTO (in plain text) is at www.torque.net/sg/p/original/SCSI-Programming-HOWTO.txt
sg version 2 from lk 2.2.6 in the 2.2 series. Its documentation is available in abridged form [www.torque.net/sg/p/scsi-generic.txt] and a longer form [www.torque.net/sg/p/scsi-generic_long.txt].
sg version 3 in the linux kernel 2.4 series.
A more general description of the Linux SCSI subsystem of which sg is a part can be found in the SCSI-2.4-HOWTO.
This document was last modified on 26th January 2002.