Task Control Block

Last updated

The Task Control Block (TCB) contains the state of a task [a] in, e.g., OS/360 and successors on IBM System/360 architecture and successors.

Contents

The TCB in OS/360 and successors

In OS/360, OS/VS1, SVS, MVS/370, MVS/XA, MVS/ESA, OS/390 and z/OS, the TCB [1] [2] [3] :311–321 contains, among other data, non-dispatchability flags and the general and floating point registers for a task that is not currently assigned to a CPU.

A TCB provides an anchor for a linked list of other, related request blocks [3] :269–301 (RBs); the top-linked RB for a TCB contains the Program status word (PSW) when the task is not assigned to a CPU.

When the control program's dispatcher selects a TCB to be dispatched, the dispatcher loads registers from the TCB and loads the PSW from the top RB of the TCB, thereby dispatching the unit of work.

Request Blocks

OS/360 has the following types of request blocks

Interruption Request Block [3] :281–284
An IRB is used to handle an asynchronous exit. [b]
Program Request Block [3] :285–287
A PRB represents a module invoked with an ATTACH macro, a LINK macro or a synchronous exit. [c]
System Interruption Request Block [3] :289–291
An SIRB is used to run I/O error recovery code.
Supervisor Request Blocks [3] :293–301
An SVRB represents the execution of a Type 2, Type 3 or Type 4 SVC routine

An RB contains several fields, among them an old PSW, old general registers, a PSW and a wait count.

Dispatching

The Dispatcher is a routine in the nucleus that selects the work to be dispatched. It selects the highest priority task that:

  1. Is not running on another CPU
  2. Does not have any non-dispatchability flags set
  3. Has a top RB with a zero wait count.

The system maintains a pair [d] of TCB pointers known as TCB old and TCB new. A TCB new pointer of zero causes the dispatcher to search for an eligible task.

When the dispatcher finds an eligible task, it sets the old and new TCB pointers. loads the registers from the TCB and loads the PSW from the top RB.

If the dispatcher fails to find eligible work, it enters an enabled wait.

History

With the introduction of MVS/370 and successor systems, a whole new environment was introduced: the Service Request Block (SRB), which generally has a higher priority than any Task Control Block, and, indeed, which itself has two distinct priorities: a Global SRB (priority over all local address space SRBs and TCBs) and a Local SRB (priority over only the local address space TCBs); and MVS's dispatcher must manage all of these with absolute consistency across as many as two processors (MVS/370) and as many as sixteen processors (successor systems).

See also

Notes

  1. Roughly analogous to a thread in UNIX-like operating systems.
  2. An asynchronous routine to handle an exception, timer event or other signal.
  3. Unprivileged callback routine.
  4. In 65MP there is a pair for each CPU; in MVS there are pointers for each address space.

Related Research Articles

<span class="mw-page-title-main">MVS</span> Operating system for IBM mainframes

Multiple Virtual Storage, more commonly called MVS, is the most commonly used operating system on the System/370, System/390 and IBM Z IBM mainframe computers. IBM developed MVS, along with OS/VS1 and SVS, as a successor to OS/360. It is unrelated to IBM's other mainframe operating system lines, e.g., VSE, VM, TPF.

<span class="mw-page-title-main">IBM System/370</span> Family of mainframe computers 1970–1990

The IBM System/370 (S/370) is a range of IBM mainframe computers announced as the successors to the System/360 family on June 30, 1970. The series mostly maintains backward compatibility with the S/360, allowing an easy migration path for customers; this, plus improved performance, were the dominant themes of the product announcement.

z/Architecture, initially and briefly called ESA Modal Extensions (ESAME), is IBM's 64-bit complex instruction set computer (CISC) instruction set architecture, implemented by its mainframe computers. IBM introduced its first z/Architecture-based system, the z900, in late 2000. Later z/Architecture systems include the IBM z800, z990, z890, System z9, System z10, zEnterprise 196, zEnterprise 114, zEC12, zBC12, z13, z14, z15 and z16.

In computing, channel I/O is a high-performance input/output (I/O) architecture that is implemented in various forms on a number of computer architectures, especially on mainframe computers. In the past, channels were generally implemented with custom devices, variously named channel, I/O processor, I/O controller, I/O synchronizer, or DMA controller.

The IBM Basic assembly language and successors is a series of assembly languages and assemblers made for the IBM System/360 mainframe system and its successors through the IBM Z.

A control register is a processor register that changes or controls the general behavior of a CPU or other digital device. Common tasks performed by control registers include interrupt control, switching the addressing mode, paging control, and coprocessor control.

In IBM mainframe operating systems OS/360 and its successors, a Unit Control Block (UCB) is a memory structure, or a control block, that describes any single input/output peripheral device (unit), or an exposure (alias), to the operating system. Certain data within the UCB also instructs the Input/Output Supervisor (IOS) to use certain closed subroutines in addition to normal IOS processing for additional physical device control.

