ST(4) BSD Programmer's Manual ST(4)NAMEst - machine-independent SCSI tape driver
SYNOPSIS
st0 at tg? unit 0
st* at tg? unit ?
DESCRIPTION
The st driver for tape drives on the Small Computer System Interface (AN-
SI X3.131-1992) bus is a machine-independent generic device which employs
machine-dependent drivers for individual host bus adapters (see hba(4))
to send commands to manipulate tapes. The st driver takes care of open-
ing the tape device, locking out other users and serializing I/O; gener-
ating the correct read and write Command Descriptor Blocks, and handling
specialized tape commands such as space forward, write filemarks or
rewind; and detecting errors and reporting them in a standard way to the
user's terminal. The driver supports the standard mt(1) tape motion com-
mands.
The clone entry st* should be listed last; this will automatically match
any otherwise unmatched SCSI tapes. Additional instances of st devices
can be ``wired'' to particular targets as described in tg(4).
FIXED BLOCK SIZE
The st driver defaults to 1024 byte records. Some DAT and 8mm drives use
jumpers to select the length of fixed length records. If the drive is
jumpered for 512 byte records then the drive may not operate successfully
with 1024 byte records. The mt(1) command can be used to select 512 byte
operation by the st driver. Refer to the mt(1) man page for details.
SUBUNIT ENCODING
There are 10 bits in the subunit field. The low order bit is the no-
rewind bit. The next 8 bits are the SCSI density bits. These can be used
to force selection of a particular density, given that the drive supports
the density and supports density selection. A value of zero means use
the default density. The high bit of the subunit filed is used to force
fixed length records for DAT and 8mm drives. Refer to the mknod(8) man
page for details on creating device special files.
RESIDUAL BYTE COUNT
An application program is allowed to do read(2) system calls with a
length greater than the expected tape record. The read(2) system call
should return the number of bytes actually transfered. Some, hopefully
all older, tape drives do not report back the number of bytes actually
transfered when the tape record was shorter than the length requested in
the SCSI read operation. To work around this, by default, the residual
byte count returned from the SCSI HBA is used for SCSI 1 and CCS tape
drives. Some SCSI 2 tape drives use the SCSI disconnect option in a man-
ner which makes it impossible for the HBA to correctly determine the
residual byte count. For this reason, by default, only the residual byte
count returned from the target is used with SCSI 2. Therefore, using the
default settings, a SCSI 2 tape drive which does not return the residual
byte count correctly will not operate correctly. It is also conceivable,
but highly unlikely, that SCSI 1/CCS drives exist that will have problems
using the default settings. It is possible with boot(8) to force the non
default action for both SCSI 1/CCS and SCSI 2 tape drives. The -param
command is used to set the ``usehbaresid'' parameter. The values that
``usehbaresid'' can be set to are ``yes'' or ``no.'' The following are
examples of lines which might be added to boot.default: the command
-parm st0 usehbaresid=yes
-parm st1 usehbaresid=no
BUS RESET and REWIND
If the HBA driver detects that the SCSI bus is hung in will reset the bus
and notify all the unit drivers of which the st is one. If this occurs
st will not allow read or write operations until a user application com-
mands a rewind or unload. This is to prevent possibly over writing infor-
mation at the beginning of the media because the tape drive rewound when
the SCSI bus was reset.
FILES
/dev/rst[0-n] auto-rewind tape devices
/dev/nrst[0-n] no-rewind tape devices
/dev/rst[0-n]_q11 force QIC-11 tape format
/dev/rst[0-n]_q150 force QIC-150 tape format
/dev/rst[0-n]_fixed force fixed-length records on 8mm or DAT drives
/dev/rst[0-n]_dds force DAT dds 1 density selection
/dev/rst[0-n]_ddsII force DAT dds 2 density selection
/dev/rst[0-n]_fdds force both fixed-length records and DAT dds 1 den-
sity selection
/dev/rst[0-n]_fddsII force both fixed-length records and DAT dds 2 den-
sity selection
SEE ALSOhba(4), mt(1), mknod(8)HISTORY
Written by Donn Seeley of BSDI for BSD/OS 0.3.
BUGS
Many SCSI-1 tapes don't support the SCSI `mode select' command, which the
driver uses to select tape density. The driver currently assumes that
most tapes do support this feature; this assumption may not be wise, and
it will break any tape that does not support it and that isn't listed
specifically in the driver. Currently all Sankyo tapes and some Wangtek
tapes are assumed not to support mode selection.
Most SCSI-1 tapes can't report tape position. The Archive Viper 150 sup-
ports a read physical record number command which gives somewhat differ-
ent results from the SCSI-2 read position command.
Cooked tape doesn't work.
BSDI BSD/OS June 4, 1996 2