DISK — Devices
NAME
disk − Device used to read and write disk sectors
DESCRIPTION
Disk devices are used to read and write sectors on magnetic disk devices. Each read or write kernel call on a disk device may access one or more sectors on the device. The buffer specified to the kernel call must be a multiple of the disk’s sector size, normally 512 bytes. Reading or writing disk sectors advances the file pointer to the sector after the last one accessed. The lseek kernel call may be used to position the file pointer to any sector.
PARTITIONS
A disk may be divided into eight possibly overlapping ranges of disk sectors called partitions. The partitions are defined by a structure called a disk label which resides in the first sector of the disk. The label structure is defined in the include file <kernel/devDiskLabel.h>. Traditionally, partitions have been named by the letters a through h. Partition c is normally used to access the entire disk.
UNIT NUMBERS
For disk devices, the least significant four bits of the unit number are used to select the partition. A unit number of zero implies partition a while seven implies partition h. The entire disk can be accessed using a unit number of eight regardless of the partitioning defined by the label. Unit number eight is useful for writing a label to an unlabeled disk.
KEYWORDS
disk, partition, label
Sprite version 1.0 — July 02, 1989