Specifications
Data Structures
1.19 Unit Control Block (UCB)
1.19 Unit Control Block (UCB)
The unit control block (UCB) is a variable-length block that describes a single
device unit. Each device unit on the system has its own UCB. The UCB describes
or provides pointers to the device type, controller, driver, device status, and
current I/O activity.
During autoconfiguration, the driver-loading procedure creates one UCB for
each device unit in the system. A privileged system user can request the
driver-loading procedure to create UCBs for additional devices with the System
Generation utility (SYSGEN) command CONNECT. The procedure creates UCBs
of the length specified in the DPT. The driver uses UCB storage located beyond
the standard UCB fields for device-specific data and temporary driver storage.
UCBs are variable in length depending on the type of device and whether the
driver performs error logging for the device. The operating system defines a
number of UCB extensions in the data structure definition macro $UCBDEF
and defines a terminal device extension in $TTYUCBDEF. Table 1–21 lists those
extensions that are most often used by device drivers, indicating where each
extension is described in this chapter. Note that use of the dual-path extension is
reserved to Digital; its contents should remain zero.
Table 1–21 UCB Extensions and Sizes Defined in $UCBDEF
Extension Used by Size Figure Table
Base UCB All devices UCB$K_SIZE 1–23 1–22
Error log extension All disk and tape devices UCB$K_ERL_LENGTH 1–24 1–23
Dual-path extension Reserved to Digital UCB$K_DP_LENGTH
(UCB$K_2P_LENGTH)
——
Local tape extension All tape devices UCB$K_LCL_TAPE_LENGTH 1–25 1–24
Local disk extension All disk devices UCB$K_LCL_DISK_LENGTH 1–26 1–25
Terminal extension
1
Terminal class and port
drivers
UCB$K_TT_LENGTH 1–27
2
1–26
1
The terminal UCB extension is defined by the data structure definition macro, $TTYUCBDEF.
2
Fields marked by asterisks may be written only by the terminal class driver (TTDRIVER.EXE); a port driver may only
read these fields.
To use an extended UCB, a device driver must specify its length in the ucbsize
argument to the DPTAB macro. For instance:
DPTAB -,
.
.
.
UCBSIZE=UCB$K_LCL_TAPE_LENGTH,-
.
.
.
As illustrated in Figure 1–22, each UCB extension used in a disk or tape driver
builds upon the base UCB structure and any extension $UCBDEF defines earlier
in the structure. (Note that UCB extensions shown in bold boxes are reserved
to Digital.) For instance, if you specify a UCB size of UCB$K_LCL_TAPE_
LENGTH, the size of the resulting UCB can accommodate the base UCB, the
error-log extension, the dual-path extension, and the local tape extension.
1–83