7090/94 Input/Output and Traps
The 7090/94 system was designed for high-speed internal processing with input/output units (Channels) that operated asynchronously with the central processor.
Control of the various I/O units (magnetic tape drives, printers, card readers, etc.) was maintained by Data Channels that were specialized independent input/output processors. Each Data Channel could control up to ten tape drives, a line printer, card reader, card punch, and disc and/or drum storage units (through a 7631 File Control unit). Up to eight Data Channels could be attached to a 7090/94.
The 7090/94 was a tape-oriented system (disc and drum units were, apparently, rather rarely used). Typically, printer and punched card I/O was handled by offline equipment such as an IBM 1401 computer; card-to-tape convertors; tape-to-printer units; etc. Almost all production software I/O was directed strictly to and from magnetic tape units.
I/O programming, for any system, is usually a somewhat messy affair -- only a brief explanation of typical I/O sequences will be examined here with an emphasis on the more frequently used magnetic tape operations.
Rather than invoking operating system calls, I/O on the 7090/94 machine was controlled by the programmer with hardware instructions that directed the Data Channels. In general, to initiate an I/O operation (or sequence of I/O operations) required two setup instructions: (a) A Data Channel Select instruction that specified an I/O device and the Channel to which it was connected; and (b) A Reset and Load Channel instruction that gave the Channel the address of an I/O command (or sequence of commands).
The Data Channel commands specified the I/O type; a maximum word count to transfer between the I/O device and a buffer in core storage; and the address of the buffer.
Non-data I/O instructions were used to instruct the Data Channels to backspace; rewind; write end-of-file marks; etc.
Other I/O instructions would interrogate Data Channels and return error conditions, end-of-file statuses, etc.
Selecting a Channel
The first step in preparing to initiate an I/O operation (or sequence of operations) was to select the I/O device and the Data Channel.
The select instructions were of the binary form:
|OP. Code (Bits S, 1-11)||(Bits 12-17)||T (Bits 18-20)||I/O Unit and Channel (Bits 21-35)|
There were two Channel select instructions:
After a Channel select instruction was executed, a Reset and Load Channel instruction must have been executed within a 'short' amount of time or the I/O unit would logically disconnect -- the device and Channel selection would timeout.
- 'RDS' (Read Select)
- 'WRS' (Write Select)
The binary codes in the Y-field (Bits 21-35) specified the Channel, I/O unit (tape drive, reader, punch, printer, etc) and for tape and printer would designate the mode of the operation (binary or BCD which would trigger an automatic character translation). With magnetic tape, the field also indicated the tape drive to be used.
CHANNEL SELECTION Y-FIELD OCTAL CODES (Bits 21-35)
|DEVICE||CHANNEL||BCD - MODE||BINARY - MODE|
|MAGNETIC TAPE||'A'||1201 - 1212||1221 - 1232|
|'B'||2201 - 2212||2221 - 2232|
|'H'||10201 - 10212||10221 - 10232|
For symbolic coding, unique mnemonics could be used and the Y-address left blank in which case the assembler would generate the correct Y-address. The unique mnemonics were formed by the following rules:
The I/O device number (if any) would be specified in the variable field.
- First Letter: 'R' for Read Select or 'W' for Write Select.
- Second and Third Letters: 'TB' for tape (Binary Mode); 'TD' for tape (Decimal Mode); 'PB' for printer (Binary Mode); 'PD' for printer (Decimal Mode); 'CD' for card reader; and 'PU' for card punch
- Fourth Letter: 'A' through 'H' for Channel number.
- RCDA - Read Select Card Read Connected to Channel A.
- WPDA - Write Select Printer in Decimal Mode on Channel A.
- RTBA 1 - Read Select Tape Unit 1 attached to Channel A in Binary Mode.
Reset and Load Channel
The next step, after selecting the I/O device and Channel, in preparing to initiate I/O was to Reset and Load the Channel which would command the Data Channel to reset itself and give the Channel the starting address of a sequence of commands to execute:
'RCHi' (i = A,... , H) (Reset and Load Channel)
The format of the Data Channel Commands was as follows:
|I/O Command||Count||F (Bit 18)||H (Bit 19)||(Bit 20)||Y-Address (Bits 21-35)|
...Where Count was the maximum word count to transfer; N was used to suppress transmission of data in a read operation; and Y-Address specified the starting address of a core memory buffer area.
Once a Channel has been selected and the first Channel control word has been specified, the Channel will continue to execute a specified sequence of I/O Control Words (commands).
There were seven Channel Control Words:
CHANNEL CONTROL WORDS
|IOCD||Input-Output under Count Control and Disconnect|
|IOCP||Input-Output under Count Control and Proceed|
|IORP||Input-Output of a Record and Proceed|
|IOSP||Input-Output with Signal, then Proceed|
|IOCT||Input-Output under Count Control and Transfer|
|IORT||Input-Output of a Record and Transfer|
|IOST||Input-Output until Signal then Transfer|
A sequence of Channel Command Words would continue to be executed by a Channel until one of the following two events occurred:
Three of the Channel commands will be discussed in some detail:
- A Channel command was executed that explicitly disconnected the Channel after completion of the command (e.g., IOCD).
- A Channel command was executed that transferred to a previously given and waiting Load Channel instruction (e.g., IOCT, IORT, or IOST).
An 'N' specified at the end of any of the instruction mnemonics signified that the record was to be processed but that no data was to be transferred (i.e., skip a record).
- IOCD (Input/Output Under Count Control and Disconnect). The number of words specified by the Count field would be transmitted between an I/O device and core storage beginning at the Y-Address. The command would read more than one record if needed to transfer the specified number of words. If the specified word count was read and the I/O device was in the middle of a record, then the remainder of that record would be read and the trailing data ignored and not transferred. On magnetic tape output, completion of the Count caused a tape record gap to be created. After executing the one Channel command, the Channel would then logically disconnect.
- IORP (Input/Output of a Record and Proceed). Data transmission continued until either an end-of-record was encountered on the I/O device or until the specified word Count had been reduced to zero. When the record gap or zero word Count event occurred, then the Channel would take and execute the next sequential Channel command word.
- IORT (Input/Output of a Record and Transfer). In a read operation, data was transferred until an end-of-record was encountered by the I/O device or until the word Count was reduced to zero. A specified Count of zero would cause the I/O device to skip a record. After the Channel command word had been executed, the next Channel word would be automatically loaded by a previously given Load Channel (LCH) instruction which could not be executed pending this event. If no LCH was present, then the Channel would be automatically disconnected. In a write operation, the affect was similar with the next Channel command being specified by the LCH and if not specified, then the Channel would disconnect.
Example: Write a single binary tape record of 20-words starting at location DATA; 35-words starting at RECORD+10; and 16-words starting at BUFFER:
START WTBA 1 USE CHANNEL A, TAPE 1
RCHA IOC1 RESET CHANNEL AND SPECIFY CONTROL WORD ADDRESS
IOC1 IOCP DATA, 0, 20
IOCP RECORD+10, 0, 35
IOCD BUFFER, 0, 16
DATA BSS 20
RECORD BSS 50
BUFFER BSS 20
Example: Read into DATA six-words in decimal mode from a tape record; Skip over the next 16-words; Read seven more words; and then disconnect the Channel. Use Channel B and tape unit 1:
START RTDB 1 SELECT CHANNEL
RCHB IOC1 RESET AND LOAD
IOC1 IOCP DATA, 0, 6
IOCPN 0, 0, 16
IOCD DATA+6, 0, 7
DATA BSS 13
Timing of Input/Output
The Data Channels operated asynchronously and independently of the central processor which allowed for processing that was simultaneous with I/O.
Two instructions were used to synchronize I/O:
Example: A 10-word record is to be read decimally from tape-3 of Channel A; Written into the memory buffer DATA; and then written onto tape-4 of Channel A. The two tape units are on the same Channel and cannot, therefore, be used simultaneously. It is necessary to test for completion of the I/O before proceeding:
- TCOi (i = 'A',... 'H') (Transfer on Channel in Operation): If the specified Channel was busy, then the next instruction was taken from the Y-address; else the next sequential instruction was executed.
- TNAi (i = 'A',... 'H') (Transfer on Channel Not in Operation): If the specified Channel was not busy, then the machine would transfer to Y; else it would execute the next sequential instruction.
RCOA * LOOP UNTIL CHANNEL IS FREE
IOC1 IOCD DATA, 0, 10
DATA BSS 10
By using two different Channels and two separate core buffers, almost simultaneous I/O operations could be obtained.
The magnetic tape used on with the 7090/94 was 1/2 inch wide and was usually packaged in 2400 foot reels. The 36-bit computer word was broken into 6-bit bytes for recording on tape. Each tape frame contained a 6-bit byte plus a parity bit (7-track drives) and therefore required six-frames to record one computer word.
The tape units read in either binary or in binary coded decimal mode with the internal representation of BCD being slightly different and with automatic conversion.
The 7090/94 could read and write variable-length records on tape. Each physical record (that contained one or more logical records) was separated from other records by a three-quarter inch interrecord gap. The physical beginning and end of the tape was marked by reflective spots that were automatically sensed by the tape drive hardware. When rewound, the tape would automatically position to the beginning (the so-called load point) of the tape. Sensing of the physical end of a tape by the tape drive hardware would automatically turn on an indicator bit that could be checked by the application software. End-of-file was indicated by writing a special end-of-file character to the tape (which did not usually coincide with the physical end of a tape).
In addition to the regular instructions for using a Data Channel to read and write tape, there were several additional instructions that were necessary to use magnetic tape:
MAGNETIC TAPE SPECIFIC INSTRUCTIONS
|BSR (+0764 Backspace Record)||The tape, designated by Y, would move backward until an inter-record gap or load point was sensed.|
|BSF (-0764 Backspace File)||The tape, designated by Y, would move backward until an end-of-file or load point was encountered.|
|REW (+0772 Rewind)||Tape Y would be rewound to its load point.|
|RUN (-0772 Rewind and Unload)|| Same as Rewind except that the tape would be put into Automatic Unload Status.|
|WEF (+0770 Write End-of-File)||An end-of-file gap and character would be written to the tape specified by Y.|
|SDN (+076 Set Density)||Set density of the tape drive)|
|BTT (+0760 Beginning-of-Tape Test)||The status of the Channel (specified by Y) beginning-of-tape indicator would be tested. If ON, then the next sequential instruction would be executed; If OFF, then the next instruction would be skipped.|
|ETT (-0760 End-of-Tape Test)||The Channel specified by Y would be tested to check if the end-of-tape indicator was set. If ON, then the next sequential instruction would be executed; If OFF, then the next instruction would be skipped.|
|TRCi (i='A',... 'H') (Transfer on Channel Redundancy Check)||If the tape-check indicator was ON, then turn it OFF and transfer to the Y-address; if OFF, then execute the next sequential instruction.|
|TEFi (i = 'A',... 'H') (Transfer on Channel End-of-File)||If the end-of-file indicator was ON for the specified Channel, then turn it OFF and transfer to the Y-address; If OFF, then execute the next sequential instruction.|
Reading or writing magnetic tapes involved the following (or similar) steps:
In addition to the above sequence, usually, a tape label, written as the first record, would be verified to assure that the correct tape had been loaded. When a tape error occurred, the error routine would usually backspace and attempt to read the record again. After several tries, the record would be assumed to be unreadable, but usually tape errors were caused by dust or minor tape imperfections and rereading the record would result in a successful read.
- 1. Rewind the tape to be used (REWi).
- 2. Select instruction (RTBi).
- 3. Reset and load instruction (RCHi).
- 4. Channel command instruction.
- 5. Test for completion of command (TCOi).
- 6. Test for parity error (TRCi).
- 7. Test for end-of-file (TEFi) on input.
- 8. Test for end-of-tape (ETT) on output.
- 9. Write end-of-file if end of file on output (WEF).
Example: A program is to be built that will read a tape record; process the information; and then write the revised information to another tape. The input tape is number 3 on Data Channel A (in binary form) and the output tape is tape number 2 on Channel B. The number of words in the input record is variable, ranging from 10 to 12, while the output record will always contain 11 words. For simplicity, no attempt is to be made to overlap input-output and processing (in practice, such overlapping was very important):
START REWA 3 REWIND TAPES TO LOAD POINT
REWB 2 REWIND TAPES TO LOAD POINT
RTBA 3 SELECT CHANNEL, RESET AND LOAD CHANNEL CONTROL WORD
TCOA * HANG UNTIL DATA TRANSFERRED
TEFA STOP1 TEST FOR END-OF-FILE.
TRCA ERROR1 TEST FOR TAPE ERROR
. (Process Record -- Not Shown)
NEXT WTBA 2 SELECT CHANNEL
RCHB CONTR2 RESET AND LOAD CHANNEL
TCOB * HANG UNTIL DATA TRANSFERRED
TRCB ERROR2 TEST FOR TAPE ERROR
ETTB TEST FOR END OF TAPE
CONTR1 IORT DATA1, 0, 12 READ A RECORD <= 12 WORDS...
CONTR2 IOCD DATA2, 0, 11 WRITE A RECORD OF 11 WORDS...
DATA1 BSS 12
DATA2 BSS 11
Data Channel Traps
The Data Channels could interrupt the central processor by trapping the application program.
When a trap occurred, the next instruction to be executed was stored in a fixed location and the processor automatically would fetch the next instruction from another fixed location which would allow the program to handle certain conditions on an exception basis.
Rather than polling for certain conditions with loops, the trap mechanism would automatically take over processing when certain conditions arose. For example, instead of repeatedly testing for end-of-file, the end-of-file conditions could case a trap.
Trapping could occur to signal the end of a Channel command; end-of-file; and redundancy tape check. The instructions ENB (Enable) and RCT (Restore Channel Traps) would turn the trapping capabilities on and off.
It was also possible to set an interval timer to automatically trap after a certain period of time.
Certain other non-I/O related conditions (such as floating point overflow, etc.) could also cause traps.
http://www.frobenius.com/io.htm -- Last Revision: 23 August 2001
Copyright © 1996 - 2017 Jack Harper (unless otherwise noted)