Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

df(1)

diskpart(8)

SD(4)  —  UNIX Programmer’s Manual

NAME

sd − SCSI disk controller

SYNOPSIS

device sd0 at sec? doneq 50 req 50 bin 5 unit 0 target 0 # embedded SCSI device sd0 at sec? doneq 50 req 50 bin 5 unit 0 target 6 # target adaptor

DESCRIPTION

This device driver controls both SCSI disk target adapters and SCSI disks with embedded targets ("embedded SCSI" disks).  It supports up to eight disks per target adapter, with a maximum of seven target adapters per SCED board, or it can support a maximum of seven embedded SCSI disks per SCED board.  The device driver can support a maximum of 32 disk drives per system.  Mixing of embedded SCSI and target adaptors is not allowed on one system. 

Special files with minor device numbers 0−7 refer to partitions a−h on drive “sd0” (the first drive listed in the kernel configuration file), minor device numbers 8−15 refer to “sd1”, and so on.  Standard device names are of the form “sdnx”, where n is the drive number and x is the partition name (a−h). 

Block devices access the disk via the system’s normal buffering mechanism, and may be read and written without regard to physical disk records.  There is also a “raw” interface that provides for direct transmission between the disk and the user’s read or write buffer.  A single read or write call results in exactly one I/O operation, and therefore raw I/O is considerably more efficient when many words are transmitted.  The names of the raw special files conventionally begin with an extra “r” — e.g., “rsd0a”.  Raw transfers are limited to a maximum of 254 512-byte sectors because of the SCSI command structure.  In raw I/O, counts must be a multiple of 512 bytes, and must begin on 16-byte aligned memory addresses.  Likewise, lseek calls should specify a multiple of 512 bytes. 

CONFIGURATION

Before attempting to add a new disk or target adapter, read the disk and target adapter manuals thoroughly.  The main information needed is how to set the target adapter number and drive-select cabling. 

Table of disk units. 
The “sdbconf” array in the device driver binary configuration file (/sys/conf/conf_sd.c) must contain an entry for each drive that may be configured; the entries must be in the same order as the “device” entries in the kernel configuration file (kernel configuration files are described in the article “Building DYNIX Systems with Config” in Volume 2).  When adding a new drive, make sure that the corresponding entry in “sdbconf” points to the partition table for the appropriate drive type.  (As installed, “sdbconf” has entries for 8 drives, all using the same partition table.  Superfluous entries are ignored; you must add more entries if you have more than 8 drives.) 

Partition tables. 
The binary configuration file contains one or more partition tables, defined as arrays of 8 “sd_partition” structures. Each partition table gives the starting address and size (in 512-byte sectors) of the 8 partitions on a particular type of disk. To support a new disk layout, add a new partition table to the binary configuration file, using an existing table as a template.

TUNING PARAMETERS

The following tuning parameters are defined for each drive in the “sdbconf” array of the binary configuration file: (1) the buffer size for ioctl operations, (2) the number of IATs (indirect access table entries, used for scatter/gather I/O), and (3) water marks to lessen the interrupt load on the SCED board. 

IATs. 
An indirect access table is used to map a contiguous I/O buffer in virtual memory to the corresponding pages scattered throughout physical memory. Each table entry (IAT) can map up to 2048 bytes. The number of IATs directly affects the total number of of outstanding requests that the device driver can queue to the SCED board. Groups of IATs are allocated on a per-transfer basis, and there must be enough entries to handle at least one request.

Water marks. 
The water marks are “low” and “thresh(hold)”. The device driver will queue up a maximum of “thresh” requests in a drive’s device output queue before interrupting the SCED board to handle the requests. The “low” water mark is used when the device input queue has been filled and is draining off. The device driver does not begin queuing requests again until the “low” water mark has been reached. (The size of a drive’s device input and output queues is defined by the “doneq” and “req” fields of the corresponding “device” entry in the kernel configuration file.)

FILES

/dev/sd?[a-h]block files
/dev/rsd?[a-h]raw files
/sys/conf/conf_sd.cbinary configuration file

SEE ALSO

df(1), diskpart(8)

DIAGNOSTICS

See the ANSI X3T9.2 (SCSI) specification. 

BUGS

In raw I/O, read(2) and write(2) truncate file offsets to 512-byte block boundaries, and write scribbles on the tail of incomplete blocks.  Thus, in programs that access raw devices, read, write, and lseek(2) should always deal in 512-byte multiples.

A program to analyze the logged error information (even in its present reduced form) is needed.  Error messages should be more consistent. 

The partition tables for the file systems should be read off of each disk, as they are never quite what any single installation would prefer, and this would make disks more portable. 

The kernel “milliseconds per seek” statistic is not kept for this device; thus, iostat(1) always reports zero for this statistic.

When a request to the disk accesses past the end of media (for example, a non-existent block number), the device driver will report soft errors followed by a hard error in the same way that a bad block is treated.  There is no special handling of the volume overflow sense error code for disks. 

DYNIX

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026