Unit Control Block - Overview

Overview

During initial program load (IPL) of current MVS systems, the Nucleus Initialization Program (NIP) reads necessary information from the I/O Definition File (IODF) and uses it to build the UCBs. The UCBs are stored in system-owned memory, in the Extended System Queue Area (ESQA). After IPL completes, UCBs are owned by Input/Output Support. Some of the information stored in the UCB are: device type (disk, tape, printer, terminal, etc.), address of the device (such as 1002), subchannel identifier and device number, channel path ID (CHPID) which defines the path to the device, for some devices the volume serial number (VOLSER), and a large amount of other information, including OS Job Management data.

While the contents of the UCB has changed as MVS evolved, the concept has not. It is a representation to the channel command processor of an external device. Inside every UCB is a representation of a subchannel information block, that is used in the SSCH assembler instruction (put in the IRB, for input, or put in the ORB, for output), to start a chain of channel commands, known as CCWs. CCWs are queued onto the UCB with the STARTIO macro interface, although that reference does NOT discuss the STARTIO macro as that macro instruction is NOT an IBM-supported interface, not withstanding the fact that that interface has remained the same for at least the past three decades. The STARTIO interface will either start the operation immediately, should the Channel Queue be empty, or it will queue the request on the Channel Queue for deferred execution. Such deferred execution will be initiated immediately when the request is at the head of the queue and the device becomes available, even if another program is in control at that instant. Such is the basic design of IOS.

The UCB evolved to be an anchor to hold information and states about the device. The UCB currently has 5 areas used for an external interface: Device Class Extension, UCB Common Extension, UCB Prefix Stub, UCB Common Segment and the UCB Device Dependent Segment. Other areas are internal use only. This information can be read and used to determine information about the device.

In the earliest implementations of this OS, the UCBs (foundations and extensions) were assembled during SYSGEN, and were located within the first 64 kbytes of the system area, as the I/O device lookup table consisted of 16-bit Q-type (i.e., relocatable) addresses. Subsequent enhancements allowed the extensions to be above the 64 kbyte line, thereby saving space for additional UCB foundations below the 64 kbyte line and also thereby preserving the architecture of the UCB lookup table (converting a CUu to a UCB foundation address).

Read more about this topic:  Unit Control Block