Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ gd(7) — CX/UX 6.20

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

format(1M)

hdc(7)

hsa(7)

ise(7)

gd(7)

NAME

gd − Generic disk device driver

DESCRIPTION

The gd driver is a generic disk device driver.  It is generic in the sense that differing disk interfaces can share the same higher level disk driver software, while relegating most interface specific functions of the device driver to a standard collection of kernel entry points known as interface modules.  This layered approach to the driver software allows the gd driver to uniformly handle all the disk related issues of the device driver, such as managing disk geometries, formatting, etc.  Thus, all disks employing this generic driver will share a similar functional profile, from the perspective of the user or system administrator.  Disks that use the gd driver will have consistent special file names, the same major number and consistent minor device numbering.  The gd driver also facilitates the sharing of disk partitioning, flaw management, formatting, and error reporting software, eliminating the the need for new (incompatible) utilities. 

There are currently one SMD disk interface and two SCSI interfaces that employ the generic disk driver.  The HVME Disk Controller (HDC) supports SMD and SMD/E disks.  The HVME SCSI Adaptor (HSA) and the Integral SCSI/Ethernet Daughtercard (ISE) both connect to SCSI interface disks.  It is expected that device drivers for future CX/UX disk products will also use this same generic driver/interface module paradigm to ease integration of new technologies and disk interface mechanisms. 

Disk Names, Special Files, Minor Device Numbers

Disk device special file names have the form /dev/dsk/?s0 and /dev/rdsk/?s0.  /dev/dsk refers to a blocked disk device; /dev/rdsk refers to a raw disk device.  The character "?" stands for a unit number (hex) in the range 0-1f.  The number refers to a partition (0-7) on the disk unit.  Special files with minor device numbers 0-7 refer to the 8 partitions on disk unit 0; minor device numbers 8-15 refer to the 8 partitions on disk unit 1; etc. 

Blocked and Raw I/O

Blocked files 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 which provides for direct transmission between the disk and a buffer.  A single read or write call results in exactly one I/O operation; therefore raw I/O is more efficient. 

Disk Partitions

Each hdc disk is made up of eight partitions (?s0 - ?s7).  Partition ?s0 starts at sector 0; partitions ?s1 - ?s6 start at sector 0 plus the sum of the sizes of all lower-numbered partitions.  Partition ?s7 is defined (via the profile prom) to be the last cylinders of the disk.  The gd driver formatting program, format, may be used to define the size of each partition (partition ?s7 may not be redefined). 

Partition ?s0 is normally used for the root file system.  Partition ?s1 is normally used as a paging area.  Partition ?s2 is normally used for the rest of the disk.  Partition ?s7 is comprised of the disk description and diagnostic tracks.  The description tracks contain the geometry block and flawmap for the disk.  Only format may modify the contents of the description tracks. 

Geometry Block

A geometry block resides on the first sector of the disk description tracks (in partition ?s7) of each gd disk.  This geometry block defines the disk partitions and the location of the flaw map on disk.  Only format may modify the geometry block. 

OPERATIONS

A number of ioctl operations are defined for raw disk partitions via the <sys/dskio.h> include file.  The DSKIOCFORMAT, DSKIOCFORMATCTL, DSKIOCVENDORFLAW, DSKIOCSETGEOMETRY, DSKIOCVERIFY, DSKIOCATOMICFORMAT, DSKIOCRELOCATE functions are reserved for use by the format utility.  However, certain others are generally available. 

DSKIOCGEOMETRY

This function uses the geometry_status structure as the ioctl argument and returns the starting and ending sector address for each of the disk partitions. 

DSKIOCSTATUS

This function returns a dsk_status structure (passed as the ioctl argument) which will contain the status of the selected raw disk. 

DSKIOCPASS

This function, which is available only on the SCSI disk controllers, is used to pass a SCSI command directly to the drive.  The ioctl argument must be the address of a dskpass structure, containing the length of the SCSI command, the SCSI command bytes, an optional buffer address giving the user address of a data buffer, the length of the data buffer, and a mode word indicating whether the buffer is for input, output or neither. 

DSKIOCPRIORITY

This function, available only on selected controllers, allows the user to pass a priority table to the controller.  The function uses the priority_op as the ioctl parameter, which points to a user buffer.  This buffer consists of an array of ’short’ integers, one for each possible priority in the system.  The value in the array corresponding to the process priority is then passed to the disk controller as the priority of the operation.  The function is accepted only when sent to the ?s7 partition of the disk. 

FILES

/dev/dsk/[0-1f]s[0-7]      dsk block files
/dev/rdsk/[0-1f]s[0-7]     dsk raw files
/usr/include/sys/dskio.h

SEE ALSO

format(1M), hdc(7), hsa(7), ise(7)

BUGS

When raw I/O is used, buffers must begin on a long word boundary and byte counts must be a long word multiple.  Reads and writes return EFAULT when either condition is not true. 

CX/UX Administrator’s Reference

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