INTRO(4) BSD INTRO(4)
NAME
special files - introduction to special files
DESCRIPTION
This section describes various special files found in /dev, which is a
link to `node_data/dev. With a few exceptions, these files are devices
or pseudo-devices.
Domain/OS implements the conventional UNIX I/O functions (read, write,
open, close, etc.) by way of managers specific to each device's type.
Loosely, there are two classes of device special files:
⊕ Those whose characteristics are known to the system and, therefore,
carry no additional information (and hence are 0-length).
⊕ Those that contain information needed by the manager in the file
itself (for example, some files implementing pseudo-ttys contain the
circular buffers used for holding the characters being read or
written).
This classification is strictly informal: the size and contents of the
device special file are known to and used only by its manager.
Each device has associated with it a 23-bit major device number and a 9-
bit minor device number. For character special devices, there is no
further interpretation of the major device number; interpretation of the
minor device number is up to the manager of the particular device type.
For block special devices, on the other hand, the device number has the
following structure:
Major Number Minor Number
|_____________________________________________________|_____________________|
|___________________NODE_ID____________________|__CT__|_CN_|__DN__|__LVN____|
31 12 11 9 8 7 6 4 3 0
Managers of block special devices interpret these fields as follows:
Major Number Major device number (23 bits, 9-31), containing the
following fields:
NODE ID The Apollo node identifier (20 bits, 12-31)
CT Controller type (3 bits, 9-11), where
winchester = 0, floppy = 1, and storage
module = 4.
Minor Number Minor device number (9 bits, 0-8), containing the
following fields:
CN Controller number within controller type (2
bits, 7-8)
DN Drive number on this controller (3 bits, 4-6)
LVN Logical volume number on this drive (based on
one drive; 4 bits, 0-3)
`node_data/device_numbers maps major device numbers to device type UIDs
(unique identifiers) and vice-versa. Use mkdevno(8) to view and alter
the contents of `node_data/device_numbers.
Use crddf(1) to create special devices. Raw disk device special files
must have device numbers identical to the corresponding block disk device
special files.
FILES
`node_data/device_numbers map of major device numbers to device type
UIDs
SEE ALSO
crddf(1), mkdevno(8)