Execute Channel Program
In IBM mainframe operating systems, Execute Channel Program (EXCP) is a supervisor call 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.[1][2] EXCP for OS/360 and successors[3][4] is more specifically described in the OS System Programmer's Guide.[5]; EXCP for DOS/360 and successors[6] is more specifically described in DOS Supervisor and I/O Macros[7][8]. This article mostly reflects OS/360 through [z/OS]; some details are different for TOS/360 and DOS/360 through z/VSE.
Specifying datasets
Using EXCP, legacy devices and legacy datasets may be operated on with relatively high performance. EXCP devices are OPENed (that is, are made available to the application) by specifying the Data Control Block (DCB) for OS and the DTFPH for DOS.
Exits (Appendages)
A comprehensive list of "exits" (called, in the EXCP context, "appendages") allows authorized programs to override or augment many of the system security and data integrity checks. Most of these appendages (really, closed subroutines) are supported for compatibility with earlier instances of the OS, but the functions of several have been modified or extended for MVS. The appendages are specified in the DCB as the last two characters of the module name IGG019xx. where xx = WA to Z9 inclusive. These module names are reserved for installation-written appendages. Any other name of the form IGG019xx is reserved for use by IBM access methods.[9] Appendages must reside in SYS1.SVCLIB (SYS1.LPALIB in SVS or later instances of the OS).
Dataset integrity
Normally, when a device is OPENed for EXCP, only the first "extent" is represented in the Data Extent Block (DEB). Among other information each DEB contains information on the location and size of each extent of the data set. (Each DEB is forward- and backward-chained to the DCB as a system security measure as the DCB resides in unprotected user storage whereas the DEB resides in protected system storage, Subpool 253). If, for example, the programmer tries to read past the end of an extent, an exception occurs and the operation is suppressed, thereby preventing a data integrity exposure. Should the DEB include additional extents, the channel program may be updated by the programmer to refer to the next extent and the EXCP may be reissued, or the end of extent exit appendage, if provided, may update the channel program to the next extent and the operation may be re-driven without first going through the EXCP processor.
Legacy datasets only
EXCP is sometimes confused with a direct access storage device access method, but it is not for direct access storage devices exclusively; rather, it is a general purpose low-level device access interface which supports any legacy device type and any legacy dataset organization. For accessing all device types and all dataset organizations, the more general Start Input/Output interface (STARTIO) is available in MVS/370 and subsequent instances of the OS although it is not an officially supported interface.
Simplified operations on direct access datasets
A variation of EXCP is Execute Direct Access Program (XDAP), which is used for accessing direct access storage only, and is provided for reading and updating existing direct access storage records. XDAP cannot be used to add records, but XDAP can be utilized along with BSAM or BPAM to effect record additions to such datasets, and several OS components utilize XDAP in this manner (the Linkage Editor, IEWL, in particular).
Telecommunications device access
EXCP may also be used to access communications devices attached to IBM 2701, 2702 and 2703 communications controllers and IBM 370x or Amdahl 470x front-end processors (and their respective follow-ons) operating in emulator mode (EP) or partitioned emulator mode (PEP).
Relationship to supervisor
EXCP's front-end is always in TCB mode, as EXCP is a Type 1 SVC. In MVS/370 and subsequent instances of the OS, the EXCP processor invokes STARTIO to schedule execution of the channel program. Although the EXCP processor's back-end is always in SRB mode, the back-end contains emulation code which allows the appendages developed for earlier, pre-MVS instances of the OS, specifically for EXCP, to function largely as before and thereby to appear to be in TCB mode, for which these appendages were originally designed. This distinction can complicate conversion of certain "roll-your-own" access methods and applications to MVS.
Channel programs
System/360 channel programs are a sequence of commands which are executed by the channel and the I/O device. Channel programs can be located anywhere in main storage. The channel program is a sequence of Channel Command Words (CCWs), which may be executed sequentially unless a branch, called "Transfer In Channel" (TIC), is executed, or the channel returns a status modifier. Each CCW is a doubleword (eight bytes) as follows:[10]
bit 0 7 8 31 +--------+-----------------------+ |Command | Data address | +--------+-----------------------+ 32 36 40 47 48 63 +------+---+--------+------------+ |Flags |000|reserved| count | +------+---+--------+------------+ Six commands are defined, in the low-order bits of the command field (0-7). The high-order four (or six) bits are ''modifiers'' ('M') for some commands, or are ignored. The commands are: 0100 - Sense 1000 - Transfer in Channel (TIC) 1100 - Read backward --01 - Write --10 - Read --11 - Control
The data address (8-31) is the 24-bit address of a main storage buffer area to or from which the data is to be transferred.
The flag bits (32-36) are defined as follows:
Bit | ID | Name | Description |
---|---|---|---|
32 | CD | Chain data | Use the storage area specified in the next CCW to continue this command |
33 | CC | Chain command | Execute the next sequential CCW when this command completes if CC or CD are not set, the channel program terminates after executing this command |
34 | SLI | Suppress length indication | Ignore incorrect length for this command |
35 | SKIP | Skip | Suppress data transfer for this command |
36 | PCI | Program controlled interruption | Generate an interrupt when this command starts executing |
The count field (48-63) indicate the number of bytes to be transferred by this command.
All eight bits of commands that initiate I/O operations are passed to the device. "The modifier bits specify to the device how the command is to be executed." For example, for the IBM 2305 DASD the write command ('MMMMMM01'BX) may have the following values:[11]
Bit value | Hexadecimal | Description |
---|---|---|
0001 1001 | '19'X | Write home address |
0001 0101 | '15'X | Write record 0 |
0001 0001 | '11'X | Erase |
0001 1101 | '1D'X | Write count, key, and data |
0000 0001 | '01'X | Write special count, key, and data |
0000 0101 | '05'X | Write data |
0000 1101 | '0D'X | Write key and data |
References
- Reino Hannula (1974). Computers and Programming: A System/360-370 Assembler Language Approach. Houghton Mifflin. p. 431. ISBN 978-0-395-16796-0.
- Gopal K. Kapur (1 January 1970). IBM 360 Assembler Language Programming. John Wiley & Sons. pp. 453–454, 456–459, 461. ISBN 978-0-471-45840-1.
- Robert H. Johnson (June 1989). MVS: concepts and facilities. Intertext Publications. p. 558. ISBN 978-0-07-032673-6.
- IBM z/VSE Version 6 Release 1 System Macros User's Guide (PDF). IBM. 2015. SC34-2709-00.
- IBM System/360 Operating System System Programmer's Guide (PDF). IBM. March 1967. C28-6550-2.
- Gary A. Stotts (1 August 1990). DOS/VSE: Introduction to the Operating System. QED Information Sciences. p. 18. ISBN 978-0-89435-332-1.
- DOS Supervisor and I/O Macros (PDF). IBM. GC24-S037-12.
- IBM z/VSE Version 6 Release 1 System Macros User's Guide (PDF). IBM. 2015. SC34-2709-00.
- IGG = I/O Support component prefix; 019 = Open SVC sub-component; xx = sub-function
- IBM Corporation (January 1967). IBM System/360 Principles of Operation (PDF). pp. 84–121. Retrieved Dec 4, 2019.
- IBM Corporation (August 1971). Reference Manual for IBM 2835 Storage Control and IBM 2305 Fixed Head Storage Module (PDF). p. 17. Retrieved Dec 5, 2019.