In IBM mainframe operating systems, basic partitioned access method (BPAM) is an access method for libraries, called partitioned datasets (PDSes) in IBM terminology. BPAM is used in OS/360, OS/VS2, MVS, z/OS, and others.

A Supervisor Call instruction (SVC) is a hardware instruction used by the System/360 family of IBM mainframe computers up to contemporary zSeries, the Amdahl 470V/5, 470V/6, 470V/7, 470V/8, 580, 5880, 5990M, and 5990A, and others; Univac 90/60, 90/70 and 90/80, and possibly others; the Fujitsu M180 (UP) and M200 (MP), and others; and is also used in the Hercules open source mainframe emulation software. It causes an interrupt to request a service from the operating system. The system routine providing the service is called an SVC routine. SVC is a system call.

In IBM mainframe operating systems, Execute Channel Program (EXCP) is a macro generating a system call, implemented as a Supervisor Call instruction, for low-level device access, where the programmer is responsible for providing a channel program—a list of device-specific commands (CCWs)—to be executed by I/O channels, control units and devices. EXCP for OS/360 and successors is more specifically described in the OS System Programmer's Guide.; EXCP for DOS/360 and successors is more specifically described in DOS Supervisor and I/O Macros. This article mostly reflects OS/360 through z/OS; some details are different for TOS/360 and DOS/360 through z/VSE.

The history of IBM mainframe operating systems is significant within the history of mainframe operating systems, because of IBM's long-standing position as the world's largest hardware supplier of mainframe computers. IBM mainframes run operating systems supplied by IBM and by third parties.

<span class="mw-page-title-main">OS/360 and successors</span> Operating system for IBM S/360 and later mainframes

OS/360, officially known as IBM System/360 Operating System, is a discontinued batch processing operating system developed by IBM for their then-new System/360 mainframe computer, announced in 1964; it was influenced by the earlier IBSYS/IBJOB and Input/Output Control System (IOCS) packages for the IBM 7090/7094 and even more so by the PR155 Operating System for the IBM 1410/7010 processors. It was one of the earliest operating systems to require the computer hardware to include at least one direct access storage device.

<span class="mw-page-title-main">OS/VS2 (SVS)</span> Operating system

Single Virtual Storage (SVS) refers to Release 1 of Operating System/Virtual Storage 2 (OS/VS2); it is the successor system to the MVT option of Operating System/360. OS/VS2 (SVS) was a stopgap measure pending the availability of MVS, although IBM provided support and enhancements to SVS long after shipping MVS.

The IBM System/360 architecture is the model independent architecture for the entire S/360 line of mainframe computers, including but not limited to the instruction set architecture. The elements of the architecture are documented in the IBM System/360 Principles of Operation and the IBM System/360 I/O Interface Channel to Control Unit Original Equipment Manufacturers' Information manuals.

The IBM Administrative Terminal System (ATS/360) provided text- and data-management tools for working with documents to users of IBM System/360 systems.

In MVS/370 and successor versions of IBM mainframe operating systems, Start Input/Output (STARTIO) is a macro instruction and a "branch entry" for low-level device access, where the programmer is responsible for providing a list of device-specific CCWs, that is, a channel program, to be executed by I/O channels, control units and devices and a number of "exits", several of which may be immediate returns to the Input/Output Supervisor (IOS). Invokers of STARTIO must be in supervisor mode and key 0. STARTIO interfaces directly with the IOS component of MVS.

In IBM mainframe operating systems, Execute Channel Program in Real Storage (EXCPVR) is a macro generating a system call, implemented as a Supervisor Call instruction, for low-level device access, where the programmer is responsible for providing a list of device-specific CCWs, that is, a channel program, to be executed by I/O channels, control units and devices. Additionally, the programmer is expected and required to ensure that the input/output data areas are in real storage and are "fixed", either prior to invoking EXCPVR or via the page fix appendage. EXCPVR can in some situations provide improved performance compared to EXCP.

The Input/Output Supervisor (IOS) is that portion of the control program in the IBM mainframe OS/360 operating system and successors which issues the privileged I/O instructions and supervises the resulting I/O interruptions for any program which requests I/O device operations until the normal or abnormal conclusion of those operations.

A Service Request Block (SRB) is a data structure of MVS/370 and successor versions of IBM mainframe operating systems employed mainly, but not exclusively, by the Start Input/Output interface.

References

  1. IBM System/360 Operating System - Fixed-Task Supervisor - Program Number 360S-CI-505 (PDF). Program Logic (Third ed.). February 1967. Y28-6612-2.
  2. IBM System/360 Operating System - MVT Supervisor (PDF). Program Logic (Eighth ed.). May 1973. GY28-6659-7. Retrieved March 14, 2022.
  3. 1 2 3 4 5 6 IBM System/360 Operating System: System Control Blocks - OS Release 21.7 (PDF). Systems Reference Library (Tenth ed.). IBM. April 1973. GC28-6628-9. Retrieved June 12, 2022.