Y28-6616-1

Program Logic

IBM System/360 Input/Output Supervisor

Program Number 360S-CI-505

This publication describes the operation of the I/O supervisor within the IBM Sys­ tem/360 Operating System control program. The I/O supervisor's components, the EXCP supervisor and the I/O interruption super­ visor, are discussed in detail to show the internal structure and logic involved in the control of I/O devices and channels. Program Logic Manuals are intended for use by IBM customer engineers involved in program maintenance and by system program­ mers involved in altering the program design. Program logic information is not necessary for program operation and use; therefore, distribution of this manual is limited-to persons with program maintenance or modification responsibilities.

Restricted Distribution PREFACE

This publication discusses the operation RECOMMENDED PUBLICATIONS of the I/O supervisor. It is directed primarily to IBM customer engineers and to IBM system programmers. Information required for an understand­ ing of this manual is contained in the The publication is divided into an following publications: introduction and five parts to provide both general and detailed presentations of the following areas: IBM system/360: Principles of Operation, Form A22-6821 • EXCP supervisor. • I/O interruption supervisor. .' Error routines. IBM System/360 Operating System: Intro­ • SVC transient area routines. duction to Control Program Logic, Pro­ • Control blocks, tables, and queues. gram Logic Manual, Form Y28-6605

All options that may be added to the primary control program are included in the In addition, the following publication may presentations. The control program options be found convenient for reference: are explained in the publication IBM Systeml360 Operating System: storage Esti­ IBM System/360 Operating System: System mates, Form C28-6551. Programmer's Guide, Form C28-6550

Second Edition (April 1967)

This edition, Form Y28-6616-1, is a reprint of Form Y28-6616-0 incorporating TNLs Y28-2155, dated 6/1/66, Y28-2169, dated 8/31/66, .dated 2/27/67. Note also that the prefix is changed from Z28- to Y28.

Specifications contained herein are subject to change from time to time. Any such change will be reported in subsequent revisions or Technical Newsletters.

This publication was prepared for production using an IBM computer to update the text and to control the page and line format. Page impressions for photo-offset printing were obtained from an IBM 1403 Printer using a special print chain. copies of this and other IBM publications can be obtained through IBM Branch Offices. A form for readers' comments appears at the back of this publication. It may be mailed directly to IBM. Address any additional comments concerning this publication to the IBM Corporation, Programming Systems Publications" Department D58, PO Box 390. Poughkeepsie, N. Y. 12602 CONTENTS

INTRODUCTION • • 7 PART II: I/O INTERRUPTION SUPERVISOR. • 28

