The Linux SCSI Generic (sg) HOWTO
Prev |  | Next

# Chapter 1. Introduction

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.

This document can be found at the Linux Documentation Project's site at `www.linuxdoc.org/HOWTO/SCSI-Generic-HOWTO/` . It is available in plain text and pdf renderings at that site. A (possibly later) version of this document can be found at `www.torque.net/sg/p/sg_v3_ho.html`. That is a single html page; drop the ".html" extension for multi-page html. There are also postscript, pdf and rtf renderings from the original SGML (docbook) file at the same location.

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 3rd May 2002.

Prev | Home | Next
The Linux SCSI Generic (sg) HOWTO |  | What the sg driver does