I/O operations on S/370 are used to transfer information to and from I/O devices which are attached to channels. There are many types of I/O devices including card readers, card punches, printers, tape devices, terminals and disk storage devices.
A channel attached device can be thought of as a very simple computer that uses a very limited programming language. The programming instructions are called Channel Command Words (CCW). A CCW indicates the operation to be performed (such as read a card or print a line), the data location in the processor memory and the length of the data operation. In addition there are some flags that may be set in the CCW to further indicate how to execute the requested operation.
Each individual device type has a set of commands that it will respond to. An invalid command will result in an execution error of the channel program. When writing channel programs it is necessary to know the programming specifications for each specific device being used.
An I/O operation is initiated by building a channel program consisting of one or more CCWs. The address of the channel program is placed in a fixed position in low storage called the Channel Address Word (CAW). An I/O operation is initiated using the Start I/O (SIO) instruction. This instruction along with all other I/O commands can only be executed when operating in privileged mode.
When the channel program is complete an I/O interrupt will be generated if interrupts are enabled. If interrupts are disabled for the device, the interrupt will be queued. A queued I/O interrupt can be cleared either by enabling interrupts or using the Test I/O (TIO) instruction.
When the pending I/O interrupt condition for a device is cleared the Channel Status Word (CSW) in low storage will be updated providing information on the completion status of the I/O operation.