The Input/Output Supervisor. • 8 General Operating Procedure. • 28 (. ~"., EXCP Supervisor • • • • .• • • • • 10 " .' I/O Interruption Supervisor Operation of the Subroutines and .~~. • 11 '{ 1 ----" __.- ___. ___ Modules • • • • • • • • • • 29 The Error Routines • • • • •• 11 UCB Lookup Routine. • • • • • • 29 I/O Interruption Analysis • • • 29 The Purge and Restore Routines 1,2 Channel Data Check, Channel Control Check, Interface The Control Blocks, Tables, and Queues • 12 Control Check Bits. • • • • • 29 Control Blocks. • • • • • • • •• 12 Control Unit End Bit •••• • 30 Input/Output Block • • 13 PCI Bit and PCI Appendage. • • 30 • • .• •• • 13 Channel End Bit and Channel End Data Extent Block. • 13 Appendage • • • • • • 30 Event Control Block. • •• 13 Device End Bit •••••••• 30 • • • • 13 Attention Bit. • • • • • • • • 31 Tables. • • • • • • • • • • 14 Unit Check Bit and Abnormal End UCB Lookup Table • • • • • 14 Appendage • • •• • • • • 31 Channel Table. • • • • 14 Unit Exception and Incorrect Device Table •• • • • • • • • 15 Length Bi ts • • • • • • • 31 Statistics Table • .• • • • • • 15 Program Check, Protection Check, Attention Table. • • • 15 and Chaining Check Bits • • 31 Request Element Table. • • • • 15 Status Modifier and Busy Bits ••• 31 Logical Channel Word Table • • • • 16 Trapcode Modules. • • • • • • • • • • 31 Queues. • • • • • • • • • • • • • 16 unit Record and Logical Channel Queues • •• • 16 Telecommunications Trapcode Seek Queues. • • • • • • • 17 Modules • • • • • • • • • • 31 Queueing Procedures. • • • 17 Tape Trapcode Module • • • • • • • 31 Direct-Access Trapcode Module. • • 32 PART I: Channel Restart Subroutine. • • 32 SUPERVISOR. • • • • • • • 18 Channel Search Modules. • • • • 32 Multiplexor Channel with Burst General Operating Procedure. • • 18 Devices • • • • • • • • • • • 32 Multiplexor Channel with No Operation of the Subroutines and Burst Devices • • • • • • • 33 Modules • • • • • • • • •• 19 Selector Channel Included in EXCP validity Check Subroutine. • • • 19 Only One Logical Channel. • • • • 33 GET Request Element Subroutine. 20 Selector Channel Included in Error EXCP Routine. • • • • • • • • • 20 More than One Logical Channel • • 33 Test Channel Modules •••••• • 21 Sense Subroutine. • • • • • • • • • • 34 Selector Channel Test Channel Interfaces. • • • • • • • • • • • • • 34 Module. • • • • • • • • • • 21 Attention Routine Interface. • 34 Multiplexor Channel Test Channel Error Routine Interface. 35 Module. • • • • • • • • 21 SER Interface. • • • • • • • • • • 36 Enqueue and Dequeue Modules • • • • • 21 ABTERM Routine Interface • • • • • 36 Normal Enqueue Module. .• • 22 Post Routine Interface • • • • • • 36 Priority Enqueue Module. • 22 Normal Dequeue Module. • • • • 22 PART III: IBM-SUPPLIED ERROR ROUTINES. 37 Ordered Seek Enqueue Module. • • • 22 Ordered Seek Dequeue Module. • 23 Device-Dependent Routines •••••••• 37 Select Subroutine • 23 General Operating Procedure • • • • • 38 Start I/O Modules • • • • • • • • • .~ 24 Device-Dependent Characteristics. • • 39 Unit Record and 1052, 2150 Error Routine • • • • • 39 Telecommunications Start I/O 2540/2821 Error Routine. • • • • • 41 Module. • • • • • • • • • • • • • 24 1403/1443 Error Routine. • • • • • 41 Tape Start I/O Module. • • • • •• 24 1442, 2501, 2520 Error Routine •• 42 Direct-Access Start I/O 2671/2822 Error Routine. • • • • • 43 Module • • • • • • • • • • • 25 2400 Tape Series Error Routine • • 43 End-of-Extent Appendage. • 26 Direct-Access Device Error Start I/O Subroutine. • • • • • • 26 Routine • • • • • • 45 Start I/O Appendage. • • • • • 26 2250 Error Routine • • • • • 48 Post-Start I/O Subroutine • • • • 26 2260 Error Routine • • 48 Common Routines. • • • • • 4B Event Control Block • • • • • • • • • 62 Error Interpreter Routine • • • • • • 4B Input/Output Block. • • • • • • • 62 Write-to-Operator Routine • • • • 48 Logical Channel Word Table. • • • 66 Statistics Update Routine • • • • 49 Request Element Table • • • • • • • • 67 Statistics Table. • • • •• 67 I/O Outboard Recording Routines. • • 50 UCB Lookup Table. • • • • 70 The Outboard Recorder • • • • • • 50 Unit Control Block. • • 71 The Statistical Data Recorder • • • • 50 Module Operation. • • • • • • • • 50 CHARTS • • 75 PART IV: SVC TRANSIENT AREA ROUTINES • • 52 APPENDIX A: LOAD MODULE NAMES 84 SVC Purge Routine .• • .• • • • • • 52 Purge Complete Subroutine. • • • • 54 APPENDIX B: LINKAGES WITHIN THE Restore Routine • • • .• • • • 54 REQUEST ELEMENT TABLE • • • • B4 DEVTYPE Routine • 54 IOHALT Routine. • • • 54 APPENDIX C: THEORY OF LOGICAL CHANNELS. • • • • • • B 6 PART V: CONTROL BLOCK AND TABLE FORMATS • • • • • • • .• 55 APPENDIX D: SYSTEM ENVIRONMENT Attention Table. • • • • 55 RECORDING OUTPUT DATA SET FORMAT.. BB Channel Table •• • • • • 56 Header Record • • • • • • • • • • BB Data Control Block. • • • • • 57 Statistical Data Records. • • 90 Data Extent Block • • • • 59 Record Entries. • 91 Device Table. • • .• • • 59 INDEX. • • • • • • • • • • • 93 ILLUSTRATIONS

FIGURES

Figure 1. Organization of the Figure 12. Device Table Entry Format •• 59 Input/Output supervisor Within Main Figure 13. Event Control Block Format storage • • • • • • • • • • • • • • 7 After Posting • . • • • • • • • • 62 Figure 2. Relationships Among a Figure 14. Input/Output Block Format •• 62 Processing Program or the Control Figure 15. Logical Channel Word Format • 66 Program, an , and the Figure 16. Request Element Formats.. 67 Input/Output Supervisor • • • • • • 8 Figure 17. Statistics Table Entry Figure 3. Control Flow Within the Formats • • • • • • • • • • • • • • • • 67 System and the Input/Output Figure 18. UCB Lookup Table Format • • • 70 Supervisor. • . • •• •• • • 9 Figure 19. Unit Control Block Format •• 71 Figure 4. Control Blocks Used by the Figure 20. Seek Queue Control Word Input/Output Supervisor • • • 12 Format for FIFO and Priority Requests • 74 Figure 5. Tables used by the Figure 21. Seek Queue Control Word Input/Output supervisor • • • 14 Format for Ordered Requests • • • • 74 Figure 6. Execution of Ordered Seek Figure 22. Linkages Within the Requests. • • • • • • • • • • • • • • • 22 Request Element Table • • • • • • 84 Figure 7. UCB Lookup Algorithm ••••• 29 Figure 23. Logical Channels. ~ • • 86 Figure 8. Attention Table Entry Format • 55 Figure 24. Physical Channel Paths and Figure 9. Channel Table Format • • • • • 56 Logical Channels •••••••••••• 87 Figure 10. Data Control Block Fields Figure 25. Header Record Format. • • • • 88 Used by the Input/output Supervisor • • 57 Figure 26. Statistical Data Record Figure 11. Data Extent Block Format. • • 59 . Format. • • • • • • • • • • • 90 Figure 27. Record Entry Format ••••• 91

CHARTS

Chart 01. Functional Flow of the Chart 06. Input/Output Interruption Input/Output Supervisor • •• •• 75 Analysis (2). • • • • • • • • • 80 Chart 02. Control Flow Within the EXCP Chart 07. scheduling of an Supervisor. • • • • • • • • • • • • 76 IBM-Supplied Error Routine. • . • • 81 Chart 03. Control Flow Within the Chart 08. General Operating Procedure Error EXCP Routine. • • • • • • • • • • 77 for Device-Dependent Error Routines • • 82 Chart 04. Control Flow Within the Chart 09. OBR/SDR Module Flow. • • 83 Input/output Interruption Supervisor •• 78 Chart 10. General Operating Chart 05. Input/Output Interruption Procedure-Graphics. • • • • • • • • 83 Analys is (1). • • • • • • • • • • • • • 79

TABLES

Table 1. Modular Areas Within the Input/Output Supervisor • • • 9 Table 2A.. Sense Bytes and lOB Flags • .• 40 I Table 2B. lOB Error Counts •.• 40.1 Table 3. Load Module Names •• • • 84

INTRODUCTION

The input/output (I/O) supervisor is the Routines and control areas used with the portion of the control program that issues I/O supervisor are: the privileged I/O instructions and super­ • Error routines. vises the resulting I/O operations for any • Purge routine and restore routine. program that requests I/O device activity. • DEVTYPE routine. The I/O supervisor has two purposes: • IOHALT routine. • Control blocks, tables, and queues. • To handle I/O requests, which are requests for the execution of channel Frograms. Error routines are transient and are • To handle I/O interruptions, which called by the I/O supervisor to handle result from. the execution of channel device and channel errors and unusual con­ programs and from. operator interven­ ditions. The purge and restore routines tion. are also transient and are used, respec­ tively, to remove from the system I/O To facilitate the handling of the I/O requests that are active or waiting to be requests and interruptions, the I/O super­ started and to reschedule I/O requests that visor is divided into two major program were previously removed. The DEVTYPE rou­ sections: tine passes information concerning I/O • Execute channel program (EXCP) supervi­ device characteristics to the user. The sor. IOHALT routine allows the graphics or tele­ • Input/output (I/O) interruption super­ communications user to halt I/O activity on visor. any device except a direct access device. These major sections are resident in Control blocks, tables, and queues all main storage and provide control program reside in main storage. Control blocks are support for the execution of channel pro­ created either by the user at. assembly time grams. by means of control statements and macro­ instructions, or by the system at system The EXCP supervisor handles all I/O generation time. Tables, and also the requests issued by means of the EXCP macro­ control fields for queues and the elements instruction and SVC 15. The I/O to be queued, are created at system interruption supervisor handles all I/O generation time. The queues are then main­ interruptions, provides error recovery tained by the I/O supervisor. supervision, indicates to the user when an I/O request is complete, and restarts avai­ Figure 1 shows the organization of the lable devices and channels. I/O supervisor within main storage.

System Residence Volume

Dynamic LlNKLlB Area Partitioned Data Set

Nonresident Error SVCLlB Main Routines and 1/0 Storage Purge Routine

I/O Supervisor Transient Area NUCLEUS Partitioned Data Set Fixed SVC Transient Area Area fXCP Supervisor, I/O Interruption Supervisor, Resident Control Program Modules, and Control Areas o .Figure 1. Organization of the Input/Output Supervisor Within Main Storage

Introduction 7 THE INPUT/OUTPUT SUPERVISOR When a channel program must be retried because of an error in its execution~ SVC 15 is issued, usually by IBM-supplied error The I/O supervisor starts and supervises routines. I/O operations for programs that request I/O device activity. Ex~cution of the EXCP macro-instruction I or SVC 15 causes an interruption. This and Processing programs and the control pro­ all other interruptions in the system are gram request I/O device activity via a handled by the first level interruption macro-instruction. The type of macro­ handlers (FLIH).3 After storing the program instruction that is used depends upon the status word {PSW> and saving the contents use of an access method.1 of general registers, a FLIH routes control to the routine that performs the functions required by the interruption. If an access method is used, the expan­ sion of the GET/PUT or READ/wRITE macro­ instruction contains a branch to access The I/O supervisor receives control from method routines. These routines construct a FLIH after the following interruptions: a channel program, provide control block information, and cause control to be routed to the I/O supervisor via an EXCP macro­ • Supervisor call

If an access method is not used to • I/O interruptions of all types. request the execution of channel programs, the processing program or the control program must issue the EXCP macro­ instruction. Before doing so, they must provide the necessary channel program and An SVC interruption also occurs when SVC the control block information required for 16, 17, 24 or 33, respectively,. for the the I/O supervisor. 2 PURGE RESTORE, DEVTYPE or IOHALT macro­ instruction is executed. A FLIH gains control; however, since the required purge Figure 2 illustrates the relationships or restore routine is transient, it must be among a processing program or the control called into the SVC transient area before program, an access method, and the I/O control is given to it. supervisor.

Figure 3 shows the flow of control within the system and within the I/O Processing Access Input/Output Program Method Supervisor supervisor from the time an SVC or I/O interruption occurs until the time the Organize interruption is handled and the control Specify an Information Perform the program or a processing program is given Input/ GET for the EXCP Input/ control. Output PUT Input/ Output Operation READ Output Operation WRITE Supervisor Within the mainline code of the I/O Figure 2. Relationships Among a Processing supervisor, there are five modular areas Program or the Control Program, (these are not load modules). There are an Access Method, and the three modular areas within the EXCP super­ Input/Output Supervisor visor and two within the I/O interruption supervisor. The size and function of these areas is dependent upon system configu­ ration. Their inclusion in the I/O super­ 1Access method descriptions are contained visor is determined at system generation in the section "Data Access Methods" of the (SYSGEN) time. IBM System/360 Operating System: Data Management publication, Form C28-6537. 2The necessary information is contained in 3The FLIHs are described in the IBM the section "Execute Channel Program (EXCP) System/360 operating system: Fixed-Task Macro-Instruction" of, the System Supervisor, Program Logic Manual, Form Programmer's Guide. Y28-6612.

8 Processing, P'rogram or Contro,1 Program

I/O LPSW InterrlJption

Fir,t level I.nterruption Handle",

I/O Interruption Handle" SVC Hand I.er

All I/O SVC a (EXCP) Interruptions and SVC 15 SVC [7 SVC 33 (RESTORE) (tOHALT)

I/O EXCP tnterruptfDn Supervisor Supervisor

~------"""''-----.,------:-=---:----'------Input/Output Supervisor

Figure 3. Control Flow Within the System and the Input/Output Supervisor

The modular areas. shown in Table 1. Table 1. Modular Areas Within the are: Input/Output supervisor r------T------, IMajor I Modular Area I • Test channel. A test channel module IProgram~------T------1 determines if a channel is available ISectionl Name I Features I for the device that is to be used for ~------+------+------1 an I/O request. I ITest lOne module per logical I I I Channel I channel; created at I I I I SYSGEN time. I • Enqueue and dequeue. An enqueue module I ~------+------1 queues I/O requests that cannot be I EXCP IEnqueuelThree modules; selected I immediately started. After an I/O ISuper- I and lat SYSGEN time according I request has finished, a dequeue module Ivisor IDequeuelto enqueueing options. I removes the request from the queue. I ~------+------1 I I Start lOne module per device I I 11/0 Iclass; selected at I • Start I/O. Start I/O modules provide I I I SYSGEN .time. I device information and actions preced­ ~------+------+------1 ing the issuance of a start I/O I IChannellOne module per physical I instruction for the device. 11/0 ISearch I channel; created at I IInter- I I SYSGEN time. I Iruption~------+------~ • Channel search. When an I/O request ISuper- ITrap- lOne module per device I has finished such that a channel Ivisor I code Iclass; selected at SYSGENI becomes available, a channel search LI ______i I ______i I ______time. JI module determines the next I/O request to be started on that channel by searching queues constructed by enqueue modules. The object module for the I/O supervisor • Trapcode. Trapcode modules establish is named IEAASUOO. This load module information for a device after an I/O includes the mainline code and the modular interruption associated with that areas of the I/O supervisor _and in addi- device.

Introduction 9 tion, includes the dispatcher, the exit control to the I/O interruption super­ effector, the FLIHs, and the communication visor where normal processing contin­ vector table (CVT) of the fixed-task super­ ues. visor. The .load module names for the various error routines and the purge and • Channel end. The I/O interruption restore routines are summarized in supervisor exits to a channel end Appendix A. appendage after a channel end interrup­ tion occurs, before indicating to the Routines that supplement the handling of user how the I/O request completed. I/O requests and interruptions are appenda­ (The channel end appendage is also ges to the I/O supervisor. (They do not entered when the channel end interrup­ alter the I/O supervisor program.) These tion is accompanied by a wrong length appendages may be supplied by the user of indication or a unit exception, or the I/O supervisor. both. )

Appendages are called into main storage • Abnormal end. The I/O interruption by the open routine and are removed by the supervisor exits to an abnormal end close routine or at the end of a job appendage whenever there has been an step.1 When the I/O supervisor branches to error associated with the processing of an appendage, the current PSW has all an I/O request. interruptions except machine check inter­ ruptions masked as disabled; it indicates the supervisor state, and a protection key of zero. EXCP SUPERVISOR There are five exits from the I/O super­ visor to an appendage vector table; the table contains addresses, which mayor may The EXCP supervisor is the portion of not route coritrol to an appendage. (The the I/O supervisor that starts the channel append~ge vector table is described in Part programs requested by use of the EXCP V: Data Extent Block.) If control is not I macro-instructions and SVC 15. It performs routed to an appendage, the I/O supervisor the same procedures when initiating the retains control and continues normal proc­ channel programs for both. Chart 01 shows essing. 2 the functional flow of the EXCP supervisor, and also of the I/O interruption supervi­ The five appendage exits are: sor. (All charts precede Appendix A.) • End-of-extent. The provision for an Before accepting a channel program for end-of-extent appendage is included execution, the EXCP supervisor determines within the EXCP supervisor for direct­ if: access device I/O requests. The appendage is given control when the • The control blocks for the I/O request EXCP supervisor determines .that execu­ are valid. tion of the request will violate the extent limits of 'the . • The device for the I/O request is available. • Start I/O. The provision for a start I/O appendage is included within the • A physical channel for the device is EXCP supervisor for all I/O requests. available. The appendage receives control preced­ ing the execution of the start I/O (SIO) instruction for the request. If the first of these conditions is not met, either a program check results or the • Program-controlled interruption. The task requesting the I/O activity is abnor­ provision for an appendage for a mally terminated. If either the device or program-controlled interruption (PCI) the channel is not available, the I/O is included within the I/O interruption request is queued for subsequent process­ supervisor. The PCI appendage returns ing. When the required conditions are met, 1The OPEN and CLOSE routines are described the EXCP supervisor issues an SIO instruc­ in the publication IBM System/360 Operating tion, which in turn initiates the commands system: Input/Output support in the channel program. The following (OPEN/CLOSE/EOV), Program Logic Manual, conditions may result: Form Y28-6609. 2Additional information regarding the use • The channel program may be accepted and of appendages can be found in the EXCP the I/O operations successfully start­ section of the System Programmer's Guide. ed.

10 • An error may occur during initiation of • program-controlled interruptions. A the channel program, in which case, PCI appendage supplied by the user of control is given to the I/O interrup­ the I/O supervisor is entered. tion supervisor and the reason for the error is determined. If necessary, an • Catastrophic errors. When catastrophic error routine is scheduled. errors (channel data check, channel control check, and interface control • The control unit for the device may check CSW bits) occur, the system envi­ signal busy. In this case, the channel ronment is recorded and the CPU is put program is not accepted and the I/O into the wait state. The system is request is queued (except in the case then considered inoperative and the of some telecommunications requests). Initial Program Load procedure must be followed to re-initialize the system. After the resulting condition is han­ (System environment recording (SER) is dled, control returns to the FLIH. a 'group of programs that collect and record data regarding System/360 machine errors.) The completion of an I/O request is I/O INTERRUPTION SUPERVISOR indicated by a channel end or a channel end and device end interruption. The I/O interruption supervisor indicates this com­ An I/O interruption occurs after signals pletion to the user. from I/O devices have been generated (in response to channel program execution and After the reason for the I/O interrup­ operator action) and accepted by the cen­ tion has been determined and the interrup­ tral processing unit (CPU). The I/O inter­ tion processing completed, the I/O inter­ ruption supervisor analyzes status bits in ruption supervisor determines the state of the channel status word (CSW), which is the channel upon which the interruption was stored as a result of the I/O interruption, received. Pending I/O in'terruptions are to determine the reasons for the I/O inter­ accepted and handled. If the channel is ruption. free., an attempt is made to restart it with a queued I/O request (one that was pre­ The I/O interruption supervisor process­ viously requested, but could not be started es the following, when denoted by the CSW immediately). The appropriate queues are status bits: searched until an I/O request is started or until it is determined that there are no • Attentions. The appropriate attention I/O requests that can be started on the routine is entered. free channel. Cont~ol returns to the FLIH. • Status modifier situations. Status modifier conditions, such as a control unit busy condition that causes an I/O THE ERROR ROUTINES request to be queued, are handled.

• Control unit end, channel end, and Standard IBM-supplied error routines are device end interruptions. These inter­ selected at SYSGEN time for each type of ruptions indicate normal ending condi­ I/O device in the system. Error routines tions and normal processing continues. are transient and reside in the SVC librar­ . Normal completions are indicated to the y.1 However, the portions of the direct­ user. access device error routine that are necessary for the system residence device • Busy conditions. When the selected I/O and for frequent unusual conditions device or control unit is unavailable, (end-of-cylinder, head switching, alternate the I/O request is queued. track procedures, etc.) are resident in main storage. The names of the error • Unit check. A sense command is issued routine load modules are in Appendix A. to obtain additional information regarding the unit check. Whenever an I/O interruption occurs and the I/O interruption supervisor detects an ~ Errors and unusual conditions. When error that requires error recovery errors, such as program, channel chain­ procedures, it determines whether or not an ing. and protection checks, and unusual IBM-supplied error routine is to be used. conditions, such as unit exception and wrong length indication, are detected, an error routine is scheduled. An 1The requirements for an error routine are uncorrectable error is indicated to the discussed in the EXCP section of the System user as a permanent error condition. Prograrrmer's Guide.

Introduction 11 An indication of the required error routine The control blocks supply information to and of the channel program that developed the I/O supervisor regarding I/O requests the error are passed to the task and devices, and regarding the data sets supervisor's exit effector and an asynchro­ required for the execution of the requests. nous exit is requested. The error routine The tables point to device- and channel­ must be sCheduled asynchronously because dependent modules and are used internally immediate in-line processing of the error by the I/O supervisor. Queues are used by would hinder efficient channel scheduling. the I/O supervisor for I/O requests that cannot be started immediately. Part V The appropriate error routine is entered contains detailed formats and explanations into the I/O supervisor transient area of the control blocks and tables. (providing the error routine is not resident) and, when scheduled, is given control. The error routine determines the type of error and. where possible, issues the ERREXCP macro-instruction in an attempt to retry the channel program and to recover from the error. At completion of error CONTROL BLOCKS processing (successful or unsuccessful). the error routine issues the ERREXCP macro­ instruction so that the I/O request can be Control blocks maintain the information properly terminated by the I/O interruption that concerns the status and activity of supervisor. The completion is indicated to I/O devices, requests, and interruptions. the user and the error routine returns The I/O supervisor is concerned with the control to the task supervisor. following control blocks:

• Input/output block. • Data control block. THE PURGE AND RESTORE ROUTINES • Data extent block. • Event control block. • Unit control block. The SVC purge and restore routines are transient and are called into the SVC transient area whenever a PURGE or RESTORE These control blocks, and the pointers macro-instruction (SVC 16 and SVC 17, indicating their relationships, are shown respectively) is issued. The load module in Figure q. name for the SVC purge routine is IGE0001F and for the SVC restore routine is IGE0001G. r------, The SVC purge routine removes active or I I I queued I/O requests from the system. The I I lOB I SVC restore routine reschedules I/O I I requests that were previously purged. I I I r- ---- There is also an I/O purge routine; the 1 I ~ I load module name is IGE0025E. This routine I I I CCW ECB I DO is used only by the I/O supervisor and I List I should not be confused with the SVC purge I I I I routine, which is called by means of a L _____ ...J I J system macro-instruction. The I/O purge I routine removes certain requests from the I system whenever there has been a permanent I error. It is discussed in Part II: Error I J DEB Routine Interface. I I Unprotected L-J----...J Storage

-Protected- ---, B Storage THE CONTROL BLOCKS, TABLES, AND QUEUES UCB

The I/O supervisor. as well as other portions of the control program, records the status of devices. data sets, and internal routines in control blocks, • Figure q. Control Blocks Used by the tables, and queues. Input/Output Supervisor

12 Input/Output Block Event Control Block

An input/output block (lOB) is the An event control block (ECB) is used by communication medium between a routine that the I/O supervisor to indicate to the user requests I/O operations and the I/O super­ when and how the execution of his channel visor. The address of an lOB is passed to program completed. A. normal completion is the I/O supervisor when an I/O request is determined by either a channel end or a given. channel end and device end interruption. The I/O supervisor indicates a request has The contents of an lOB include: completed, successfully or not, by posting the request complete by use of the post • The address of the channel program, routine of the task supervisor. 1 which consists of a group of channel command words (CCW), to be executed. • An indication that the channel program is or is not related to other channel Unit Control Block programs. (Related channel programs are all associated with the same data set. Each is dependent upon the suc­ A unit control block (UCB) is the means cessful completion of its preceding by which the I/O supervisor notes and related channel programs. If a perman­ determines the activity and status of each ent error occurs that is associated I/O device attached to the system. A UCB with a related channel program, the I/O represents the I/O device for the volume purge routine purges the remaining upon which a data set resides. It is related requests for the data set.) addressed by a DEB. • A storage area for the CSW, which is There is one UCB for each I/O device or stored by the I/O supervisor at the telecommunications line addressed in the completion of an I/O request. system. One UCB per volume is required if a data set resides on two or more volumes • The initial seek address for a direct­ that are mounted concurrently upon separate access device. I/O devices. In this case, each of the UCBs is addressed by the same DEB. • The address of the data control block and the event control block. The contents of the UCB include:

• The unit address, which is used in the SIO instructions for the device.

Data Control Block • The type of device the UCB represents (e.g., IBM 2311 Disk Storage. IBM 2400 Magnetic Tape Unit, etc.). A data control block (DCB) contains information that pertains to the current • The flag bits, which indicate the cur­ use of a data set and contains the address rent status of the associated I/O of a data extent block. A DCB provides the device. For example, the UCB busy bit I/O supervisor with the status of error may be set to indicate that the device correction procedures for each data set and is currently in operation. Other flag indicates whether or not IBM-supplied error bits may be set to indicate UCB not routines are to be used for the data set. ready, control unit busy, post, etc.

• An area for sense information., which details the conditions, such as a pro­ Data Extent Block gramming error or equipment malfunc­ tion. that cause a unit check interrup­ tion. When the I/O supervisor issues a A data extent block (DEB) is an sense command. up to six bytes of sense extension of the information contained in a information from the control unit of DCB. Each DEB is associated with a DCB, the device is read into this area; the and the two blocks address each other. A number of bytes of information that is DEB describes the extent of a data set; it meaningful varies with the device type. indicates the storage medium, the location, and the boundaries of the data set, con­ tains an appendage table address, and pro­ 1For information concerning the post rou­ vides data protection and priority informa­ tine, refer to the Fixed-Task Supervisor, tion. Program Logic Manual.

Introduction 13 • Reference fields, consisting of an UCB Lookup Table indexing value or an address, that refer to tables. When the reference is an indexing value, the I/O supervisor The UCB lookup table contains the adds it to the starting address of the address of each UCB in the system and the pertinent table to obtain the address values that are necessary to locate these of the proper entry. When the ref­ UCB addresses within the table. The table erence is an address, it is of the is divided into channel values, control proper entry. unit values, and UCB addresses.

After an I/O interruption occurs, the TABLES I/O supervisor calculates the address of the UCB that represents the I/O device associated with the interruption. The Tables contain pointers to control table values and the I/O address, which is blocks and to device- and channel-dependent stored in the psw, are used to perform the routines, modules, and queues. They also calculation. provide an area for device statistics. The I/O supervisor contains the following tables:

• UCB lookup table. • Channel table. Channel Table • Device table. • Statistics table. • Attention table. The channel table is used by the I/O • Request element table. supervisor to re-enable a channel for addi­ • Logical channel word table. tional I/O interruptions and to locate the channel search module for the channel. The These tables, and the pointers indicating table contains one entry for each physical their relationships, are shown in Figure 5. channel attached to the system.

Device r--~ UCB UCB Lookup Table

Logical ·h Request Device __ Statistics ~Attention C anne I ~--.---+i Table Table Table Word ' L Element Table Table L..-_---' r __1 __ --, I Attention : I Routines I L ______...l r------.., I Enqueue I L_.0~d~I.:s_ J

Figure 5. Tables Used by the Input/Output Supervisor

14 Device Table the address of the appropriate entry within the table is obtained. The system routine must have placed into this entry, at SYSGEN The d.evice table is the means by which time, the address of the attention routine the I/O supervisor determines the proper for the device. Since the attention table device-dependent modules for a device. is constructed at SYSGEN time, it is avail­ Each entry in this table contains the able only to routines that specify their address of a start I/O module, an enqueue attention routines at SYSGEN time. module, and a trapcode module. When an attention interruption occurs, the I/O supervisor passes control to the attention routine. If execution of the attention routine is not desired, the sys­ tem routine must place a zero into the UCB statistics Table instead 6f an indexing value. The first entry in the attention table contains a branch back to the I/O supervisor; thus, The statistics table contains one entry, when an attention interruption occurs, the which includes up to eight statistics coun­ starting address added to zero yields the ters, for each I/O device attached to the address of the first entry in the table and system. Each statistics counter is used by the I/O supervisor regains control. the IBM-supplied error routines to count the number of temporary read and write errors, equipment checks, interventions required, and other statistics that depend on the particular device type. Request Element Table Whenever a statistics counter overflows or a permanent error occurs, the SER The request element table1 consists of a program's statistical data recording rou­ number of request elements that are used to tine uses the statistics counters to update represent I/O requests. The number of statistical data records. Statistical. data elements in the table is determined at records are expansions of the statistics SYSGEN time a~d remains fixed. . counters. They reside on the system resi­ dence device, so that they are available The I/O s:upervisor issues a request .for recall and analysis. element to represent each I/O request given by means of the EXCP macro-instruction. An element is not issued when an I/O request is retried by means of SVC 15. When the element is issued, the I/O supervisor Attention Table stores information into it, which includes the addresses of the UCB, DEB, and lOB associated with the I/O request. The attention table is constructed at SYSGEN time to contain the addresses of Each request element can be in one of attention routines. Attention routines are three states: specified by system routines to service attention interruptions. • Available. • Active. There are two types of attention inter­ • Queued. ruptions: An example of the linkage relationships of • Normal attention interruptions, which the available, active, and queued request are indicated by the attention bit in elements within the request element table the CSW status field • is presented in Appendix B. • Unsolicited device end interruptions, Available Request Elements: Available which are caused by the transition from request elements are not in current use; the not-ready to the ready state that -they are either unused or contain informa­ occurs when the operator presses the tion that is no longer needed by the I/O ready button. supervisor. These request elements are issued to represent incoming I/O requests. When a system routine desires that an attention or unsolicited device end inter­ ruption is to be handled, it places an 1In some documentation, the request element indexing value into the UCB for the device. table is referred to as the 12 star (12*)' When the indexing value is added to the table and its request elements as 12* starting address of the attention table, elements.

Introduction 15 The available reques·t elements are Logical Channel Word Table linked together by means of a "link field" that is contained in the first two bytes of each element~ This linkage of available The logical channel word table 'contains request elements forms a "freelist". Each a logical channel word entry that corres­ element in the freelist points to the next ponds with each logical channel in the element. Because other request elements in system. A multiplexor channel has one the request element table might be active logical channel; a selector channel may or queued, members of the freelist are not have more than one. (For further informa­ necessarily contiguous within the table. tion concerning logical channels, refer to Appendix C.)

The first element in the freelist, A logical channel word designates the referred to as nnext available", is always first and. last request elements in the the next request element issued by the I/O logical channel queue associated with a supervisor for an incoming I/O request. logical channel. If the queue is empty, The "freelist pointer" contains the address the logical channel word contains in its of the next available request element. It first two bytes the dummy address of hexa­ resides within the I/O supervisor and is decimal FFFF. A logical channel word also addressed by an entry in the communications contains the address of a channel-dependent vector table (CVT).~ test channel module.

The last element in the free list is the last available request element and is iden­ tified by means of a "dummy address" in its 2-byte link field. The dummy address is a QUEUES hexadecimal FFFF (Le., has all bits on). When there are no available request ele­ ments, the free list pointer contains the The I/O supervisor uses two types of dummy address t.o indicate that the freelist queues for I/O requests: is empty. • Logical channel queues . • Seek queues. Active Request Elements: Active request The logical channel queues consist of elements correspond to I/O requests that request elements that represent I/O have been started but have not yet been requests for the execution of channel pro­ completed. The I/O supervisor indicates grams on either sequential or direct-access that a request element is active by placing devices. the address of the active request element into the UCB that represents the device The seek queues contain request elements being used for the I/O request. When an that represent I/O requests for seek opera­ I/O interru~tion associated with the device tions to be executed on direct-access devi­ occurs, the I/O supervisor finds the active ces. When a seek operation has been exe­ request element, which is then used to find cuted and the access arm of the direct­ the various control blocks that are used access device is in the proper position, during the processing of the I/O interrup­ the representative request element is tion. enqueued in the appropriate logical channel queue.

Queued Reguest Elements: Queued request elements correspond to I/O requests that could not be started immediately. The Logical Channel Queues elements belonging to the same queue are linked together by means of the link fields located in the first two bytes of the I/O operations awaiting execution are elements. The last element in each queue held for subsequent processing in a logical is denoted by means of the dummy address channel queue. There is one 'logical chan­ within its link field. During the queueing nel queue associated with each logical procedure, only the contents of the link channel in the system. (See Appendix C.) fields in the request elements are changed. A multiplexor channel has one logical chan­ nel queue; a selector channel may have more than one. The last request element in each ~The CVT is described in the Introduction logical channel queue is identified by the to Control Program Logic, Program Logic dummy address in the link field of the Manual. element.

16 Seek Queues Queueing Procedures

The I/O supervisor uses seek queues in The I/O supervisor effects linkage with­ conjunction with logical channel queues to in the queues of request elements in the overlap seek operations for non-drum request element table by means of three direct-access devices that are attached to types of queueing procedures: first-in­ the same physical channels. There is one first-out (FIFO), priority, and ordered. seek queue associated with each non-drum The user selects queueing procedures at direct-access device in the system. The SYSGEN time. UCB for a direct-access device contains a seek queue control word that indicates the seek queue for the device. When the seek In FIFO queueing, a request element is queue is empty, the seek queue control word queued according to the order in which its contains in its first two bytes the dummy corresponding I/O request is received address of hexadecimal FFFF. (pushup queue). The queue is constructed and maintained so that the next request When an I/O request is given for a element to be retrieved is the oldest direct-access device, a seek address is element in the queue. indicated by the user in the associated lOB. This seek address is used by the I/O supervisor to issue an initial seek command In priority queueing, a request element required for the requested I/O operations. is queued according to the dispatching priority of the task associated with its corresponding I/O request. The next When the direct-access device necessary request element to be retrieved is that to execute the initial seek command is with the highest priority. busy, the request element representing the I/O request is enqueued in the seek queue for that device. When the direct-access In ordered queueing, a request element, device becomes available and the seek com­ representing an I/O request for a direct­ mand has been executed so that the access access device, is queued according to the arm is at the proper address, the request numerical order of the given seek address. element is dequeued from the seek queue and The seek addresses are ordered from the enqueued in the logical r.hannel queue asso­ lowest to the highest. Related requests ciated with the device and the physical are queued in FIFO arrangement and are channel. The remaining I/O operations executed where appropriate during the specified in the channel program for the ordered "sweep" of the direct-access arm. I/O request are then started when a physi­ Ordered queueing minimizes the movement of cal channel and the device are available. the arm.

Introduction 17 PART I: EXECUTE CHANNEL PROGRAM SUPERVISOR

The EXCP supervisor receives control to indicate the 1/0 request is related, initially from the SVC FLIH after either an and must be handled as such. SVC 0 or an SVC 15 interruption. When the EXCP supervisor is entered, the current PSW • The start address contains the address has all interruptions except machine check of the first CCW to be executed in the interruptions masked as disabled, indicates channel program. supervisor and running states, and has the supervisor protection key of zero. • The channel program description indi­ cates the type of chaining in the channel program, as follows: The EXCP macro-instruction (SVC 0) is used to request normal 1/0 processing of a 00 No chaining channel program. SVC 15 is used by the 10 Data chaining error routines to request that a channel 01 Command chaining program whose execution encountered an 11 Data and command chaining error be retried and also to indicate a permanent error or a successful retry. The • The ECB address contains the address of 1/0 purge routine uses SVC 15 to return the corresponding ECB. control to the 1/0 supervisor after related requests are purged. • The DCB address contains the address of the DCB for the data set on which I/O The user of EXCP or SVC 15 is processing is requested. responsible for certain fields within the DCB and the lOB associated with the 1/0 When the EXCP supervisor receives con­ request. Within the DCB, the user must trol, the address of the lOB that contains ensure that: the information necessary for the 1/0 request must reside in general register 1. • DCB exception bits set to 11, indicat­ Processing of the 1/0 request then takes ing a permanent error on the data set, place. are reset to 00. If this is not done, further related requests for that data After the oreration of the EXCP supervi­ set are posted as complete without sor is complete, control returns to the execution. type 1 exit of the svc FLIH, which deter­ mines whether control is to be given to the • DCB exception bits set to 01, indicat­ dispatcher or to the routine giving the 1/0 ing error recovery procedures are in request. progress, remain at this setting. Chart 02 shows control flow· among the • The tape block count remains unchanged subroutines and the modules within the EXCP until the lOB associated with the supervisor. request has been posted complete. Within the lOB, the user must ensure that:

• The block count increment amount for GENERAL OPERATING PROCEDURE tape block counts is reset if the channel program indicated by the lOB changes. For a normal I/O request, the EXCP validity check subroutine is entered The field must be zero if block count directly from the SVC FLIH. This subrou­ updating is not desired. tine checks the validity of the control blocks associated with the 1/0 request. It The field must be negative for a also initializes certain lOB fields that backspace. are to be used in later processing.

The field must be zero for a rewind; For an error retry, the EXCP validity the DCB block count field must also check subroutine is entered from the error be zero. EXCP routine. The error EXCP routine ensures that the lOB fieldS are not ini­ • The unrelated flag is on to indicate tialized, since their content is necessary the 1/0 request is unrelated or is off for the error retry.

18 After the EXCP validity check subroutine OPERATION OF THE SUBROUTINES AND MODULES is executed, the get request element sub­ routine issues a request element for a normal I/O request. It stores address The following subroutines, routines, and information required by the I/O supervisor modules are used to perform the fUnctions into the next available request element. of the EXCP supervisor: Because a request element is issued for all normal I/O requests, an additional request element is not issued if an error retry for • EXCP validity check subroutine. a particular I/O request becomes necessary. • Get request element subroutine. • Error EXCP routine. • Test channel modules. The flag bits within the VCB that denote • Enqueue and dequeue modules. the status of the I/O device are inspected • Select subroutine. to determine if the requested device is • Start I/O modules. available for processing. • Start I/O subroutine. • Post-start I/O subroutine. When the device is available, a test channel module determines II a physical channel in the device's logical channel is available. The correct test channel module is selected by means of the logical channel EXCP VALIDITY CHECK SUBROUTINE word table. For both normal (SVC 0) and error retry If conditions associated with the device (SVC 15) entries into the EXCP supervisor, prohibit processing or if the test channel the EXCP validity check subroutine vali­ module does not find an available physical dates the control blocks associated with channel, the request element is queued for the request. These control blocks are: subsequent processing of the I/O request. The appropriate enqueue module is selected • Input/output block. by means of the device table entry for the • Data control block. particular device. • Data extent block. • Unit control block.

When a channel is free and the device is The addresses of the control blocks are available, the select subroutine is placed into general registers. During this entered. This subroutine selects the process, the DEB and UCB identification appropriate start I/O module for the device fields are checked, the pointer to the DCB by means of the device table and gives within the DEB is checked, and if applica­ control to it. The start I/O module per­ ble, the DEB protection tag is compared forms device-dependent functions and against the task control block (TCB) pro­ branches to the start I/O subroutine, which tection tag. If the subroutine finds that in turn issues the SIO instruction for the the control blocks are on improper boundar­ I/O request. ies, a program check occurs. On other errors, the ABTERM routine interface of the I/O interruption supervisor is entered and the task is abnormally terminated. The condition code and the CSW (if stored) that results from the execution of the SIO instruction indicate whether the When the EXCP validity check subroutine channel program for the request has been is used for normal I/O processing, the started, whether the request element must following lOB fields associated with the be queued, or whether the SIO instruction last I/O request processed on the currently for the I/O request should be re-issued. requested I/O device are reset: The start I/O subroutine and the post-start I/O subroutine handle these results. • Error count. • Flags 1, 2, and 3. • csw. Once the operations for an I/O request • Condition code. are terminated (because of completion, • Sense. error, or external action on the device), • ECB cede. an I/O interruption occurs. Information concel:ning the operation of the I/O inter­ When the subroutine is used for error ruption supervisor is contained in Part II: retry, these fields are not reset and I/O Interruption Supervisor. control returns to the error EXCP routine.

Part I: Execute Channel Program Supervisor 19 GET REQUEST ELEMENT SUBROUTINE I/O request for the data set.) In this case, the abnormal end appendage exit is tdken. For a normal return from the appen­ After a normal I/O request is validated, dage, the request is posted complete with a request element is issued to represent the purge code and the request element is it. If an error retry for a particular I/O returned to the freelist. Control returns request becomes necessary, an additional to the task supervisor. request element is not required because one had teen previously issued. control block UCB Condition Test: The conditions asso­ information is loaded into the request ciated with the I/O device that may prohi­ element, and UCB conditions, which deter­ bit iwmediate processing are denoted by the mine if the request element must be queued, following bits contained in the UCB: are tested. • Control unit busy. If there is no available request element • Device busy. (i.e., the freelist pointer contains the • Not ready. dummy address of hexadecimal FFFF), the • Disk arm seeking. EXCP supervisor uses an enable/disable loop • Error routine in control. (pseudo disable) to allow an I/O interrup­ tion to occur. The I/O interruption super­ If any of these bits are on, the request visor processes the I/O interruption and, element is queued by an enqueue module for if the I/O interruption signifies comple­ subsequent processing of the I/O request. tion of an I/O request, returns the asso­ If none are on, the device is available, is ciated request element to the freelist. able to accept the request, and a test If, however, there is an error associated channel module is entered. with the I/O request that is interrupted, the task that initiated the operation in error is abnormally terminated. The EXCP supervisor uses the request ERROR EXCP ROUTINE element that is returned to the freelist to represent the I/O request. However, if no request element can be returned to the The error EXCP routine directs the retry freelist, or if no I/O interruption occurs, of I/O requests (and the results of each the EXCP supervisor repeats the retry) to the I/O supervisor. The routine enable/disable loop. is enter€d frorr, the SVC FLIH after the SVC 15 interruption. Chart 03 shows the flow The next available request element is of centrol in the error EXCP routine. loaded with the following information: SVC 15 is provided to simplify error • Address of the UCB, which represents recovery procedures with respect.to request the I/O device to be used for the elements; an additional request element requested operations. need not be issued by the get request element subroutine. • TCB identification, as noted in the TCB for the task requesting I/O operations. IBM-supplied error routines issue SVC 15 (In an operating system in which option to retry channel programs because of an 4 is included, the address of the TCB error, and also issue it when the error has is also placed into the request ele­ been corrected, when another retry is nec­ ment. ) essary, and when the error is permanent. (See Part III: IBM-Supplied Error • Address of the lOB, which indicates the Routines.) channel program to be executed. The I/O purge routine issues SVc 15 when • Dispatching priority of the request, as it has purged all related requests and the noted in the DEB. (If no priority is abnormal end appendage must be entered. specified, this field is not signifi­ (See Part II: Error Routine Interface.) cant. ) The resident portion of the direct­ • Address of the DEB, which indicates the access device error routine returns (it location of the data set to be operated need not issue SVC 15) to the error EXCP upon. routine: when an error is corrected; and when a request element must be queued in a If the request is related and there is a seek queue for error recovery purposes. In permanent error, as indicated by the lOB the first case, the channel end appendage unrelated flag and the DCB permanent error is entered; in the second, the channel code, the request cannot be executed. (An restart subroutine of the I/O interruption error has occurred on a previous related supervisor is entered.

20 The only parameter that the user of SVC Module Selection: The test channel module 15 must furnish is the address of the associated with the device and its logical request element that represents the I/O channel is selected by means of the logical request that is to be retried. The request channel word indexing value, which is con­ element contains the address of the lOB tained in the UCB, and the logical channel associated with the I/O request and is word table. The proper logical channel loaded into general register 1 for entry to word contains the address of the test the EXCP validity check subroutine. channel module for the device. The EXCP validity check subroutine checks the validity of the control blocks pertinent to the request and loads their Selector Channel Test Channel Module addresses into general registers. The EXCP validity check subroutine then returns to the error EXCP routine: the lOB fields are The selector channel test channel module not reset. issues a test channel (TCH) instruction for each physical channel attached to the When an error routine is in control (the requested device to determine whether or lOB error correction indicator flag is set) not a physical channel is available for and the request must be retried, the error that device. If an available channel is EXCP routine tests the following UCB condi­ found, the select subroutine attempts to tion flags: start the channel program for the I/O request. If one is not found, the request • Device busy. element is queued. • Not ready,. • Disk arm seeking. • Disk data transfer,. Multiplexor Channel Test Channel Module The EXCP supervisor determines the result of the test" and the request element is either enqueued or a test channel module is Because a multiplexor channel never pre­ entered. sents a busy condition to a TCH instruc­ tion, one is not issued and control immedi­ When the error has been corrected and ately passes to the select subroutine, the error routine is no longer in control, which attempts to start the I/O request. the channel end appendage is entered. If The multiplexor channel test channel module the error has not been corrected, the error is included to facilitate channel­ routine interface of the I/O interruption independent coding. supervisor is entered, which indicates a permanent error condition and enters either the I/O purge routine or the abnormal end appendage, depending on whether or not the ENQUEUE AND DEQUEUE MODULES request is related.

If the channel program for an I/O request cannot be immediately started because a device or a physical channel is unavailable, the request element that rep­ TEST CHANNEL MODULES resents the I/O request is queued. The queueing procedure used depends on the type of device and the type of enqueueing speci­ When the device necessary for the I/O fied by the user at SYSGEN time. request is available, a test channel module determines whether or not a physical chan­ The queueing procedures that are avail­ nel in the device's logical channel is able are: FIFO, priority., and ordered. available for device operation. If a phy­ Logical channel queues are maintained in sical channel is not available, control either FIFO or priority arrangements: seek passes to an enqueue module and the request queues are maintained in FIFO, priority, or element is queued. ordered arrangements. There are two types of test channel The dequeueing procedures depend on the modules: one for a selector channel: the type of enqueue module assigned to a other for a multiplexor channel. A selec­ device. The normal dequeue module is used tor channel test channel module exists for for the dequeueing requirements of all each logical channel in the system. One queues maintained in FIFO and priority multiplexor channel test channel module arrangements. The dequeue module for exists for the logical channel associated ordered seeks is used for seek queues with the multiplexor channel. maintained in an ordered arrangement.

Part I: Execute Channel Program Supervisor 21 Module Selection: The address of the from queues maintained in FIFO and priority appropriate enqueue module is contained in arrangements. A search is made of the the device table entry for the device class queue until the request element to be of the particular device. The proper entry dequeued is located. 'The element is in the table is found by use of the device unlinked and the queue is relinked by means table indexing value contained in the UCB of the 2-tyte link field. that represents the device.

To determine the dequeue module to be used for a particular type of enqueueing, Ordered Seek Engueue Module the enqueue module address that is con­ tained in the device table is incremented by eight; at the resultant address is a The ordered seek enqueue module queues branch to the dequeue module. the request elements for unrelated seek requests into the seek queue for a direct­ access device according to seek address. This arrangement causes the stand alone Normal Enqueue Module seeks issued ty the channel restart subroutine of the I/O interruption supervi­ sor to be executed in the order of seek The normal enqueue module queues request address, as the arm moves from the lower to elements in a FIFO arrangement. The module the higher cylinder addresses. Ordered is used for the enqueueing requirements of arrangement optimizes seeking time by elim­ both logical channel queues and seek inating irregular arm movement. Priority queues. considerations are disregarded in ordered queueing. This module places the address of the request element that represents an I/O Since seek requests are executed only as request into the link field of the last the arm is moving from the lower to the request element in the pertinent logical higher addresses on the cylinders, the channel queue or seek queue. This request cylinder address at the time of the request element becomes the "last" element in the determines whether the request is to be queue and the dummy address is placed into executed in this pass across the face of its link field. The previous last request the device or during the next pass. (See element is then updated to point at the new Figure 6.) last request element.

Priority Enqueue Module

At SYSGEN time, the user specifies priority queueing for certain logical chan­ nel queues and seek queues. The request elements that represent the I/O requests are queued in an order that maintains the priority specified in the DEB for the pertinent task. All requests specifying Priority queueing is effected by search­ seek addresses from 100 ing the logical channel or seek queue until to 200 are executed in this pass. -- All requests specifying the priority point at which the request seek addresses from 000 element is to be queued is found. The to 100 are executed in address of the request element is placed the next pass. into the link field of the next highest or equal priority request element in the queue. The highest priorities are at the Figure 6. Execution of Ordered Seek top of the queue. Within a given priority, Requests requests are in a FIFO arrangement.

To help determine when the request is to be executed, a seek queue for ordered Normal Degueue Module queueing is arranged into three different queues. The first element in each queue is addressed by the seek queue control word in The normal dequeue module is used by the the UCB for the direct-access device. (See I/O supervisor to dequeue request elements Part V: Unit Control Block.)

22 The seek queue divisions and their supervisor need refer to only one field arrangements are: within the seek queue control word while obtaining a seek request to restart the • Primary queue. The primary queue con­ channel. tains all request elements for requests that specify a seek address greater The ordered seek dequeue module first than or equal to the current cylinder tests to determine if the primary queue is address. The queue is ordered from the empty. If so, it switches the secondary lowest seek address, which is the top queue to become the primary queue by of the queue, through the highest seek replacing the address of the primary queue address. in the seek queue control word with the address of the secondary queue. Thus, a • Secondary queue. The secondary queue new secondary queue must be started and the contains all request elements for next stand alone seek to be executed causes requests that specify a seek address tQe arm to move back to a lower cylinder less than the current cylinder address. address and to begin a new pass of the face The secondary queue is ordered the same of the device. as the primary queue. After the secondary-to-primary queue • Related queue. The related queue con­ switch is made or, if the primary queue was tains all request elements for related not empty and no.switch was made, the seek requests. The queue is maintained in a address for the first request in the relat­ FIFO arrangement. The order of execu­ ed queue is compared with the current tion of a related request is discussed cylinder address and with the seek address in "Ordered Seek Dequeue Module." for the first element in the primary queue. If the related seek address is between the When an I/O request must be queued for a current cylinder address and the primary direct-access device that has ordered queue seek address, the module moves the queueing specified, the ~equest element is first request from the related queue to the placed into the seek queue according to top of the primary queue. In this manner, seek address. (If the seek queue is empty, related requests are executed where the element is placed as the first element appropriate within the ordered pass of the in the primary queue. If the request is arm. related, it is placed at the end of the related queue.) control returns to the pest-start I/O subroutine. The current cylinder address, specified by the last seek address field in the UCB for the device, is compared to the seek address specified for the I/O request in the lOB. If the current cylinder address SELECT SUBROUTINE is lower than the seek address, the primary queue is searched for the point at which the element should be placed to maintain The select subroutine selects the order. If the current cylinder address is appropriate device-dependent start I/O higher than the seek address, the secondary module and then passes control to it, queue is searched. When the correct point except when an error exists from a previous is found, the element is queued. Control I/O request. then returns to the task supervisor. This subroutine is entered from both major program sections of the I/O supervi­ sor. The EXCP supervisor uses the select Ordered Seek Dequeue Module subroutine to start an I/O request when the requested device is available and the test channel module has located an available After a stand alone seek has completed physical channel for the device. The I/O for a device that specifies ordered seek interruption supervisor uses the select queueing, the ordered seek dequeue module subroutine to restart a channel with a dequeues the request element for the stand previously queued I/O request. alone seek request from the seek queue. (Stand alone seeks are explained in If the I/O request is for a burst device "Direct-Access Start I/O Module.") The attached to a multiplexor channel, it must module removes the request element from the be determined if the I/O request can be primary queue of the seek queue and, if started without causing overrun on the necessary, switches a related request ele­ other devices attached to the multiplexor ment or the secondary queue (or both) to channel. / The procedure that determines become the primary queue.. Thus, the chan­ this is described in Part II: Multiplexor nel search module of the I/O interruption Channel with Burst Devices Attached.

Part I: Execute Channel Program Supervisor 23 When it is determined that the I/O Module Selection: There is one start I/O request may cause overrun, control is given module for each device class in the system. to an enqueue module and the request ele­ The address of the appropriate start I/O ment is queued. When the I/O request can module is obtained by the select subrou­ be started, control returns to the select tine. It adds the device table indexing subroutine where the proper device­ value contained in the UCB that represents dependent start I/O module is selected. the device to the starting address of the device table. The entry in the device Errors from previous I/O requests are table at the resultant address contains the indicated when the UCB intercept flag is start I/O module address. set or when the DCB specifies that a permanent error is associated with a related I/O request. UCB Intercept Flag: The UCB intercept flag Unit Record and Telecorrn;unications Start indicates that the lOB associated with the I/O Module next I/O request on the device is to be intercepted for error correction proce­ dures. (The error occurred after channel The unit record and telecommunications end on the previous I/O request for the start I/O module is used for all I/O device. Correction was not attempted then requests on unit record equipment and tele­ because the request element had been communications devices. It loads a general returned to the freelist.) When this flag register with either the lOB start or the is set, the select subroutine intercepts lOB restart address field, depending on the the lOB for the current request by storing setting of the lOB start/restart flag. the CSW status bytes, contained in the UCB Control is then given to the start I/O for the device associated with the error, subroutine where the CAW is loaded with the into that lOB. The error routine interface contents of the register. of the I/O interruption supervisor is then entered and an error routine is scheduled, However, when an immediate operation is so that the current request may be tried required by an error routine, control goes for error correction. directly to the start I/O subroutine. Related Request: A related I/O request is indicated when the unrelated flag in the associated lOB is not set. A related request is started only if a previous Tape Start I/O Module related I/O request has successfully com­ pleted. The tape start I/O module is used for The associated DCB is inspected for a all I/O requests on the 2400 tape series. permanent error condition. If present, the This rrodule prepares the following command related I/O request is posted complete with chained CCWs, contained within I/O supervi­ a permanent error indication. All subse­ sor storage, for execution by the start I/O quent requests related to this I/O request subroutine: are posted complete with a purge error indication. (The lOBs for the I/O requests • First CCH. A set mode command, which are not held in the DEB purge chain. The is specified in the modifier byte of request elements are returned to the free­ the DEB extent by the open routine, is list.) Control returns to the task super­ placed in the command code field. This visor. corrmand sets the mode (parity, density, etc.) of operations on the tape unit. (If 9-track, the modifier byte will contain a NOP.) START I/O MODULES • Second CCW. The command code field ccntains a transfer-in-channel (TIC) When a device and channel are both corrmand. The data address field is available for an I/O request, a start I/O loaded with the lOB start or restart module is entered. It establishes the address. prerequisite device-dependent commands (set mode command for tape, set file mask com­ Control passes to the start I/O subroutine. mand for direct-access devices, etc.), the CCW address fields for the channel address Tape Unit Positioning: When repositioning word (CAW), and the CCHs necessary for the (backspacing, forward spacing. erasing) is operation of an I/O device. The start I/O necessary for error recovery procedures, subroutine is then entered to issue the SIO control passes immediately to the start I/O instruction. subroutine where a stand alone CCW is

24 loaded with the repositioning command code. the limits of that extent. If not, an The code is specified in the lOB modifier end-of-extent appendage is entered. byte by the 2400 tape series error routine. If the seek address is within the extent Cyclic Redundancy Check Correction: When limits, the direct-access start I/O module cyclic redundancy check (CRC) 1 correction loads the address of the stand alone CCW is required, the tape start I/O module into the CAW. Control passes to the start loads the first CCW command code field with I/O subroutine, which enters the start I/O a request track in error operation code appendage and then issues the stand alone (hexadecimal 1B). It also places the third seek to position the access arm for the sense byte, which contains the CRC bits, direct-access device. into the CCW for later transfer to the tape adapter unit (TAU). If a CSW is not stored upon return from the start I/O SUbroutine, the module effects a loop with a test I/O (TIO> Direct-Access start I/O Module instruction until the CSW is stored. The stored CSW indicates that channel end has The direct-access start I/O module is occurred and that the seek address haS been used for all I/O requests on direct-access transferred to the head register of the devices. The extent limits are checked; if control unit. The module sets the disk arm they will be violated, the end-of-extent seeking flag in the UCB to indicate that appendage exit is taken. If the requested the direct-access device is involved in a device has movable access arms, a stand­ seek operation and, if necessary, enters alone seek and a sUbsequent start data the dequeue module to dequeue the request transfer seek are used to start the channel element from the seek queue. programs. If the request is for a device such as the 2301 drum storage unit (which The address of the request element for has a fixed access mechanism) the stand­ the I/O request is placed into the UCB alone seek is not necessary, and only the until device end for the seek operation is start data transfer seek is issued. received. At this time, the request ele­ ment is enqueued in a logical channel queue Stand Alone Seek: The stand alone seek is for subsequent data transfer procedures. a preliminary seek command that is necessary to position the access arm before Start Data Transfer Seek: Device end for a a channel program for a direct-access stand alone seek indicates that the access device can be initiated. The stand alone arm is in position for data transfer opera­ seek starts the access arm seeking for one tions and that the channel program may be I/O request while allowing other I/O opera­ initiated. The start data transfer seek is tions on the same physical channel. issued when the channel search module with­ in the I/O interruption supervisor deter­ The stand alone seek is issued by means mines that the associated physical channel of a stand alone CCW contained within I/O and direct-access device are available. supervisor storage. The module loads the The start data transfer seek initiates the CCW with the 'seek command code and with the channel program. seek address that is provided by the user within the lOB. The file mask at this time To issue the start data transfer seek, allows all seeks, having been automatically the direct-access start I/O module prepares reset following the last operation. the following command chained CCWs with the proper command codes and data addresses: Before issuing the stand alone seek, the direct-access start I/O module ensures that • First CCW. The command code field all user-specified seek addresses are with­ contains a seek command. The data in the extent limits indicated by the DEB address field contains the address of that is associated with the data set to be the seek address that was stored in the operated upon. The module stores the lOB UCB during the stand alone seek opera­ seek address into the UCB for later start tion. data transfer seek procedures and then When the command is executed, the indexes the extent area of the DEB with the seek address overlays the control unit M EXTENT field of the lOB to locate the head register. The head register must correct extent. be reinitia1ized to the proper seek address because the seek address from The module checks the lOB seek address the stand alone seek associated with to determine whether or not it is within this channel program might have been destroyed by subsequent seek commands to other direct-access devices on that 1Information regarding a CRCerror is con­ control unit. tained in the IBM 2401# 2402, 2403, 2404, • Second CCW. The set file mask speci­ and 2816 Model I: principles of Operation fied in the DEB, which describes the publication, Form A22-6866. types of write and seek commands that

Part I: Execute Channel Program Supervisor 25 can be initiated on this data set, is address of the starting CCW and after loaded into this CCW. loading the SIO instruction with the unit address contained in the UCB. • Third CCW. The cOlrmand code field contains a TIC command. The data After execution of the instruction, the address field is loaded with either the start I/O subroutine stores the PSW condi­ lOB start or the lOB restart field, tion code, the instruction length code, and depending on the setting of the lOB the program mask into the lOB and stores start/restart flag. the unit and channel address into the UCB. When the command is executed, con­ Also, the UCB busy and post flags are set. trol passes either to the user channel When the SIO instruction is accepted or program or to an error recovery channel when the CSW is stored, as indicated by program. condition code settings of 0 and 1, control passes to the post-start I/O subroutine. The direct-access start I/O module sets the data transfer flag in the UCB, and When the path to the device is busy, as branches to the start I/O subroutine, which indicated by a condition code setting of 2, initiates the CCW execution. The results the request element is queued. If the of channel program execution are handled by device is unavailable, as indicated bya the post-start I/O subroutine. condition code setting of 3, the request element is dequeued and the task is abnor­ mally terminated. The I/O request is not posted corr,plete. End-of-Extent Appendage

Entry into the end-of-extent appendage is made by means of the appendage vector Start I/O Appendage table. Upon return, the arrendage speci­ fies one of the following: A start I/O appendage is given control • To disregard the error and try again. preceding the execution of the SIO instruc­ tion for an I/O request. For direct-access • To skip execution of the request and devices, the appendage receives control have it posted complete. preceding the execution of the SIO instruc­ tion for the stand alone seek. Entrance to • To indicate a permanent error, enter a start I/O arpendage is by use of the the abnormal end appendage, and then appendage vector table. Its address is post the request complete. placed in the DEB by the open routine. The start I/O appendage returns control to the EXCP supervisor with the indication to continue with normal processing or to START I/O SUBROUTINE skip proceSSing of the request. If the result is skip, control is given to the dequeue module and the I/O request is not The start I/O subroutine issues all SIO posted complete. instructions for the start I/O modules. When tape and unit record start I/O modules require immediate operations or uni t repositioning., the start I/O subrou­ tine places the operation code contained in POST-START I/O SUBROUTINE the lOB modifier byte into a stand alone CCW for execution. It places the address of that CCW into the CAW. The post-start I/O subroutine determines the results of the SIO instructions issued The start I/O appendage exit is then by the start I/O subroutine. It analyzes taken before the SIO instruction is issued. the condition code and, if the CSW is This exit is not taken, however, when a stored, the CSW status bits. start data transfer seek is to be issued or when an error routine is in control. The SIO Instruction Accepted: A condition code start I/O subroutine issues the SIO setting of 0 indicates the acceptance of instruction directly. the SIO instruction. This implies that the channel rrogram is successfully started. Execution of the SIO Instruction: The The request element is dequeued from the start I/O subroutine issues the SIO logical channel queue and its address is instruction after loading the CAW with the placed in the UCB.

26 CSW Stored: When the CSW is stored, indi­ • Program or Protection Check. The cated by a condition code setting of 1, the abnormal end appendage is entered and, CSW status bits may indicate the following: if the check is not reset, the task is abnormally terminated. The I/O request • catastrophic channel errors. When is not posted complete. catastrophic channel errors (i.e., channel control, channel data, or interface control checks) occur, con­ trol goes to the SER interface and the • Unit check. The sense subroutine entire system becomes inoperative. issues a sense command, the abnormal end appendage is entered, and then the • Busy. If accompanied by control unit error routine interface is entered. end, the I/O request is retried. If not, the request element is enqueued.

• Channel end. The operation was an • Attention. An attention interruption immediate command. The I/O request is for the device may be brought in. The posted complete and, if device end is attention routine interface is given also on, the UCB busy bit is cleared. control.

Part I: Execute Channel Program Supervisor 27 PART II: I/O INTERRUPTION SUPERVISOR

The I/O interruption supervisor receives subroutine issues a sense command and reads control after an I/O interruption from the additional information regarding the I/O I/O FLIH. The I/O interruption oc.curs interruption into the sense field of the either in response to channel program exe­ UCB. If an error or unusual condition cution or because of operator intervention. occurs (the I/O request did not complete The conditions that cause the I/O interrup­ normally), the error routine interface is tion are indicated in the CSW. entered; this routine determines whether or not an IBM-supplied error routine should be When the I/O interruption supervisor scheduled for the condition. receives control, the current PSW is in the supervisor and running states, has the supervisor protection key of zero, and has When the I/O request completes normally all interruptions, except machine check (indicated by a channel end or device end, interruptions, masked as disabled. or both, interruption), a trapcode module is entered. The device table is used to After operation of the I/O interruption select the correct trapcode module for the supervisor is complete, control returns to type of device. For direct-access devices, the I/O FLIH, which determines whether the trapcode module determines if enqueue­ control is to be given to the dispatcher or ing of the request element on a logical to the interrupted routine. channel queue is necessary. For tape, the trapcode module updates the DCB block Chart 04 shows the control flow among count. For other devices, a trapcode the subroutines and modules within the I/O module only facilitates device indepen­ interruption supervisor. dence.

The I/O request is posted complete by GENERAL OPERATING PROCEDURE the task supervisor's post routine, which is entered by means of the I/O interruption supervisor's post routine interface. The The I/O interruption supervisor finds type of completion (error, normal, etc.) the address of the UCB that represents the is specified in the ECB. interrupted device by means of the UCB lookup routine. This routine uses an algorithm with the values contained in the When the I/O request is complete and the UCB lookup table to find the UCB, which in channel is free, the I/O interruption turn contains the address of the active supervisor attempts to restart the channel. request element for the interrupted I/O The channel is enabled for interruptions, request. (In cases where the request ele­ and any I/O interruption that is pending is ment was already returned to the freelist, accepted and processed. If no I/O inter­ such as when an I/O interruption occurs ruption is pending, a channel search module because of an error after channel end, is entered. there is no active request element.> From the UCB and the request element, the pert­ inent control blocks, tables, and modules A channel search module for a particular are located. channel is selected by means of the channel address and the channel table. The module The I/O interruption supervisor analyzes searches the seek and logical channel the CSW status bits to determine the reason queues associated with the Channel for a for the I/O interruption and then proceeds request element that represents an I/O to service it. For example, when catastro­ request that can be started on the channel. phic channel failures (channel data check, The channel search module is re-entered channel control check, interface control until a request that can be started is check bits) occur" the SER interface is found or until it is determined that there entered so that the system environment .can are no suc~ requests available. be recorded; the system becomes inoper­ ative. When the PCI bit is set, a PCI appendage is entered. When the attention The I/O FLIH regains control when the bit is set, the attention routine interface channel is either restarted (by the start is entered and control is given to an I/O routines described in Part I) or it is attention routine. For a unit check condi­ determined from the queues that there is no tion, the sense subroutine is entered; this request that can be started.

28 OPERATION OF THE SUBROUTINES AND MODULES r------, IIECILKl + 3-bit channel address I I -----> K I The following subroutines, routines, and I I modules are used to perform the functions IIECILKl + 4-bit control unit address ~ K I of the I/O interruption supervisor: I -----> L I I I IIECILK2 + 2(4-bit device address) + 2L I • UCB lookup routine. I -----> the actual UCB address I • I/O interruption analysis. I I • Trapcode modules. ITheL______-----> reads "is the address of." JI • Channel restart subroutine. • Channel search modules. Figure 1. UCB Lookup Algorithm • Sense subroutine. • Interfaces. • I/O purge routine. IECILKl is the starting address of the UCB lookup table. IECILK2 is the starting address of the UCB UCB LOOKUP ROUTINE address list portion of the UCB lookup table.

The UCB lookup routine locates the Note: The addresses of both the address of the UCB for the device associat­ IECILKl and the IECILK2 are contained ed with the I/O interruption by use of the in the CVT. ii-bit I/O address, stored in the I/O old PSW, in conjunction with the values in the K UCB lookup table. The I/O address consists is the index value obtained from the of the channel, control unit, and device channel portion of the UCB lookup addresses associated with the I/O interrup­ table. tion. The UCB lookup table, consisting of the channel, control unit, and UCB address L list portions, is described in detail in is the index value obtained from the Part V: UCB Lookup Table. control unit portion of the UCB lookup table. Actual UCB address The I/O interruption supervisor locates is the 2-byte address of the UCB the UCB for all types of I/O interruptions associated with the I/O interruption. except for catastrophic errors and for the It is obtained from the UCB address setting of the CSW control unit end bit list portion of the UCB lookup table. alone. The algorithm shown in Figure 1 is used to obtain the address of the UCB. I/O INTERRUPTION ANALYSIS

The UCB contains the address of the active request element (representing the The I/O interruption supervisor analyzes I/O request for which the I/O interruption the csw status bits, stored as a result of occurred), which in turn contains the an I/O interruption, to determine the cause addresses of the associated lOB and DEB. of the interruption and the processing The DEB contains the address of the DCB. procedure that must be followed. The CSW The addresses of these control blocks are status bits are analyzed in the order in placed into general registers, Which are which they are described. Charts 05 and 06 not changed during the processing of the show the details of the I/O interruption I/O interruption. analysis.

If the I/O interruption is such that the Channel Data Check, Channel Control Check, I/O request has been previously posted Interface Control Check Bits complete, there is no active request ele­ ment; the element has already been returned to the freelist. This occurs for devices The CSW status bits may indicate the that have channel end and device end status presence of a channel data check, a channel presented separately. control check, or an interface control

Part II: I/O Interruption Supervisor 29 check. All are catastrophic errors. If The I/O request is posted complete when one is present, the SER interface is the normal processing return is specified. entered and the system environment is recorded. A catastrophic error causes the system to become inoperative. When the channel end bit is not set, but the UCB post flag is set, it is an indica­ Catastrophic errors are checked, and tion that channel end was suppressed either thus detected, immediately upon entry into because of corrmand chaining in a channel the I/O interruption supervisor. If such prograrr, or because an error occurred at an error exists, the other CSW status channel end prior to this interruption. conditions may not be accurate. The UCB busy and the UCB post bits are turned off, and the CSW status is moved to the lOB fer the user. If there are any errors, the sense command is issued and an error routine is scheduled. If no errors Control unit End Bit are present, but the device end bit is set, the channel end appendage exit is taken, as above. If the device end bit is not set, The setting of the control unit end bit the channel restart subroutine is entered. alone, (without a channel end, device end, or unit check bit setting) is a response to the "control unit busy" condition (busy with status modifier) that is presented when the control unit is interrogated while executing an operation. It may occur when a control unit that is shared by two or Device End Bit more I/O devices or channels becomes free. The channel restart subroutine is given control. Device end is caused either by the completion of an I/O operation at the device or by the manual change of the device from the not-ready to the ready PCI Bit and PCI Appendage state. The following conditions may be present with device end:

If the PCI bit is set, the PCI appendage supplied by the user of the I/O supervisor • Device end with the UCB busy flag set, is entered. Because a PCI condition may which indicates that an I/O device has -ride in with other I/O interruptions, chan­ corr.pleted its most current operation. nel status conditions (program, protection, The UCB busy flag is turned off and the chaining checks) as well as unit status operational status of the associated conditions are inspected upon return from channel is interrogated. the appendage. ~f no additional status conditions are present, control returns to the I/O FLIH. If status conditions are • Device end alone (without the UCB busy present, analysis is continued and the or post flags set), which indicates conditions are handled. that the I/O interruption is an unsoli­ cited device end caused by the transi­ tion from the not-ready to the ready state. The attention routine interface Channel End Bit and Channel End Appendage is entered. • Device end with the UCB post flag set, The channel end bit indicates the com­ but with no channel end bit set, which pletion of an I/O request. The I/O inter­ indicates either that channel end has ruption supervisor moves the CSW status to been suppressed by command chaining or the lOB for subsequent examination by the that an error occurred at channel end. user of the I/O supervisor. The channel The handling of these conditions is end appendage exit is then taken. described under the "Channel End Bit." The appendage returns control to the I/O • Device end with the UCB busy flag set, interruption supervisor and specifies one with the UCB post flag not set, and of the following: with a unit check or unit exception status, which indicates that an error • continue normal processing. occurred at device end. The UCB inter­ • Skip further processing of request. cept flag is set to indicate that the • Reschedule request. error must be inspected at the next I/O • Ignore request entirely. request for the device.

30 Attention Bit status bit indicated, unless the appendage specifies otherwise. When the attention bit is set, the When the program check or the protection attention routine interface is entered. check status bits are set, the abnormal end appe'ndage is entered. If the appendage does not change the setting of the bits and specifies to continue normal processing, an error routine is scheduled. The ABTERM Unit Check Bit and Abnormal End Appendage routine interface is subsequently entered and the task associated with the I/O request that developed the error is abnor­ When the unit check bit is set, the mally terminated. sense subroutine is entered so that addi­ tional information about the I/O interrup­ tion may be obtained. The unit check bit usually occurs with channel or device end bit settings (or both) or during the ini­ Status Modifier and Busy Bits tial selection of the device. The I/O interruption supervisor sets the The status modifier and the busy bits iOB exception flag to indicate an error may are set to indicate a control unit ,busy be present, and takes the abnormal end condition. (See "Control Unit End Bit.") appendage exit. The appendage returns to The UCB is located by means of the UCB the I/O interruption supervisor and speci­ lookup routine and the UCB control unit fies one of the following: busy flag is then set. • Continue normal processing. • Skip further processing of request. • Reschedule request. • Enter IBM-supplied error routine. TRAPCODE MODULES When an error routine is entered, error correction is attempted; however, if the A trapcode roodule, or the capability for error routine determines that the error is it, exists for each device class. The permanent, the abnormal end appendag.e is trapcode modules provide device-dependent re-entered. The preceding returns are functions for channel end and device end applicable. interruptions. Upon return, either the channel status is interrogated or the 9han­ nel end appendage exit is taken, depending on the settings of the UCB post flag. Unit Exception and Incorrect Length Bits Module Selection: The appropriate trapcode module is selected by use of the device The unit exception and incorrect length table, which contains the address of the bits indicate that a device-dependent con­ trapcode module to be used with a particu­ dition is present. The lOB exception flag lar device class. is set to indicate that an error may be present, and when a channel end condition exists, the channel end appendage is entered. If the channel end bit is not Unit Record and Telecommunications Trapcode set, the abnormal end appendage is taken. Modules When control returns to the I/O interrup­ tion supervisor, the error routine inter­ face is entered, unless the appendage spe­ The unit record and telecommunications cifies otherwise. trapcode modules perform no functions. A branch is made back to the I/O interruption analysis. Program Check, Protection Check, and Chaining Check Bits Tape Trapcode Module When the chaining check status bits are set, the abnormal end appendage exit is The tape trapcode module updates the taken. Upon return, the error routine block count in the DCB using the block interface is entered to schedule an error count increment amount specified in the routine that will inspect the type of lOB.

Part II: I/O Interruption Supervisor 31 Direct-Access Trapcode Module tra~sfer, busy, and not ready flags are inspected. The channel search module regains control if any of the UCB flags are The direct-'access trapcode module deter­ on to indicate that the device is not mines whether or not a seek request element available. should be queued in a logical channel queue. When the device is available, control is routed to the select subroutine, where At the completion of a stand alone seek, start I/O procedures are followed to issue indicated by a device end interruption, the an SIO instruction. The select subroutine representative request element is enqueued returns with a "try again" or "accepted" on the logical channel queue associated decision. with the device. The subsequent start data transfer seek initiates the data transfer If the decision is a try again, the operations for the request. However, when channel search module is re-entered. If it either the EXCP supervisor or an error is an accepted decision, the channel is routine is in control and the results of tested for operational status and, depend­ the TIO instruction specify a channel end ing on whether or not it is busy, control and device end to indicate completion of a returns to the I/O FLIH or to the channel stand alone seek, the start data transfer restart subroutine, respectively. seek is given immediately. If a seek end has not occurred, the module returns directly to the I/O inter­ CHANNEL SEARCH MODULES ruption analysis. The "both on" or "both off" settings of the disk arm seeking and disk data transfer flags in the UCB for the The channel search modules supply the interrupted device indicate that there is addresses of previously queued request ele­ no seek end. When both flags are on, data ments for a particular channel to the transfer is taking place. channel restart subroutine until an I/O request is found that can be started on the channel or until it is determined that there is no such I/O request. There is a CHANNEL RESTART SUBROUTINE channel search module for each of the following: The channel restart subroutine attempts • Multiplexor channel with burst devices to restart the channel after an analysis of attached. the I/O interruption determines that the channel is available for processing. • Multiplexor channel with no burst devi­ ces attached. The available channel is first re­ enabled by use of the channel mask • Selector channel included in only one contained in the entry for that channel in logical channel. the channel table. If a pending I/O inter­ ruption is accepted, the I/O interruption • Selector channel included in two or supervisor handles it. Otherwise, the more logical channels. channel is disabled and a channel search module is entered. Module Selection: The channel restart sub­ routine multiplies the address of the The channel search module returns with available physical channel by four and then the address of either a request element adds it to the starting address of the that was previously queued in a logical channel 'table. The entry at the resultant channel queue associated with the channel, address contains the address of the channel or with the address of a UCB that rep­ search module to be. used for that channel. resents a direct-access device attached to the channel. The UCB contains the seek queue control word, which provides the address of a request element previously Multiplexor Channel with Burst Devices queued in the seek queue for a direct­ access device. Whenever a burst device is operating on If the request element contains a dummy a multiplexor channel, that channel is tied address, there is no request element queued up and other devices cannot be serviced. for the available channel and the task Because of this, those devices may overrun. supervisor regains control. However, if the request element does not contain a When data is transferred to or from an dummy address, the associated UCB data unbuffered control unit, overrun can occur

32 if the channel fails to respond on time to channel queue, the request is started a request for service from a device. The regardless of the types of devices operat­ data (input or output) is considered inval­ ing on the multiplexor channel. id. OVerrun also occurs during cowmand chaining when a device receives a .command that is too late for the data. Multiplexer Channel with No . Iurst Devices The devices are classified within the UCB as being burst, overrunable byte, or non-overrunable byte. The following rules The address of the first request element are applied to their operation: in the logical channel queue associated with the multiplexor channel is passed to • Only one burst device can be operated the channel restart subroutine. If the at one time. request can be started, the select subrou­ tine is given control. Otherwise, the • A burst device and an overrunable byte module is re-enter ea. device cannot operate at the same time. When the addresses of all request ele­ • More than one overrunable byte device ments queued in the logical channel queue can operate at the same time. have been passed to the channel restart subroutine or when none of the I/O requests • A non-overrun able byte device can oper­ represented by the request elements could ate at any time. be started, control returns to the task supervisor. Burst Device: Whenever a request is for a burst device, or whenever a request element representing a request for a burst device is the first element in the logical channel Selector Channel Included in Only One queue, it must be determined whether or not Logical Channel any other burst devices or an overrunable byte device are operating. If they are, the request is not started and control is To start seek overlap, this module pass­ returned to the task supervisor. No other es to the channel restart subroutine the request elements in the logical channel address of a UCB that represents a direct­ queue are inspected until that burst access device attached to the available request is started. physical channel. The UCB contains the seek queue control word, which indicates The request is started if no other burst the first request element in the associated device or overrunable byte device is oper­ seek queue. ating. A flag byte is then set to 'FF' to indicate that a burst request is operating. The channel restart subroutine inspects (The flag byte is reset when the request is the UCB disk arm seeking flag and, if the completed.) Either the channel restart arm of the device is busy, returns control subroutine is entered with the request to this module for the address of the next element for the burst request or control is direct-access device'S UCB. If the arm is returned to the select subroutine. not busy, the first seek is initiated. The module is then re-entered until all Overrunable Byte Device: Whenever a possible seek requests for the channel request element for a request on an over­ within all the seek ,queues are initiated. runable byte device is the first request in the logical channel queue, it must be After all seeks have been initiated so determined whether or not any burst devices that seek overlap is started, a logical are operating. If none are, the channel channel queue for the channel is searched restart subroutine is entered and the until a data transfer request is started on request is started. A counter is incre­ the channel, or until it is determined that mented every time an overrunable byte there are no requests that can be started. device is started and decremented every Control returns to the task supervisor. time an overrunable byte device terminates its operations.

If a burst device is operating, control Selector Channel Included in More than One is returned to the task supervisor. No Logical Channel other request elements are inspected until that request is started. This module starts seek overlap in the Non-Overrunable Byte Device: Whenever the same manner as the module for a selector request element for a non-overrunable byte channel included in only one logical chan­ device is the first element in the logical nel, described above. It then starts the

Part II: I/O Interruption Supervisor 33 highest priority request in each logical SIO instruction is busy, the SER interface channel queue for the available selector is entered. If it is not available, the channel. (When priority queueing is not ABTER~ routine interface is entered. implemented, the address of the first request element is passed to the channel CSW Inspection: The sense subroutine restart subroutine.) "spins" on a TIO instruction until the CSW is stored, which indicates that the sense To determine the highest priority data has been transferred to the UCB. The request elements, the module places the following procedures are taken for the 2-byte link fields from the first request resultant CSW conditions: elements in each logical channel queue for the selector channel into the scratch field • catastrophic error. The SER interface of the logical channel word for the asso­ is entered. ciated queue. The scratch field maintains the address of the request element within • unit Check. The ABTERM routine inter­ the queue that is next to be compared for face is entered. priority. The priority of the request elements are then compared. • CSW busy bit. The SIO instruction is re-issued. The address of the highest priority request element is passed to the channel • CSW status modifier bit. The UCB sta­ restart subroutine, which determines wheth­ tus modifier flag is set and control er or not the represented request can be returns to the I/O interruption super­ started. If it can, the select subroutine visor. is entered. Otherwise, the address of the next highest priority request element is All other csw conditions are disregard­ passed. This procedure continues until a ed., and the first two bytes of sense request is started, or until all queues information is stored in the lOB. Control have been inspected and it is determined is returned to the I/O interruption super­ that no request can be started on that visor. selector channel. Control then returns to the task supervisor. INTERFACES SENSE SUBROUTINE Interfaces are routines that are used as common points of departure from, and that The sense subroutine is entered when the direct the transfer of control from, an analysis of the CSW status bits after an operating system routine to another system I/O interruption shows that the unit check routine. The interface positions data in bit is set. The subroutine issues a sense the form required by the system routine to command to read into the UCB additional be entered and also provides a return information regarding the unit check condi­ point. The following interfaces are used tion for the device in error. by the I/O supervisor: Issuing the Sense Command: Before a sense • Attention routine interface. command can be issued, the sense subroutine • Error routine interface. must inspect the UCB busy flag to determine • SER interface. whether or not the device represented by • ABTER~ routine interface. the UCB is busy. • Post routine interface. If the device is busy, the sense subrou­ tine sets the lOB sense flag to indicate that an error occurred. The I/O interrup­ Attention Routine Interface tion supervisor checks the lOB sense flag at device end for the busy device and, if it is on, ·ORs" the CSW field from the lOB The attention routine interface routes (stored there at channel end) to the pre­ control to the proper attention routine sent CSW bits. Thus, the channel end error after an attention interruption occurs. appears as a channel end/device end error (See "Introduction: Attention Table.") and the sense command is issued. The appropriate attention routine is When the device is available, a CCW that indicated by the index value to the atten­ contains the sense operation code is con­ tion table that is contained in the ATNTAB structed and the SIO instruction is issued. field of the UCB that represents the device The sense information is read into the UCB requiring the attention routine. The user sense area. If the initial response to the sets the index value when execution of an

34 attention routine that was specified at routine is entered, and if necessary, the SYSGEN time is desired. The attention transient portions are called in. routine interface adds that index value to the starting address of the attention For sequential-access devices, the error table. The entry at the resultant address routine interface passes the address of the contains either the address of the pert­ request element in error to the exit effec­ inent attention routine or. if the index tor of the task supervisor. The exit value is zero. a branch back to the I/O effector places this element into the asyn­ interruption supervisor. chronous exit queue for scheduling. The exit effector then completes the name of After the attention routine has been the required error routine by use of the executed, control returns to the I/O super­ ERRTAB byte in the UCB. This byte. when visor. appended to the name in the system inter­ rupt request "block (SIRB) yields the name of the error routine within the SVC libra­ ry. (If the freelist is empty, the error Error Routine Interface routine interface returns the request ele­ ment in error to the next available. and enters the ABTERM routine interface. The The error routine interface controls associated task is abnormally terminated execution of the error routines required by because in scheduling the required error the I/O supervisor for error recovery pro­ routine, the contents supervisor uses the cedures. It tests the I/O supervisor error EXCP macro-instruction.) key (contained in the DCB) and determines whether or not error recovery procedures The contents supervisor uses the are to be used. If a transient error 8-character name to search the SVC library routine must be scheduled, the error rou­ for the error routine. When found, the tine interface routes control to the exit error routine is read into the I/O effector. In the case of a related request supervisor transient area. and then given with a permanent error, the error routine control. interface calls the I/O purge routine. so that the related request elements for the The I/O purge routine is called into the data set will be purged. I/O supervisor transient area in the same manner as the transient IBM-supplied error I/O Supervisor Error Key Test: Providing routines. The error routine interface that the lOB does not indicate a permanent passes the request element for the related error, in which case the post routine I/O request to the exit effector, which interface is entered, the I/O supervisor places it into the asynchronous exit queue error key is tested to determine when for scheduling of the routine. IBM-supplied error routines are to be used. They may be used for: The constant that is used to cofuplete the name of an error routine to be sched­ • All errors. For direct-access devices, uled asynchronously, which is normally the error routine interface branches to obtained from the ERRTAB byte in the UCB, the resident portion of the direct­ resides however, for the I/O purge routine. access device error routine. which in a location following the UCB lookup handles the error. For sequential table. The address of a location that access devices, the error routine reflects this change is placed into the UCB interface passes the request element to address field of the request element. the exit effector for subsequent sched­ Thus. this location simulates that of the uling of the appropriate transient IBM­ ERRTAB byte of the UCB. and the exit supplied error routine. effector uses it to complete the name of the I/O purge routine within the SVC libra­ • No errors. The error is posted as ry. When the I/O purge routine gains permanent. control. it replaces the UCB address field in the request element with the actual UCB Scheduling of an Asynchronous Routine: If address for the device so that later proc­ the I/O supervisor error key indicates that eSSing is not affected. an IBM-supplied error routine is to handle an error, the error routine interface I/O Purge Routine: The I/O purge routine branches to the direct-access device error is transient and is called by the error routine or, if the error routine is tran­ routine interface whenever a related I/O sient. causes it to be scheduled asynchron­ request develops a permanent error condi­ ously. Chart 07 shows the scheduling pro­ tion. (The name of the I/O purge load cedure. module is IEC0025E.) All other related I/O requests for the same data set must be For direct-access devices, the resident purged because they are dependent upon the portion of the direct-access device error successful completion of the preceding

Part II: I/O Interruption Supervisor 35 related I/O requests, one. of which has ABTERM Routine Interface failed. The ABTERM routine interface routes con­ The I/O purge routine removes all queued trol to the ABTERM service routine of the ~equest elements for the related I/O task supervisor, which abnormally termi­ requests from the logical channel and seek nates a task. queues that are associated with the parti­ cular data set extent(s) defined in the The AaTERM routine interface is entered DEB. (The correct queues are found by from the I/O supervisor whenever the fol­ means of the logical channel word and seek lowing occur: queue control word indicated in the UCB.) The I/O purge routine returns the request • Device or channel not operational. elements to the freelist, chains the lOBs • CSW ~rograrr check bit set. associated with them to the DEB system • csw protection check bit set. purge chain field, and posts the ECB that • Invalid DEB or UCB identificqtion corresponds to each lOB complete with a field. permanent error code. • DCB specification error in the DEB. • Error routine to be scheduled, but no request element. The I/O purge routine returns control to the I/O supervisor via SVC 15 and the The I/O request associated with these abnormal end appendage exit is taken. conditions is not posted complete.

Post Routine Interface SER Interface The post routine interface routes con­ The SER interface is entered whenever trol to the post routine of the task the 1/0 supervisor detects a catastrophic supervisor.. The post routine interface error (i.e., when a CSW channel data check, prepares the 30-bit completion code that channel control check, or interface control describes the manner in which an I/O check bit is set). It routes control to request has completed and passes it to the the SER routines. post routine, where the code is posted in the ECB for inspection by the user. It The SER interface places the address of also passes the address of the TCB of the the request element in error into location task for which the I/O request has complet­ 280 and places the unit address at location ed. 58 of the I/O old PSW. The hexadecimal code OF, which indicates an I/O channel If a WAIT macro-instruction had been failure, is then placed into location 115 issued, the completion code clears the wait of the machine check (MCH) new PSW. The bit in the ECB. The post routine clears MeH new PSW indicates the wait state and the wait bit in the request block. has all interruptions masked as disabled. The SER interface then loads the MCH new The post routine interface is also used PSW. Since one of the SER routines gets by the purge complete subroutine to post immediate control, hardware indicators can the completion of an SVC purge request also be inspected. (described in Part IV).

36 PART III: IBM-SUPPLIED ERROR ROUTINES

An error routine may be entered follow­ issues SVC 15. Upon receiving control, ing a unit check., a unit exception, a wrong however" the I/O supervisor purges any length indication, a program check, a pro­ request elements related to the request tection check, or a chaining check indica­ element in error by use of the I/O purge tion in the CSW status bytes. When such a routine. It points to the purged requests condition exists, the I/O supervisor passes with the system purge field in the DEB for control to the error routine interface, the appropriate data set. The request which tests the I/O supervisor error key in elements are returned to the freelist and the DCB and branches to or has the the ECB is posted with a permanent error appropriate error routine scheduled asyn­ code. chronously. At the completion of error processing There are three types of IBM-supplied (successful or unsuccessful), the error error routines: routine, when necessary, updates the sta­ tistics table, writes error messages to the • Device-dependent routines. operator, and calls the I/O outboard • Common routines. recording routines for external error • I/O outboard recording routines. recording. Device-dependent routines attempt error recovery and correct errors for particular device types according to the standard IBM DEVICE-DEPENDENT ROUTINES error recovery procedures (ERP). All of the device-dependent routines, except a resident portion of the error routine for The device-dependent routines correct direct-access devices, use the I/O supervi­ errors according to the standard IBM error sor transient area for execution. recovery procedures. The routines are:

Three routines commonly used by the • 1052, 2150 error routine, which handles device-dependent routines are the error errors on the console typewriter. (The interpreter, which is resident, and the load module name is IGEOOOOD.) write-to-operator and statistics update routines, which are transient. • 25ijO/2821 error routine, which handles card read and punch errors. (The load I/O outboard recording routines maintain module names are IGE001C and IGE0101C.) external records on the system residence device regarding the operation of each I/O • 1403/1ij43 error routine, which handles device. These routines are the statistical printer errors. (The load module name data recorder and the· outboard recorder and is IGEOOOOG.) are always provided when IBM-supplied error routines are included in the system. • lij42, 2501, 2520 error routine, which handles card read and punch errors. (The load module name is IGEOOOOE.) The device-dependent and common routines determine the type of error. When the • 2671/2822 paper tape reader error rou­ error is such that the I/O request can be tine, which handles errors on the paper retried, the error routine issues an SVC 15 tape reader. (The load module name is to retry the channel program, and then IGE0002?) returns to the task supervisor by means of the RETURN macro-instruction. As each • 2400 tape series error routine, which retry is executed, control returns to the handles magnetic tape errors. (The error routine. load module names are IGEOOOOI, IGE0100I, and IGE0200I.) When an error is corrected by an IBM­ supplied error routine, the routine issues • Direct-access device error routine, SVC 15 to return control to the I/O which handles errors en direct-access supervisor. The ECB is posted with a devices and performs alternate track normal completion code and normal process­ procedures. Most of this error routine ing continues. is resident; the lnad module for the resident portion is dependent on device Also, when the IBM-supplied error rou­ type and selection of the track over­ tine cannot correct the error, the routine flow feature, as follows:

Part III: IBM-supplied Error Routines 37

IEC23XXB - 2311 only; without overflow The load module name for the transient portion is IGEOOOOA. IEC23XXC - 2311 only; with overflow • 2250 error routine, which handles IEC23XXD - 2311 and/or 2302~ 2303; errors on the 2250 display unit. (The without overflow load module name is IGE0010A.) • 2260 error routine, which handles IEC23XXE - 2311 and/or 2301., 2302" errors on the 2260 display station and 2303, 2314; with overflow associated 1053 printer. (The load (overflow is a standard fea­ module names are IGE0010B and ture on 2301 and 2314) IGEOllOB. )

Rart III: IBM-Supplied Error Routines 37.1 GENERAL OPERATING PROCEDURE • Data and Command Chaining. The error routines do not retry any channel pro­ grams that have mixed chaining (lOB The device~dependent routines, all channel program description bits set to except the resident direct-access device 11): the routines write an error mes­ routine, gain control from the contents sage to the operator and indicate a supervisor. Although each routine has permanent error by means of the DCB characteristics pertinent to the device exception bits. SVC 15 is issued so type, the programming techniques used for that the request element will be each routine are similar. returned to the freelist, and then control is returned to the task super­ The routines set the lOB error indicator visor via the RETURN macro-instruction. bits, examine the sense and CSW status bits stored in the lOB to determine the type of • Command Chaining. When a channel pro­ error, and where possible, attempt to re­ gram is command chained (lOB channel cover the error by retrying the channel program description bits set to 01), it program by means of SVC 15. must be restarted at the proper CCW address. When a channel program has Chart 08 shows the general operating teen retried (indicated by the setting procedure for all device-dependent routines of the entry flag) and the error is except the 2250 and 2260 error routines. corrected, a subsequent error may occur The general operating procedure for these on a different CCW. This error is routines is shown in Chart 10. detected when the address of the erro­ neous CCW does not equal the restart Setting Error Indicators: All device­ address in the lOB. In this case, the dependent routines upon entry, turn the lOB channel program is restarted at the exception bit and error flag on. These erroneous CCW address. However, if an flags indicate to the error routine error occurs at the execution of the interface that an error routine is in SIO instruction for this retry, the control, and that control must be returned accuracy of the CCW is unpredictable. to the error routine until the error is This error is indicated by the condi­ corrected or is determined to be uncorrect­ tion code setting of 01. The channel able. An uncorrectable error is a perman­ program is again started at the address ent error. of the erroneous CCW, which is the restart address in the lOB. When the error is permanent, the lOB exception bit is left on and all error • Data Chaining or No Chaining. When the flags and counts are reset to zero. If the channel program has data chaining or no DCB exception bits are set to 01 (i.e., chaining (lOB channel program descrip­ indicate that error correction is in tion bits set to 10 or 00, respec­ progress), the I/O supervisor resets the tively), the channel program is bits to 11, indicating the permanent error restarted from the top of the CCW list, condition. Until the DCB exception of 11 which is the start address in the lOB. is cleared, all further related requests for the particular DEB are rejected and Determining the Type of Error: The type of posted as a permanent error. error is indicated by the setting of the CSW status bits, and in the case of a unit When the error is corrected" the lOB and check condition, the sense bits. The error DCB exception flags and the lOB error flags routines (except the 2250 and 2260 error and counts are reset to zero. routines) examine the setting of these bits by means of the error interpreter routine. lOB Channel Program Description Bit Test: Instructions within the 2250 and 2260 error In all error routines, except the direct­ routines test the bits: the other device­ access device, 2671/2822, 1052, 2150, 2250, dependent routines branch to the error and 2260 error routines, the lOB channel interpreter with a list of codes and program description bits are inspected for address constants following the branch the type of chaining within a channel instruction. program in error so that the proper restart procedure is taken. The direct-access Each entry in the list is 1 byte in device. 2671/2822, 1052. 2150, 2250, and length. The order of the entries depends 2260 error routines always retry the chan­ upon IBM standard error recovery proce­ nel program in error from the top of the dures, upon the type of device-dependent CCW list (at the first CCW): thus, they routine in control, and upon the meaning handle any type of channel program and the CSW status or sense bits have for the chaining is not significant. type of device. The procedure taken for chained channel Each entry contains a code that corres- programs, shown in Chart 08, is as follows: ponds to either a CSW

38 status bit or a sense bit, and an indexing DEVICE-DEPENDENT CHARACTERISTICS factor that indicates the point at which the error interpreter is to return to the error routine after determining the type of Since each device type has different error. characteristics, the meaning of the CSW unit exception bit, the sense bits, lOB flags 1, flags 2, and flags 3 fields, and The error interpreter routine compares the lOB error count field vary according to each code to the CSW status or sense bit. the type of device. The CSW status bit If the particular status or sense bit is interpretation and their order of inspec­ set, the error routine regains control at tion is shown in the coding for the IBM­ the point indicated by the address con­ supplied error routines. The sense bit stant. meanings are shown in Table 2 and are explained in the subsequent error routine sections. The lOB flags 1, 2, and 3 fields The error routine then handles the con­ and the lOB error count field are also dition denoted by the particular status or shown in Table 2. sense bit. The following procedures are taken: 1052, 2150 Error Routine • Permanent error. A permanent error is one that either cannot be corrected or fails to be corrected after standard Special considerations are necessary error recovery procedures. A permanent when the console typewriter has a permanent error is indicated by the lOB exception read or write error. On a permanent read bit. The statistics update and the I/O error, the write-to-operator routine is outboard recording routines are called called; it writes a message indicating for error recording and then SVC 15 is typewriter failure to read input messages. issued. (See "Common Routines.") When operator After the I/O supervisor routines intervention is required and a permanent have posted the request complete with a write error has occurred, the console bell permanent error, have entered the is rung by use of the console -alarm rou­ ABTERM routine interface in the case of tine. a program or protection check, have purged any requests related to the The console alarm routine issues a TIO request in error, and have entered the instruction until the conSole device is abnormal end appendage, control returns free and then issues the SIO instruction to the error routine. The error rou­ that rings the console bell. After doing tine uses SVC 3 to return to the task so, the console alarm routine loads the PSW supervisor. to put the machine in the wait stci"te. • Operator Intervention. When it is det­ The bits in the first sense byte ermined that operator intervention is (byte 0) have the meanings described below. required, the write to operator routine is entered for the writing of the Bit 0: Command Reject "intervention required" message. SVC This bit is set when an invalid com­ 15 is issued, then the RETURN macro­ mand code is detected. instruction is issued to return control to the task supervisor. Bit 1: Intervention Required This bit is set when one of the • Recoverable errors. The channel following occurs: program is retried by means of the • Console is out of forms. ERREXCP macro-instruction, and if the • Not-ready key is depressed. error is corrected, the lOB exception and error flags are set to zero and Bit 2: Bus-Out Check normal processing continues. This bit is set when a parity error is If the error is uncorrectable, the detected on a command or a data byte. procedure for a permanent error is taken. Bit 3: Equipment Check This bit is set when one of the following occurs: statistics Update: In unit check cases, • Keyboard parity error. the statistics update routine is always • Keyboard-printer compare check. called to update the error counters in the • Printer failed to take a mechanical statistics table and, if a statistics coun­ cycle. ter overflows, the statistical data recor­ der is called for external error recording. Bits 4 - 7: Unused.

Part III: IBM-Supplied Error Routines 39

Table 2A. Sense Bytes and lOB Flags

Sense Byte Meanings lOB Flag.

""" Bit Byte 0 Flags I Devic~ 0 3 4 leevice~ o I 1 2 3 4 5 6 7 Channel 1052, Cmd Int Bu, Eq 1052, Program Err Mode lOB Resht 2150 Rej Req Out Chk 2150 Description Flag 1 X Ex [X Flag Channel 2540/ 2540/ Cmd Int Bu, Eq Data X Unu,uadV Program Err lOB RestTt 2821 Rej Req Out Chk Chk Cmd V" 2821 Description Flag IX [X Ex IX Flag Channel 1403/ Cmd Int Bu, Eq 1403/ Err Program lOB Restrt 1443 Rej Req Out Chk 1443 Flag Description [X [X Ex IX Flog 1442, 1442, Channel Cmd Int Bu. Eq Err lOB Restrt 2501, 2501, Program Rei Req Out Chk Flag [X [X Ex Flag 2520 2520 DescriDtion lX Channel 2671/ Cmd Int Bu. Eq 2671/ Program Err lOB Restrt 2822 Rej Req Out Chk 2822 Flog ~~;lXjXIX Description IX IX Ex IX Flag Wrt Data Channel TeplI- Cmd Int Bu, Eq Data Over- Err CRC lOB Restrt 2400 Cnt Cnvtr 2400 Program Reposi- Rej Req Out Chk Chk run Flag Bit Ex Flag Zero Chk Description tion lX TM< 2311/2841 Channel ll12841 Int Bu. Eq Data Over- Cand S•• k Err lOB Restrt 302;2303 CmdRej 2301;282( Program r Req Out Chk Chk run Chk Chk Flog Ex Flag 2302;2303 Description [>< Should Should ·2314 Bu. Data r.x r.x 2250 Camel Not Not Channel Out Chk Rej Occur Occur 2250 Program Err lOB Res ... Flag Ex Should Should Should Should Interruption [>( Flag Cand .Int Bus Eq X X Not Not Not Not Channel Rej Req, Out Chk Err Occur Occur Occur Occur 2260 Program lOB Restrt Description Flag Ex [>( Flag 2301/ Camel In! Bu. Eq Data Over- X' Inval X X 2820 Rei Req Out Chk Chk run Addr Flags·2

230!1;2820 Byte 1 Read . No End 2302;2303 CCHH Home of Ext" Unit Unit 2311;2314 Upclate 7 At Wrt File Tope [X Address Te .. Status Status 2321/2841 [X 20 "Noise Trk Load Stat Prot Ind X Avail Busy Point X 2540/ !"';:' ~ 1;2841 Data Eonfd Inv No File Missing Over- 2821 [X [X [X [X 302,;2303 Chk R.c X t>< IX Method 2314 Fid Cyl Seq Fnd Prot ~~~ f:: Wrt 2400 Half [X[X [X UEX [X ~t ci~r ~:. [X [X [X [>

2301/ Rdy 2841 Op

2303/ Rd Wrt On IVIVIV 2841 Rdy Op Safety Safety Line V'" V'" A On Unsafe Wrt Pack End [X Seek line Safety Change of Inc:mpl Cyl

Part III: IBM-Supplied Error Routines 39.1 Table 2B. rOB Error Counts

Byte 4

Echo Rei Rd Wrt Diy Seq Seq Seq 2400 Cntr Ind Err Tape Clock Clock Ind Ind Unit Err Err Err C B A Seq Seq Seq Seq Seq 2301/ Seq Seq Seq Ind Ind Ind Ind Ind 2820 Ind Ind Ind 0 1 2 3 4 5 6 7

Byte 5

2311/2841 Command in progress when overflow ,ncomplete occurs 2302/2303 or 2314 Zero 2301/ 2820 v'XIx1Y1x1XI I I

lOB Error Counts

Bit Device o 3 4 5 7 o 7

Bus Overrun Wrt 2400 Control Count Read Data Check Out Chain Check Ind Write

2311/2841i Seek Err Count Data Check Count No Record Found Count 2301/2820'

2540/ 2821

2250

Bus Bus Bus 2260 Out Out Out ABEND 1 2 3 App

40 2540/2821 Error Routine Bit 3: Equipment Check The setting of this bit occurs after one of the following: When a card jam causes a punch error indication on the 2540 punch, operator • Hole count error. restart procedures are necessary. • Buffer parity error. • Translate check. No recovery is attemped under program • Address check. control on a punch error (equipment check) unless the queued sequential access method This error applies to the previous (QSAM) is in use and requests recovery. card punched for which data was trans­ mitted; it is considered permanent. The bits in the first sense byte (byte 0) have the following meanings for the 2540 Bit 4: Data Check error routine: The setting of this bit indicates an invalid card code was detected. The Bit 0: Command Reject operation is retried once, and upon The setting of this bit indicates one recurrance, is denoted as a permanent of the following permanent errors: error.

• A read backward or write command was Bit 5: Unused. issued to the reader. Bit 6: Unusual Command Sequence • A read backward control other than This bit is set due to a read follow­ NOP or a read feed and stacker ing a read with no intervening feed. select command was issued to the This error is considered permanent. punch without the PFR feature. Bit 1: Unused. • A read backward or control command was issued to the punch with the PFR feature. 1403/1443 Error Routine • An incorrect sequence of instruc­ tions was issued. The bits in the first sense byte • A command was received which the (byte 0) have the meanings described below. device was not designed to execute. Bit 0: Corrmand Reject Bit 1: Intervention Required This bit is set when one of the The setting of this bit indicates a following occurs: not-ready condition due to one of the following: • A read backward command is received. • A carriage instruction to space more • Cards are not at each station (not than three lines is received. EOF for the Reader) •. • A carriage instruction to skip to • Stacker is full. channel 0, 13, 14, or 15 is • Hopper is empty (not EOF for the received. Reader) • • A command is received that the • Stop key is depressed. device has not been designed to • Chipbox is full or removed. execute. • Card is jammed. These errors are permanent. A message is typed, and the operator must perform the right action. Upon Bit 1: Intervention Required correction, the last operation which This bit indicates a not-ready condi­ was interrupted is repeated. tion due to one of the following:

Bit 2: Bus-Out Check • Forms have run out or jammed. The setting of this bit indicates a • stop key is depressed. parity error on bus-out on a command • Cover interlock is open. or data byte during either initial • Synch. check. selection or command execution. A message is typed and the operator When this error is detected, no punch­ must correct the·condition. When the ing occurs. The operation is retried interruption occurs due to the correc­ once and if it occurs a second time, tion of the error, i.e., the unit goes it is considered a permanent error and from not-ready to ready status, the a message is written. last operation is repeated.

Part III: IBM-Supplied Error Routines 41 Bit 2: Bus-Out Check 1442, 2501, 2520 Error Routine The setting of this bit indicates incorrect parity on bus-out during command-out time during selection or The bits in the first sense byte at service-out during data transfer. (byte 0) have the meanings described below. This error is considered permanent. Bit 0: Command Reject This bit is set when a read backward Bit 3: Equipment Check command is issued or a command is The setting of this bit indicates a received which the device has not been program resettable malfunction was designed to execute. The error is detected in the printer or in its considered permanent. controls. The errors are buffer or hammer checks, and are reset by the Bit 1: Intervention Required next write or control command. This bit is set when one of the following occurs:

Bits 4 and 5: Type Bar Selection • Power is off. (1443 only) • Cards are not registered at the read These bits are used in combination and station. indicate the following: • stacker is full. • Feed check light is on. • 52 character set (00) • Stop key is depressed. • 13 character set (01) • Chip box is full or removed. • 39 character set (10) • No cards are in hopper and end of • 63 character set (11) file is not on. • Cover interlock is .open. These bits can be changed only by repositioning the type bar character A message is typed, and the operator indication switch. must correct the condition. Upon cor­ rection, the last operation that was interrupted is repeated. Bit 4: Data Check (1403 only) If the universal character set feature Bit 2: Bus-Out Check is installed, the setting of this bit This bit is set when there is a parity indicates that a code in data storage check on bus-out during command or did not match any code generator stor­ data bytes, but not during the time age. This is considered a permanent period of address-out or command-out error. proceed.

If the universal character set feature On a command byte, one retry is made; is not installed, this bit should not if upon return the error is not cor­ be set. rected, it is considered permanent. On a data byte, the card is already Bit 5: Code Generator Storage Parity Error punched; the error is considered per­ (1403 only) manent. If the universal character set feature is installed, this bit indicates that Bit 3: Equipment Check a parity error was detected on data This bit is set at the following being written into or read from code situations: generator storage. If it occurs while loading generator storage, a retry is • Punch operations - the punch echo is done. If it occurs at any other time, checked for invalid card codes; it is treated as a permanent error. i.e., rows 1 through 7 have more than one punch in one column. If the universal character set feature is not installed. this bit should not • Read or punch operations - equipment be set. check detects an error from the 9 bit match. The invalid card code part of equipment check is not set Bit 6: Unused. during card image punch. Bit 4: Data Check Bit 7: Channel 9 The setting of this bit indicates an This bit is set when a hole is sensed invalid card code was detected during in channel 9 of the carriage control a read operation; i.e., rows 1 through tape during execution of the last 7 have more than one punch in anyone write or control command. column. (This ~s not indicated when

42 the read command is in data mode 2.) mitted the last previous character by This error pertains to the card for the time the next character is to be which data was sent. read into the register.

A message is typed. and the operator must reposition the cards for one The operator must reposition the cards retry.. If the error persists. it is and the operation is retried once. If considered permanent. the error persists, it is considered permanent. Bit 5: Overrun This bit is set during a read opera­ tion if the i.nterface has not trans- Bits 6 and 7: Unused.

Part III: IBM-Supplied Error Routines 42.1

2671/2822 Error Routine programming error as an invalid com­ Irand.

Because the paper tape reader cannot be Bit 3: Equipment Check backspaced or repositioned under program This bit indicates that a time-out has control, all unit check errors except a teen detected in the tape reader since bus-out check are considered permanent. the last data byte was sensed at the The bus-out check is retried once, but if tape read station. This time-out of not corrected, is then considered perman­ approximately 1 second can be caused ent. by: The sense bits in the first sense byte • A failure of the photo cells or the (byte 0) have the meanings described below. light projection system. • A tape drive motor failure. Bit 0: Command Reject • An unusual tape creeping condition. This bit is set for the 2671 Paper • A length of tape without punching. Tape Reader when a read Cackward or a write command is received at the tape Bit 4: Data Check reader or valid commands have invalid This bit is set for 2671 Paper Tape modifier bits. Reader when an invalid character is read. Parity of the data to be read A parity error on the command prevents can be checked if the parity switch is these conditions from ceing detected. set to either the odd or even posi­ tion. Regardless of the tape code Bit 1: Intervention Required used, the data sent to the system is This bit is set when the device is in odd parity. not-ready. This is best described by stating the conditions for ready. The device is considered ready when: 2400 Tape Series Error Routine • Power is on. • Tape is properly loaded. • start key is pressed. Minimum tape record lengths are 12 bytes for a read operation and 18 bytes for a The 2671 Paper Tape Reader becomes write operation. This minimum length has not-ready immediately after a read been established to distinguish noise operation has been initiated when: records from data records. There is no check for noise unless there is a data • There is an overstep condition (the check. tape did not stop on one character) on a normal or abnormal tape stop. The maximum block size on tape is limit­ ed to 32,000 tytes. • Tape jamming occurs in the take-up stacker (special feature). The tape The bits in the first sense byte transport mechanism is immediately (byte 0) have the meanings described below. released. Bit 0: Command Reject • The end of tape is detected at the The setting of this bit is caused by: reading station (with EOF light off) • • A write, write tape mark, or erase command is addressed to a file pro­ • The stop key has been depressed tected tape unit. during the read operation and a normal or abnormal completion has • A "data converter on" mode set com­ occurred. mand is recognized on a control unit without the data converter feature. As soon as the device is restored from the not-ready conditions back to a This error is considered permanent. ready condition, a device end inter­ ruption is generated tOo inform the Bit 1: Intervention Required program of this transition. This bit is set when the addressed tape unit is not-ready or when the Bit 2: Bus-Out Check addressed tape unit is nonexistent. This bit is set for the 2671 Paper Tape Reader when a parity error has The status of the addressed unit is been detected for a command issued by determined by the setting of bits 1 System/360. A transmission error or a and 2 in sense byte 1. If set, a command byte is thus separated from a message is typed out to the operator

Part III: IBM-Supplied Error Routines 43 indicating the type of error. A • A clocking error occurs (Bit 2, 3, nonexistent taFe address is considered and 4 of Byte 4). as an unrecoverable error. Aconsole message is typed, and control is given • The tape control failed to keep the to the error routine interface. , proper sequence of controls in oper­ ation (Bit 5, 6, and 1 of Byte 4). Bit 2: Bus-Out Check This bit is set when uneven parity Bit 4: Data Check appears on bus-out. The error may be This bit indicates a parity error on caused: data during ~ read, read backward, or write operation. It is set at the • During the initial selection following situations: sequence (command out response). • The H/W register during a read or • During a write or control operation read backward operation contains when a byte of data is offered from incorrect parity (the bit cannot be the channel (on bus-out in response set after an overrun or receipt of a to service-in). stop command), (Byte 3, Bit 0).

If the cause is the latter cas,e, the • Longitudinal parity of a record does tape is repositioned and the operation not agree with the check character retried. In the first case, the oper­ of that record. Occurs during a ation is retried without any reposi­ read, read backward, or write opera­ tioning of the tape. In both cases, tion (Byte 3, Bit 1). if the error persists, it is consid­ ered to be a permanent error. • Excessive skew encountered during a write type operation (Byte 3, Bit Bit 3: Equipment Check 2) • This bit is set due to a machine malfunction. Data transfer and tape • Cyclic redundancy check computed motion are indeterminate for all during a read or read backward does equipment checks, and no attempt is not agree with the computed check made to recover. Control is passed to mode created when the record was the I/O outboard recording routines, written (Byte 3, Bit 3). the error is indicated as permanent, and control returns to the error rou­ • Character containing incorrect pari­ tine interface. ty has been read into skew register during a write, write tape mark, or The equipment check ITay occur for the ERG (Byte 3, Bit 4). following: On a read or read backward with data • A difference in overall parity when check, the record in error is examined operating seven-track feature with for noise (a record less than 12 the translator off (Bit 1, Byte 3). bytes), unless data chaining is used, in which case the records are not • A difference in overall parity among checked for noise. If a noise record three-byte characters on a nine­ is detected, the noise bit (sense byte track write operation with tape 1, bit 0) is checked. If it is off, control having the seven-track fea­ the record is true noise, is ignored, ture and data converter (Bit 7. Byte and the operation continues. 3) • If the noise bit is on, the read • Echo error indicating that the tape record is not a noise record, the tape unit failed to generate an echo is repositioned, and the operation is pulse in reponse to a write pulse re-executed in the same direction as (Bit 0, Byte 4). the original read. If the error per­ sists, the operation is retried up to • Incorrect parity is recognized in nine times for a total of ten reads the H/W register during a write per record, at which point the tape is operation on the 2403/2803 (tape positioned past the tape cleaner control) without seven-track feature (unless the tape is at load point or (Bit 1, Byte 3). contains previous noise records), repositioned to its original position, • Selected tape unit failed to respond and an attempt is again made to read to a set read or set write status the tape. when instructed or became not-ready during the execution of a tape The above process is repeated until motion operation (Bit 1, Byte 4). the error is corrected, or is repeated

44 to a maximum of 10 loops or 100 reads. 3. IEC23XXD 2301/2820 (2302, 2303, If the error still persists, the 2311, 2314/2841) error routine without affected record is defined as a perma­ overflow. nent read error, counted as such, and return is made to the error routine interface after the appropriate opera­ 4. IEC23XXE 2301/2820 (2302, 2303, tor message is typed. (For nine-track 2311, 2314/2841) error routine with tape operations on read errors, the overflow. CRC is used in the attempt to recover.) The resident direct-access device error routines attempt to restart the channel program in error from its original starting If the data check is associated with a point, the first CCW. This eliminates the write operation, the tape being writ­ problem of repositioning required by disk, ten is backspaced, one record erased, and allows the handling of channel programs and then the write operation repeated. that include command and data chaining. This procedure is repeated until the Any errors within errors are also handled. write is corrected or a total of For example, if a data check occurs and fifteen rewrites have been executed. upon retry a seek check. is encountered, the If the error still persists, it is error counts for both the data check and recorded as a permanent error. The seek check are incremented and recovery is operator is notified, and control still possible. An unrecoverable error is passes to the error routine interface. not indicated until the error is retried the standard number of times.

Bit 5: Overrun The handling of track condition check is This check can occur only during a an exception to the general practice of read, read backward, or write opera­ restarting the channel program at the orig­ tion. The bit is set when the control inal start location. In this case, the unit requests service but finas the home address and RO record on the track is servicing lines busy. This implies read to determine if the track is a defec­ that the data has come too fast for" tive or alternate track and to locate the the system or channel to handle it. corresponding alternate or defective track. The data transfer is stopped. If it is an alternate track, the address When overrun is detected, the tape is of the defective track, plus one, is used repositioned and the command is re­ in a seek command. (This is found in the executed until the error is either ID field of the RO record.> The operation corrected or retried five times. If is resumed after a search to the desired the error persists, it is recorded as track position. a permanent error. If it is a defective track, the address Bit 6: Word count Zero of the alternate track is used in a seek This bit is set when the command is command. (This is found in the ID field of halted (by the halt I/O instruction) the RO record.> The operation is resumed after initial selection but before the after a search to the desired track. transfer of data has taken place. This implies no tape movement. It is The direct-access device error routine also set when a write is issued with a also handles both cylinder and head switch­ WC of zero. ing for sequential and split cylinder.

Bit 7: Data Converter Check On a no-record-found error, no console This bit is set during a read message is issued if the arm has sought the operation using a data converter correct track. Instead, a permanent error option upon reading module 4 with a is flagged in the lOB. remainder other than zero. When the overflow incomplete bit is set, Direct-Access Device Error Routine a CCW for the remainder of the record must be constructed, because only a partial There are four direct-access device record has been either read or written. error routines available to the user. The The command code for the CCW to be con­ one used depends on the devices in the structed is taken from sense byte 5. Since user's system. The routines are: it is required to construct the command outside of the original CC~ list and then 1. IEC23XXB 2311/2841 error routine TIC to the original channel program, the without overflow. data chaining must not extend beyond this CCW. Data chaining that includes a TIC may 2. IEC23XXC 2311/2841 error routine result in an uncorrectable overrun condi­ with overflow. tion.

Part III: IBM-Supplied Error Routines 45 Whenever an overflow incomplete. in con­ • The file is trying to read and junction with a file mask violation. end­ write at the same time. of-cylinder, or track condition check is • The write gate is off. and the detected, the direct-access device error write driver is on. routine assumes that the continuation of • The write gate is on. and the the overflow record on the following track write driver is off. has the Record 1 in its ID field. This • The erase driver is off. and the assumption is necessary because the error erase gate is on. routine must orient the interrupted channel • The erase driver is on, and the program to the first data record on the erase gate is off. following track. • More than one file module has been selected. Sense Byte 0: The bits in the first sense • One of the DC file voltages has byte have the meanings described below. been lost (2311 only). Bit 0: Command Reject This bit indicates that the 2841 has 2. Serializer/Deserializer Check received an invalid operation code. (Byte 2. Bit 2) - This bit indi­ It is also turned on when a seek cates that a bit has been either check, invalid sequence of commands. lost or gained when the parallel or file protect condition is detected. channel data is converted to seri­ al file data during a write opera­ Bit 1: Intervention Required tion. This bit indicates that the specified file is: 3. Channel Tag Line Check (Byte 2. Bit 3) - This bit indicates that • Not physically attached to the the 2841 has detected the presence system. of 'two concurrent tag lines. i.e •• • Physically attached to the system command out and service out. but not available for use because the file motor is not on. a cover 4. 2841 Arithmetic Logic Unit (ALU) interlock is open. etc. Check (Byte 2. Bit 4) - This bit indicates that more than one con­ Bit 2: Bus-out Parity dition has been detected during a This bit indicates that a data parity search operation. i.e •• during a error has been detected during the search equal operation both the transfer of information from the chan­ equal and high latches are on. nel to the 2841. This check is an odd redundancy check and occurs on both 5. Unselected Status (Byte 2. Bit 5) control and write operations. This - Status line from files is on check is done by the 2841. A parity with no file selected. error detected during a command trans­ fer is a bus-out check and not a A message is written to the operator. command reject. Bit 4: Data Check The sequence is repeated ten times if This bit indicates that a data error the error continues to occur. On the has been detected in the information eleventh occurrence of the error con­ received from the file. Error detec­ dition. a message is written to the tion in the 2841 is performed by the operator and the control unit is con­ division of the message polynomial by sidered inoperative. a generator polynomial, using Mod 2 arithmetic. In the case of the 2841. Bit 3: Equipment Check the 'polynomial is X16 + 1. This bit indicates that an unusual condition has been detected in the Bit 5: Overrun control unit or device. A message is This bit indicates that either a written to the operator. service-out signal was not received in the 2841 within the specified time The conditions that cause the bit to allowed after service-in or that a be set are: chained CCW was issued but that it was received too late to be properly exe­ 1. Unsafe (Byte 2. Bit 0) - This bit cuted. Detection of an overrun during is used to indicate that a file reading or writing causes an immediate malfunction has been detected. stop of data transmission. When writ­ Some of the malfunctions are: ing. the remaining portion of the record area is padded out with valid • More than one head has been zeros. On reading. the remaining por­ selected. tion of the record continues to be

46 read into the 2841 and the check is point is detected. This type of error generated. is created during a write-RO or write­ count, key, or data operation. The original sequence of operations is repeated ten times if the error con­ tinues to occur. On the eleventh Bit 2: End-of-Cylinder occurrence of the error, a message is This bit indicates that the CCW written and the task is abnormally command chain has not been completed, terminated. but that end-of-cylinder has been detected. Bit 6: Track Condition Check This bit does not apply to the 2301. It is set for other direct-access Bit 3: Invalid Sequence devices whenever the following condi­ This bit indicates that an attempt has tions are detected. been made to execute an invalid sequence of CCWs. Invalid sequences • Defective track - (track condition are normally related to write opera­ bit B6=1). A track condition check tions. It will also occur if two set is generated whenever a search, read file mask CCWs are attempted to be or write command is attempted on a performed in the same chain of CCws. flagged defective track. Exception: Command reject (Byte 0, Bit 0) is also home address and descriptor record turned on when an invalid sequence is (RO) commands. A seek to the alter­ encountered. nate track is made. (Address of alternate track in ID field of RO Valid sequences are defined in the count area.) individual command description. A summary of valid sequences follows: • Alternate track - (track condition bit B7=1). A track condition check 1. Set File Mask is generated when command-chaining Write HA and multiple track mode signals 2. Set File Mask indicate that operations are to con­ write HA tinue on the next high ordered Write RO track. The track condition check write CKD indication inhibits the incremental 3. Search HA head switching. A seek to the TIC defective track plus one is made. Write RO (Address of defective track in ID write CKD field of RO count area.) 4. Search ID EQ (RO) TIC Bit 7: Seek Check Write CKD This bit indicates that the file has Write CKD been unable to successfully complete a write Special CKD seek due to: 5. Search ID EQ (Previous ID) TIC • Failure of a home address compare Write CKD after automatic head switching on a 6. Search Key EQ (Previous Key) mUlti-track operation. TIC write CKD (Rn) • Failure of hardware which results in Search ID (Rn) the access mechanism going to either TIC the inner or outer crash stop. Read KD (Rn) Write CKD (Rn+1) • An invalid address (2301 only): the 7. Search ID EQ address in a seek command is more TIC than 199. Write KD or Write Data 8. Search Key EQ TIC Sense Byte 1: The bits of the second sense Write Data byte have the following meanings. Bit 4: No Record Found Bit 0: Data Check in Count Field This bit indicates that two index This bit indicates that a data error points were detected while executing a has been detected in a count field chain of CCWs, a read home address, or read from the file. a read RO, with no intervening read or write operation on the data field of Bit 1: Track Overrun any record. (This could be an expect­ This bit indicates that writing has ed condition on search command not been completed by the time index chains.)

Part III: IBM-Supplied Error Routines 47 Bit 5: File Protected 2250 Error Routine This bit indicates that a seek, write ccw. or MIT read or search command was issued that violates the file mask. The bits in the first sense byte have The write file mask. if violated. also the meanings described below: causes the command reject bit to be set. Bit 0: Command Reject The setting of this bit indicates that there was an invalid modifier bit in a Bit 6: Service Overrun (2301) or Missing command, or an invalid command Address Markers (2841) sequence. This is considered a per­ The service overrun bit is turned on manent error. when a service out signal is not received in the 2301/2820 within the Bit 1: Should Not Occur specified time allowed after the ser­ If any of the "Should Not Occur" bits vice in signal. The overrun bit (bit are set, a catastrophic error is 5 of sense byte 0) is also set. assumed. The Log Out bit in the lOB is set, and the permanent error proce­ The incident of a missing address dure is performed. marker is detected during the execu­ tion of any command or chain of com­ Bit 2: Bus-Out Check mands which operate successive cQunt This bit is turned on when a parity fields on a track. error is detected on a command or data byte during bus-out. The operation is The detection is accomplished by iden­ retried once, and on the second occur­ tifying that two successive records on rence of the error condition a message a track have equal bit conditions in is written to the operator. bit 0 of the flag bytes. In normal conditions, bit 0 of the flag byte is Bit 3: Should Not Occur always a zero for all even numbered records and is always a one for all Bit 4: Data Check odd numbered records. The setting of this bit indicates that a buffer parity error was detected Upon detection of a missing address either during a read operation or marker, bit 6 of sense byte one during image regeneration. The opera­ (missing address marker) is turned on tion is retried once, and on the for all commands or chained commands second occurrence of the error condi­ except search 10 CCWs. The search 10 tion a message is written to the CCW may be used to pass over the operator. m2ss2ng address marker so that the remaining data on the track can be Bit 5: Should Not Occur retrieved. Bit 6: Buffer Running In addition to the flag byte check This bit is set when orders are being described above, a missing address executed in the buffer. marker will be detected if two index points are passed with no intervening Bit 7: Should Not Occur address marker recorded on the track.

Bit 7: Overflow Incomplete This bit is used with the optional record overflow feature. It is set as 2260 Error Routine follows:

• Overflow to a bad track - overflow The bits in the first sense byte (byte incomplete and track condition check 0) have the meanings described below: are set. Bit 0: Command Reject • Overflow from an alternate track The setting of this bit indicates that overflow incomplete and track condi­ there was an invalid modifier bit in a tion check are set. command, or an invalid command sequence. This is considered a per­ • Overflow to a file protected bounda- manent error. ry overflow incomplete and file protected are set. Bit 1: Intervention Required The Intervention Required bit is set • Overflow to wrong track-head number if a Write 1053 Printer command is compares unequal overflow incom- encountered, and the 1053 Printer is plete and seek check are set. not ready.

48 Bit 2 : Bus-Out Check • Error interpreter, which tests the This bit is turned on when a parity sense bits and the csw status bits to error is detected on a command or data determine the type of error. This byte during bus-out. There are three routine is resident; its load module cases: name is IECINTRP. 1. Bus-out Check Initial Selection, • Write-to-operator routine, which command or data byte parity for constructs an "error" or "intervention 2260 or 1053. required" message and writes that mes­ sage to the operator. This routine is 2. Bus-Out Check Data Transmission, transient; its load module name is data byte parity for 2260 follow­ IGE0025C. ing write Line Address or Erase command. • Statistics update routine, which keeps the counters in the statistics tables 3. Bus-out Check Data Transmission, up-to-date with the temporary and per­ data byte parity for 2260 follow­ manent errors determined by the device­ ing Write Buffer Storage command. dependent error routines. This routine is transient; its load module name is For 1 and 2, the operation is retried IGE0025D. once, and on the second occurrence of the error condition a message is writ­ ten to the operator. For 3, an Erase Buffer Storage command ERROR INTERPRETER ROUTINE is issued, and the Write command is reissued; on the second occurrence of the error condition a message is writ­ The error interpreter routine determines ten to the operator. the types of errors for which error correction is required. The address of the Bit 3: Equipment Check routine is contained in the communication The setting of this bit indicates that vector table (CVT). a parity error was detected during a read operation. The error interpreter "ANDs" the codes in the code and address constant list of When this condition occurs. the 2260 the device-dependent routine to the corres­ error routine transfers control to its ponding sense or status bit. (See Part second load (load module IGE0110B), III: General Operating Procedure.) If the which erases the message in error. result is not zero, the bit is on and The operator is then requested to correction procedures for the specified re-enter the message; if the error is sense or status condition must be taken. encountered a second time, it is con­ The 'address constant is added to the link­ sidered permanent. age register and an address within the device-dependent routine is obtained. Con­ Bits 4-7: Should Not Occur trol returns to the device-dependent rou­ If - any of the "Should Not Occur" bits tine at that address. are set, a catastrophic error condi­ tion is assumed. The Log Out bit in the lOB is set, and the permanent error procedure is performed. WRITE-TO-OPERATOR ROUTINE

The write-to-operator routine is used by COMMON ROUTINES the device-dependent routines to format an error message and to write that message to the operator by use of the WTO macro­ Common routines are used by the device­ instruction. dependent error routines to analyze the type of error, to write console messages, The write-to-operator routine constructs and to update the statistics tables. These two message types: an intervention required ,routines are: message and an error message.

Part III: IBM-Supplied Error Routines 48. 1

The standard message code, message text, It is the operator's responsibility to channel and unit address, command code, csw take the correct action, such as:. make the status bits, and the first two sense bytes unit ready; feed more cards to the reader are written into the message formats. For or punch;. clear card ja,m; clear full stack­ direct-access devices the cylinder and er; clear full chip box;. insert paper to track addresses are also written. the- printer or console, e·tc.

Error i'4essage: This message is used when a The standard message code consists of an permanent error has occurred. Its message internal component name, serial number, and format is:. action code. IEAOOOI I/O ERR aaa bb cccc dddd eeee ffff The internal component name identifies the system component of Operating where: system/360 responsible for the format and content of the message. The operating IEAOOOI system component for the I/O supervisor is is the standard message code for the lEA. The three characters are alphabetic operator. The internal component name and are identical to the internal code is lEA, the serial number is 000, and assigned to the system component. the action code is I. meaning informa­ tion, immediate operator action is not The serial number is assigned to each required. message within a program. I/O ERR The action code is a single character is the message text, indicating the used to indicate the nature of the operator occurrence of an I/O error. action required. The following a-b-c-d-e-f information is typed in hexadecimal. Intervention Required Message: This message is used when operator intervention aaa is required. Its message format is: is the unit address. IEAOOOA INT REQ aaa tb cccc dddd bb is the command code as specified in where: the failing CCW in the channel pro­ gram. IEAOOOA is the standard message code for the cccc machine operator. The internal compo­ is the status bytes of the CSW as nent name is lEA. The serial number specified in the lOB. is 000, and the action code is A, meaning attention. Operator action is dddd required before the device can contin­ is the first two sense bytes as speci­ ue its operation. fied in the lOB. INT REQ The following e and f fields apply only to is the message text, indicating inter­ direct-access devices: vention required. eeee The following a-b-c-d information is typed is the cylinder address. in hexadecimal: ffff aaa is the track address. is the unit address. bb is the command code as specified in STATISTICS UPDATE ROUTINE the failing CCW in the channel pro­ gram. The statistics update routine updates cccc the 4-bit counters contained in the statis­ is the status bytes of the CSW speci­ tics table for the device-dependent rou­ fied in the lOB. tines. (See Introduction: Statistics Table. ) dddd is the first two sense bytes specified The work area of the statistics table in the lOB. entry for a particular device indicates the

Part III: IBM-Supplied Error Routines 49 counters that must be ufdated. (See Part OBR Interface: An error routine places V: statistics Table.) The first byte of into location 280 (decimal) the address of the work area corresponds to the bits in the request element associated with the sense byte O. The second work area byte error; from it. the OBR can obtain the corresponds to sense byte 1. or. if sense address of the UCB. which indicates the byte 2 is significant for the device type, device in error. and of the lOB. The to bits from both sense bytes 1 and 2. The address of the statistics table entry for order of correspondence is device-dependent the device is placed in location 284 and indicated by the counts maintained in (decirral>, and the last four digits of the the statistics table entries shown in Part module name for the OBR are placed in a v. register. Control is routed to the task supervisor. The supervisor uses the digits The first (low-order) bit of the work in the register to complete the name of the area corresponds to the first 4-bit counter OBR, which is then loaded from the systems in a statistics table entry. This corres­ residence device into the I/O supervisor pondence continues through the counters and transient area and given control. . the last bit of the work area. The I/O supervisor transient area cannot When determining the counters to be be used by any other error routines until updated. the statistics update routine the OBR has completed its processing; this inspects the work area starting at the last action guarantees that no other requests work area bit (high-order). The table are made to the OBR such that the data at entry counters are thus updated from the location 280 and 284 is overlaid. Upon right side of the table to the left side completion of proceSSing, the OBR routine starting from the bottom. However, if a ca,lls in the SDR routine. data check is indicated. the read and write counters are updated first. THE STATISTICAL DATA RECORDER If an overflow occurs in the counters, the statistical data recorder is entered for external error recording. (See follow­ The SDR is called by an IBM-supplied ing section.) error routine whenever anyone of the 4-bit error statistics counters within the sta­ tistics table contains a count of 15. The SDR adds that 4-bit counter plus the par­ I/O OUTBOARD RECORDING ROUTINES tial counts within the other counters to an expanded statistics counter on the system residence device. Thus, a summary list of The I/O outboard recording routines. the the various device failures are available outboard recorder (OBR) and the statistical for inspection. data recorder

The OBR is called by an IBM-supplied error routine whenever an I/O device has a MODULE OPERATION permanent error. The OBR constructs a record entry that contains a description of the device environment at the time of Six modules. all of which use the I/O failure and writes it on the system resi­ supervisor transient area. make up the I/O dence device. outboard recording routines:

50 • The OBR consists of three modules. The All Illodules use the machine log out area load module names are IGE0025F, for o~erations upon the SER output data IGE0125F, and IEG0225F. set. The machine log out area (decimal locations 128 through 383 of main storage) • The SDR consists of two modules. The is used because no other feasible storage load module names are IGE0525F, and locations are available. If a machine IGEO 625F. check or catastrophic channel error occurs, Which causes hardware recording in the log • The error message module is used by out area to overlay any information put both the OBR and the SDR. Its load there by the I/O outboard recording rou­ module name is IGE0425F. tines, a higher level diagnostic SER rou­ tine (SERO or SER1) gains control and the The three OBR modules and the two SDR occurrent errors are handled from that modules are executed whenever a permanent level. error occurs; the two SDR modules are executed whenever a counter reaches the value of 15. If an error occurs during To read and write the header record, module execution, the error message module statistical data records, and record is called. entries, the OBR and the SDR modules use the EXCP macro-instruction. The lOB is After an error routine determines that loaded with the DCB, ECB, and CCW list I/O outboard recording is required, it addresses. For error messages, the error places the address of the request element message module uses the WTO macro­ in error and of the statistics table entry instruction. Before these macro­ for the device into the machine log out instructions are issued, however, the area, loads the name of either the OBR or system is enabled. the SDR module for the transfer control (XCTL) routine of the contents supervisor, The channel programs necessary for oper­ and then branches to the XCTL routine. ations upon the SER output data set consist (See the OBR and SDR interface descrip­ of the following CCWs: tions.) • Read home address (required only by the After loading, the first module of eith­ SDR). er the OBR or the SDR gains control from the supervisor routine FINCH, which masks • Search on ID or key equal for the all interruptions as disabled. The module appropriate record. that gains control is executed and then brings the next required module into the • TIC to the first CCW until the record I/O supervisor transient area by use of the is found. XCTL routine, and so forth., until all required modules are executed. The last • Read or write the record. module to be executed issues an SVC 3 (EXIT) and control is given back to the After execution of the channel program supervisor. and when the I/O request is complete, the modules inspect the ECB completion code, Depending upon the type of system resi­ which provides the status of the execution dence device and the number of UCBs in the as follows: system, the SER routine requires a data set extent, on the system residence device, of • Normal. The record has been read into at least two tracks. These tracks are the log out area or written onto the formatted and initialized by the system residence device with no errors. SYS1.LOGREC initialization program. 1 • Intercepted. The lOB for the request The extent is termed the SER output data was intercepted for other error recov­ set and contains in contiguous positions: ery procedures because of an error at a previous device end; the EXCP macro­ • Header record. instruction is re-issued. • Statistical data records. • Record entries. • Fail. The request has failed because either the data set is not within the A detailed description of these records may extent specified or a permanent I/O be found in Appendix D. error has occurred; an error index value and the load name for the error message module is set and an EXIT 1For information concerning this program, Illacro-instruction is issued. refer to the IBM system/360 operating Sys­ Note: An EXIT macro-instruction is also tem: utilities" Program Logic Manual, Form issued when the header safety byte is Z28-6614. zero.

Part III: IBM-Supplied Error Routines 51 The fUnction of each module follows; the of the first load module of the SDR or the flow among them is shown in chart 09. name of the error message module is loaded into the XCTL register and the XCTL macro- First OBR Module: The first OBR module, instruction is issued. upon ga~n~ng control, reads the header record from the system residence device into the machine log out area and starts First SDR Module: The first SDR module constructing a record entry. reads the statistical data record for the particular device from the system residence The module obtains and formats the device and obtains the internal statistical following fields within the machine log out counters which are to be added to the area (build area): external counters in the statistical data record. The second SDR module is then • Record entry label. called. • Record entry type. • Device type. Second SDR Module: The second SDR module • Date. adds the appropriate statistical table • Program ID." entry counter (or counters) to the external statistical data record counters and then The name of the second load module of writes the record back onto the system OBR is loaded into the XCTL register and residence device. If necessary, the error the XCTL macro-instruction is issued. message module is called; otherwise, the machine log out area is cleared, and SVC 15 Second OBR Module: The second OBR module is issued so that the request element for completes the construction of the record the routines will be returned to the e"ntry. It inserts the following fields: freelist. Finally, the RETURN macro­ instruction is issued for a return to the • First ccw. task supervisor and then to the I/O • Failing CCW. supervisor. • csw. • Sense information. Error Message Module: This module handles • Channel and device address. all errors occurring within the I~O out­ • Last seek address. board recording modules and writes a mes­ • Volume label. sage to the operator regarding them. If • Time. the OBR routine was in control, the error message rr,odule calls in the first module of The name of the third load module of the the SDR; if the SDR was in control, it OBR is loaded into the XCTL register and returns to the task supervisor. the XCTL macro-instruction is issued. The following error messages may be Third OBR Module: The third OBR module written to the operator: writes the header record and the record entry onto the system residence device. If 1. IFB001I I/O ERROR DURING SER the records do not fit in the extent, the 2. IFB003I SER RECORDING AREA FULL error message module is called. The name 3. IFB0041 SER DISK AREA FORMAT ERROR

52 I PART IV: SVC TRANSIENT AREA ROUTINES

The SVC transient area routines are type The queues are purged in the following 3 SVC routines that are called into the SVC order: transient area in response to system macro­ instructions. The macro-instruction names, load n~dule names, and SVC numbers are: 1. Asynchronous exit queue.

• PURGE: Load module IGC0001F (SVC ~6) 2. Request blocks for the given TCB. • RESTORE: Load module IGC0001G (SVC 17) • DEVTYPE: Load module IGC0002D (SVC 24) • IOHALT: Load module IGC0003C (SVC 33) 3. Logical channel and seek queues of the I/O supervisor that are used for I/O requests associated with either the DEB or the TCB specified.

a. If the DEB is specified, the SVC purge routine examines its extents SVC PURGE ROUTINE for the device (or devices) upon which the data set resides and purges the associated logical The purge routine removes (purges) channel and seek queues. request elements that are associated with a task or a data set. Request elements may be purged from the logical channel and seek b. If the TCB is specified, the SVC queues of the I/O supervisor, from the purge routine examines the request asynchronous exit queue of the task super­ element table and removes each visor, or from the request blocks that are active request element associated chained to the TCB. The request elements with the TCB from its correspond­ are purged according to the options speci­ ing queue. fied in the purge input parameters. These options are:

The SVC purge routine contains four • Purqe specified DEB. Purge only the subroutines that purge the queues according specified DEB or purge the complete DEB to the options specified. These subrou­ chain. tines are:

• Post Complete. Post the purged I/O • Asynchronous exit gueue (AEQ) purge requests complete or do not. subroutine. Purges the asynchronous exit queue by use of the check subrou- tine. • Halt I/O. Issue a halt I/O instruction for active requests or allow them to quiesce. • Reguest block (RB) subroutine. Purges the RB list by use of the check subrou­ tine. • Purge related. Purge only related requests or purge all requests. • Check subroutine. Purges the AEQ and RB list according to the options speci­ • Purge only requests associated with a fied by the PURGE macro-instruction and specified TCE on the DEB. Indicated by returns the purged request elements to a unique code in the parameter list. the freelist.

After the request elements are purged, the • UCB purge subroutine. Purges the logi­ SVC purge routine returns the elements to cal chann,el and seek queues of the the freelist and chains the lOBs that are request elements associated with either addressed by each of the purged request the DEB or TCB specified in the purge elements onto the chain field specified in input parameters. the Furge input parameters.

Part IV: SVC Transient Area Routines 53 Purge complete Subroutine If the DEVTAB parameter is specified in the DEVTYPE macro-instruction, and the device is a direct access device, the Whenever a PURGE macro-instruction is output area must be 5 words long. The given without the halt I/O option speci­ DEVTYPE routine locates the device chara­ fied, the SVC purge routine must allow the teristics table via the communications vec­ active I/O requests to quiesce. tor table, moves the appropriate entry into the low order three words of the output The SVC purge routine places a count of area, and moves the blocksize field to the the active I/O requests into the second second word of the output area. four bits of the ECB for the purge request. These requests must finish before the ECB If the DEVTAB parameter is not speci­ can be posted. The SVC purge routine sets fied, the output area must be 2 words long. the lOB purge flag for each active I/O The DEVTYPE routine determines the maximum request to indicate that it is awaiting the block size from the device characteristics completion of that I/O request. table (if the device is a direct access device) or from internal constants, and The purge complete subroutine is given moves it to the second word of the output control when the I/O interruption supervi­ area. sor, at the completion of an I/O request, determines that the lOB purge flag is set. When processing is complete, the DEVTYPE The purge complete subroutine decrements routine places a return code in general the count in the ECB for the purge request register 15. An error return code of 04 and when the count is not zero, returns indicates one of the following conditions: control to the I/O interruption supervisor. When the count is zero, the subroutine • No output area specified: the area posts the ECB for the purge request com­ parameter is missing from the DEVTYPE plete via the post routine interface. macro-instruction. • DD name not found: there is no TIOT entry that corresponds to the DD name RESTORE ROUTINE supplied. • Invalid UCB unit type field: the UCB unit type field (byte 4 of the device The restore routine re-introduce~ purged code field) does not specify a direct requests to the system. Because the access, tape, or unit record device. requests are exclusively for I/O opera­ tions, the EXCP macro-instruction is issued If the request is completed satisfactorily, for each request element. The request the DEVTYPE routine places a return code of elements are indicated by the lOBs in the 00 in general register 15, and exits via chain created by the SVC purge routine. SVC 3. The RESTORE macro-instruction requires that the IFLGS field in the DCB be initial­ IOHALT ROUTINE ized in the same way as for the EXCP macro-instruction. When the IOHALT routine (SVC 33) receives control, it is given the address DEVTYPE ROUTINE of the UCB associated with the device to be stopped. It checks that address for valid­ ity, then inspects the UCB device code When SVC 24 is executed, the DEVTYPE field to make sure that the device is not a routine is loaded into the SVC transient direct access device. area and receives control. The expansion of the DEVTYPE macro-instruction places If the device is a byte mode device, and parameters in general registers; the there is a burst mode device running on the DEVTYPE routine uses the parameters to same channel, the routine enters a wait identify the device, and to place device loop until the burst mode device stops. information in an output area. The HALT I/O instruction is then execut­ The DEVTYPE routine looks at the param­ ed, and the condition codes and CSW status eter that specifies the address of a field bits are inspected to determine the success that contains a DD name. USing that DD of the operation. name, the routine finds the corresponding TIOT entry, and uses it to locate the The appropriate condition code is placed prop,er UCB. The DEVTYPE routine then moves in general register 15. If the operation the UCB device code field to the high order was successful, the IOHALT routine places a word of the output area specified by the post code (X'4S') in the ECB code field of area parameter. the lOB ,and issues SVC 3 (EXIT).

54 PART V: CONTROL BLOCK AND TABLE FORMATS

The I/O supervisor uses control blocks For convenience, the following control and tables to communicate with itself, with blocks and tables are presented in alpha­ the rest of the control program, with betical order: processing programs, and with I/O devices. • Attention Table. • Channel Search Table. This section of the publication • Data Control Block. describes in detail the characteristies of • Data Extent Block. the control blocks and of the tables used • Device Table. by the I/O supervisor. • Event Control Block. • Input/Output Block. • Logical Channel Word Table. Figures 8 through 21 show control block • Request Element Table. and table formats. Where pertinent, a • Statistics Table. discussion of the fields follows the fig­ • UCB Lookup Table. ures. • Unit Control Block.

ATTENTION TABLE

The attention table is used by the I/O supervisor to obtain the addresses of the attention routines required to service the I/O devices attached to the system. The attention table has the following characteristics: • Creation. The table is created at system generation time. • Storage Area. The table resides, as a permanent part of the resident supervisor, in protected resident storage (when protection is available).

• Size. The table contains one 4-byte entry per attention routine, up to a maximum of 64 entries.

• Means of Access. The ATNTAB byte, supplied by the user in the UCB, is added to the starting address of the attention table to obtain the proper attention routine entry in the table for the device. • Format. The format of an attention table entry is shown in Figure 8.

r------, 1 1 1 1 1 r------~------T------, 1 I L1 ______Unused ~1 ______Attention Routine Address J1 1 1 1<----1 byte----> 1<------3 bytes---_------>1 1 1 1<------4 bytes------>1 1 1 1 1L ______J 1 Figure 8. Attention Table Entry Format

Part V: Control Block and Table Formats 55 CHANNEL TABLE

The I/O supervisor uses the channel table to find the proper channel search module and to re-enable for additional I/O interruptions. The channel table has the following characteristics:

• Creation. The channel table is created at system generation time. • Storage Area. The table resides, as a permanent part of the resident supervisor, in protected resident storage (when protection is available).

• Size. The table contains one 4-byte entry for each physical channel attached to the system. • Means of Access. The address of a particular physical channel is multiplied by 4 and added to the starting address of the channel table to obtain the address of the entry for that physical channel. • Format. The format of the channel table is shown in Figure 9. r------, 1 1 1 r------T------T------, 1 1 0001 1 1 1 1 1 (Multiplexor 1 Channel Search Module Address 1 Channel Mask 1 Unused 1 I 1 channel) 1 1 1 1 1 1 ~------+------+------~ 1 1 0011 1 1 1 1 1 (Selector 1 Channel Search Module Address 1 Channel Mask 1 Unused 1 1 1 channell) 1 1 I 1 1 1 .------+------+------~ 1 1 0021 1 1 I 1 1 (Selector 1 Channel Search Module Address I Channel Mask 1 Unused 1 1 1 channel 2) 1 1 I 1 1 1 • ______~ ______L ______------~ 1 1 etc. 1 1 1 1 I 1 I I1 1L ______JI I

1 1<------2 by tes------> 1<---1 byte----> 1 <---1 byt~--->I I I 1<------4 bytes------>I 1 IL ______J1 Figure 9. Channel Table Format

Channel Search Module Address (2 bytes) to be started on that channel when it This 2-byte field contains the address becomes available. of the channel-dependent channel search module associated with the phy­ sical channel. A channel search Channel Mask (1 byte) module exists for each ~hysical chan­ This byte contains the channel re­ nel and it determines the next request enable mask.

56 DATA CONTROL BLOCK

A data control block (DCB) is used primarily by the open and close routines of data management, but ,the I/O supervisor is concerned with several of its fields. The characteristics of a DeB are as follows:

• Quantity_ There is one DCB for each data set. • Creation. Space for the DCBs is reserved at problem program assembly time. The DCB is completed at open time. • Storage Area. All DCBs reside in unprotected problem program storage.

• Size. Refer to the Introduction to Control Program Logic, Program Logic Manual for the size and description of the entire DCB.

• Format. The DCB fields used by the I/O supervisor are shown in Figure 10. r------T------T------T------, I FIELD I CONTENT I SIZE I SECTION I ~------+------+------+------~ I IFLGS I I/O Supervisor error flags I 1 byte I Foundation I I I I I Block I I DEBAD I DEB address I 3 bytes I I ~------+------+------+------~

LI ______BLKCT ~I ______Tape block count ~I ______4 bytes ~I ______Tape JI Figure 10. Data Control Block Fields Used by the Input/Output Supervisor

IFLGS (1 byte) when printer overflow occurs. They These are flag bits used by the I/O have the following value: supervisor in communicating error conditions and in determining correc- tive procedures. They decode as fol- 10 Channel 9 printer overflow. lows: 01 Channel 12 printer overflow. Bits 0 and 1: DCB Exception These two bits are used during error Bits 4 and 5: I/O Supervisor Error Key recovery procedures when accessing This key is mandatory and indicates sequential files where positioning is whether or not an IBM-supplied error important. The flags indicate the routine should be entered. The key is error status for the pertinent data checked by the error routine inter­ set, and must always be present. They face. The flags have the following have the following value: value: 00 Normal conditions are present. 01 Error correction is in progreSs. 00 Always use IBM-sufplied error rou- 11 A permanent error condition tines. exists. 11 Never use IBM-supplied error rou- tines. Bits 2 and 3: Printer OVerflow These bits are set by error'routines Bits 6 and 7: Reserved

Part V: Control Block and Table Formats 57 DEBAD (3 bytes) Notes: An incorrect block count field This DEB address field contains the results when an error occurs in the actual address of the data set's asso­ middle of a command chained eew list. ciated data extent block. The DEB In this case, it is the user's contains the location and boundaries responsibility to adjust the DeB block of that data set. The DEB address count field. He rrust determine which must always be present in the DeB eew had the error and then decrement foundation block after open time. the block count so that it reflects the true count. BLKeT (4 bytes) This device-dependent area is used by the I/O supervisor to accumulate the When an uncorrectable error occurs, tape block count for a data set on the block count field is updated as tape that is either being read or usual. written. The block count designates physical unit position, not relative data set position. At the normal The effect of a halt I/O request by completion (channel end/device end) of the purge routine on the block count all I/O requests, the lOB block count field is unpredictable, since the I/O increment amount is added to this DeB interruption condition is determined block count field to form the updated by the disposition of the device and tape block count. control unit, which are variable.

58 DATA EXTENT BLOCK

A data extent block (DEB) describes the location and boundaries (extent) of a data set and points to the pertinent UCB(s) for the device(s) upon which the data set resides. The characteristics of a DEB are as follows:

• Quantity. There is one DEB for each DCB.

• Creation. The DEBs are created by the open routine.

• storage Area. All DEBs reside in the dynamic area. • Size. Refer to the Introduction to Control Program Logic, Program Logic Manual for the size and description of the entire DEB.

• Format. The DEB format is shown in Figure 11.

r------, 1 1 1 1<------4 bytes------>1 I , -16, 7':"'7'"'7"'777777777(,"777777""777""""777-"""""'-7""7777""77"""",...77""7""7-7 77""""7771 , , PREFIX' , 4 , I 0 ------, , TCB ADDRESS , A I + 4 ------~ I , NEXT DEB ADDRESS , I , + 8 ------~ , I IRB ADDRESS , , , +12 ------~ I SYSTEM ,PURGE CHAIN , I +16 I---.----.---,----.---.------~ BASIC , NMEXT, USER PURGE CHAIN , , +20 ~------+------~ , , PRIORITY, PURGE LIST ADDRESS 1 I +24 ~------T------+------~ I 1PROT TAG' DEB ID, DCB ADDRESS 1 , +28 ~------~------+------~ I , EXTENT SCALE I APPENDAGE VECTOR TABLE ADDRESS 1 V L ______~ ______J

+32 r------T------, Tape or 1 MODE SET BYTE I UCB ADDRESS I Unit A L ______~ ______J I Record I I I I +32 r------T------, I I I FILE MASK I UCBADDRESS I A DEVICE I +36 ~------~------T------~ , DEPENDENT I I B B I C (START) C I Direct , I +40 ~------+------.------~ Access 1 , I H (START) H I C (END) C I I 1 I +44 ~------+------~ I , , , H (END) H , NMTRK I V V L ______~ ______J ,1 , ACCESS METHOD 1 DEPENDENT 1 and , SUBROUTINE 1 SECTION 1 ELll] The I/O supervisor does not use the shaded fields. L, ______J1 Figure 11. Data Extent Block Format

Part V: Control Block and Table Formats 59 TCB ADDRESS (3 bytes) structed at open. The appendage table This field contains the address of the consists of address constants (adcons) TCB associated with this DEB. as follows:

NEXT DEB ADDRESS (3 bytes) r------, This field contains the address of the 0 I DC A(EOE) I End of Extent next DEB in a chain of DEBs running ~------~ under the same task. 4 I DC A (SIO) I Start I/O ~------~ IRB ADDRESS (3 bytes) 8 I DC A (PCn I PCI The interruption request block (IRB) ~------~ address for system error exits is 12 I DC A(CE) I Channel End contained here. ~------~ 16 LI ______DC A(XCE) JI Abnormal End SYSTEM PURGE CHAIN (3 bytes) This field contains the address of the 1<-4 bytes->I first lOB in the chain of lOBs for I/O requests purged by the I/O purge rou­ The I/O supervisor uses the respective tine. adcon as a branch address to the five types of appendages. If an appendage NUMBER OF EXTENT ENTRIES (1 BYTE) is not used, the respective adcon This byte contains the number of points to a branch back to the I/O ,extent entries specified in this DEB. supervisor "normal" processing return.

USER PURGE CHAIN (3 bytes) When no appendages are required, this This field contains the address of the table contains five adcon's pointing first lOB in the chain of lOBs for I/O back to the "normal" processing requests purged by the purge routine return. for SVC 16.

PRIORITY (1 byte) FILE MASK or MODE SET (1 byte) This field contains a binary number, This field contains either the file assigned by the open routine, which mask for a direct-access device or a indicates the dispatching priority of mode set byte for tape. the task associated with an I/O request. UCB ADDRESS (3 bytes) This field contains the address of a PURGE LIST ADDRESS (3 bytes) UCB associated with this DEB. This field contains the address of a parameter list for an SVC purge BB (2 bytes) request. The I/O supervisor uses this This field contains the bin number of field when purging to locate the a direct-access volume (data cell appropriate purge ECB to post com­ drive). plete. CC START (2 bytes) PROTECTION TAG (4 bits) This field contains the cylinder These bits contain the protection tag address for the start of an extent on for the associated task. a direct-access volume.

DEB ID (4 bits) HH START (2 bytes) These four bits identify this block as This field contains the read/write a DEB by means of a hexadecimal "FR. head number for the start of an extent on a direct-access volume. DCB ADDRESS (3 bytes) The address of the DCB corresponding CC END (2 bytes) to this DEB is contained here. This field contains the cylinder address for the end of an extent on a direct-accEss volume. EXTENT SCALE (1 byte) This byte contains a shift factor used HH END (2 bytes) to determine the size of the extent This field contains the read/write entries in the DEB. This field con­ head number for the end of an extent tains 4 for a direct-access device and on a direct-access volume. 2 for a non-direct-access device. NMTR (2 bytes) APPENDAGE VECTOR TABLE ADDRESS (3 bytes) This field contains the number of This field contains the address of the tracks allocated to a given extent on appendage vector table that is con- a direct-access volume.

60 DEVICE TABLE

The device table is used by the I/O supervisor to locate the device-dependent start I/O, enqueue, or trapcode module that pertains to the device in use. The following characteristics are pertinent: • Creation. The device table is created at system generation time.

• Storage Area. The device table resides, as a permanent part of the resident supervisor, in protected resident storage (when protection is available).

• Size. The device table may have from one to a maximum of 42 entries, each entry being 6 bytes in length. There is always one entry per device type per enqueueing option specified for the device types at system generation time. For example, direct-access devices using priority enqueueing would have one entry, direct­ access. devices using FIFO enqueueing would have one entry, etc.

• Means of Access. The DEVTAB byte in the unit control block WCB), when added to the starting address of the device table, gives the address of the proper entry in the table for the device. • Format. The format of a device table entry is shown in Figure 12. The possible entries in the device table and their order, are:

Unit Record Priority FIFO Tape Priority FIFO Direct-access Ordered Priority FIFO Telecommunications Priority FIFO

r------~----, 1 1 1 1 1 r------T------T------, 1 1 LIAddress ______of Enqueue ModulelAddress ~ ______of Start I/O Module ~1 ______Address of Trapcode Module J1 1 1 1<------2 bytes------> 1<------2 bytes------>I<------2 bytes------>1 1 1 1<------6 bytes------>1 1 1 I LI ______J1 Figure 12. Device Table Entry Format

Part V: Control Block and Table Formats 61 EVENT CONTROL BLOCK

An event control block (ECB) is used to post the completion of an I/O request. It indicates whether or not the request has completed successfully. The following characteristics are pertinent:

• Quantity. There is one ECB for each I/O request. • Creation. The ECBs are created by the user of the I/O supervisor. • Storage Areas. All ECBs reside in unprotected problem program storage.

• Size. An ECB is 4 bytes in length. • Format. The ECB format, after it is posted complete, is shown in Figure 13. r------, I I I W C I I r---T---T------, I I IL ___0 ~I ___1 ~I ______COMPLETION CODE JI I I 012 31 I LI ______JI Figure 13. Event Control Block Format After Posting

Bit 0: W 000100 lOB intercept code. Whenever This is the wait bit and is set to O. an error occurs after a chan­ nel end interruption for a device, the I/O request for Bit 1: C that device has already been This is the complete bit and is always posted complete and the set to 1 when the I/O request has request element returned to completed, regardless of the success the freelist. To handle the of the event. error, the I/O supervisor sets the UCB intercept flag to indicate that the next I/O Bits 2-31: Completion Code (30 bits) request for that device must This code, along with the complete be intercepted. When inter­ bit, is the ECB code as contained in cepted, the lOB for the new the lOB. The completion code I/O request and the CSW and indicates to the user in what manner sense data for the error are the I/O request has completed. When passed to the error recovery the first bit of the completion code procedures for the device. If is off, the request was not success­ a permanent error exists, the fully completed. The next, five bits ECB for the intercepted lOB is indicate the cause and the remaining posted complete with the lOB 24 bits are O. There are six differ­ intercept code. ent completion codes; the six signifi­ cant bits for these codes are: 001000 Not started or purged. This code signifies either that the 111111 Normal completion (no errors). I/O request has not been started or that it has been purged. 000001 I/O permanent error code.

000010 Extent permanent error code. 001111 Error could not be retried. This code indicates that the This code signifies that the seek address specified in the home address and/or RO could lOB is out of the extent spec­ not be read during error ified in the DEB. recovery procedures.

62 INPUT/OUTPUT BLOCK

An input/output block (lOB) contains information that pertains to a requested I/O operation and is used by the I/O supervisor. The address of an lOB is passed as the only parameter of the EXCP macro-instruction. The characteristics of an lOB are as follows: • Quantity. There must be one unique lOB for each I/O request. • Creation. The lOBs are created by the user of the I/O supervisor. • Storage Area. All lOBs reside in unprotected problem program storage.

• Size. An lOB is 32 or 40 bytes in length. 1. The 32-byte field is always present for all devices. 2. The 32-byte field plus 8 additional bytes are present for direct-access and telecommunications devices. • Format. The lOB format is shown in Figure 14. ,r------'------, , , 1<------4 bytes------~------>, , I + 0 r------T------T------, , , , FLAGS 1 , FLAGS 2, SENSE BYTES I 1\ , , + 4 ~------+------~------~ , , , 'ECB CODE , ECB ADDRESS 1 1 1 + 8 ~------+------~ 1 , , FLAGS 3, CHANNEL 'I , +12 ~------~------~ I , , STATUS WORD 'ALL , +16 ~-~------T------~------~ DEVICES , , SIO CC, START ADDRESS 1" +20 ~------+------~ , , , , DCB ADDRESS '" +24 ~------+------~ , 1 IREPOS. MODIFIER' RESTART ADDRESS I' 1 +28 ~------~------T------~ , , 1 BLK CNT INC AMT (TAPE) 1 ERROR COUNT 1 V 1 L ______~ ______~ ______J 1 I +32 r------T------, 1 , M EXTENT 'SEEK (If T/P, these bytes are' DIRECT ACCESS' +36 ~------~------~------~ AND T/P 1 ,L ______ADDRESS pointers for QTAM or BTAM.),J 1 1 L1 ______J , Figure 14. Input/Output Block Format

FLJI.GS 1 (1 byte) Bit 2: lOB Error Correction Indicator Bits 0 - 1: Channel Program Description This bit is set by an IBM-supplied These two bits indicate the construc­ error routine to indicate that the I/O tion of the CCW list, and are set by request associated with the lOB is the user of the I/O supervisor. They under control of the error routine. decode as follows: Bit 3: Modifier Flag 1 00 No chaining This bit is set by an error routine to 10 Data chaining only indicate that the device in use must 01 Command chaining only be repositioned by use of the command 11 Data and command chaining (mixed) code specified by an IBM-supplied

Part V: Control Block and Table Formats 63 error routine in the lOB reposition Bit 4: No Test for Out-of-Extent Flag modifier byte. (See Part I: Tape This bit is turned on by the 2311 Start I/O Module.) error routine when an alternate track is in- use. Bit 4: Modifier Flag 2 Bit 5: CCHH Update Flag This bit is set by an IBM-supplied This bit is turned on by the direct­ error routine to indic.ate that a access device error routines when cyclic redundancy check (CRC) is updating the seek address because of a required for the tape. (See Part I: cylinder end or file mask violation Tape Start I/O Module.) condition. Bit 5: lOB Exception Bit 6: Reserved This bit is set to indicate that an error occurred during the I/O request Bit 7: lOB QSAM Flag associated with this lOB. The bit is This bit is turned on by the Queued turned off when the error is deter­ Sequential Access Method routines when mined to be corrected; if uncorrected, error recovery (using three buffers) the exception bit is left on. is to be provided for a 2540 card punch. Bit 6: Unrelated This bit is set by the user of the I/O supervisor and identifies all I/O SENSE BYTES (2 bytes) requests (for use of a data set) that The sense subroutine loads these bytes are not related to any other request. with the first 2 bytes of sense infor­ Requests that are related are executed mation read into the UCB when a sense in a first-in first-out (FIFO) command is given. arrangement and no related request is started until all prior related requests have completed. (Related is ECB CODE (1 byte) 0, unrelated is 1.) The I/O supervisor places the comple­ tion code for the I/O request asso­ Bit 7: Start/Restart ciated with the lOB into this area. This bit is set by an IBMTsupplied This code is also placed into the error routine to indicate that the event control block (ECB) when the restart address in the lOB is to be request is posted complete. (For used for the I/O request; when 0, the additional information, see "Event start address is used. Control Block".)

ECB ADDRESS (3 bytes) FLAGS 2 (1 byte) These bytes are set by the user of the Bit 0: Halt I/O Issued Flag I/O supervisor to contain the address This bit is set by the SVC purge of the event control block (ECB) that routine to indicate that it has issued corresponds to the lOB and is to be a halt input/output (HIO) instruction posted complete at the completion of for the device in use for the I/O the I/O request described in the lOB. request that is associated with the lOB and is being purged. FLAGS 3 (1 byte) This byte is used by IBM-supplied Bit 1: Sense Flag error routines and is defined in Part This bit indicates that a sense com­ III: Device-Dependent Characteristics. mand should be issued by the sense subroutine because of an error at the CHANNEL STATUS WORD (7 bytes) previous channel end. At device end, These bytes contain the low-order the device is free and the sense seven bytes of the channel status word command is issued. (CSW), as stored by the I/O supervisor at channel end. Bit 2: Purge Flag This bit is turned on by the SVC or SIO CC (1 byte) I/O purge routine when awaiting com­ The low-order two bits of this byte pletion of the device and allowing the are set by the start I/O subroutine to I/O request to quiesce. contain the condition code resulting froIT, issuance of the SIO instruction Bit 3: Read HA RO Flag for the associated I/O request. This bit is turned on by the 2311 error routine when no seek is START ADDRESS (3 bytes) required. These three bytes are supplied by the

64 user of the I/O supervisor and contain update the tape block count (BLKCT) the address of the first ccw that is field in the DCB associated with the to be executed in the channel program. lOB. The field is signed and may contain an increment or decrement up DCB ADDRESS (3 bytes) to ±32768. When an uncorrectable These bytes are supplied by the user error occurs, the I/O sUFervisor uses of the I/O supervisor to contain the this field to update the DCB block address of the data control block count as usual. (DCB) that corresponds to the lOB. REPOSITION MODIFIER (1 byte) ERROR COUNT (2 bytes) This byte is loaded with a positioning These bytes contain flags and counts command code by IBM-supplied error used by the IBM-supplied error rou­ routines that are used for device tines and are explained in Part III: repositioning procedures when the lOB Device-Dependent Characteristics. modifier flag 1 is on. M EXTENT (1 byte) RESTART ADDRESS (3 bytes) This byte is set by the user of the This address is used as the ccw I/O supervisor to indicate the number address in the channel program for an of the DEB extent that is to be used error restart by IBM-supplied error for the request. (The first extent is routines during error correction pro­ indicated by the character 0, the cedures. second by 1, the third by 2, etc.) BLOCK COUNT INCREMENT AMOUNT (2 bytes) SEEK ADDRESS (7 bytes) This is the tape block count increment The user supplies the initial seek amount set by the user of the I/O address BBCCHHR required for the I/O supervisor and is used by the I/O request for the direct-access device. supervisor at normal channel end For teleprocessing devices, this field (completion of the I/O request) to contains QTAM and BTAM pointers.

Part .V: Control Block and Table Formats 65 LOGICAL CHANNEL WORD TABLE

The logical channel word table consists of the logical channel words that control the logical channel queues. It is used by the I/O supervisor and the I/O purge and SVC purge routines. The logical channel word table has the following characteristics: • Creation. The table is created at system generation time. • storage Area. It resides, as a permanent part of the resident supervisor, in protected resident storage (when protection is available).

• Size. The table contains one 8-byte logical channel word per logical channel queue. • Means of Access. The LCHTAB byte in the UCB, when multiplied by 8 and added to the starting address of the logical channel word table, gives the proper logical channel word for the device and its associated logical channel queue. • Format. The format of a logical channel word is shown in Figure 15.

r------, 1 1 1 r------T------T------T------, 1 1 1L ______FIRST REQUEST .L1 ______LAST REQUEST .L1 ______SCRATCH .L 1 ______TCH ~OD ADDR J1 1 1 1<---2 bytes--->I<---2 bytes --->1<----2 bytes --->1<---2 bytes --->1 1 1 1<------8 bytes------~------>I 1 1L ______J1 Figure 15. Logical Channel Word Format

FIRST REQUEST (2 bytes) 2. When there is only one request These two bytes contain either an element in the queue, both "first address or an index value to the first request" and "last request" con­ request element in the logical channel tain the address of that element. queue. LAST REQUEST (2 bytes) These two bytes contain either an address or an index value to the last SCRATCH (2 bytes) request element in the logical channel This field is used as a temporary queue. storage area for an address or index value. It is used when more than one Notes: logical channel queue for a physical channel is searched in order to find 1. When a logical channel queue is the highest priority I/O request with void, the "first request" field which to restart the channeL contains a dummy link address of hexadecimal FFFF and the "last request" field contains the TCH MOD ADDR (2 bytes) address of that logical channel This field addresses the device­ word. dependent test channel module.

66 REQUEST ELEMENT TABLE

The elements in the request element table are used by the I/O supervisor to represent active or queued I/O requests. The unused elements in the table are available for incoming I/O request representation. The request element tatle has the following characteristics:

• creation. The table is created at system generation time. • storage Area. It resides, as a permanent part of the resident supervisor, in protected resident storage (when protection is available).

• Size. The total number of request elements in the table is defined at system generation time. The request element table for a system in which option 4 is excluded contains a 12-byte request element for the maximum number of I/O requests expected at anyone time; and for a system in which option 4 is included, a 16-byte request element.

• Means of Access. The active request elements are addressed by the LAST REQUEST field in the associated UCB. The available request elements are contained in the freelist, which is addressed by the freelist pointer in the CVT. The queued request elements are within the particular logical channel queue or seek queue referenced by the logical channel word and seek queue control word, respectively.

• Forrrat. The I/O supervisor is concerned with all information in a request element. The format of a 12-byte and 16-byte request element is shown in Figure 16.

r------~------, 1 1 Format of a 12-byte Request Element Format of a 16-Byte Request Element 1 r------T------, r------T------, 1 1 LINK FIELD 1 UCB ADDRESS 1 I LINK FIELD 1 UCB ADDRESS 1 1 ~------T------L------~ .------T------L------~ 1 ITASK ID 1 lOB ADDRESS I 1 I lOB ADDRESS 1 1 .------+------~ .------+------~ 1 1L ______PRIORITY L1 ______DEB ADDRESS J 1 IPRIORITYI DEB ADDRESS 1 I .------+------~ I 1<1 byte>I<1 byte>I<----2 bytes---->I 1L ______LI ______TCB ADDRESS JI I 1<------4 bytes------~->I 1 1<1 tyte>I<1 byte>I<----2 bytes---->I lI ______1<------4 bytes------>1 _ Figure 16. Request Element Formats

LINK FIELD (2 bytes) PRIORITY (1 byte) This is a 2-byte link field used to This byte contains the priority of the link the request elements that are I/O request represented by this members of a particular queue or request element. The priority is belong to the freelist. assigned at open time according to the priority of the associated task. If priority enqueueing is not specified, UCB ADDRESS (2 bytes) this byte is not significant. This field addresses the UCB associat­ ed with the queued I/O request. DEB ADDRESS (3 bytes) TASK ID (1 byte) This field contains the address of the This byte contains the task control DEB associated with the data set for block identification of the task that this I/O request. originally initiated the I/O request. TCB Address (3 tytes) lOB ADDRESS (3 bytes) This field contains the address of the This field contains the address of the task control block for the task that lOB associated with the I/O request. initiated the I/O request.

Part V: Control Block and Table Formats 67 STATISTICS TABLE

The statistics table contains the statistical data required to maintain statistical data records. It is used by IBM-suppliedeiro~ routines and the statistical data recorder (SDR) of SER.

The statistics table has the following char.acteristics: • creation. The statistics table is created at system generation time.

• storage Area. The table resides, as a permanent part of the resident supervisorl in protected resident storage (when protection is available).

• Size. The statistics table contains from 0 to 128 ten-byte entries; there is one entry for each device attached to the system.

• Means of Access. The STATAB byte in the UCB contains a factor, which when multiplied by ten and added to the starting address of the statistics table, provides the address of the proper entry for a device.

• Format. The format of each entry in the ta·ble varies with the type of device. The first 8 bytes of an entry contain statistical data; the last 2 bytes are a work area used by error routines. The device type formats are shown in Figure 17; note that the work area is not shown. r------,

unit Record Equipment 2400 Tape Series r------r------, r------T------, 1052 1Temporary 1Temporary 1 I Temporary _ I Temporary I 2150 IRead Failures IWrite Failures 1 IRead Failures IWrite Failures I 1015 ~------+------~ .------+------~ 1285 1Intervention IBUS Out 1 I Intervention IBUS Out 1 1402 1Required 1Check 1 IRequired ICheck I 1442 ~------+------~ .------+------~ 1404 1Equipment 1 1 I Equipment I Overrun I 2201 I Check· I Overrun I I Check I I 1403 ~------+------~ .------+------~ 1443 I I I I Word IData 1 2501 1Device-Dependent I Device-Dependent I ICount 0 IConverter Check I 2520 ~------+------~ .---~------+------~ 2671 1 I I IR/W Vertical I Longitudinal I 2701 I 1 1 IRedundancy ChecklRedundancy Check 1 2702 ~------+------1 .--~------+------~ 7770 I 1 I I Skew 1Cyclic 1 7772 1 I I I IRedundancy Check I 2250 .------+------~ .------+------~ 2260 I I I ISkew Reg VRC INoise 1 I 1053 I I -I I I 1 I .------+------~ .------+------~--~ I I I I I I 1 1 LI ______~I ______~JI LI ______~I ______JI I I 1<------1 byte------.>I 1<------1 byte------>i I I I L __ ~------~------______J • Figure 17. Statistics Table Entry Formats (Continued)

68 r------,

2841 Control Unit 2820 Control Unit r------T------, I Temporary I Temporary I r------T------,I Temporary I Temporary I IRead Failures IWrite Failures I IRead Failures Iwrite Failures I ~------+------~ ~------+------~ I Intervention IBUS Out I I Intervention IBuS Out I I Required I Check I I Required I Check 1 ~------+------~ ~------+------~ I Equipment I Overrun I I Equipment I I I Check I I ICheck I I ~------+------~ .------+------~ I Track ISeek I ITrack I I I Condition I Check I ICondition Check I I .------+------~ ~------+------~ I I I I I Track I I Unsafe I I I I Overrun I ~------+------~ ~------+------~ ISerializer/ Icontrol unit 1 I I I IDeserializer ITag Line I I I I ~------+------~ ~------+---...:------~ I Arithmetic I 1 INo Record I I ILogical Unit 1 I I Found I I ~------+------~ ~------+------~ IMissing Address I I I I I LI Marker______i I ______JI IL ______L I ______J I 1<------1 byte------>1 1<------1 byte------>I

______J

Figure 17. Statistics Table Entry Formats (Continued)

Part V: Control Block and Table Formats 69 UCB LOOKUP TABLE

The UCB lookup table is used by the I/O interruption supervisor to obtain the address of the UCB associated with an I/O interruption.

The UCB lookup table has the following characteristics:

• Creation. The table is created at system generation time.

• Storage Area. The table resides, as a permanent part of the resident supervisor, in protected resident storage (when protection is available).

• Size.. The size of the table is dependent upon the number and the unit addresses of I/O devices, control units, and physical channels attached to the system.

• Means of access. The table values are used in the algorithm routine described in Part II: UCB Lookup Routine. The table is addressed by the CVT.

• Format. The UCB lookup table is segmented as shown in Figure 18.

r------~------, I I Ir----T----T----T----T----T----T----T----T----T------T-----T----T-----T------,1 II K1 I K2 I K3 I K* I K* I K* I K* I L1 I L2 I L3 Ln 2 ILn 1 I Ln IUCB011UCB02 UCBN II I ~----~----~----~----L----~----~----+----~----~------~-----~----+-----~------1 I I I <------Channel Portion------> I <----Control Unit Portion----->I11 Il ______JI Figure 18. UCB Lookup Table Format

(1 byte) index values that are relative to the The channel portion contains index starting address of the UCB address values that are relative to the start­ list. ing address of the entire UCB lookup table. UCBn (2 bytes) Ln (1 byte) The UCB address list contains tpe The control uni't portion contains addresses of the UCBs in the system.

70 UNIT CONTROL BLOCK

Every device is represented by a unit control block (UCB). A UCB indicates device activity and provides the linkage to device-dependent code and tables. The properties of a UCB follow:

• Creation. The UCBs are created at system generation time. • Storage Area. All UCBs are located below 32K in protected resident storage (when protection is available). and are a permanent part of the resident supervisor. • Size,. A UCB is from 24 to 100 bytes. • Quantity. There is one UCB per unique. physical device address defined for the system. Each telecommunications line on a transmission control unit and a device attached to a shared control unit or a tape unit switch has only one UCB. • Format. The UCB format is shown in Figure 19. r------, I <---·------4 bytes------> I + 0 UCB ID 1\ + 4 I HIO/SM/CHANADDR I UNIT ADDRESS X I FLAGS1 I + 8 t------·------+------f------·--·------,--·+-----,--·------01 I ERRTAB X I STATAB X I LCHTAB X ALL +12 DEVICES I +16 I I +20 I LAST REQUEST I SENSE I V L-,____ . __• ______~ ______----_------______J

+24 1\ +28 TAPE OR +32 DIRECT ACCESS +36 I V

+40 r-----·------,SEEK QUEUE I 1\ +44 t--·--·---·------·----·------·----·---..,------i I CONTROL WORD I I +IJ8 1---.------.------i I LAST I DIRECT +52 ~------.---.------i ACCESS SEEK ADDRESS I ONLY +56 I I I IL ______WORK AREA I 1+961 J V I I I X The X areas are loaded at system generation time; all except I I ATNTAB, which is changed by system routines" remain constant. I I I I 1 +136 if the device featUres track overflow. I I ~ IL ______The I/O supervisor does not use the shaded fields. J I Figure 19. Unit Control Block Format

Part V: Control Block and Table Formats 71 UCB ID (1 byte) Bit 3: UCB Intercept This is an encoded field of hexadeci­ This bit indicates an error has mal "FF" that identifies this block as occurred after channel end for the a UCB. last request processed on the device and that an error routine must be HIO (1 bit) called when the next request "for the This bit is turned on when a halt I/O device is given. (Refer to lOB j,nter­ (HIO) instruction is issued for the cept code in "Event Control Block".) device represented by this UCB.

SM (1 bit) Bit 4: Control Unit Busy This bit indicates that a sense com­ This bit is turned on whenever a bit mand was attempted for the represented setting of busy and status modifier device, but that the CSW status modi­ are detected in the csw after issuance fier flag was set in response to the of a SIO instruction. The setting of sense command. When the device is the control unit busy bit indicates free, the sense is re-issued. that requests issued for the rep­ resented device by means of the EXCP Bits 2, 3, and 4: Not Used. macro-instruction cannot be started. This bit does not, however, prevent CHANNEL ADDRESS (3 bits) queued requests for the device from Bits 5 to 7 contain the physical being started by the channel restart channel address of the last physical subroutine. This bit is necessary channel used for the device represent­ because the control unit end CSW indi­ ed by this UCB. cation sometimes presents itself to the channel with a different address UNIT ADDRESS (1 byte) than was presented with control unit This byte gives the absolute device busy. and control unit address that pertains to the device represented by this UCB. The address of the physical channel to Bit 5: Disk Data Transfer be used by the device is calculated This bit indicates, when the UCB rep­ when a physical channel becomes avai­ resents a direct-access device, that lable. The total I/O address, con­ the device is currently involved in a sisting of the unit address and the data transfer operation. channel address, is used in the start I/O (SIO) instruction. Note: A device accessed through a tape Bit 6: Disk Arm Seeking unit switch must always have the same This bit indicates, when the UCB rep­ control unit address. resents a direct-access device, that the device is currently involved in a seeking operation. FLAGS 1 Bit 0: UCB Busy Bit 7: Error Routine in Control This bit is turned on by the I/O This bit is turned on by an error supervisor when the represented device routine to indicate that error recov­ is started and remains on until device ery procedures are in progress for the end. device and that any related requests must not be started. Bit 1: UCB Not Ready This bit is turned on when the I/O supervisor determines a device not­ DEVTAB (1 byte) ready condition and indicates that This field provides the indexing value operator intervention is required. A (in bytes) from the beginning of the message is displayed to the operator device table to the significant device by the error routine handling the class entry in the table for the condition. device represented by the UCB. The device table entry contains the Bit 2: Post addresses of the device-dependent This bit indicates either that channel enqueue, start I/O, and trapcode end is awaited, or that an error modules for the device type. (For occurred at device end which will be additional information, refer to passed when the next SIO instruction "Device Table.") is issued for this device.

72 ERRTAB (1 byte) Eit 2: Burst Device This byte contains a nUIreric constant When on, it indicates that the that is used by the exit effector to device operates in burst mode; complete the 8-byte name of an IBM­ when off, the device operates in supplied error routine within the SVC byte mode. library for the represented device. Bit 3: Data Chaining STATAB (1 byte) When this bit is on data chaining At SYSGEN time, a device number is allowed for the device. If it ranging from 0 to 128 is assigned to is off, data chaining is not each I/O device attached to the sys­ allowed. tem. The number for the represented device is stored in this byte. The The remaining bits and bytes are not statistics table contains an 8-byte used by the I/O supervisor; they are data area, in which information discussed in the Introduction to Con- regarding the device's operation is trol Program Logic. Program Logic maintained, and a 2-byte work area for Ma.nual. each device. The I/O supervisor locates each data area by using the LAST REQUEST (2 bytes) product of the STATAB byte and ten as The I/O supervisor issues a request an indexing value. (Refer to element to represent each I/O request "Statistics Table.") for a device. When the I/O request is started, the address of the request LCHTAB (1 byte) element is placed into this field This field, when multiplied by eight, (LAST REQUEST) which then indicates gives the indexing value (in bytes) the last I/O request for the device. from the beginning of the logical The information in the request element channel word table to that logical is used during interruption process­ channel word associated with the rep­ ing. (For additional information, resented device. The logical channel refer to "Request Element Table.") word indicates the status of the par­ ticular logical channel queue to be SENSE (2 to 6 bytes) used when the I/O superv~sor must When the I/O supervisor issues a sense queue a request for the device. (For cowmand, up to 6 bytes of sense infor­ additional information, refer to mation from the device's control unit "Logical Channel Word Table.") is read into this area of the UCB. The number of bytes of sense informa­ ATNTAB (1 byte) tion that is read varies with the This field contains the indexing value device type; however, all information (in bytes), set by system routines, significant to the use of the device from the beginning of the attention is normally provided within the first tpble toone of its 4-byte entries. two bytes. The I/O supervisor then The entry contains the actual address places these two bytes into the lOB. of the attention routine required for the represented device. (For addi­ SEEK QUEUE CONTROL WORD (8 bytes) tional information, refer to This area contains the seek queue "Attention Table.") control word which gives the status of the seek queue for a direct-access UNIT NAME (3 bytes) device. The format of this field is This field contains a symbolic name in shown in Figure 20. EBCDIC characters for the device rep­ resented by the UCB. This name ~s When used for ordered seek enqueueing used for device allocation and also by and dequeueing, the format of the seek error routines in messages to the queue control word is shown in operator concerning this device. Figure 21. DEVICE TYPE (4 bytes) LAST SEEK ADDRESS (8 bytes) The contents of this field describe This area contains the seek address the type of device and pertinent char­ MBBCCHHR for the last seek on the acteristics of it. The first 4 bits direct-access device represented by of the first byte are flags that the UCB. decode as follows: WORK AREA (40 bytes) Bit 0: Unassigned .• This area is used by IBM-supplied error routines for the CCWs necessary Bit 1: Overrunable Device for the alternate track procedures and When on, this bit indicates that the· head and cylinder switching proce­ the device is overrunable. dures for direct-access devices.

Part V: Control Block and Table Formats 73 r------T------T------T------, r------T------T------T------~, I FIRST I LAST I I I r PRIMARY I SECONDARY I RELATED I ENQUEUE I

LI ______REQUEST ~I REQUEST______~I ______SCRATCH ~ IENQUEUE ______JI LI ______QUEUE ~I ______QUEUE ~I ______QUEUE ~I ______JI <-2 tytes>I<2 bytes>I<2 bytes>I<2 bytes-> <2 bytes>I<-2 bytes->1<2 bytes>I<2 bytes> I <------8 bytes------> <---~------~-8 bytes------>I I The contents of these fields are: The contents of these fields are: I I FIRST REQUEST (2 bytes) PRIMARY QUEUE (2 bytes) I This field contains the address of the This field contains the address of thel first request element in the seek first request element in the primary I queue. queue of the seek queue. LAST REQUEST (2 bytes) SECONDARY QUEUE (2 bytes) This field contains the address of the This field contains the address of the last request element in the seek first request element in the secondary queue. queue of the seek queue. SCRATCH (2 bytes) RELATED QUEUE (2 bytes) This field is used in ordered seekl This field contains the address of the enqueueing and dequeueing. (See Fig-I I first request element in the related ure 21.) I I queue of the seek queue. I I IENQUEUE (2 bytes) I IENQUEUE (2 bytes) I This field contains the address of, orl I This field contains the address of, or I an index value to, the enqueue module I I an index value to, the enqueue module I to be used in queueing a request I I to be used in queuing a request ele­ I element from the seek queue into al I ment from the seek queue into a logi-I LI ______logical channel queue. JI LI ______cal channel queue. J I Figure 20. Seek Queue Control Word Format Figure 21. Seek Queue Control Word Format for FIFO and Priority Requests for Ordered Requests

74 CHARTS

Chart 01. Functional Flow of the Input/Output Supervisor

I/O INTERRUPTION EXCP SUPERVISOR SUPERVISOR

***·82********* ****B4********* * START * * START * *************** *************.* I I. .v. V C2 *. *****C4********** ****Cl********* .* ARE *. * PROGRAM CHECK * NO.* CONTROL *. * DETERMINE * PCI * OR ABNORMAL *<---*. BLOCKS FOR .* * REASON FOR * APPENDAGE TERMINATION * *. REQUEST .* r--*AND SERVICE 1/0* EXIT *************** *.VALIo.* * INTERRUPTION * * •• * ***************** * YES 1 I I TRAPCODE I J ~_E-r- .v.I .v. 02 *. 04 * • .* IS *. .* ERROR *. NO l NO .* • *IS DEVICE *. *. *. OR UNUSUAL .*------, *. AVAILABLE .* *. .* *.CONDITION.* 1 *. .* *PRESENT* * •• * * •• * * YES rES **** 1 CHANNEL END : E4 !-> ~:NORMAL ENol I ~~~~NEL * **** * I ~~~iNDAGE I .v. MODULE V V E2 * • *****E4********** *****E5********** • * IS *. .SCHEDULE ERROR * * * v CNO.* CHANNEL *. *ROUTINE TO ANA-* * INDICATE TO ,------*. AVAILABLE .* *LYZE + PROCESS * * USER HOW * I * ERROR OR UN- * REOUEST * *USUAL CONDITION* * COMPLETED * I *·*·*·f~~:·* J ******.********** ***************** '------I :**** 1 ~ :*::* :->1<.v. F4 *. INTER- *****F5******* J ****F3********* .* *. RUPTION * * * RETURN TO * BUSY.* TEST *. PENDING * ENABLE * TASK *<---*. ASSOCIATED • *----> * FOR I/O * * SUPERVISOR * *. CHANNEL .* * INTERRUPTIONS* *************** *..* * * A * •• * ************** * FREE THE TASK SUPERVISOR I 1 REGAINS ,.--- - CONTROL AND 1 CHANNELfl ROUTES THE NO 1 I SEARCH I/O INTER- .*. V MODULE RUPTION TO G3 *. *****G4********** THE I/O .* *. * * J SUPERVISOR • • * WAS *. * FINO REQUEST *-- I *. REQUEST .*<----* TO START * 1*· *. ::t::s.~ ,""~"~:.:: '::;11:::~**** I/O EXTENT START I/O V MODULE APPENDAGE I l :~~~NOAGE :****Hi;:~:*****: EXIT II * START I/O ------.J ------>* INSTRUCTION 1 * TO START * REQUEST * ***************** L ****** I ~------: E4 :<-, II DEV OR CNTRL ENQUEUE I I IERROR IUNIT BUSY MOo~~;**.Jl *~******** CNTRL .J2 .*. *. J3 .V. *. .J4 .*. *. * * UNIT.* *. .* *. .* *. **** EN~~~UE :<--+~~*:*E~i:Riu~~gR*:*<~*:;HR6~~~R~~Cp *:~ __>*:* ~~~~~~N *:~~~~: E4 * * REQUEST * *. RESULT .* *. SUPVSR .* *.START 1/0.* * * *..* *..* *RESULT * L-=::**t········ ."fo<",," ..... ):::''''"

I V *N** * ****K2********* * RETURN TO * ---->* TASK * * SUPERVISOR * *.********* ••**

Charts 75 • Chart 02. Control Flow Within the EXCP Supervisor

FROM FROM svc FLIH svc FLIH AFTE~ SVC 0 INTERRUPTION AFTER SVC 15 INTERRUPTION (EXCP MACRO-INSTRUCTION) ****Al***···*** * ·*··A4······*** • ·* START ... . START . • *** •• **** •••••. . .

tecxcp IECXCPER I XVCK-Ql V XCPTST tNTER2 V ·····SI***······· .·····82·········· . ····*83·**······· **··*e4·····***··.. SEE CHART 03 .. THIS ROUTINE ·*-*-*-*-*-*-*-*-* . *-*-*-*-*-*-*-*-* ·.. TEST ueB . *-*-*-*-*-*-*-*-* USES THE EXCP .. EXCP VALIDITY" r-->* GET REQUEST *------>* CONDITIONS ERROR .. VALIDITY CHECK SUB ROUT I NE. : SUB~~~~~NE SU~~~~~~~E:" .. R:i~~~NE : ****····*1*·***···:J :.** •••••• * ••••*** •••••••••••••• **. • •••••*********** :~i:**->I I • • <:------"- .. **. v ••• XCP010 .*. C1 •• C3 •• •• •• •• IS *. •• IS *. YES .* DEVICE *. NO •• REQUEST •• *. AVAILABLE .*------, •• VALID •• *. .* *. .* •• .* * •• * * •• *

INO XC PO 11 iYES V ****.03**.*****.* ****01·*·*···*· •• • PROGRAM CHECK • * ..... -.-.-.-.-.-.-. * OR ABNORMAL * • TEST • • TERMINATION • • CHANNEL • •••••• * •••• *... • MODULE * * •••••••• * •• * •••• I v ••• V E3 *. • •••• E4 •• * •• *•••• • * IS *. .XCPPNQ • * .... E5* •• * ••••• •• CHANNEL •• NO .. - .. -*-*-.-.-.-*-. * RETURN • •• AVAILABLE ••------>* ENQUEUE .------>. TO TASK • *. •• A * MODULE * SUPERVISOR •.•. .•.• I : •• * •• * •••*...... • ••••**:*.* ••• *

.-______>j YES

XCP030 V ·····F3·*······.. • ·XCPSEL • • -.-*-.-.-*-*-*-* • 'SELECT • • SUBROUTINE • ·.* ••••••••• ***.**

VI XCP032A IF NECESSARY" ·····G3***·*·*··· THE ENO-OF­ EXTENT APPENDAGE ·*-*-*-*-*-.-.-.-. . EXIT 15 TAKEN START HERE. I/O ···_···T·······* MODULE • THESE CONDITIONS ARE HANDLED BY THE I/O IN­ TERRUPTION SUPERVISOR. V ** ••*H1.*****.... • ••••H3 •••••• ** •• • ANALYZE * THE START I/O .XCPSIO • • CSW CONDITION. APPENDAGE .-.-*-.-.-.-.-*-* • AND *---, EXIT IS • START • * HANDLE * V TAKEN HERE. I/O • ••••• * SUBROUTINE • ...... *...... ·05 • • •••••• * ••••••••• A '.D!' I I(CC=l) • V ••• XCP112 ••• J1 •• * ••• *J2 •••••••••* J3 •• •••• .XCPPIO • ..RESULT •• • ••• J4 ••• * •• " •• • * CONDITION *. .-*-.-.-.-.-.. -.-. •• OF START •• BUSY • A8TERN • *.CODE AND CSW .*<------* POST-START *<------*.1/0 INSTRUC- •• * ROUTINE * TRY *. STATUS •• • I/O • OTHER * •. TION .* (CC=2) INTERFACE * AGAIN .RESULT.* • SUBROU1INE • CONDITIONS.... * ••* •••****.**. •• .* *•••••••• *...... * A • • NOT I ~~~UEST LI_O~P-E~R~A~T~1-0-N-A~L-----~ t~~;~)ED (CC=3)

••* ••K3...... • ••••K4.* ••••*.* • • XCPPDQ * • PLACE ADDRESS • • -*-*-.-.-.-*-*-. • OF ACTIVE * L-______>* DEQUEUE .------>.REQUEST ELEMENT*------~ ·• MODULE * .• IN UCB •

16 • Chart 03. Control Flow Within the Error EXCP Routine

FROM SVC FLIH AFTER SVC 15 INTERRUPTION *···Ai········· * START *

IECXCPER

INTER3 V *****81********** 4- INDICATE * ERROR EXCP * ... ROUTINE IN * 4- CONTROL ***************** I ]NTER6 V *****Cl*********· ... INITIALIZE * GENERAL REGISTER 1 WITH lOB ... ADDRESS ****************.

INTER9 IV *****01*********­ *XVCKOI * *-*-*-*-*-*-*-*-* 4- EXCP VALIDITY * * CHECK * 4- SUBROUTINE ... ***** ***** ***************** *03 4- ENTRIES F~OM RESIDENT PORTION OF DIRECT-ACCESS DEVICE ERROR ROUTINE *03 * I 4- E2· * .E5* . I *(THE ERROR IS CORRECTED. A SEEK MUST BE GIVEN.

V. V INTERS INTER7 El .*. *. E2 .*. *. **E3******* *****E5********** .* IS *. .* IS *. ... 4- * INDICATE * .* ERROR *. NO .4-ERROR COR- *. YES ... CHANNEL END * ERROR *. ROUTINE IN .*------>*. RECTED (lOB .*------>* APPENDAGE ROUTINE *. CONTROL .* -.EXCEPTION.. * IS IN * *..* * 00).* * CONTROL * * ... * * •• * THE I/O IN­ ***************** * YES .. NO TERRUPTION SUPERVISOR HANDLES THE CHANNEL END AND ABNORMAL END APPEND­ • *. AGE RETURNS • *****F 1 ********** F2 *. **F3******* *****F5********** ... TEST * .* IS *. * * * * UeB DEVICE .* THIS A *. yes *ABNORMAL END * FINO SEEK STATUS *. RETURN FROM .*------>* APPENDAGE * · QUEUE CONDITIONS *. I/O .* * ADDRESS *.PURGE.* ·* ***************** * •• * ·

vI o ***** *02 * La ! * C3* INT057 v .*. V *****G2**********r G3 *. *****G5********** * * . *INTERR * .* *. *XCPPNQ * *-*-*-*-*-*-*-*-* • * RELATED *. *-*-*-*-*-*-*-*-* TO EXCP SUPERV I SOR ERROR *------>*. REQUEST .* ENQUEUE (XCPOI0) ROUTINE * *. .* MODULE . * INTERFACE * *..* ·* . A TEST CHANNEL ***************** * •• - OR AN ENQUEUE TO INDICATE * YES MODULE I S EN­ PERMANENT TERED, DEPEND­ ERROR. I ING ON TEST RESULT. I V I v **H3******* *****H5********** *INT028 * * I/O PURGE * *-*-*-*-*-*-*-*-* ROUTINE . CHANNEL * RESTART * * * SUBROUTINE * * * ***************** I V V ****J3********* ****J5********* * SVQ~ * * RETURN TO * AND TASK * RETURN * * SUPERV I SOR * ***** •• n.***** ***************

Charts 77 Chart 04. Control Flow Within the Input/Output InterruFtion Supervisor

FROM I/O FLIH AFTER I/O INTERRUPTION ****A2********* * START * * ***************

IECINT

.v.I INTOOl *****6 1 ********** 82 *. *****83********** * SERRO 1 * • * *. * * *-*-*-*-*-*-*-*-* YES .* *_ NO *-*-*-*-*-*-*-*-* SER *<------*.CATASTROPHIC .*------>* ue8 I NTERF ACE *. ERROR • * LOOKUP * *..* ROUTINE ***************** ***************** THE SYSTEM IS CONSIDERED INOPERATIVE I INT003 V **Cl******* *****C3********** * SEE CHART 05 * * * YES.* PCI *. *-*-*-*-*-*-*-*-* PCI *<------*. CONDITION • * <------* I/O APPENDAGE * *. .* * INTERRUPTION *. .* * ANALYSIS * *********** * •• * ***************** t * NO I 1,------>1 INTOOt .v. INT013 .*. *****01 ********** 02 *. 03 *. *****04********** * INATT * .* *. .* *. * INTSEN * *-*-*-*-*-*-*-*-* YES .* ATTENTION *. NO .*UNIT CHECK *. YES *-*-*-*-*-*-*-*-* ATTENTION *<------*. CONDITION .*------>*. CONDITION .*'------>* SENSE ROUTINE * *. .* 1\ *. .* * SUBROUTINE * * INTERFACE '* *..* I *..* * * ***************** * •• * I * •• * ***************** I * II * NO I I . I I 1< . • *. INT023 .v. *****El********** E2 *. E3 *. **E4******* *****E5********** * * .* *. .* *. * * * INTERR * *-*-*-*-*-*-*-*-* YES.* CHANNEL *. YES.* NORMAL *. NO * ABNORMAL * *-*-*-*-*-*-*-*-* TRAPCQDE *<:------*. END AND/OR .*<~~----*.COMPLETION OF.*'------>* END *------>* ERROR MOCULE *. DEVICE .* *. REQUEST .* * APPENDAGE * * ROUTINE *. END .* ~..* INTERFACE ***************** * •• * * •• * *********** *****************

I iNO * I v .v. INT024 V **F 1 ******* F2 *. *****F3********** **F4******* *****F5********** * * .* IS *. * XCPPST * * * * * CHANNEL .* THERE *. YES *-*-*-*-*-*-*-*-* * POST * SCHEDULE END *------>*. A REQUEST • *------> * POST *------>* ROUTINE ERROR APPENDAGE * *. ELEMENT • * * ROUT I NE * ROUTINE INTERFACE * *********** * •• * ***************** *********** *****************

i< NO vI 1< __ .J INT028 .V. *****G 1 ******* G2 *_ * * .* *. ****G4********* * ENABLE * INTERRUP-.* TEST *. BUSY * RETURN '* FOR I/O *< *. CHANNEL .*------>* TO TASK * * INTERRUPTIONS* TION PENDING. STATUS .* * SUPERVISOR * *..* *************** ************** * •• * A THE TASK * FREE SUPERVISOR I REGAINS CONTROL AND ROUTES THE I II I/O INTERRUPTION II TO THE I/O 1 NO INTERRUPTION INT027 V INT034 .*. SUPERVISOR *****H2********** *****H3********** H4 *. * *... INT023 * .* *. *-*-*-*-*-*-*-*-* *-*-*-*-*-*-*-*-* .* STARTABLE *. * CHANNEL *------>* CHANNEL *------>*. REQUEST .* SEARCH A RESTART * *. FOUND .* MODULE * 1 it SUBROUT I NE * *..... ***************** ***************** * •• * I * YES

I ! I i 1 TRY V .*.AGAIN ****'*J3********** J4 *. * * .*RESULT *. 1 I '* START I/O * .* OF START *_ * PROCEDURE ~----->*.I/O INSTRUC- _*--~

****************: *.*.::0:*_*_* I ~~~~~~~o SEE CHART 02, BLOCKS F3,G3,H3 BUSY * I

78 Chart 05. Input/Output Interruption Analysis (1) . . ..., A4 ... ****I .*. .*. INT027 Y INT034 .*. A2 *. A3 *. *****A4********** AS *. FROM .* *. .* CHAN *...... * .... I/O FLIH .* CONTROL *. YES .*END. DEvlce*. NO *-*-*-*-*-*-4-*-* .* STARTABLE *. NO AFTE:.R I/O INTERRUPTION ,>*_ UNIT END .*--->*.END. OR UNIT .4____ >* CHANNEL *--->*. REQUEST .4------, ***** *-._ _.. -it ._ •• CHECK •• _. t: ~g~~~~: ._ ... FOUND •• _" I *05 .. * •• * it •• * I ***************** * •• * *.61* I .. NO .. YES .. YES I • I 1 1 1 1 I I I I >1 I >1 II I I I i TRY I IECINT .Y. I INTOOl V I .·.AGAIN V I 61 it. *****63********** B4 *. *****65********** I .* *. .._ I .... IBUSY.* *. .. .. *:~ATASTROPHIC *:~ :-*~*-*~~~*-*-*-: L .. :* RE~~~TS *:*<---: P~~~~~U~~~ I *. ERROR ...... LOOKUP" *. .*.. . *. .* it ROUTINE" *...... * •• it **tfo.****.. * •••• *** * •• * ....*.*4********** * YES IYES *REQUEST I IACCEPTED I I .'~", V INTOIA .V. * G4 * :;:::~!*********! :****C2*********: .*C3 IS *. *. * .. *-*-*-*-*-*-*-*-* * GET 108. * YES.* THERE *. .. SER * * DES AND OCB *<---*. A REQUEST .* * INTERFACE * ADDRESS * *. ELEMENT .* * * * * *..* ***************** ***************** * ••*

E:~!:'I I >i NO INTOOS .v. INT003 .v. 01 *. 03 *. • * *. .* * • 4**04******* • • * CHANNEL *. .* PROGRAM *. YES * PCI

:*~;. * ••• '::1.... :_~_~_'_··_·_'_< ______---'I ~... '~!;l!F;" '->'. ':::j:::

.*. INT009 .V. INT004 .V. .V. EI *. E2 *. E3 *. E4 * • • * *. .* *. .* UCB *. .* PROG. *. NO.* DEVICE *. NO.* OCB *. NO.* STATUS *. YES .*PROTECTION.* • .---*. END .*<--*. POST FLAG .* *. MODIFIER .*<---*. OR CHAINING .* ;'~': ·····T,;;·· .....:(.. ····~f';;·· 'L ····::r··· j

.V. INT006 .V. INT020 V .v. FI *. F2 *. *****F3********** F4 *. INT033 .* *. .* *. *INTSEN * .* *. ****FS********* NO.* UCB *. .* lOB *. NO *-*-*-*--*-*-*-*-* YES.* ANY *. NO - RETURN * r--*. BUSY FLAG .* *. SENSE FLAG • * SENSE *. UNIT .->* TO TASK *< •.•. ON .*.* * ••• ON ••• * * SUBROUTINE * *. STATUS.* A * SUPERVISOR * I * * *. ~* *************** *:** *·*·~ES *·*·~ES *********1******** *.*.*

: J5 : I' E::* * -> : *::*!*. TCH .->* MASK TO * * TO CURRENT *. IN CNTRL .* "*INSTRUCTION* * ENABLE I :**~~:*~!:!~~***: *. * •• *.* I *. * •• *.* *********-*******

I 1'1YES (::)' : .::.:, .V. v .*. INTOII .V • • *H~NIT*·_. :****H2*********: * •• *H3.~.****** •• H4 *.'fi. ..H5 *.* • • * CHECK *. NO * TURN IOd * RETURN * .* DEVICE *. NO .* *. NO *. OR UNIT .-----, * SENSE FLAG * TO SELECT * r>*. ENO .->*. ATTENTION .*-1 *.~XCEPTI~~.* I: OFF * * **~~~~~~!!~;*** * i *. .* "*. .* I ··'I·'YES I *********1'<*******· I *.* ·*·YES*.* II *.* ·*·YES *.* I :'::. ~ I I :.::. :->1

Y IINTOl4 v INT:~:*** v . JINTOIO! * *! I *********! J :;~~:~i*********: :****Jl :****J2*********: :****J3*********: :****J4**.***.***: I * MOVE * TURN uca * * MOVE * * TURN uca * *-*-*-*-*-*-*-*-* I * CSW STATUS * aUSY FLAG *->* CSW STATUS 4-- * BUSY FLAG * * ATTENTION *' * TO !JCB * OFF * * TO lOB OFF ROUTINE ...... ••••• *••••••••• *: : ••••••••••••••• : : ••••••••••••••• : : ••• !:!;~~~~; ••• : I

_>.1 I I :./1 :::':*~;* .. < " v INTOl3 .v. !****K 1*********:' .4 K5 *·4. * SET 4 YES.* UNIT *. 4 UCS INTERCEPT • .----*. CHECK .4 : FLAG : **~** *. *. .4.4 4**************** *06 * * •• * * A2* * NO * * * I Y ***** *06 * * *A~*.

Charts 19 Chart 06. Input/Output Interruption Analysis (2)

***** ._... * * *06 ... *06 ...... * ...... Ai· ...... A~* :O~3: ...... **** I I LtC INTOlS V .v. INTOIS .* • • ****A2********** A3 *. A4 .*. *. AS *. *INTSEN ... .* PROG *. .* *. .* *. *-*-*-*-*-*-*-*-* .* PROT OR *. NO .* CHANNEL *. NO .* CONTROL *. ... SENSE'" *. CH CHAIN .*---->*.END DR DEVICE.*--->*. UNIT .* : SUBROUTINE: *"' •• C':U< •• _* *"' •• END •• _. -", •• BUSY •• "'* ** •• ************* * ••* ..... * * •• * I i y:~* •• * i YES '1 YES I '->: F3 : I **** I I .*. v V 83 *. ****-B4********** *****85*********- .* *...... *INTERR .. Y YES.* ueB *. *-*-*-*-*-.-*-*-* *-*-*-*-*-*-*-* .... * *. POST FLAG .. *<----* TRAP CODE ... .. ERROR ... 4. ON.* ... MODULE'" ... ROUTINE ... I *. * •• *.* :****•• *********! :***!~!~~~~~~**.: I .. NO " *05**L .. II' INT021 • v. .. G3- C2 *. .. .. • * *. * *:*Roui~~~RIN *: ••Y~E~S~ ______:>I *. CONTROL •• *. * ••• .-

o .v.r .it. 02 *. 03 * • • * *. .* PROG. - • • * UNIT *. NO ••PROTECTION ••• NO *.CHECK•• EXCEPTION.. OR UNIT.*->*. *.CHKS.OR CHAINING OR •• .ILL LNG. ...** •• * * •• * -l i YES >i YES

]NT012 V ***-*E3********** * * ... SET ... .. lOB EXCEPTION ... I :..... :~::* ..... : I

1 :••*::*:-J _* I INT 126 V INT023 .* • F4 •• .. **F3******* ... J • * * • ... CHANNEL END ... .* lOB *. YES .OR ABNORMAL END*< , >._ EXCEPTION .0______---' ...... APPENDAGE ... " *. .* *. .- it •• * I ... NO

I I 1 G3· v. .... ~ *****G4*~******** ••GS*._."_ • • * *. *XCPPST ... .. * .* NORMAL *. YES *-*-*-*-.. -*-*-*-* .. POST *. RETURN. .. POST *->* ROUTINE *..* ROUTINE'" it *..* .. INTERFACE" .. .. * •• it ."!'.** __ *.__ *._._. •... ** ____ • . ~ , I I ~I ------~I .v. INT025 .v • ••H3 ._._ _.He\. -_._ :****H5*********:

.* SKIP *. YES .it lOB *. YES *-*-*-*-*-*-*-*-* *. POST .*'"--->*. PURGE FLAG .*->* PURGE *. RETURN .* *. ON.* * COMPLETE *. * •• *.* *. * •• *.* :**~~~~~~!!~~***:

.1. NO *1' NO

J3 * • • * * • • * EXCP *. NO V *. RETURN.-----, .------' *. .* I *. * •• *.* I

*1 YES II ** ::*:* ELEMENT TO *---->- POST FLAG * * ON LOGICAL * - FREELIST * * * :.;~:~~i;.~~;~~*: :*****44.* •••••*: : ••••• ** •• **.**.! A I

80 Cbart 07. Scheduling of an IBM-Supplied Error Routine

FROM ERROR ROtITIINE HITERFACE * ...... *07 * ... C2"* .. .. * .v.I *****Cl********** C2 *. • ••••C3**** ••• *** ... BRANCH TO ... .* *. ... PLACE REQUEST * * RESIDENT .. YES.* DIRECT- *. NO "ELEMENT IN " EXIT EFFECTOR .. DIRECT-ACCESS "<~------*.ACCESS DEVICE.*'------>" ASYNCHRONOUS " PART HID * DEVICE ERROR " *. ERROR.* A" EXIT QUEUE .. " ROUTINE" " ••" I * (FIFO) ..

·· .. ···:1:· .. ···· ..... 1':,1 ...... "]" ......

01 *. *****D3*.******* • • * *. ... ENABLE- * .* TRANSIENT *. YES " HANDLE I/O " INPUT/OUTPUT *. PORTION .* ... INTERRUPTION ... SUPERVISOR *.NECESSARY." " OR RESTART .. *. .* ... CHANNEL * *. .* **.*••• *.****-*.... i~ I V V *****E 1 ****** ... ***. *****E3********** ... GET * "... HANDLE * " ERRTAB .. * CONDITIONS * .. BYTE FROM .. * * UCB * .. .." " * ***~************* ***-*************

I EXIT EFFECTOR ., PART THREE

V *****F3********** ... COMPLETE * " ERROR ROUTINE * * NAME IN * * SIRB WITH * • ERRTAB " *****************

-----, BLDL VI *****G3********** I " SEARCH " " SVC LIBRARY .. .. FOR ERROR .. .. ROUTINE " ******************

FETCH IV *****H3********** * READ ERROR " .. ROUTINE INTO .. CONTENTS *1/0 SUPERVISOR" SUPERVISOR * TRANSIENT " (FINCH) * AREA * ********.'.*-*****I . I I V *****J3********** ... GIVE * * ERROR * * ROUTINE * * CONTROL * .. " I ****************~

Chart,s 81 • Chart 08 • General operating Procedure for Device-Dependent Error Routines ...... *08 ...... 81- I V ·····81·······.··.. SET • .. lOB • .. EXCEPTION • .. AND ...... ERROR FLAG .. I ...... ·····l ...... •...... ~ .•. Cl * • • * 2311. * • • 2671.0R 1052*. YES *. ERA RTN •••==------, •• IN eNTAL •• *. •• * ••• *NO I ...... :: I ~~ ...... ~~~~~:~~~~~~~~~~~ ..... 'L" ...... ::~:~~~...... ·.. 04· .. ·.... ·· ·····05······· .. * .* *...... * •.•. -ERROR INTRPRTR .. .. CLEAR JOB .. •• MIXED •• YES .. TURN OFF" .* 'UNIT *. NO *-*-*-*-*-*-*-*-* .. EXCEPTION AND .. •• CHAINING •• >* lOB ERROR" >*. CHECK ....=--->. EXAMINE ... r>* ERROR FLAGS. .. *. .* ... FLAG A.. •• .. REMAINING CSW .. I" AND DCB ...... ::; :... mT······: ····r:: :"::!!lm:'': :... lllT l::••• : .. e2...... v ..... E3...... v E4 ••• ... J ..E5 ...... V . ••TO ... -eRROR u[rRPATR ... •• WAS ...... *-*-*-*-*---*-. *-*-*-*-*-*-.-*-* .* ERROR *. YES *-*-*-*-*-*-*-* .. WRITE" .. EXAMINE. >*. CORRECTED • • STATISTICS * MESSAGE * .' SENSE" *PREVIOUSLY.* • UPDATE • *TO OPERATOR* * BITS * *..* * ROUTINE * ••***** •• ** ...... *.***.*** * •• * **.** •••***

IV *****F3*****.**** F4 .i."*. V ****F2********· * * .* *. ··*·FS·*······* • SVCI5 * * CLEAR * YES •• PERMANENT *. • SVCl5 * * AND * * lOB' ERROR *

v v G} .*. *. **G3**..... G4 .*. •• • * *. * .. .* •• • * CONDITION •• YES *-*-*-.-*-*-*-. .* OPERATOR *. NO *. CODE SET •••==------> * STATISTICS *.INTERVENTION .~.~------, *. 01 .* • * ROUTINEUPDATE· * ·.REQUIRED*..* .* I' *. ••• * .* ••••••* •• ** •• .* o I * YES V rv .•. V HI *. ..H3.*** •• * HS .*. *. •• *. * • .* * • • * COMMAN,D *. NO .-.-*-.-*-*-*-* •• lOB •• YES *. CHAINING ., ••'------> * OUTBOARD *.RESTART FLAG .*, •• .* RECORDING *. ON .* *.' .* ROUTINE • •• •• * ••• ** ••**** •• * * ••• jYES POSl"1 NG * NO !~i;AGE I V .*. .•. V V JI *. J2 *. •• J4*••• *** *··**J5*******·** .* *. .* ccw *,. ·WTO • * USE • • * ENTRY *. YES •• ADOR eQUAL *. YES •-*-.-.-*-.-.-* • lOB START • •• FLAG .... >*. REST ART .*--> • WRITE -FIELD TO RETRY - *. ON.. •• ADDR .* • MESSAGE • • CHANNEL * .TO OPERATOR* • PROGRAM * ...*•• .* *...•• •• ***•••••••• .*•• * ••• ****** ••*

ro ro L-______> <______~ I v v * ••••KI...... •.... K2* ..** ••••• V •••*.KS •••••• **** * •• PUT CCW AODR • • ••*K4*.****... • USE • TURN .. * INTO lOB RE- * SVCI5 * • lOB RESTART • ENTRY FLAG *------>. START FIELD + AND *<------.FIELD TO RETRY .< ON • • TURN lOB RE- • • RETURN. * CHANNEL • • * START FLAG ON * *** ••* ••••***.. * PROGRAM • * ••••••••••*...... * ..... * ••••• ***** .*.*•••• * ...... **.4

82 Chart 09. OBR/SDR Module Flow

ENTRIES FROM CONTENTS OBR SUPERVISOR SDR ***** (FINCH) ***** *09 * *09 * * 82* * 84* * * * * * *

IGE0025F vI IGE0525F VI *****82********** *****84********** * OBTAIN * * OBTAIN * * HEADER RECORD * * STATISTICAL * FIRST OBR MODULE FIRST SDR MODULE : RE~~~DB~~~~y : :DA~~A~i~~~gsAND:<~ * CONSTRUCTION * * COUNTERS * 1 ***************** *****************

. v.I .v.I C2 *. C4 * • • * *. .* * • • * *. YES YES .* *. *. ERROR -*------>1<------*- ERROR .* *. .* *. .* *. .* I *. .* * •• * * •• * * NO * NO I 1 1 1 IGE0125F V IGE0625F V *****02********** *****04********** * * *ADD STATISTICS * * COMPLETE * * COUNTERS TO * SECOND oBR MODULE * RECORD ENTRY * * DATA RECORD * SECOND SDR MODULE * CONSTRUCTION * * AND WRITE ON * * * * SYSRES DEVICE * ***************** ***************** I I .V. .V. E2 *. E4 * • • * *. .* * • • * *. YES YES .* *. *. ERROR .*- > <--- *. ERROR .* *. • * *. • * *. .* *. .* * .• * * •• * * NO * I I I IGE0225F V IGE0425F V *****F2********** *****F3********** * WRITE RECORD * * * * ENTRY ANO * * WRITE * ERROR THIRD 08R MODULE * RECORD HEADER * r-->* ERROR * MESSAGE * ON SYSRES * 1 ** MESSAGES * MODULE * DEVICE * * ***************** ***************** I I I I 1 G2· V.*. .* * • d . * *. YES *. ERROR .* *. .* *. .* * •• * * NO I I I 1< I I .V. H3 * • JI 1 • * *. .* OBR IN *. YES ~------.------>*. CONTROL .*------*. .* *. .* * •• * * NO I V ****J3********* * * * RETURN * * *************** *

Charts 83

Chart 10. General Operating Procedure-Graphics

.. •• ** *10 * .. 82* * o * I ER2250 V ER2260 *****82********** o 0 .. SET EXCEPTION «­ .. BIT AND ERROR «­ .. FLAG IN lOB ..

I ~ V MAINER V ***··C2*********--­ *****(4********** TEST * * TEST SENSE * CSW STATUS BITS * BITS * * ********~******** *****************

I vI .*.v 02 *. 04 .*. *. • * «-. ~. * • YES .«-SHOULD NOT *. .-SHOULD NOT *. YES .---*. OCCUR .* *. OCCUR .*-. I ·.CONDITION.· *.~~NDITI~:.* I **** *..* I * •• * v 1 o •• :*::.: *o *, NO : *::*: I< __J **** r v SERQUT v .*. *****El********** E2 *. E4 .*. *. * * • * * • .* «- • SET YES .* WAS ERROR *. LOG OUT BI T •:* UNIT CHECK *:*~ *. CORRECTED •• IN lOB *. .* "PREVIOUSLY.«- *. .* *. .* * ••• * •• * o NO o NO I I V v TESTST .*. .*. F2 *. F4 *. • * •• .* * • YES .* «-. .* *. NO 1*_ PERMANENT .* *. PERMANENT .*------­ *. ERROR .* *. .* I *.<:R~:.*.* * •• «- I ro rES I 1< .----' V v ISCEOE .*. tNOE~~***G2*~******** *****G4********** G5 .... , : CLEAR : .* *. ..* CLEAR *«- NO.* 2260 * • * EXCEPTION BIT * .. ERROR FLAG IN «­ r---*. EQUIPMENT .* * IN lOB * .. lOB .. I *. CHECK .* I *. .* J ***************** ***************** , *·(~ES I >1 I '------>1 I PERMER V V *****H2********** **H4******* WTO I .*HsoLo**IGG0110B * CLEAR ..* 4-*-*-*-*-*-* .. -** * * * .. ERROR FLAG IN * * WRITE MESSAGE * * ERASE AND * * lOB * * TO * * REQUEST RE- * * * OPERATOR * ENTRY OF MSG* ***************** .. ********** *********** I II<------.~ V .**J2******* . *-*-*-*-*-*-*-* STATISTICS ,L>: **'*Js*~*******S~~6s * UPDATE * RETURN * ROUTINE *************** *********** I V **K2******* * * ****K3********* *-*-*-*-*-*-*-* * SCV15 * OUTBOARD *--->* AND RECORDING * * RETURN * * ROUT I NE * *************** ***********

Appendix B: Linkages Within the Request Element Table 83.1 APPEND~X A: LOAD MODULE NAMES

The load module names for the I/O supervisor, the error routines, and the purge and restore routines "are shown in Table 3.

Table 3. Load Module Names r------T------, I LOAD I I I MODULE I I I NAME I ROUTINE NAME I ~------+------~ IIEAASUOOIResident I/O Supervisor and Fixed-Task Supervisor I ~------+------~ IIEC23XXBIResident Error Routine for 2311 only (without overflow) I IIEC23XXciResident Error Routine for 2311 only (with overflow) I IIEC23XXDIResident Error Routine for 2311 and/or 2302, 2303 (without overflow) I IIEC23XXEIResident Error Routine for 2311 and/or 2301, 2302, 2303, 2314 (with overflow) I IIGEOOOOAITransient Direct-Access Device Error Routine I ~------+------~ IIGE0001CILoad 1 of 2540/2821 Error Routine I IIGE0101CILoad 2 I ~------+------~ IIGEOOOODI1052,2150 Error Routine I ~------+------.------~ IIGEOOOOEI1442,2501,2520 Error Routine I ~------+------~ IIGEOOOOGI1403/1443 Error Routine I ~------+------~ IIGE0002?12671/2822 Error Routine I ~------+------~ IIGEOOOOIILoad 1 of 2400 Tape Series Error Routine I IIGE0100IILoad 2 I IIGE0200IILoad 3 I ~------+------~ IIGE0010AI2250 Error Routine I ~------+------~ IIGE0010BlLoad 1 of 2260 Error Routine I IIGEOllOBILoad 2 . I ~------+------~ I IECINTRP I Resident Error Interpreter Routine I ~------+------~------~ IIGE0025CIWrite-to-Operator Routine I ~------+------~ IIGE0025DIStatistical Update Routine I ~------+------~------~ IIGE0025EII/0 Purge Routine I ~------+------~------~ IIGE0025FlLoad 1 of OBR Routine I IIGE0125FILoad 2 I IIGE0225FILoad 3 I ~------+------~ IIGE0425FIError Message Module I ~------+------~ IIGE0525FILoad 1 of SDR Routine I IIGE0625FILoad 2 I ~---~----+------~ IIGC0001FISVC Purge Routine I ~------+------~ IIGC0001GISVC Restore Routine I ~------+------~ IIGC0002DISVC DEVTYPE Routine I ~------+------~ lIIGC0003CISVC ______~ ______IOHALT Routine JI

84 APPENDIX B~ LINKAGES WITHIN THE REQUEST ELEMENT TABLE

The request element table contains ment is linked through location 2084, request elements that represent active I/O the address of the last element in the requests, available request elements that queue. The last request element is form a freelist, and queued request ele­ identified by the dummy address FFFF ments that are part of either a logical contained in its link field. channel queue or a seek queue. The follow­ ing example provides a detailed explanation of these elements and their linkages within • Seek queue. The seek queue control the request e'l.ement table. word, located in Unit Control Block 2, identifies the first and last request In Figure 22, the request element table elements in the seek queue. The first contains fourteen elements: four available request element in the seek queue request elements are in the freelist, two resides at location 2120 and is linked active request elements represent active through location 2156, the address of I/O requests, five queued request elements the last element in the seek queue. are.· in a logical channel queue, and three The last element in the queue is iden­ queued request elements are in a seek tified by the dummy address FFFF con­ queue. tained in its link field.

• Available request elements. The freel­ ist pointer contains location 2132, which is the address of the next avai­ lable request element (first element in the freelist). The request element at location 2132 points to the element at location 2144, which is linked through Request Element Table location 2060., the address of the last 2000 2048 Queued available element in the freelist. The Free list last available element is identified by Pointer 2012 2156 Queued the dummy address of hexadecimal FFFF 2024 2000 Queued in its link field. 12132 1 2036 Active • Active request elements. The unit con­ X Unit Control trol blocks that represent the two Block I 2048 2072 Queued devices engaged in active I/O opera­ Last 1210s1 Active Request Element 2060 FFFF tions contain the addresses of the Available request elements that represent the I/O requests for the operations. Unit Con­ 2072 20S4 I Queued Unit Control trol Block 1 identifies the request 2084 FFFF Queued element at location 2108 as the rep­ Block 2 \ resentative of one active I/O request. 2036 Active Request Element 2096 2060 Unit Control Block 2 identifies the Fi rst I Lost Seek Queue 2108 X request element at location 2036 as the 2120 2156 Control Word representative of an active I/O request 2120 2012 / Queued operating on a direct-access device; Next Unit Control Block 2 also contains the 2132 2144 Available seek queue control word for that Lagical direct-access device. Channel Word 2144 2096 Available 2156 FFFF Queued • Loqical channel queue. The logical channel word for the logical channel 1>< INot Significant queue identifies the first and last request elements in the queue. The first request element in the queue Figure 22. Linkages Within the Request resides at location 2024 and this ele- Element Table

Appendix B: Linkages Within the Request Element Table 85 APPENDIX C: THEORY OF LOGICAL CHANNELS

Data that is transferred from the cen­ A subchannel is the physical channel tral processing unit to an I/O device facility required for a single data trans­ follows a path through a physical channel. fer operation between the CPU and an I/O An I/O device can be switched among several device. physical channels. each of which provides a separate path to the device. The unique A selector channel has only one subchan­ collection of all physical channel paths to nel and the attached devices share the a particular device is called a logical subchannel. A selector channel is used for channel. If more than one device is only one data transfer operation at a time; included in the same set of physical chan­ however, other I/O devices attached to the nel paths. those devices are included in selector channel can be simultaneously exe­ the same logical channel. cuting control operations. In Figure 23, if physical channel 2 was a selector chan­ nel. device B could maintain a data trans­ A physical channel is included in one or fer operation while device C was executing more logical channels. although a particu­ a control operation. and vice versa. lar I/O device is included in only one logical channel. In Figure 23. for exam­ A multiplexor channel, although having ple. two logical channels (A and B) are only one logical channel. has more than one shown. Logical channel A consists of the subchannel. and the devices attached to it paths through physical channels 1 and 2 to can sustain concurrently one I/O operation dev~ce A. and logical channel B consists of for each subchannel. In Figure 23. if the path through physical channel 2 to physical channel 2 was a multiplexor chan­ devices Band C. The devices and physical nel, devices Band C could operate simulta­ channel 1 are included in only one logical neously. Note that device A could not channel. whereas physical channel 2 is operate because channel switching does not included in both logical channels. apply for a multiplexor channel. and because a multiplexor channel has only one logical channel. The physical channel path to a particu­ lar I/O device may vary because of channel Various physical channel paths and their switching and subchannel considerations. logical channels are shown in Figure 24 and Channel switching occurs when a device is are described in the following list. switched. for operation purposes. from one Assume that physical channel 0 is a multi­ physical channel to one of the other physi­ plexor channel and that physical channels 1 cal channels to which it is attached. In through 5 are selector channels. Figure 23. device A may be switched between physical channels 1 and 2. Channel switch­ • Logical Channel A is defined for the ing does not hold for a multiplexor chan­ paths from physical channel 0 and its nel. subchannels to the tape units on con-

Physical Channel 1

Logical Channel A

Physical Logical Channel B Channel 1-----=------< 2

Figure 23. Logical Channels

86 trol unit 0 (the tape units share a • Logical Channel D is defined for the subchannel and operate one at a time); paths from physical channels 1 and 3 to to the reader, punch, and printer, the I/O devices on control unit 4. respectively, on the integrated control unit (the reader, punch, and printer • Logical Channel E is defined for the each use a separate subchannel and paths from physical channels 3, 4, and operate simultaneously); to two of the 5 to the tape units attached to the telecommunications lines on the trans­ tape unit switch. mission control unit (each telecommuni­ Note: All control units on a tape unit cations line uses a separate switch must be in the same relative subchannel) • position on their respective physical channels (e.g., position 5 in Figure 24). This is the only unit address • Logical Channel B is defined for the assignment requirement. The I/O super­ path from physical channel 1 to the I/O visor requires such positioning for devices on control unit 1. efficient interruption handling. • Logical Channel C is defined for the • Logical Channel F is defined for the paths from physical channels 1 and 2 to path from physical channel 3 to the I/O the I/O devices on control units 2 and devices on control units 6 and 7. 3. Because control units 2 and 3 use Because the same physical channel paths the same physical channel paths, each are used for control units 6 and 7, device attached to these control units each device attached to these control is in the same logical channel. units is in the same logical channel.

Tape Tape Tape

Integrated Transmission Control Control i--­ Reader Control r-­ Unit 0 I Punch Line 1 Unit: Unit I I I r Printer I r Line i Physical A Channel 0 B Control ------Unit 1

Physical Channel Control Control 1 r- r- Unit 2: Unit 31 I I C

Central Physical D Control Processing Channel Unit 2 Control Unit 5 Physical Channel 3 I ControlL_ Unit 7 ----. Topes }~,..Vi_ce_sc-o-n-tr-o-I Tape Physical Channel ~------~ Unit5 Unit 4 Switch

Physical Control Channel Unit 5 5

Figure 24. Physical Channel Paths and Logical Channels

Appendix C: Theory of Logical Channels 87 APPENDIX D: SYSTEM ENVIRONMENT RECORDING OUTPUT DATA SET FORMAT

The System Environment Recording

HEADER RECORD

The header record is the first record on the first track of the extent and is preceded by a 2-byte key of hexadecimal FFFF. The header record describes the entire extent of the SER output data set.

The header record has the following characteristics: • Creation. The header record is created at system generation time by the SYS1.LOGREC initialization program.

• storage Area. It resides on the system residence device.

• Size. The header record is 38 bytes in length. • Format. The format of the header record is shown in Figure 25. r------, I 1<~------4 bytes------>I<------4 bytes------> I <1 byte> I I r------T------T------T- I I First Track I Last Track I Highest I I

lI ______of Extent ~I ______of Extent ~I Address______~_I I I ------T------T- I First Record I Remaining I I Entry I Bytes I I ------~------~~ I ------~------T- I Track I Last Record I I capacity I Entry I I ------~------~- I ------T'------T------T------I UCB I Extent I Devi ce I Not I Count I Size I Type I Used I ------~------~------~------I ------T------, I I Safety I I

______~IField ______J I I I 1<-~------9 bytes------>I I lI ______JI Figure 25. Header Record Format

88 Extent Limits (8 bytes) UCB count (2 bytes) contains the addresses (CCHH) of the contains the number of UCBs in the first and last tr~cks of the data set. system.

Highest Address (1 byte) Extent Size (2 bytes) contains the highest address of a contains the number of tracks in the track on a cylinder for the particular data set extent. sy,stem residence device. Device Type (1 byte) First Record Entry (7 bytes) contains an encoded field that deSig­ contains the address (BBCCHHR) and ID nates the type of system residence of the first track of the record entry device as follows: area. Initially, the ID is zero. Device Code Remaining Bytes (2 bytes) 2311 -1- contains the number of bytes remaining 2301 2 on the track upon which the last 2314 8 record entry was written. Initially, this field contains the track capaci­ safety Field (1 byte) ty. should contain hexadecimal FF. If an overrun condition, causeq by a machine Track capacity (2 bytes) check or channel inboard failure, contains the number of bytes per track occurred while the header record was for the particular system residence being written. the header record is device. padded with zeros from the point of overrun. Thus, if this field is zero, Last Record Entry (7 bytes) critica1 data has been destroyed and contains the address (BBCCHHR) and ID safety precautions are taken to halt of the track of the last record entry and prevent further recording written in the extent. attempts.

Appendix D: System Environment Recording Output Data Set Format 89 STATISTICAL DATA RECORDS

The statistical data records follow the header record. Each is preceded by a 2-byte key. The keys are sequentially numbered, starting with zero, and are the index values to the statistics table entries associated with the particular statistical data record. The statistical data records have the following characteristics: • Creation. The extent is formatted by the SYS1.LOGREC initialization program and each record is created and written by SDR.

• Storage Area. The statistical data records reside on the system residence device.

• Quantity. There is one statistical data record for each UCB in the system. • Size. Each statistical data record is 38 bytes in length and is preceded by a 2-byte key.

• Format. The format of a statistical data record is shown in Figure 26.

r------, 1 1 1 1 1 r------T------T------T- -T------, 1 1 1 Channel and \ Device 1 1 1 \ 1

\ L\ Device______Address L\ ______Type L\ ______Counter L 1_ _L\ _____Counter~ ___ J 1 1

\ 1<--2 bytes--->\<------4 bytes------~->I<------32 bytes------>1 1 \ 1 L\ ______~ ______J 1 Figure 26. Statistical Data Record Format

Channel and Device Address (2 bytes) Counters (32 bytes) contains the address of the unit asso­ contains sixteen 2-byte counters. ciated with this particular statisti­ Each 4-bit counter within the statis­ cal data record. tics table of the I/O supervisor is expanded to a 2-byte counter on the statistical data record. Device Type (4 bytes) contains an encoded device type field for the device associated with the These sixteen counters are the summar­ statistical data record. The field is ies of the 4-bit counters and provide the same as the UCB device type field. a device error history.

90 RECORD ENTRIES

The record entry area starts on the next consecutive track after the last statistical data record. The OBR writes into it I/O outboard fixed-length record entries containing information pertinent to the type of device in error.

A record entry has the following characteristics: • Creation. The area is allocated by the SYS1.LOGREC initialization program and each record is created and written by OBR.

• Storage Area. The record entries reside on the system residence device.

• Size. The length of the record entry area is fixed for each type of system residence device. It depends upon the number of tracks required to receive approximately 100 I/O outboard record entries.

• Format. The format of a record entry is shown in Figure 27.

r------~------, 1 1 1 1 1 1 1 1<------4 by tes------> 1<1 byte>lI<--2 bytes--->1 1 I r------T------T------T------T------T- 1 liS E Rib INot UsedlRE Type 1 Not Used 1 1 1 L ______~ ______~ ______~ ______~ ___ ------~- 1 ------T------T- 1 Date I Time I 1 ------~------~- 1 ------T- I ______•.Program ______Identification ______.L-1 1 ------T-First CCW I ------~------.------T-Failing CCW 1 ------T------T------~- Not Used 1 . csw 1 ------~------~------T------T-Sense Bytes 1 Unit Address 1 ------~------~------'------T-Last Seek Address 1 1 ------~- 1 ------~-----T------T- 1 Volume Label 1 Not Used 1 1 ------~------~- 1 ------, I ______Device Type J 1 1 1 1<------8 byt-es------> 1 1 1 1L ______J Figure 27. Record Entry Format

Appendix D: System Environment Recording Output Data Set Format 91 Record Entry Label (3 bytes) lOB addressed by the request element contains the record entry 10 field of provided by the IBM-supplied error the EBCDIC characters "SER." The routine. label 'identifies the record as a dynamic error environment output record of OBR, SERO, or SER1. Failing CCW (8 bytes) contains the failing CCW within the System Identifier (1 byte) channel program as computed from the contains a blank. This field iden­ CSW command address stored in the lOB. tifies the SER routine (OBR) that wrote the record. The identifier for CSW (8 bytes) SERO is 0, and SER1 is 1. contains seven bytes of the CSW (the first byte is not available), stored Record Entry Type (1 byte) by the I/O supervisor in the lOB for contains an EBCDIC character identify­ the I/O request. ing the type of error that caused the record to be written. The characters Sense Bytes (6 bytes) are: contains the sense information stored CPU machine check (C) by the I/O supervisor in the UCB Channel inboard error (I) representing the device in error. I/O outboard error (0) Channel and Device Address (2 bytes) Date (4 bytes) contains the channel and device contains the current date in packed address for the failing device as decimal format (OOYYDDDZ) as specified specified in the UCB representing that in the CVT. device. Time (4 bytes) Last Seek Address (8 bytes) contains the current time of day after contains the last seek address, as conversion of the pseudo-clocks to specified in the lOB, for a failing binary format. direct-access device. Program 10 (8 bytes) Volume Label (6 bytes) contains the prog~am identification as contains the volume label when the specified in the request block for the fai'ling device is tape or direct- program in progress at the time of the access. error. Device Type (4 bytes) First CCW (8 bytes) contains the device type field as contains the first CCW in the user's specified in the UCB for the device in channel program a~ specified in the error.

92 Abnormal termination Bus out check 39-46 see ABTERM routine interface Busy, CSW status bit ABTERM routine interface 36 see channel status word ABTERM service routine 36 Byte device 33 Access arm 16-17 movement of 22-25 Catastrophic errors Access methods 8 definition of 11,29-30 Action code 49 handling of 36,29-30 Active request element 16 occurrence of 27,34,51 definition of 29 CAW example of 85 see channel address word Adcon CCW see address constants see channel command word Address constants CCW list 12-13,63 in appendage vector table 60 retry 38 in error interpreter 38-39,48 see also channel program Address markers 48 Chaining 38,63,82 AEQ Channel see asynchronous exit queue address 72 AEQ purge subroutine 53 available 32 Algorithm enabling of 32,56 see UCB lookup algorithm end 11,30,27 Alternate track procedures 45,47 restart 11,32-33 ALU check 46 search 6,32 Appendage vector table 10,60 Channel address word 24-26 Appendages 10 Channel command word 24-26,34 abnormal end 31 in error 38,45,58 channel end 30 valid sequences 47 end-of-extent 26 Channel mask 32,56 PCI 30 Channel 9 42,57 start I/O 26 Channel program 10 Assembly time 7,57 chained 38,45,63 Asynchronous 35 completion 11,28-30 Asynchronous exit queue 53 execution 26-27 ATNTAB initiation 10-11,23-26 definition of 73 interruption 28 use of 34,55 purged 35-36,37 see also attention table; unit control related 13,24,36,64 block retry 37.,..38 Attention Channel program description bits 18,38 interruptions 15 definition of 63 routines 15,34-35 Channel search module address 56 address of 55 Channel status word 29-31,34,64,79-80 table 15., status bits 38-39.79-80 format of 55 attention\ Available request element 15-16 see attention example of 85 busy 27,31 chaining check 31,58 Bell, console 39 channel control check 11,29-30 BLKCT 57-58 channel data check 11,29-30 Block count channel end 11,30,27 definition of 57-58 control unit end 11,27,29-30 updating 18.,31 device end Block count increment amount see device definition of 65 incorrect length 31 resetting 18 interface control check 11,29-30,. use 31,58 program check 27 Block size, tape 43 program-controlled interruption 11 Build area 52 protection check 27 Burst device 32-33 status modifier ,11,31,34,72 indication of 73 unit check 11,27,31,34,39 request for 23 unit exception 31

Index 93 Channel switching 86-87 ECB Channel table 14 see event control block format of 56 ECB code 64 Channel tag line check 46 Enable/disable 16 Channel 12 57 End-of-cylinder 47 Check subroutine 53 End-of-extent 25-26 Command chaining Enqueue module address 61 see chaining Enqueuing 21-23 Command reject 39-46 Entry flag 38,82 Communications vector table 16 Equipment check 39-46 Complete bit 62 ERREXCP macro-instruction 18,20,38 Completion Error counts 65 see channel program Error flags 57-58 Completion code 36,62 Error indicators 38 see also ECB Error interpreter 38-39 Condition code 26,38,,64 Error key 35 Console alarm routine 39 Error messages Console bell 39 see messages Console typewriter errors 37,39 Error recovery procedures 24-25,35,37-52 Contents supervisor 35,38 Error routines 11-12,20,37-52 Control unit busy flag 31,72 entry to 35,58 Control unit end scheduling 36,81 see channel status word ERRTAB Counters definition of 73 see statistics counters use of 35-36,81 CRC Event control block 13 see cyclic redundancy check format of 62 Current cylinder address 22-23 Exception bits CVT DCB 18,38 see communications vector table definition of 57 Cyclic redundancy check 25,44,45,64 lOB 31,38,39 Cylinder address 22-23,60 definition of 64 Cylinder switching 45,73 EXCP macro-instruction 18 exit effector 35,81 Data chaining 73 extent 25,60,65 see also chaining Data check 41-46 FIFO queuing 17,21,22 Data control block 12-13,57 File mask 25,60 Data converter check 45 File protected 48 Data extent block 12-13,,57,58,59 First request 66 Data record 43 Flag byte check 48 Date 52,92 FLIH 8,9,18,28 DCB Freelist 16,85 see data control block Freelist pointer 16,85 DEB see data extent block Halt I/O 53,58,64,72 DEBAD 57-59 Header record 51-52 Defective track procedures 45,47 Head register 25 Dequeuing 21-23 Head switching 45.,47,73 Device address 72 IEAOOOA 49 available 32 IEAOOOI 49 end IECILKl 29 for seek 25,32 IECILK2 29 unsolicited 15,,30 IFBOOlI 52 type 73 IFB0031 52 table 14,15 IFB0041 52 format of 61 IFLGS DEVTAB 61,72 see error flags Disk arm seeking flag 25,32-33,,72 Immediate operations 26,27 Disk data transfer flag 26,32,72 Initial seek address 13,17 Dispatcher 28 Input/output block 13 Dispatching priority format of 63-65 see priority Intercept flags Dummy address UCB 24,72 definition of 16-17 lOB 62 example of 85 Internal component name 49 uses of 20,22,32 Intervention required 39-46

94 Invalid sequence 47 Program check lOB see channel status word see input/output block Protection tag 60 lOB flags 39-40 Pseudodisable 20 I/O address 14,29,72 PSW 18 , 28, 36 I/O FLIH 28 Purge I/O interruption 11 completion 36 analysis 29-31,79,80 options 53 pending 32 posting 54 I/O purge 35-36 Purge chain I/O purge routine 20 DEB 24,25,53,60 I/O request system 36,37,60 see channel program user 60 I/O supervisor transient area 7,12 Purge complete subroutine 54 Purge flag 54,64 K 29,70 PURGE macro-instruction 53-54 Pushup queue 17 L 29,70 Last available 16 QSAM 40 Last request 66,73 Queued request element 16 Last seek address field 23,73 example of 85 LCHTAB 66,73 Queuing 17,21-23 Link field 16,67 Quiesce 54,64 Log out 51-52 Logical channel 86-87 Record entries 51-52,89,91 Logical channel queue 16,22 Related queue 23 example of 85 Related request Logical channel word 16,66 see channel program Logical channel word table 14,16,66 Repositioning disk 45 Machine log out area 51-52 tape 24,26,44 Messages 39,48-49,52 Request block 53 message text 49 Request block subroutine 53 Mixed chaining Request element 15-16,20 see chaining format of 67 Modifier byte 24,26,63-65 Request element table 14,15-16 Modules 8-9,84 example of 67 Multiplexor channel 16,21,32-33,86-87 format of 67 Restart address 38,65 Next available 16,20 RESTORE macro-instruction 53-54 example of 85 9-track tape 24,45 Safety field 89 Noise 43-44 Scratch field 34,66 SDR 50-52 OBR 50-52 SDR interface 50 OBR interface 50 Secondary queue 23 Open routine 26,57 Seek 25-26 Operator intervention 28,39,49 end 32 Option 4 20,67 initiation 25,33 Ordered queuing 17,21,22-23 overlap 33 Ordered seeks 22 stand alone 25,32 outboard error 50-52 start data transfer 25-26,32 Outboard record 91 Seek address 22-23,17,65 Overflow incomplete 45-46,48 Seek check 45,47 Overflow record 46 Seek overlap Overrun 23,32-33,42,45-46 see seek Overrunable 33,73 Seek queue 16-17,22 example of 85 Paper tape reader 43 Seek queue control word 17,22,32,33 PCI 11 format of 73-74 Permanent error 36,39 Selector channel 16,21,32-33,86-87 Post 72 Sense 34 Post routine 36 Sense area 64 Posting 13,28,38 Sense bytes 39-48 Primary queue 23 Sense command 11,14,34 Printer overflow 57 Sense flag 34,64 Priority 20,22,34,60,67 Sequential cylinder 45 Priority queuing 17,21,22 SER 11,30,36,50,88

Index 95 Y28-66l6-l

SER disk area 52 TIC command 24,26 SER output data set 52 TIO instruction 25,34,39 format of 88-89 Track condition check 45,47 SER recording area 52 Track overrun 47 SERO 52,92 Transient 35-36 SER1 52,92 Transient areas 7,8 Serial number 49 Trapcode module address 61 Serializer/deserializer check 46 Try again 32 Set file mask command 24,25 Type bar 42 set mode command 24 Type 3 SVC 53 SIO instruction 26,34,39 with error 38 UCB SIRB 35 see unit control block Split cylinder 45 UCB busy 72 Stand alone CCW 24,25 UCB condition test 20 Standard message code 49 UCB ID 72 Start address 18,64 UCB intercept flag 24,30,62,72 Start I/O module address 61 UCB lookup 28-29 Start/restart flag 64 UCB lookup algorithm 29 STATAB 69,73 UCB lookup table 14 statistical data records 15,39,51-52 format of 70 format of 90 use of 29 Statistics counters 15,39,49-50 UCB not-ready 72 format of 68-69 UCB purge subroutine 53 Statistics table 14,15,49-50 unit address 72 format of 68- 69 Unit check work area 50 see channel status word Statistics update 34 Unit control block 13-14 Status bits address of 29,60 see channel status word format of 71-74 Status modifier Unit name 73 see channel status word Unrelated flag 18,24 Subchannels 86-87 definition of 64 SVC FLIH 18 Unselected status 46 SVC int.erruptions 8,9 Unsolicited device end interruption 15,30 SVC library 35 Unusual conditions 11,28 SVC transient area 7,8,12,54 SYS1.LOGREC initialization program 52,88 Validity checking 19 Tape block count Wait bit 36,62 see block count WAIT macro-instruction 36 Tape record 43 Wait state 11,39 Tape unit switch 71-72,87 Word count zero 45 TAU 25 WTO macro-instruction 48 TCB identification 20,67 TCH instruction 21 12* Temporary errors 48,68-69 see request element table

International Business Machines Corporation Data Processing Division 112 East Post Road, White Plains, N.Y. 10601 [USA Only]

IBM World Trade Corporation 821 United Nations Plaza, New York, New York 10017 [International] READER'S COMMENTS

Title: IBM System/360 Operating System Form Y28-6616-l Input/Output Supervisor Program Logic Manual

Is the material: Yes No Easy to Read? Well organized? Complete? Well illustrated? Accurate? Suitable for its intended audience?

How did you use this publication? As an introduction to the subject For additional knowledge Other ______fold

Please check the items that describe your position: _ Customer personnel _Operator _ Sales Representative _ IBM personnel _ Programmer _ Systems Engineer __ Manager _Customer Engineer _Trainee __ Systems Analyst _ Instructor Other______

Please check specific criticism(s}, give page number(s} ,and explain below: ___ Clarification on page (s) __ Addi tion on page (s) 1iI --- Deletion on page (s) S - Error on page (s) H to> Explanation: z o ~ Eo< ::> ()

fold

FOLD ON TWO LINES,STAPLE AND MAIL No Postage Necessary if Mailed in U.S.A. Y28-6616-1 st.

fold r------, I FIRST CLASS I I PERMIT NO. 81 I I I IL ______POUGHKEEPSIE, N.Y. JI r------, I BUSINESS REPLY MAIL I IL- ______NO POSTAGE STAMP NECESSARY IF MAILED IN U.S.A. J I 111111 111111 POSTAGE WILL BE PAID BY 111111 IBM CORPORATION P.O. BOX 390 111111 POUGHKEEPSIE, N. Y. 12602 111111 ATTN: PROGRAMMMING SYSTEMS PUBLICATIONS 111111 DEPT. D58 111111

------~------. fold

International Business Machines Corporation Data Processing Division 112 East Post Road, White Plains, N.Y.I0S0l [USAOnlyj IBM World Trade Corporation 821 United Nations Plaza, New York, New York 10017 st [International j