SD(4) — NEWS-OS Programmer’s Manual
NAME
sd − SCSI disk device driver
SYNOPSIS
/dev/sd[0-1][0-6][a-h]
/dev/rsd[0-1][0-6][a-h]
DESCRIPTION
sd is SCSI disk device driver.
Device drivers related to the disk device before Release 3.2 were separated into 3. One for hard disk (hd), one for magneto optical disk (od), and one for CD-ROM driver (cd).
From NEWS-OS Release 3.3, sd can handle all the device drivers.
Followings are the disk devices that sd can recongize.
Direct access device(device type = 0x00)
Read-only Direct-access device(device type = 0x05)
Optical memory device(device type = 0x07)
The standard device names begin from sd, followed by a logical device number, and a letter ‘a’ through ‘h’ which shows its partition.
An access to a disk device as a block device interrupts the buffering mechanizm of the system, which enables to read/write without knowledge of physical locaton of record in the disk drive.
‘RAW’ interface, which provides a direct transfer between read and write buffers for a disk device and a user, is also attatched. It executes one input/output operation by only one call for read/write. Raw input/output is very effective for a large amount of data transfer. The raw device starts from a letter ‘r’.
The followings are how to specify a configuration of sd device driver.
NWS-800/900/1800/3800 Series:
controllersdc0at iop0priority n
disksd0at sdc0 drive 0flags 0
NWS-1200/1400/1700/3200/3400/3700 Series:
controllersdc0at hb0priority n
disksd0at sdc0 drive 0flags 0
SCSI bus number of the disk device is specified by bit 3 in priority n.
SCSI ID number of the disk device is specified by bit 0 to 2 in priority n.
Logical Unit number of the disk device is specified by drive.
NWS-3100/5000/5900 Series:
controllersdcBat ap0priority 0
disksd0at sdcB drive nflags 0
SCSI bus number of the disk device is specified by sbcB. (B is SCSI bus number.)
SCSI ID number of the disk device is specified by bit 0 to 2 in drive n.
Logical Unit number of the disk device is specified by bit 3 to 5 in drive n. Specify initialization procedures for each device in flags.
Bit 0 in flags enables or disable input to RAW device. When this bit is 0, write action in RAW device is disabled for the partitions opened by block device, which prevents wrong input at a RAW device level. When this bit is 1, write action at a RAW device level is enabled for the partitions opened by block device.
Bit 1 in flags controls error status for sd. When this bit is 1, expand error status of sd is set to b_error of buf structure.
Bit 2 in flags controls WRETE AND VERIFY actions. When this bit is 1, media verify by ECC check whether the data is written correctly after the input.
For those with the disk informations on a partition size etc in the first sector of the disk device, that information is used. For those without the disk information recorded in the device information table, sddevinfo, in device information file " /sys/{newsiodev,newsapbus}/sddefs.c " is used. When partition information is not recorded, the partition information is culculated and used from a disk device memory capacity.
New type device can be attatched by modifying a device information. However, please avoid changing data recorded in an existing device information table.
See the header file /sys/{newsiodev,newsapbus}/sdreg.h for the format of a device information table.
Disk device whose media can be taken apart rotates a media at the time of devices openning, and stops the rotation when there is no following open action within a certain interval after closing device.
Besides once device is opened, eject action is prohibited until closing it.
SUPPORT DEVICE
Disk device supported by sd device driver is recorded in a device information table, sddevinfo, in the device information file /sys/{newsiodev,newsapbus}/sddefs.c. By adding the disk devices’s descriptions into the device information table, sddevinfo, new type disk devices can be used.
Moreover, the disk devices which are not recorded in the device information table, sddevinfo, can be attached.
In this case, the defaults of those disk devices are used for functions such as error correction, pre-reading data chache and so on.
IOCTL
sd device driver equips some ioctls, shown by
/sys/newsiodev/dkio.h
/sys/{newsiodev,newsapbus}/sdreg.h
/sys/newsiodev/scu.h
/sys/newsiodev/odreg.h
/sys/newsiodev/cdctl.h
The specifications may change from a version to another.
FILES
/dev/sd[0-1][0-6][a-h] block device
/dev/rsd[0-1][0-6][a-h] RAW device
/sys/{newsiodev,newsapbus}/sd_var.c disk device environment variables definition file
/sys/{newsiodev,newsapbus}/sddefs.c disk device information file
/sys/{newsiodev,newsapbus}/sdreg.h ioctl command and structure definition
/sys/newsiodev/dkio.h ioctl command and structure definition
/sys/newsiodev/scu.h ioctl command and structure definition
/sys/newsiodev/odreg.h ioctl command definition related to magneto optical disk
/sys/newsiodev/cdctl.h ioctl command and structure definition related to CD-ROM
SEE ALSO
NEWS-OSRelease 4.2.1R