GY20-0590-1

Type 111

Control Program-67 /Cambridge Monitor System(CP-67 /CMS) Version 3.1
Program Number 3600-05.2.005
CP-67 Program Logic ManualThis publication describes the internal logic of the
CP-67 (Control Program-67) system. The system
consists of a Control Program that creates a multiprogramming, time-sharing environment by providing
virtual machines for users to run their own operating
systems concurrently with other users. This manualis directed to personnel who will be responsible for the
maintenance and modification of CP-67.

Class A ProgramPRE.FACE
The following documents are referenced
Manual:in the CP-67 Program Logic

Functional Characteristics and Principles of Operation
IBM System/360 Model 67: Functional Characteristics,

A27~2719

IBM system/360 Principles of Operation, A22-6521
Assembler
IBM OS/360: Assembler Language, C28-6514
IBM OS/360: Assembler(F}

Programmer's Guide, C26-3756

The following documents provide further information on CP-67:
CP-67/CMS User's Guide,

GH20-0859

CP-67 Operator's Guide,

GH20-0856

CP-67/CMS Installation Guide,

GH20-0857

CP-67/CMS System Description Manual,
CP-67 Program Logic Manual,GH20-0802

GY20-0590

CMS Program Logic.Manual,

GY20-0591

CMS SCRIPT User's Manual,GH20-0860

CP-67/CMS Hardware Maintainability Guide,

GH20-0858

CP-67: Operating Systems in a Virtual Machine, GH20-1029
Second Edition {October 1971)
This edition is a major revision of, and obsoletes, GH20-0590-0.
This Type III Program performs functions that may be fundamental to the operation and maintenanceof a system.
It has not been subjected to formal test by IBM.

Until the program is reclassified, IBM will provide for it: {a) Central Programming Service, including
design error correction and automatic distribution of corrections; and {b) FE Programming Service,including design error verification, APAR documentation and submission, and application of Program
Temporary Fixes or development of an emergency bypass when required. IBM does not guarantee
service results or represent or warrant that all errors will be corrected.
You are expected to make the final evaluation as to the usefulness of this program in your own
environment.
THE FOREGOING IS IN LIEU OF ALL WARRANTIES EXPRESSED OR IMPLIED, INCLUDING,
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESSFOR A PARTICULAR PURPOSE.
This edition applies to Version 3, Modification Level 1, of Control Program-67/Cambridge Monitor
System {3600-05 .2.005) and to all subsequent versions and modifications until otherwise indicated in
new editions or Technical Newsletters.
Changes are continually made to the information herein. Therefore, before using this publication,
consult the latest System/360 SRL Newsletter{GN20-0360) for the editions that are applicable andcurrent.
Copies of this and other IBM publications can be obtained through IBM branch offices.
A form has been. provided at the back ofthis publication for readers' comments. If this form has been
removed, address comments to: IBM Corporation, Technical Publications Department, 1133 Westchester
Avenue, White Plains, New York i0604.

TABLE OF CONl'ENTS

Section 1: Introduction to CP-67
Machine configuration
Virtual computers
T~es~r~g

Program States
PagingReader/Printer/Punch Input-Output
Other Input-Output
Section 2: Method of Operation
system Setup Operations
Cylinder Allocation
Establishing User Directories
Additional Control Statements
USER Statement Processing
CORE Statement Processing
UNIT Statement Processing
OWN Statement Processing*EOU* and *EOD* Statement Processing
System Backup Operation
Control Program Initialization
CHKPT Program
CPINIT ProgramCore Table Initialization
Allocation Table Chaining
Attaching a User to the System
IDENTIFY Routine
CONSINT Routine
LOGON Routine
UTABLE Initialization
Segment Table Creation
swap Table creation
Virtual I/O Block Creation
User Accounting Statistics
Processing control Program I/O Requests
Real Multiplexer Channel I/O Operations
Card Reader Interruption
Printer or Punch Interruption
Real Terminal I/O Operations
Read from a Terminal - RDCONS
Write to a Terminal - WRTCONS
Stack or Start Terminal I/O Requests - STCONSIO
Processing Terminal I/O Interruptions - CONSINT
Real Selector Channel Operations
Initiating Selector Channel I/O

(

1
1
3
4
4
5
9
9
11
11
12
13
13
13
14
14
14
14
15
15
15
18
23
23
25
25
27
27
28
29
30
30
33
33
35
37
37
38
38
40
42
44
45
45

Processing Selector Channel I/O Interruptions
Processing of I/O Errors - IOERROR
Processing User Selector Channel I/O Requests
Program Interruption Handler - PROGINT
Privileged Instruction Simulator - PRIVLGED
Virtual Machine I/O Executive Program - VIOEXECCCW Translator - CCWTRANS
CCW Untranslator - UNTRANS
ccw Return to Free Storage - FREECCW
Virtual I/O Request Queueing Routine - QUEVIO
Virtual Channel Interruption Handler - VIRA
Routine to Analyze and Record Errors - RECERROR
Main Dispatcher and Control Routine - DISPATCH
Processing User Multiplexer Channel I/O Requests
SIO on a Virtual Multiplexer Channel
TIO on a Virtual Multiplexer Channel
TCH on a Virtual Multiplexer Channel
HIO on a Virtual Multiplexer Channel
Pseudo Timer Device - TIMR
Processing Dedicated Multiplexer Devices
Processing Virtual 2702 Lines
Processing a DIAL Request
Virtual RPQ's
Interruption Handling
SVC Interruptions
External Interruptions
Program Interruptions
Paging Interruptions
Privileged Operation Interruptions
The Diagnose Instruction
Machine Check Interruptions
Machine Check Error Recording Routine - MCKERRInterruption Reflection
Main Storage Management (Paging)
Required Page in Core
Required Page Not in Core
Required Page in Transit
Obtaining Core for a Paging Operation
Reading a Required Page into Core
Returning Control
Shared Pages
Free Storage Management
Execution control
Queue Management'Real Timers'
Handling cf a Virtual 67
Control Blocks ·Different Format of the PSW
Reset Function
New Instructions

48
48
48
49
49
49
54
58
59
59
63
63
64
70
75
78
78
79
79
79
80
82
83
84
84
87
89
91
93
93
96
96
98
100
100
100
101
101
102
103
103
103
105
107
109
111
111
112
112
112

Handling Virtual Dynamic Address Translation
Virtual 67 Restriction
console Functions
Console Function Subroutines
Console Function Descriptions
ACNT
ATTACH
BEGIN
CLOSE
DCP
DMCP
DETACHDISABLE
DIRECTDISCONNECTDISPLAY
DRAIN
DUMP
DUMP
- - ENABLE
EXTERNAL
IPL
IPLSAVE
KILL
LINK
LOCK
LOGIN
LOGOUT
MSG
PURGE
QUERY
READY
REPEATRESETSEI'SHUTDOWN
SLEEP
SPACE
SPOOL
START
STCP
STORE
TERMINATE
UNLOCK
WNG
XFER
Section 3: Programming Conventions
Maintenance
Assembly Deck Format

113
116
117
118
120
120
121
122
123
124
125
126
127
128
129
130
132
133
134
135
136
137
138
139
140
142
143
144
145
146
147
149
150
151
152
154
155
156
157
158
159
160
161
162
163
164
165
165
165

Equivalence Packages and Control Block Definitions
CP-67 Device Codes
CP-67 Equate Package - EQU67
Definition of Statistics Counters in CP Core
Subroutine Conventions and Register Usage
System Macro Usage
BAS, BASR, LMC, STMC, and LRA
CALL

165
167
168
171
173
174
174
175

ENTER and EXIT
GOTO

176
177

TRANS

178

section 4: Tables and Control Block Formats
ALLOC
CC"WPKG
CORT ABLECPEXBLOKCPFDENTCPFFDBLKCPFRECRD
EXTUTABI OT ASKLOGCDATALOGIDATALOGMDATAMD ENT

MR DEB LOKMRIBUFFMVDEBLOKMVIBUFFPAGTABLE
RHEADR and RCCWLISTRCHBLOKRCUBLOKRDCONPKG
RD EV BLOKRECBUFSAVEAREASEGTABLE
SFBLOK
SWPTABLE
TR EXT

UFDENTUT ABLE

VCHBLOK
VCUBLOKVDEVBLOK

179
181
183
184
185
186
187
188
189
190
192
192
193
195
196
198
200
202
204
205
206
207
208
209
211
212
213
214
215
216
218
219
224
225
226

,,

----

Section 5: Subroutine Descriptions
System Modules
ACCTONACNTIME
ACNTOFF
CCWTRANSCF SC OMCFSDBG
CFS IPL
CFS MAINCFSPRVCFSQRYCFS SETCFSSPLCF STACHCHKCUACT
CB.KPTCONS INTCONVRTCPCORECPFILECPI NITCPSTACKCPSYM
DEDICATE
DIAGDSKDIALDISPATCHDSKDUMPEXTENDFREE
IOERRORIOI NTIPL
LINK
LOGFILESLOGIN
MRIOEXECMVIOEXECPACKPAGEGET
PAGTR
PAGTRANSPR IV LG EDPROGINTPSAQUEVIORDCONSRD SCAN

,,

.!(·

227
227
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
250
252
253
255
256
257
258
259
261
262
264
265
266
269
271
272
273
274
275
276
277
279
280
281
282
284
285
286
288
289
290

REC FREERESINT
SAVECP
SCAN UNITSCHEDULESCREDATSTCONSIOTMPSPACE
TRACERUNSTIOUNTRANSUSERLKUP
USEROFF
VIOEXECVSERSCHWRTCONS
Utility Modules
BUZZARD
DIRECT
FORMATSAVESYS
VD UMP
Appendix A: Save Areas
Appendix B: Register Usage
Appendix C: Core Layout
Appendix D: CP-67 ABEND
Appendix E: CP-67 Measurement Hooks
Appendix F: CP-67 Control Blocks
Appendix G: Alphabetical Listing of System Modules
by Entry Point

291
292
293
294
295
296
297
298
299
300
302
303
304
306
307
308
310
311
312
313
314
315
316
317
318
320
321
323
324

LIST OF FIGURES AND TABLES

Figure1 Sharing Storage Among Concurrent Users
2 Page Swapping
3 Paging Operation
4 Tables and Files created by DIRECT
5 CP-67 CHKPT
6 CP-67 Main Storage
7 CP-67 CPSAVE
8 CP-67 CPINIT
9 Chaining of Allocation Tables and Real Device Blocks
10 CP-67 Overview of Attaching a User to the System
11 LOGON Tables
12 Virtual Addressing
13 Virtual-Real I/O Blocks
14 CP-67 I/O Interrupt Handler
15 CP-67 ~..RIOEXEC
16 CP-67 RDCONS
17 CP-67 WRTCONS
18 CP-67 STCONSIO
19 Processing Real Selector Channel I/O Tasks
20 CP-67 VIOEXEC
21 CP-67 MVIOEXEC
22 CP-67 CCWTRANS
23 CP-67 QUEVIO
24 Virtual SIO Selector Channel
25 Virtual SIO MPX Channel (Nondedicated Punch or Printer>
26 Virtual SIO MPX Channel (Nondedicated Reader>
27 Real SIO MPX Channel (Punch or Printer>
28 Real SIO MPX Channel (Reader)
29 Real Terminal SIO (Write)
30 Real Terminal SIO (Read)
31 Virtual Terminal SIO (Write)
32 Virtual Terminal SIO (Read)
33 Processing a Virtual 2702 Line
34 CP-67 SVC Interrupt Handler
35 CP-67 External Interrupt Handler
36 CP-67 Program and PRIVLGED Interrupt Handler
37 CP-67 PAGTRANS
38 CP-67 Machine Check Interrupt Handler
39 Processing and Reflecting of Interrupts
40 State Representation of Scheduling Algorithm
41 CP-67 Dispatcher Scheduling Algorithm
42 Virtual 67 - Monosegment Machine

(

6
7
8

12
17
19
20
21
24
26
28
30
31
34
36
39
41
43
47
50
52
55
60
62
66
67
68
69
71
72
73
74
81
85
88
90
92
97
99
110
111
114

43 Virtual 67 - Multisegment Machine
44 CP-67 FREE
45 CP-67 UNSTIO
46 CP-67 Real Low Core

115
268
301
319

""--

Tables123Summary of Access Allowed to DASD Devices by LOGON
Summary of Access Allowed by LINK
system Modules with Entry Points

32
141
231

SECTION 1: INTRODUCTION TO CP-67
CP-67 is a Control Program designed for execution on an
IBM System/360 Model 67. Its objective is to create anenvironment in which many users can simultaneously perform
work and in which each user can perform his own work under
the supervision of the programming system of his choice. It
achieves its objective by generating a "virtual computer"for each user and by sharing the resources of the realcomputer (CPU time, main storage, etc.) among the virtualcomputers for all users that are concurrently logged into
the system.
When a user identifies himself from a terminal, theControl Program "creates" for his personal use a virtualcomputer from a predefined configuration.
(Before thesystem becomes available to users, the systems administrator
defines the configuration of each user's virtual machine.
He may define different configurations for different users.)
To the user, his virtual computer appears real and he uses
it as if it were. The Control Program also provides, as partof thevirtual computer, commands thatparallel thefunctions of the buttons and switches on an operator's
console. The user issues these commands from his terminal,
and, thus, the terminal becomes a pseudo-console for his
virtual machine.
After the control Program has created the virtualcomputer, the user equips it with the programming systemthat gives him the desired functional capabilities. He does
this by issuing a command from his terminal. CP-67 is
designed so that the user can run the programming system(for example, Operating systero/360) of his ·choice on his
virtual computer. The user who desires a terminal-oriented,
conversational programming
system that allows
him todirectly monitor his work will choose CMS.

MACHINE CONFIGURATION
Devices Supported by CP-67
CP-67 is structured to run on an IBM System/360
The minimum machine configuration for CP-67 is:Model 67.

2067-1 or 2067-2 Processing Unit
Recommended feature:#4434 Floating Storage Addressing (Model 1 only>
2365
1052
1403

Processor Storage
Printer-Keyboard Model 1
Printer-

1 -2540 card Read Punch
3 2311 Disk Storage Drives or 2314 Direct Access Storage
Facility C2 drives minimum)
2400 Nine-Track Magnetic Tape Unit. 800 or 1600 bpi
2702 or 2703.Transmission control or
2701 Data Adapter Unit/

Terminals supported by CP-67 as
Machine Operator's console
1051/1052 Model 1 or Model 2 Data Communication System
Features and Specifications:
Data Set Attachment (#9114)
IBM Line Adapter (#4647)
Receive Interrupt (#6100 or RPQ E27428) required
Transmit Interrupt (#7900 or RPQ E26903) required
Text~Time-out Suppression(#9698) required
1056

card Reader Model 32741-1,-2 communication Terminals
Features and Specifications:
Data Set Attachment (#9114)
Data Set Attachment (#9115>
IBM Line Adapter (#4635, #4647)
Dial-Up (#3255) required
Receive Interrupt (#4708) required
Transmit Interrupt (#7900 or RPQ E40681)
Print Inhibit (#5501) desirable
Line control for teletypewriterwith the IBM Telegraph Terminal(8-level ASCII code at 110 bps) •.

requiredterminals C*> compatible
Control Type II Adapter

Transmission Control Units Supported
by CP-67
2701 Data Adapter Unit
Terminals---~-----

8-level ASCII.
110 bps*2701 Adapter-----------7885

2702

Transmission control
Terminal
Terminals
Control Base2741s. 1050
8-level ASCII.
110 bps*- 2 -9696 or 7935
9697 or 7935

Terminal
controlLine
Adapter

4615. 9684. 8200**
7912

3233
3233

2703

Transmission Control
Line Speed
Terminals
Option--------2741s,1050

,(

f:I

'(';

---------4878

8-level ASCII,
110 bps*

4877

Line
Set
3205/63205/6

Terminal
Control

Line
Bases

---------

4619,4696,8200****7905, 7912'(

* The customer is responsible for terminal compatibility
with this program.
IBM assumes no responsibility for the
impact that any changes to the IBM•supplied products orprograms may have on terminals provided by others.
** Feature 8200 on the 2702 is equivalent to the 2741 Breakfeature #8055 and the Type I Break RPQ E46765 on the 2702.
**** Feature 8200 on the 2703 is equivalent to the 2741
Break feature #8055 and the Type I Break RPQ E53715 on the2703.
Other Devices Supported by CP-67
Additional devices used by CP-67 are:
2301
2303

Drum Storage
Drum Storage

2870 Multiplexer Channel#6990, 6991, 6992 1, 2, 3

Selector Subchannels

Devices Used Only by an Operating system
in a Virtual Machine and not by CP-67
2321

Data Cell Drive

2400

Magnetic Tape Units

2250
2260

Display Unit
Display Station

2860 Selector Channel#1850 Channel-to-Channel Adapter
2780
1130

Data Transmission Terminal
Computing System

VIRTUAL COMPUTERS
A virtual computing system is a time~sharing systemthat provides greater flexibility of application to theuser.
A time-sharing system provides a set of software
facilities through which users share machine facilities: the- 3 --------7505

7505

extent of the software facilities available to a user
depends on how the system is defined.
A virtual computing
system simulates hardware f aci1ities that allow the user toload a software system (Operating system/360, for example>
that provides the particular facilities he requires: theuser - not the system - determines the facilities available
to him.
For each user, CP-67 creates a virtual computer which
is an exact replica of a System 360: a programmer at aremote installation can use the computing system as if itwere exclusively his. CP-67 accomplishes this by:
Scheduling and allocating main storage space, CPU time,and I/O devices to the virtual computers
Handling all interruptions
Protecting system
during execution

files, user programs, andKeeping statistics•real" systemon the use

user dataand performanceof theCP-67 can simulate a Model 65 or Model 67 (simplex, 24
bit addressing) computing system, capable of executing any
instruction except Diagnose.
For direct access storage devices, CP-67 will support
more than one "user" or virtual machine on a pack. This
concept is called "mini-disks".
Essentially, a virtual
machine is allocated a number of contiguous cylinders fromthe disk pack, and these cylinders can be located startingat any "real" cylinder address. A "relocation" factor and"boundary• number define the start and extent of a user's"mini-disk".

TIME SHARINGThe Control Program shares execution time in thecentral processing unit (CPU) among the virtual computers on
a demand basis and on a scheduled basis.
The Control
Program schedules and allots units of CPU time to thevirtual computers.
When a particular virtual computer has
used up its unit of time, the Control Program locates thenext "runnable• virtual computer and passes control to it
for a corresponding interval of time.
If the virtualcomputer currently in control must wait for some event, theControl Program gives control to another virtual computer
which bas demanded the CPU.

PROGRAM STATESWhen instructions- 4 -in theControl Program

CCP-67> arebeing executed, the real computer is in the supervisor
state: at all other times, when running virtual machines, it
is in the problem state. Therefore, privileged instructions
can be executed only by the control Program.
Programs
running on
a virtualcomputer canissue privileged
instructions: such an instruction causes an interruptionthat is handled by the control Program.
Under certain
conditions, the control Program
simulates the virtualprivileged instructions.

PAGING
Paging is the technique used by the Control Program toshare main storage among concurrent users. The objective of
this technique is to keep in main storage only thoseportions of each user•s program that are required at a given
point in time. This eliminates the need for the programmer
to externally segment each program into manageable units.
The units automatically used by CP-67 are 4096-byte blocks
called "pages".
By breaking programs into pages, mainstorage can be allocated in page increments, and pages canbe loaded dynamically for execution.
Thus, at execution
time, main storage holds only the active part of each user•s
program.
When a user starts his session, the control Program, asa result of an IPL operation (see the description of IPL
under "Console Function Subroutines• in Section 2) places
the user•s programming system IPL program into main storage.
The page is loaded into an available block of main storage
that starts on a page boundary. The page is not necessarily
loaded at the same relative main storage position as it
would occupy were the programming system running on a realcomputer. This is possible because of the dynamic address
relocation
abilities
ofthe Model
67.
<Referto
IBM System/360
Model 67:
Functional
Characteristics,
A27-2719.)
As the user•s program is executing, the hardware
dynamically converts references to relative addresses into
actual main storage addresses. When the program refers toan address in a page that is not in main storage, aninterruption occurs and the Control Program loads therequired page into main storage. Then execution continues
with the referenced addresses being dynamically relocated.
Because of the dynamic address relocation feature, thepages of a user program need not occupy contiguous locations
and may be scattered throughout main storage <see Figure 1).
Also, because of the high demand for main storage in a
multiple-user environment, the Control Program shares mainstorage among the active pages of the programming systems ofcompeting users.

- 5 -Secondary
Storage

Dormant
pages ofusers A,B, and C.

Active pages in main storage

FIGURE 1.

Sharing Storage Among Concurrent Users

Finally, when main storage is completely filled and it
becomes necessary to bring in another page, page swapping
occurs. An appropriate page of one user's program in mainstorage is written onto secondary storage and the required
page is brought into main storage in its place.
(If thepage to be replaced has previously been swapped, and has notbeen modified since i t was last swapped, it is not necessary
to write it onto secondary storage because a copy alreadyexists there.) When the particular page that was replacedis again required, it is obtained from secondary storage andswapped with one that is in main storage Csee figure 2).

- 6 -Main storage
PagingArea

overflow

Main
StorageFirst reference
Originto page

Swapped pageneeded again

FIGURE 2.

Page Swapping

The following list contains
drums and disks used for paging.

somestatistics on

thePaging Devices

I
I
I
I

2301
2303
2314
2311

4096 bytes/record
4096 bytes/record
829 bytes/record.
5 records/page829 bytes/record.
5 records/page

9 records/2 tracks
1 record/track
15 records/2 tracks
4 records/track

The following are guidelines for the number of cylinders
required for paging virtual memory.
Note that CP-67 does
not allocate pages for virtual memory until each page has
been referenced.
When the first page is referenced. theaddress of the swapping area is put in the swap table.
These guidelines represent the total number of cylinders
required if all the pages of 256K virtual memory arereferenced.
Virt Memory Size

256K
256K

Device Type

2311
2314

Number of Cylinders Requiredfor Paging
8
3

(
-

7 -

"z:I
.....
l.Q
c:

(X)

11

Virtual Program

VirtualMachineHardware
ChannelandDevicePage relocation exception
program interrupt(!>

w

PagingDevice

l.Q

.....
<
(!>

1/0 interrupts
from reading a page

Ul

Control Program__ _!)~!'._A_!£'i. __Attempt to dispatch
this user should
be runnable now

PROGi NT
1ssuefi:!"Aiiislnacro - - - -IOINT
Lo~t;;° 1701-.;sk bi.;;;kPage in core go to DISPATCH

Process interrupts
Return to programthat created the
1/0 task, IOTASKTASKIRA
goto DISPATCH

Page not in corecall PAGE TRANSPAGETRANS(WAITPAGE)
Find user decrement
page wait countUpdate SWPTABLE
with keys
Release IOTASK block
Call CPSTACK

PAGETRANS~~E~ 1..Q .l_O~~ !QL_
Chain IOTASK to
RCHBLOKIf channel is free,call CHFREE

locate coretable entry
Set up PAGETABLE,
CORE TABLE, SWPTABLE
Create IOTASK block
Set up CCW's toread a page
Call QUERIO
Increment page
wait countOUEVIO (CHFREE)
If control unit isfree, issue SI 0

Set up CPROUEST(CPEXBLOK)
Chain CPEXBLOK
to IOTASK
Go to DISPATCH

llJ
::I

~

(!)

~.....
~0

DISPATCHCPSTACK

Process CPROUEST
back to PROGINT.
TRANS macro isreexecuted

Put CPEXBLOK
in CPSTACK(CPROUEST)

Hi

s:
(!>

~

llJ

l.Q

.....

::I

l.Q

0

~

~

llJ

rt"
.....
DISPATCH
Page wait is on
for this user
Dispatch another user

FIGURE 3.

Paging Operation

0::I

READER/PRINTER/PUNCH INPUT-OUTPUT
The Control Program simulates card readerr punchr andprinter operations requested for programs running on virtualcomputers by using a spooling operation to simulate multiple
virtual unit record devices. If a program running on a
virtual machine is to process a card filer that file mustfirst be submitted to the machine-room operatorr headed by acard identifying the user for whom it is intendedr andentered by the operator into the system. When the operator
enters the file
(through the real card reader> the Control
Program converts it to a disk file which is associated withthe corresponding virtual computer.
Thenr when a program
running on that virtual machine issues a start input-output(SIO) instruction to the virtual card readerr the Control
Program intercepts itr takes the appropriate card image fromthe disk filer and makes it available to the program in thesame manner as the real card reader would. This process isrepeated for each subsequent operation directed to thevirtual card reader.
This process works in reverse forpunch and printer operation. When a program on a virtual
machine wishes to create printer or punch outputr it issues
successive SIO operations to its virtual printer or punch.
The Control Program intercepts these attempted input-output
operationsr obtains the print line or punched card imagesr
and creates a disk file from them. The disk file is thenprinted or punched on the real devices at a later time when
the device is available for use.

OTHER INPUT-OUTPUT
Other input-output
operations issued
by programs
running on a user's virtual machine are converted to real
input-output operations by the Control Program. Translationconsists offour major
steps:
Cl>
device addresstranslationr(2)commandsequencetranslation
withappropriate
pagingoperationsr(3)
schedulingtheinput-output operation on thereal hardwarer and (4)receiving and properly reflecting the interrupts returningfrom the input-output operation after being started.

(

During device address translationr the Control Program
converts the virtual device address associated with the SIO
operation to its real equivalent.
This conversion isrequired because each virtual device has been mapped to an
extent or area on an equivalent device on the real computer
during system set-up operations. To illustrate how thisconversion worksr assume that the user has a virtual disk ataddress 190 and that this has been mapped to an extent
starting at cylinder 10 on a real disk whose label is
DISK01. Assume further that at system start-up time it has
been ascertained that DISKOl is currently mounted on realdisk drive 235. If a user program issues a write to cylinder
00 track 0 record 1 of the virtual disk 190r the Control
Program will intercept it and convert it to a write tocylinder 10 track O record 1 of the real disk at 235.
-

9 -

Conversion
similarly.

of

reads

from

virtual

disks

are

handledDuring commandsequence translation,
the Control
Program (via CCWTRANS) converts the channel command sequence
provided by the virtual machine into an equivalent realchannel command word list. This is required because virtualchannel command words can refer to contiguous virtual memory
space overlapping a page boundary. In the real machine,these virtual pages would not necessarily be in contiguous
real pages, and the channel command word involved must be
split Cvia the chain data feature) into two or more channel
command words which ref er to the real core addresses andwhich perform the same function. Thus the entire virtual CCW
sequence is translated into an equivalent sequence held in
free storage. The channel is then run off of the real
sequence.
Note that this isthe· source of a major
restriction in CP-67--channel command sequences may not be
modified while the input-output operation is in progress.
The modifications will not be reflected in real memoryr on
which the real channel is running.
If the ISAM
option has been chosen
during thegeneration of CPr and a virtual machine has been assigned
the ISAM option in the directory, certain self-modifying I/Osequences will be supported (specifically OS-ISAM).
The
channel program is scanned to determine whether any of thechannel command words modify other channel command words
withinthis I/O
sequence.
The
channel programisretranslated and reexecuted for each channel command wordthat modifies another channel command word within thechannel program.
(See "CCW Translator - CCWTRANS"
fordetails.)
The scheduling of the input-output operation is handled
by QUEVIO and CHFREE, which are discussed elsewhere. They
return to the virtual input-output executive CVIOEXEC) when
the operation is finished.
The interruption processing is provided by VIOEXEC
after initial processing by IOINT. The interrupts are
unstacked to the user in the same order as they would
appear in the real machine. UNTRANS is called to convert theaddresses returned in the channel status word <which referto the input-output string in real memory) to the virtual
addresses required by the user.

- 10 -

SECTION 2:

METHOD OF OPERATIONThis section segments CP-67 into its
and discusses each as an entity.

functional units

SYSTEM SETUP OPERATIONSBefore initializing the control Program, the DIRECT
stand-alone utility routine must
be used to allocate
cylinders between
permanent file space
and temporaryspooling and paging space.. It is assumed that the disk
packs involved have been formatted and labeled (via the
FORMAT utility) into the CP-67 format.
Input to DIRECT may be of two types: (1)control
statements
specifying
allocationof
DASD
cylinders(ALLOCATE) and (2) control cards defining a user's virtual
system (DIRECTORY). Figure 4 illustrates the relationshipsof tables and files created by DIRECT.

(- 11 -

System
Residence
Volume

Owned
List

...

•

User
Directory( U DIRECT)

SystemFile
Directory

FIGURE 4.

•

-.
User
MachineDescription
File

Tables and Files Created by DIRECT

Cylinder Allocation
DIRECT reads the allocation table from the volume
specified in the ALLOCATE statement and determines whether
temporary or permanent allocation is requested.
Temporary cylinder allocation (making the cylinders
available for temporary usager such as paging and spooling>is indicated by placing an x'OO' in the corresponding
allocation table entry.
Permanent cylinder allocation(making cylinders available for permanent file residence> isindicated by placing an x'Ol' in the entry. Cylinders to be
used as T (temporary> disk space are designated by an x'02'
while cylinders containing user directories are marked
x'04'.

- 12 -

At the end of an allocation run for a particular volume(indicated by an *EOA* statement>, cylinder 0 is permanently
allocated (for the allocation table itself and the label)
and an x'OF' is placed in the last allocation table entry.
Establishing User Directories
When a DIRECTORY control statement is read by DIRECT, asystem residence volume will becreated on the unit
specified in the control statement. The allocation table isread from the system residence volume, and the "owned" list
is initialized to contain the system residence volume. The
owned list, beginning with thefirst byte after the
allocation table, contains the VOLIDS of all volumes to beconsidered owned by the Control Program and available forpossible temporary allocation. The system residence volume
VOLID becomes the first entry in the owned list..
The "system file directory" is created; the system file
directory contains information (such as file name, volume
label, and device position of first record) for all files
used internally by the Control Program. An entry for the"user directory file" CU.DIRECT) is initially placed in thesystem file directory.
Additional Control Statements
After the owned list and the system file directory havebeen initialized,
additional control
statements which
identify users and configure their virtual machines areread.
The following paragraphs describe the processing
performed for each record type.
USER Statement Processing
USER statements supply identification and accounting
information for users of CP-67. Before a user directory file
entry is created for the USER statement, the user machine
description file must be opened, and the first four bytes ofa new machine description entry are reserved for the virtual
machine core size. Entries are created for USER statements
and written onto disk as records in the user directory file
CU.DIRECT). User directory entries contain the following
information for each user:
User's external identification
User's password
Accounting information(

User's machine description file name
User's privilege class- 13 -

User's priority
User's options
CORE Statement Processing
CORE statements define the size of core storage in thevirtual machine being defined for the user identified in thepreceding USER statement.
The core size desired must be amultiple of 8K <=8192) bytes and may be specified as either"nnnK" or "nnnM". The size is entered into the first four
bytes of the user's machine description record.
UNIT Statement Processing
UNIT statements define virtual devices in the virtual
machine being defined for the preceding USER card.
Thefollowing type of information is placed in the user machine
description file entry CMDENT) for each specified device:
Virtual device address
Device type
Device relocation factor for DASD devices
Device bound for DASD devices
Passwords and status information for device access
See the description of control block MDENT in Section 4for details.
OWN Statement Processing
OWN statements specify the VOLIDs of volumes to beconsidered "owned" by the control Program.
Each specified
VOLID is added to the "owned" list, which is retained after
the allocation table on cylinder O head O record 3 of thesystem residence volume.
An "owned" volume is any disk onwhich an allocation table bas been written; it contains user
files and/or temporary spooling and paging areas used by theControl Program.
*EOU* and *EOD* Statement Processing
An *EOU* statement indicates the end of a machine
description for a particular user.
A unique name isgenerated for the user machine description file (actually afloating point number starting at 1.0 and incrementing by
1.0 for each new file), and is placed in the correspondinguser directory entry. The user machine description file isthen written onto disk.

- 14 -

An *EOD* statement indicates the end of input for theuser directory
creation process.
Theuser directory
CU.DIRECT), the system file directory, and the system
residence volume allocation table are written onto the disk
to complete DIRECT processing.
Complete specifications for creating the user directory
are contained in the CP-67 Operator's Guide under "Directory
Allocation and Creation•.

System Backup Operation
The CMS Tape Dump command is designed for user virtual
machine back-up functions. The CMS programr CPDMPRSTr isavailable for both users and the operations departmentr to
back-up 2311 or 2314 disk packs--either minidisks or fullvolumes containing one or more minidisks of varying formats.
During dumps, if a bad track is encountered for which analternate track was assigned by the MINIDASD program, datafrom the alternate location will be written to the dump
volume. The restore function, however, cannot make such useof alternate track assignments; during a restorer a bad
track will cause a fatal I/O error.
The CPDMPRST program is modeled after
dump/restore utility program of OS/360.

the stand-alone

CONTROL PROGRAM INITIALIZATIONCHKPT Program
The IPL sequence reads the CHKPT program from the
IPL'ed disk into low core at location X'800'. The CHKPT
program performs the following functions:Examines the CPID word at X'1FC'. If the word contains"CP67" or "SHUT", the IPL is to a "warm" machine (thatis, CP-67 has been running, and accounting informationand spool file data is available in core); if the CPID
word contains anything else, a "cold" machine isassumed and the CHKPT program proceeds to the second
phase of initialization described below.
For a "warm" machine, the CHKPT program retrieves user
accounting datafrom theUTABLES andunpunchedaccounting
cards; gets
accounting fordedicateddevices; saves the system LOGMSG; saves spool filecontrol blocks for active printers and punches and all"closed• user spool files. The data is written on the
IPL'ed disk at the SYSWRM cylinder.
- 15 -

If the CPID word contains "CP67", the CHKPT program
proceeds to the second phase below. If the CPID word
contains "SHUT", shutdown messages are printed, andprocessing is completed.
The second phase of initialization involves reading the
SAVECP program and VOLID from the IPL'ed disk <records
2 and 3) into high core (X'25000') and transfering
control to the RESTORE function of SAVECP.
SAVECP (RESTORE function) reads the CP-67 nucleus fromdisk CSYSDNC cylinder) into
core from X'33D'
toX'25000'; control is transfered to the CPINIT program
now loaded at X'23000'.
See Figure 5 for a diagram of the CHKPT program operation.

- 16 -

Entermodule CH KPTentry CHKPT(IPL sequence reads 'CHKPT'
program from the IPL'ed disk
into core and XFERS control
to 'CHKPT'
No

Warm
Start

Yes

Set up programand machine
PSWS

Move 'Cold'
to IDENT
Issue HIO to
all real
MPX devices

Write accountinfo to warm
start cyl

Save
LOGMSG

Save
spooling
blocks

SIO to console'SYSTEM ACCTAND SPOOL FILES_._Y_es_ _<SAVED SYSTEMHUTDOWNCOMPLETE'

LPSW
WAIT

Move 'warm'
to IDENT

SIO to SYSRES
read SAVECP
program and
VOLID

o to
CPSAVERESTORE)FIGURE 5.

CP-67 CHKPT- 17 -

CPINIT Program
The CPINIT program performs the following functions: (SeeFigures 6, 7, and 8 for flowcharts of Main Storage, CPSAVE,
and CPINIT operation.>- 18 -

00

FREE LIST

,

//
i~

CP-67 NUCLEUS_J

SUBTABLE]

SIZE DBL WDS""'
SIZE DBLWDS

t----"I

CORE TABLE

100 SAVE AREAS
Sub pool
Allocation

'NEXT

i

l

SIZE

1

USER AREA..

EXTENDED PAGE,'......
NEXT

< ...

c

NEXT

0

<.

t '

Non-Subpool
Allocation>29 DBL WDS

I
J

T

J

0

J

0

I

.......

SIZE

~

.,)

SIZE

J

Figure 6. Flowchart of Main Storage Operation(- 19 -

Entermodule CPSAVE
entry restore

Read CP-67
nucleusfrom disk

Goto
CPINllFigure 7~-

20 -Flowchart of CPSAVE Operation

Entermodule CPINIT
entry CPINIT

Set upnew PSWS

Set dump unit
to printer(for CPINITABEND)

Clear CPUand channel

Logouts

Clear LOW
core

Set up allocationtables, owners list

Create andinitialize

and RDEVBLOK

the CORETABLE

of all CP volumes

Initialize
100 save
areas

Lock andmark CP
pages

•cp•

Set userpages tonot in use

Locate 1052
operators
consoleGet

emergency
consoleForce aninterrupt

No

Issue normal
start or restart
message tooperator

FREE (FRETR)
Set CPSTATUS
to IDLENo

Fret unused
part of last
CP page

Ring

alarm
nter CPlEMRG
from CONSINT
after INT

SIO sense to
IPLEO disk
(SYSRES)FREE

Obtain working
free storagearea

Set upoperators
UT ABLE
Set WARMGOLD=BO

FREE (FRET)

Load control
registers

LOGIN theSYS operator

No

Compute real

Select channelmachinecore sizefor right orleft GP. CONS.

LOGON
No

LOGON thesystemoperator
Yes

RUNITSGN
WAIT for 1/0
int from

SIO sense

Look forRD EV BLOK

IPLED device

Get addressof SYS RES

from intcode

Set GREG 4
for allenabledSet up allocation

Enable 1/0

interrupts
reset CFWBll

for operator

Issue nottable and
RDEVBLOK for
IPLED device.
Set OWNED and
SYSTEMfor devices inowner list andRead vol. ser.
of all avail.
real DASO
devices

Check real SYSGEN core
size issue
message. If not =mounted message
not mountedfFigure 8.

Flowchart of CPINIT Operation (1 of 2)

-21-

4

WRTCONS
Yes

Enter after msg.
turn on timer

UpdateClock

Get
MRDEBLOK

Issue msg.
'WARMSTART'WRTCONS

Get spoolingfile blocks

No

Messageturn on timer

No

RDR, PCH, PTR

Read accounting
info. fromGoto

WARM STARTDISPATCH

Set IDENT=CP67

Clear warm
start cyl

cyl.

WRTCONS

Messages forset dateand time

Chain accountcards toMREALIORDCONS

Read date
and timefrom console

Clear files
from chainsCale. disk
space needed
for a dump

TEMPSPACE

Read
LOGMSG

Chain
LOGMSG-Get-space-

Exit
to CONSINT

on diskfor dump

Set upspooling fileblock fordump

MRIOEXEC- Initiate
- -

Go to
DISPATCH

1/0

operations

I
I
WRTCONS

Msg.forstart

Read spooling
blocksRead start
parameters

Chain spooling
blocks toprinters, readers,or punches

LOGFILES---Count number ofclosed spooling file
entries ROR, PCH,
PTR

Issue msg for
number ofspooling file
entries

WRTCONS

Issue
shutdown
msg.

Yes

LPSW
WAIT

Set WARMCOLD=02

Set WARMCOLD= 02

Figure 8.
-22-

/
/

MCK error
recording CYL..Y!'_R!£0~

Set WARMCOLD=01/-FINDLOG- Sut up 1/0 and

4

Flowchart of CPINIT Operation (2 of 2)

Count numberof closedspooling file
entries ROR,
PCH, PTRl' 'Do yourthing CP ·-You're turnedon·-'Determines, byinitializing is
dump

examining the CPID
word, whether
on a warm machine after a disk ABEND

Loads the 360/67 control registers
Sets the new PSW's
Computes the real machine core size
Creates and initializes the CORTABLE at the end of theresident nucleus (size is determined by "real" machinesize)
Initializes 35 save areas forof the CORTABLE

CP-67 linkage at the end

Determines whether IPL'ed on left
possible duplex configuration

or right halfof aCalls FREE and FRFI' to obtain working free storage area
based upon "real" machine size
Creates control block for
and OWNED list

IPL' ea disk allocation table

Determines availability of all DASD devices defined in
the real I/O (RIO) configuration; reads VOLID of allavailable DASD devices; chains allocation tables of allavailable OWNed volumes
Locates 1052 system console and writes initialization
message; ifmessage fails,
rings
alarm, locatesemergency console,and initializes
for emergency
startupCalls LOGIN to log in the system operator
Checks the OWNED list for volumes not mounted and gives
messages
Checks core size for SYSCORE size; gives message if not
equal
Checks for timer in operation
Prompts operator to set datestartup parameters

and time andto specify

For a WARM start, reads the data from the SYSWRM
cylinder and restructures the LOGMSG and spool filecontrol blocks; chains the accounting information forpunching
Invalidates thestartup(SYSWRM data to avoid

future erroneousGets spooling space and control blocks for a disk dump-23-

Calls FINDLOG to initialize the error recording
Commences spooling output if any
Sets the CPID word to "CP67"
Runs the system
Core Table Initialization
The core table consists of a 16-btye entry for eachpage (4096 bytes) of real core.
Each core table entry will
point to a corresponding entry in the swap table, which isused by core management routines in paging.
The physicallocation of a page in real core is determined by the
relative location of its corresponding entry in the coretable; for example, the first core table entry corresponds
to the first page of real core. The core table entries forthe pages which contain the control Program are locked with
an identifier of "*CP*" to make them unavailable for paging
operations. The remainder of the core table entries are
initialized to X'OOFFFFFF'.
For a real machine with a 256K main storage, the unused
portion of the last Control Program page and six additional
pages are reserved as a Control Program work area. For each
additional core box, six more pages are reserved for thelarger expected number of users. The pages for free storage
are also locked and identified with "FREE".
Allocation Table Chaining
The address of the system residence VOLID and of theallocation table for the system residence volume is passed
to CPINIT by the routine SAVECP. The VOLID and allocationtable address are entered into the real device control block
CRDEVBLOK) for the system residence device.
Each additional real device control block is examined
to determine whether the corresponding device is mounted.
VOLIDs are read from all mounted devices and comparedagainst the entries in the OWNED list (obtained from thesystem residence volume). Allocation tables from all owned
volumes are read and chained according to device type.
Figure 9 illustrates the chaining of allocation tables
and their relationship to real device control blocks.

-24-System
Residence Volume(2311)
Allocation Table....

(2311)
Allocation Table_... ,r

.

--.-

~

•

•

-..

.

(2311)
Allocation Table

0

.-

.-

I l
1 l
OF

OF

I ,1r

OF

W RDEVBLOKRDEVBLOK•RDEVBLOKRDEVTYPE

RDEVALLN

T2311
T2314
T2301

~

(2301)
Allocation Table1--

1-------<~
1-~~~~---11"--~-------,,--~~-.---~~~>-------I..

(2301)
Allocation Table,1r~,___ _ _o_.

..

OF
OF

S

1

FIGURE 9.

RDEVBLOKIS RDEVBLOK

Chaining of Allocation Tables andReal Device Blocks.

(-25-

ATTACHING A USER TO THE SYSTEM(See Figure 10 for an overview diagram.)
IDENTIFY Routine
When the Control Program receives the initial interrupt
from a terminal(normally initiated by dialing in on adata-phone)
the IDENTIFY routine is entered.
IDENTIFY
performs the following operations:
Determines the terminal device type (1050 or 2741) andenters the type into the multiplexer real device block
CMRDEBLOK) •Writes to the terminal the message "CP-67 Online".
Places the address of the
BREAK routine
multiplexer interrupt return address (MIRA).
Puts the terminal
attention.

-26-

line

in a

state

to

in. thereceiveanHardware
Channeland Device

Console or
terminal
1/0 interrupts
from 270X and terminal

Control Program

IOINT

CONSINT (IDENTIFY)

Get MRDEBLDKLOGONInitialize UTABLE

Send breakGet users UTABLE
Call CONSINT
to processinterrupts for thedevice
MIRA= entry points
in CDNSINT

Initialize MVDEBLOK
for terminal device

Set device type in
MR DE BLOK

Prompt for USERID &password (calls to
WRTCONS & RDCONS)

Send break, write,
msg. 'CP-67 on line'
Send prepare-read

Go to dispatch

Initialize segment,
page & swap tables

Call LOGON

Initialize 1/0 blocks

Call BREAK

Type log msg.
(call to WRTCONS)

Get CCWPKG

See overview ofreal 510 terminal
write and read

In attention
call BREAKDISPATCH

If read edit andtranslate input line

Dispatch any user
If CFMAIN issued anormal read a CPRQUEST
is outstanding.
Process CPR QUEST
return to location
designated by CFMAIN{CON R ET) return
address in RDCONPKG

Call CPSTACKCFSMAIN (BREAK)

If more CCWPKG's get
next and issue SIO

Type 'GP' (call to
WRTCONS)

If no CCWPKG's issue
prepareIssue read to theTerminal(call to R DCONS)

CFMAIN (CONRETI

Scan input line
separate fields

CPSTACK

Test for valid
command and branch
to command routine

Put RDCONPKG in
CPSTACK - CPRQUESTDo the commandprocessing

Note:

Return from commandroutine determinedby command routine
Go to dispatch

During LOGIN 'CONS1NT' and 'LOGON' change
the return address in MR OE BLOK - Ml RA
for return entries into 'CONSINT' and 'LOGON'.
1 = Initial entry after dial-up Ml RA= IDENTIFY
2 = Entry after break

Ml RA= I DENT1

3=Entryafterwrite MIRA=SNDPRP
4 = Entry after prepare-read Ml RA= PREPCH K
DISPATCH

Dispatch any user

Figure 10.

5 =Normal entry after LOGIN MIRA= RTN41ND
for command processing.
Normal entry for operators console Ml RA= CONSI NT

CP-67 Overview of Attaching a User to the System-27-

CONSINT Routine
When the next terminal interrupt occursr the CONSINT
routine receives control Cvia MIRA). CONSINT is also enteredwheneverthe
input-output interrupt
handler
CIOINT)
determines that a terminal interrupt has occurred from therequest or attention buttonon the terminal. CINSINT
determines whether a user is logged on at the terminal; if
notr the LOGON routine is called to attach the new user tothe system.
LOGON Routine
Operations performed by LOGIN are:
Allocating and initializing thetable (UTABLE).

primary user

control

Checking the user's external identification CUSERID)
and password against entries in the user directory.
Allocating and initializing the segment table,table, and swap table for the user's machine.
Allocating the UTABLE extension
virtual machine is a Model 67.
Creating virtual I/Ovirtual machine.

blocksto(EXTUTAB)
describe theMapping virtual devices to real devices byvirtual device blocks to real device blocks.

page

if

the

user'schaining

Figure 11 indicates the relationships of tables created by
the LOGIN routine. When LOGIN functions are completed, theuser is placed in console function mode with a read on his-28-terminal by CONSINT calling BREAK.

UTABLE

Page Table

SEGTABLE

SEGTABLE

Page Table
EXTUTABMultiplexer
Virtual
Device Block

VirtualChannelBlockPage Table

UTABLE

Core Table

Swap TableDASO•

FIGURE 11.

(

LOGON Tables

UTABLE Initialization
The primary user control table CUTABLE) contains a
description of the user's virtual machine and information on-29-

the status of the machine. When a new user is logged on,
space is obtained for his UTABLE from free storage, and thefollowing information is entered:
The start of the virtual multiplexer device block list
(the address of the virtual multiplexer block MVDEBLOK
created for the user•s terminal device).
USERID after it has been verified by comparing
against the entries in the user directory.
Virtual machine core size (obtainedmachine description file).

from theituser•sAddress of the segment table.
Address of the first
virtual channel list.

virtualchannel block

in

the

Address of the UTABLE extension, if the virtual machine
has the ability to run in extended mode <virtual 67).
Segment Table Creation
LOGIN creates a four-byte segment table entry for eachpage table generated. The segment table entry contains thelength and address of its corresponding . page table.
The
address of the segment table (aligned on a 64-byte boundary>is placed in the UTABLE.

I
I
I
I
I

The relationship of the virtual storage addresses tothe segment table and page tables is illustrated in Figure
12.
The twelve low-order bits of the address provide
addressability for 4K bytes of storage Cone page); thisnumber is used as a displacement from the beginning of thepage, as defined by the page table entry. The next eightbits of the address provide addressability for 1024K bytes
of storage Cone segment); this number is used to find theappropriate page by providing a displacement from the
beginning of the page table (the beginning of a segment is
the address of the first page in the segment>.
The fourhigh-order bits of the address provide addressability for
4096K bytes of storage;
this number is used to find theappropriate segment by providing a displacement from the
beginning of the segment table.

-30-

Address
Bits

4
6
12
,-----,- - - -T - - -------,
I
Segment
I
Page
I
Displacement into
I
I
I
I
page
I

}------*----+-::::----------\
I

I

/

I

//

I

/

I
I

/

//

I

\
\

"

I

\

I

"

Core Storage'-""'-

'
'--

I

__.f

~

""

\(

I/

\,

"'--"'--

I /

/

"

"""
"'- "'-

I\/ />---SE_G_T_A-BL_E_

\

Page

,---~tj-11..,.._-'--,\\ '""""''~.

Page ·FIGURE 12.

Virtual Addressing

Swap Table Creation
For
each
page
table entry,
LOGIN
createsacorresponding eight-byte entry in a swap table (SWPTABLE> •Whereas a page table entry contains the address of a page
when it is core resident, a swap table entry contains the
DASO address of a page when it is not core resident. The
DASO address is contained in bytes 4-7 of the swap tableentry; bytes 0-3 contain control information.
Virtual I/O Block Creation
When page and swap table creation is completed, LOGIN
reads entries for I/O devices from the user's machine
description file.
After determining
the channel type(selector or multiplexer), LOGIN
creates the required-31-

virtual I/O blocks. Figure 8 illustrates
of virtual and real I/O blocks.

List of

List of

List of

VirtualVirtualVirtualChannelBlocksControl

DeviceUnit Blocks

Blocksthe relationship

List of
Real
Control
Unit Blocks

List ofReal

DeviceBlocksList ofReal

VCHANPT

VCULIST

VPNTREAL

r----,
I

I
t
I
I
I

-----,~-- ------,-----,

----,

I

I
I
I

I
I
I
I

I

t

I

I

I
I
_J

I

I

I

I

I

I
L ___ _JI

L ___ _JI

I
I

I
L---J

-----,

I
I

I

I

t
I

I

•
•
•

I

L ___ _J

I

I

I

I
I

I

FIGURE 13.

I

I

I
I
L ___ ...J... , Real

Virtual, ...

I
I

•
••

I

I
Interface

I
I

Virtual-Real I/O Blocks

For multiplexer devices, a new virtual multiplexer
device block CMVDEBLOK) is created and chained to the lastcreated MVDEBLOK. The address of the first MVDEBLOK in the
chain Cthe MVDEBLOK for the user's terminal> is entered into
the UTABLE.
For devices attached to selector channels, a virtual
device block is created, and, if necessary, control unit andchannel blocks.
A pointer to each virtual I/O block that is created isentered in the previous block, resulting in a chain Clist>of virtual I/O blocks.
Virtual device blocks are also
chained to corresponding real device blocks Csee Figure 13).

LOGON determines the right Of access to a virtual DASO
device based on information
contained in the machine
description entry of the user directory.
These rights of access are-32-

summarized in Table 1.

Thenormal mode of access to a DASD device is read/write.
In
general, unless overridden by the presence of WRMULT, only
one user can access a DASO device with write privileges.
Any number of users can have simultaneous read-only access.
The WRMULT parameter resultsin existing links being
ignored.
The use of WRMULT requires that the virtual
machine operating system containthe proper data set
protection mechanisms; in addition, CMS does not haveinterlocks. Therefore, WRMULT should be used with caution.
See the CP-67 Operator's Guide under "Directory Creation
and Allocation".

Table 1.

Summary of Access Allowed to DASD Devices by LOGIN

DirectorySpecification

Existing Links
to Other
Virtual Machines

Access Mode
AllowedMessages<see below>

RDONLY WRMULT---------------------------------------~~-----------------------

No

Yes

No

No

No

Yes

None
Read-only
Read/Write

Read/Write
Read-only
None

1
2

None
Read-only
Read/Write

Read-only
Read-only
None

2

None
Read-only
Read/Write

Read/Write
Read/Write
Read/Write

3
3

None
Read-only
Read/Write

Read-only
Read-only
Read-only

Yes

Yes

1.
2.

DEV xxx IN USE BY userid; SET TO R/O
DEV xxx IN USE BY userid; NOT ATTACHED
DEV xxx IN USE BY use rid

3.

-33-

User Accounting Statistics
In the UTABLE for each virtual machine,
are used for time accounting.

three fields

TIMEONis a six-byte field that contains the date and timein packed decimal of user login.
This is used withlogout time and is punched in the user accounting card
to give connect time.
TIMEUSED
is a fullword binary value that represents all
CPU time charged to this virtual machine. The time isin extended precision (high resolution) time units andincludes both user execution time and CP supervisor
time executed for this user.
VTCJI'TIME
is the same as TIMEUSED except
only user CPU execution time.
In addition there
These are:
VMSSIO VMPNCH V¥1LINS VMCRDS VMPGRD -are statistics

forthat it includes

user I/O

activity.

number of selector channel SIO
number of virtual "cards" punchednumber of virtual "lines• printed
number of virtual "cards" read
number of pages readAlso, there are four words reserved for user data gatheringthat may be used by the installation. These are:
VMUSERl, VMUSER2, VMUSER3, and VMUSER4PROCESSING CONTROL PROGRAM I/O REQUESTS
Control Program requested input-output operations canbe divided into two general categories: (1) those initiatedby a user (virtual) I/O request, and (2) those initiated by
the Control Program itself (for example, paging or spoolingrequests). The following text describes the routines calledby the Control Program to perform specific
I/O operations.
Processing required to analyze virtual I/O requests and totranslate them to specific real operations is discussed
later in this section under "Processing User Selector
Channel I/O Requests" and "Processing User Multiplexer
Channel I/O Requests•. See Figure 14 for a flowchart of I/OInterrupt Handler operation.

-34-

Entermodule IOINT

Save VREGS
and VPSWin UT ABLE

Get real unit
address frominterruptcode

Get real unit
address frominterrupt
code

No

Scan fordevice address

Get IOTASK
block from

IMRDEBLDKI

RDEVBLDK

Do a senseon unit checkGet users

UT ABLEandMIRA address

Find end ofgenerated
CCW's

Figure 14. Flowchart of I/0 Interrupt Handler Operation (1 of 2)

-35-

No

Make CCW ,after
last used a TIC
to next CCW

Do a senseon unitcheck

Get user's

Chain lastused CCW
to the TIC

UTABLE(RDEVUSERI

Get virtual
deviceaddress(RATTVADDI

Replace CCW
after lastused withthis TIC

Get
operator'sGet user's
UT ABLEUTABLE

Goto
dispatch

Get UT ABLE
(IOTASKI

Get IOTASKand ROEVBLOKQUERIO

svco

RestartIOISTVDE

Set virtual
DE type

Move sense
into
RDEVBLOKYes

PAGUNLOK

Reset seek bits
set arm inposition flag

Get interrupt
return address(IOTASK block)

CH FREE

CALL MACRO

RestartchannelCati interrupt
return routine

Unlock data
page of CCW
chained to TIC

Figure 14. Flowchart of I/O Interrupt Handler Operation (2 of 2)-36-

Real Multiplexer Channel I/O Operations

I
I

The multiplexer real I/O
executive CMRIOEXEC) is
entered whenever an interruption occurs on a unit record
device (printer, card reader, or card punch) attached to a
multiplexer channel. It is also called by the multiplexer
virtual I/O executive routine (MVIOEXEC) to perform printeror punch input-output operations. MRIOEXEC determines theinterrupting
devicetype
andperforms
appropriate
processing. See Figure 15 for processing in the MRIOEXEC
module.

(-37-

Enter

Enter

Enter

module MRIOEXEC
entry MRDIO

module MRIOEXEC, entry PRIRAMRIWINTPUIRA, CAIRA

Set up CAW

operators
UTABLE

2540R Reader

Get
RDEVBLOKNo

Initiate
1/0 operation

Initial
Entry

Exit

2540P Punch
1403 Printer

Find
interrupting
deviceQUERIO

Write

Issue
check roGet

and CCWs towrite or readthe buffer

Get core forGet a tencardbuffer

MRI BUFF I OT ASK

YesInitialize

Set current
card - data
address

Release card
buffer,IOTASK,MRICAWTASK IRA"MRIWIW

MRIBUFF, CSW

Chain closed fileSet up CCWs
to readten cards

Yes

MSG

Set upheaderrecordGet old
MRIBUFF

Set unpacked
count, getdata & address

Blok IMVIFILEC)

to end of 'readers'chain as (SF BLOK)

Set device
freeIssue SIO
card reader

PACK

Exit

Compress user
CCWdata
80 bytes

No

Show device
drainedNo

Get next
card from
bufferMove data to
MRIBUFF{DATADISet file
continued

Get reader
MVDEBLOK

flag 'FF'

RECFREE

Get new
recordaddress

Set end of
file flag
'EF'

Yes

Set DE int

Yes

in MVDEBLOKMRDIOStore CYL-HD
in DATAD---Queue 1/0
request to
write buffer

Set PENDING

Exit

int inUTABLE

Send 'cards
read' MSG
to user

Exit

Figure 15.
-38-

Processing in the MRIOEXEC Module (1 of 2)

Initial

AfterSIO to

Entry

Exit

Get core for

PCH or PTR

Yes

No

Enter

Enter

MRINIRAMRIRINT

Issue
check to MACRO

Get unspool
1/0 chain

MRIBUFFIOTASKInitialize
I OT ASKTASKIRAMRIRINT

Get old
MRIBUFF>-Y'-e'-'s_ _-.iSet return
MIRA= MRI NI RA

Get next
unspool

entry

Get
MRDEBLOK

Get next
CCW DATAD

Set up to

Store CCW
in CCW list

Set up CAW

Get PR-PU

Set

output buffer

MIRA=MRIOEXEC

and CCW
issue 510

Get SFBLOK
printers or
punchesread next
recordMRDIO

Set up one
blank CCW

Get next
data (DATAD)UNPACK
Remove SF BLOK
from chain

Get SF BLOK
punches

Send output

Yes

Yes

msg.

Close CCW
list

Send 'start
output' msg.

Writedrained msg

Unpack user

data

Get first
CCW in list
store in CAW

MRDIO

Get buffer
address

Releaseall blocks(DAT AD)(

Exit

Issue SIO
punch orprinterMove data to
output buffer

Exit
Process new

ccw

Fiqure 15.

Processing in the MRIOEXEC Module (2 of 2)-39-

Card Reader Interruption
To perform I/O operations on a card reader, MRIOEXEC
reads card data into a buffer (ten cards at a time>,
compresses the data Cby means of the PACK routine>, andwrites the packed records into a "spooling" file on a directaccess device. The records will later be read from thespooling file by MVIOEXEC.
If MRIOEXEC is entered as the result of an interruption
caused by the unit being made ready (that is, initial entry
into the routine), the routine obtains an in~ut buffer and aspooling buffer, constructs a ccw list to read from the card
reader, and issues an SIO instruction.
If the interruption results from a channel end or aunit exception, MRIOEXEC calls PACK to compress the input
data, and moves the packed data to the spooling buffer. Whenthe buffer is full, or at end-of-file, it creates an I/Otask block and a CCW list to write the buffer to a spoolingfile on a direct access device.
The routine QUERIO iscalled to attach the task block to the appropriate channel
block and schedule it for service.
When the buffer has been written to the spooling file,a test is made for an.end-of-file indication Cset when aunit exception interruption occurred, indicating that allcards have been read).
If the end-of-file flag is on,
buffers are returned to free storage, and the file is added
to the chain of closed files. Reader files are chained off
the READERS word in MRIOEXEC.
Printer or Punch Interruption
To perform I/O operations on a printer or card punch,
MRIOEXEC reads records from a spooling file on a directaccess device, unpacks the data (by means of the UNPACK
routine>, and prints or punches the records on the specified
device.
If MRIOEXEC is entered as the result of an interruption
caused by the unit being made ready (that is, initial entry
into the routine), the routine obtains an I/O task block forreading records from a spooling file on a direct accessdevice and a buffer area into which these records may beread.
Printer and punch processing check the PRINTERS and
PUNCHES chain respectively to locate a closed file entry(spool file control block). PRINTERS and PUNCHES are words
in MRIOEXEC.
If a closed file is available, a message indicating theoutput device is written to the system operator's console bycalling the routine WRTCONS. A ccw list for reading records
from the file is created, the I/O task block is initialized,
and the routine QUERIO is called to attach and schedule thetask block to the appropriate channel queue.
When records have been read from the spooling file, the-40-

routine UNPACK is ca1led to unpack the spooled records, theunpacked records are moved to an output buffer, and the nextgroup of spooled records is read. When the output buffer isfilled, or when the spooling file has been completely read(logical end-of-file encountered), an SIO instruction isissued for the appropriate device (printer or punch).
When a file has been completely written out, or if noclosed spooling file was available, MRIOEXEC processes
requests for unspooled punch output. Unspooled punch output
requests are initiated by the Control Program (typically foraccounting information cards) and are added to a MREALIO
queue by RPUNCH, a subroutine within MRIOEXEC.
Real Terminal I/O Operations
The routines used by the Control Program to communicate
with either the real operator's console or a remote terminal
are RDCONS for read operations and WRTCONS for write
operations. RDCONS and WRTCONS prepare CCW lists and I/Otask blocks for their respective I/O operations, and call
STCONSIO to stack and initiate the I/O requests.
The
console interruption handler (CONSINT) receives control whenthe I/O operation is completed.
Read From a Terminal - RDCONS
See Figure 16 for processing in RDCONS module.

(-41-

Entermodule RDCONS
entry RDCONS

Initialize
RDCONPKG
set up return
address

Get terminal
MRDEBLOK for
this user

Get device
address

Set upCCWPKG
construct
CCW's

Chain RDCONPKG
off CCWPKGSTCONSIO

Exit

Figure 16. Processing in RDCONS Module-42-

When a read operation from a terminal is required, theControl Program calls RDCONS, passing in register 1 theaddress of a 132 byte input buffer, and, if required, inregister 2 the parameters for the EDIT and/or UCASE options.
EDIT and UCASE options, if requested, are processed by the
console interruption handler, CONSINT.
RDCONS obtains storage for and initializes a control
list for the read operation. The appropriate I/O device
block CMRDEBLOK) is initialized. If the data is to be readfrom the real operator's console, the current operator's
MRDEBLOK is used; otherwise, the address of the MRDEBLOK is
obtained from the indicated user's virtual console MVDEBLOK.
An appropriate ccw list is constructed for the type ofterminal device, and the address of the CCW list is placed
in register 6.
The EDIT and/or UCASE parameters, if
present, and the device type are placed in the control list,
and the routine STCONSIO is called.
When control is
eventually returned to RDCONS upon completion of the readfunction, an exit is taken to the calling routine.
Write to a Terminal - WRTCONS
See Figure 17 for WRTCONS module processing.

(-43-

EntryEntry

module WRTCONS
entry WRTCONS

module WRTCONS
entry PRIORITY

Set priority
control bit

SVC 0

Yes

Get operator
MRDEBLOKand UTABLE

Yes

Initialize
RDCONPKG
with return
addressSet
MR DE BLOK

Get device
address

Set upCCWPKG
construct
CCWs

Translate
data

Chain RDCONPKG(if one exists)
off CCWPKGPR IMSGYes

Exit

Fiqure 17. WRTCONS Module Processing-44-

When a write operation to a terminal is required, thethe following
Control Program
calls WRTCONS, passing
information in the indicated registers:
GPR 0 - the number of bytes in the output message;
GPR 1 - the location of
message;the first byte of

the output

GPR 2 - the parameters for the NORET, DFRET, OPERATOR,NOAUTO, and ALARM options;
GPR 11 - the appropriate user's UTABLE address.
Unless the NORE'!' option was specified, WRTCONS obtains
storage for and initializes a control list in which will besaved the return address
and register contents.
The
appropriate I/O device block (MRDEBLOK) is initialized.
If
the message is to be written to the real operator's console,the current operator's MRDEBLOK is used; otherwise, theaddress of the MRDEBLOK is obtained from the user's UTABLE
entry.
An appropriate ccw list is constructed for the type ofterminal device being used and for the option. Option
parameters, passed to WRTCONS in register 2, are stored in acontrol list preceding the CCW list~
The address of the ccw package (CCW list and controllist) is placed in register
6, the device type andparameters for the DFR~~ option, if present, are stored in
the control list, and the routine STCONSIO is called. Whencontrol is returned to WRTCONS, an exit is taken to thecalling routine.
Two alternate entry points, PRIORITY and CLRCONS, areprovided for the WRTCONS routine. If the routine is enteredat PRIORITY, write requests will be created as usual, exceptthat the STCONSIO routine will be entered at PRIMSG, causing
the write request to be stacked on a priority basis. If theroutine is entered at CLRCONS, all outstanding terminal I/Orequests to that user will be deleted.
Stack or Start Terminal I/O Requests - STCONSIO
see Figure 18 for STCONSIO module processing.

-45-

EnterEnter

module STCONSIO
entry STONSIO

module STCONSIO
entry PR l MSG

Set non-PRJMSG
branch SW.

Set PR I MSG

branch SW.

Get M ROES LOK

and device
addressNo

Yes

CCWPKG(UTABLE-CIOREQ

Exit

-46-

STCONSIO Module Processing(UTABLE-CIOREO)

No

Issue HID

Queue

Figure 18.

Find end ofqueue chain

CCWPKG(UTABLE-CIOREQ)

CAW

Issue SIO

Non PRIMSG

Get current

Yes

Store CCW
address in

PR I MSGStore current
CCWPKG as
next

Get next
CCWPKG(for insert)

Chain CCWPKG
to CIOREO

chain

Exit

When a ccw package has been created for a terminal I/O
operation, STCONSIO is called to add the I/O request to thechain of pending requests, or to start the operation if noother requests are pending. At entry to STCONSIO, register
6 contains the address of the ccw package, register 8
contains the device type, and register 11 contains theaddress of the appropriate user's UTABLE.
If no other I/O requests are pending, the address ofthe ccw package is placed in the channel address word and an
SIO instruction is issued. When the I/O operation has been
initiated, the current I/O request pointer is updated topoint to the CCW package of the active operation, the countof pending I/O requests CNCIOREQ) is incremented by 1, andan exit is taken to the calling routine.
If other I/O requests are pending, the ccw package isadded to the chain of pending requests, the count of pending
requests is incremented by 1, and the exit is taken to thecalling routine.
If the routine STCONSIO was entered at the entry point
PRIMSG, a priority operation has been requested.
If otherI/O requests are pending, the current CCW package is
examined to determine the type of operation in progress. If
the current operation is a read, an HIO instruction isissued, the priority ccw package becomes the current package(added at the top of the chain), and the ccw package of thehalted operation becomes the "next" package <second on the
chain). If the current operation is a write, no HIO isissued; the priority CCW package becomes the next package(inserted after the current package in the chain>. In eithercase,
the countofpending
requests(NCIOREQ)
isincremented, and an exit is taken to the calling routine.
Processing Terminal I/O Interruptions - CONSINT
When an I/O interruption occurs on a terminal, the I/Ointerruption handler, IOINT, receives control and determines
the type of interrupting device, obtains the multiplexerinterruption return address (MIRA) from the MRDEBLOK, andgives control to the terminal 1/0 interruption handler(CONSINT) at the entry point specified by MIRA.
For an inte~piption following an output
CONSIN'I' performs the following processing:operation,

If the NORET option is not specified, the routine
CPSTACK is called to add an entry for the current user
to the stack of Control Program execution requests.
This entry notifies the caller of WRTCONS of thecompletion of the operation.

-47-

If other terminal requests are pending for this device
an SIO instruction is issued for the next ccw package,and pointers to the "current" and "next" CCW packages
are updated.
Control is<DISPATCH).

returned

to

the

main

controlroutineFor an interruption following an input operation, CONSINT
performs the following processing:Unless the terminal
is a 1052, thetranslated into EBCDIC from line code.

messageis

If the EDIT option is specified, the input message isscanned, and deletions are made as required.
If the UCASE option is specified, the input message istranslated to uppercase letters.
The routine CPSTACK is called to add an entry for thecurrent user to his stack of Control Program execution
requests.
This entry notifies the calling Control
Program routine of completion of the input operation.
If other terminal requests are p~nding for this device,an SIO instruction is issued for the next ccw package,and pointers to the "current" and "next" ccw packages
are updated.
control is returned to DISPATCH.

Real Selector Channel Operations
The routine QUERIO is called by the Control Program
whenever a selector
channel I/O operation is
to beperformed. The address of a completed I/O task block ispassed to QUERIO in register 1. QUERIO indicates that theoperation is being requestedby the control Program,attaches the task block to the appropriate channel, andtests to see whether the channel is free.
Initiating Selector Channel I/O
If QUERIO determines that the channel is free, theroutine CHFREE
is called, withthe addressof theappropriate channel block (RCHBLOK) passed in register 1.
CHFREE issues an SIO instruction to the indicated channel.
The resulting condition code is checked and appropriate
action taken:-48-

For a condition code of O, the task block is attachedto the real device block (RDEVBLOK), the task count isdecremented, and control is returned, through QUERIO,
to the routine which requested the I/O operation.
For a condition code of 1, csw information is obtained,
the condition code is placed in register O, and control
is passed to the routine
specified in the task
interruption address CTASKIRA).
Foracondition code
is issued.

of

2,

a

retry

of

the

SIO

instr~ction

For a condition code of 3, the task block is unchained
from the channel, the task count is decremented, thecondition code is placed in register O, and control ispassed to the routine indicated in TASKIRA.
Figure 19 shows the processing ofchannel and device blocks .•I/O tasks on the selector(-49-

Last task
RCH 1

IOTASK 1

IOTASK 2
ROE

IOTASK 3
ROE

ROE 1

IOTASK4
Current task

ROE 2

FIGURE 19.

-50-

Processing Real Selector Channel I/O Tasks

ROE

Processing Selector Channel I/O Interruptions
When an I/O interruption occurs for a selector channel
device, the I/O interruption
handler,
IOINT, receives
control.
Register 0 is cleared
to indicate that aninterruption has occurred,and control is given to theroutine indicated in TASKIRA. When IOINT again receives
control, control is passed to DISPATCH via a GOTO macro.

Processing of I/O Errors - IOERROR
When IOINT passes control to the routine whose address
is indicated in TASKIRA, that routine issues a CHECKIO macro
to check for successful completion of the I/O. If only thechannel end and device end bits are set in the channel
status word, the routine concludes
that the I/O was
successful and continues processing.
In all other cases,
IOERROR is called. When IOERROR receives control, a call ismade to the subroutine RECERROR, which analyzes and, in somecases, records the error.
(For details, see the subroutine
description of RECERROR below.)
If the sense information indicates that intervention isrequired, a message is sent to the operator indicating thedevice address and asking •REPLY 'GO' WHEN AVAILABLE OR'FAIL' IF NOT AVAILABLE".
If the operator replies GO, theI/O operation is retried, whereas if the operator replies
FAIL, a permanent error is assumed.
For CF-generated I/O Cpaging, spooling, and reading thedirectory>, the I/O is retried up to 64 times if errors
occur. This is accomplished by setting up a special retry
I/O task consisting of a recalibrate CCW followed by a TIC
to the original IOTASK block. TASKIRA is set up so that
return is to the REPRTN entry point in IOERROR. If the I/Ocompletes successfully, control returns to the program which
originally generated the I/O request. If, on the other hand,
the I/O is retried unsuccessfully 64 times, a major error
message with error count, sense, and status information isprinted at the operator's terminal and the system will
ABEND.
Note that the error retry and recording procedure apply
only to selector channel devices represented by RDEVBLOKS
and not to shared unit record equipment or nondedicatedterminals.

PROCESSING USER SELECTOR CHANNEL I/O REQUESTS
When a pseudo-supervisor Cthat is, a supervisor operating
in a user's virtual machine)requests an I/O operation, aprogram interruption
occurs, and the Control Program must
determine the type of operation requested and the processing-51-required to honor the request.

I
I

The following text describes the major routines involvedin honoring user selector channel input-output requests.
Only the I/O-related operations of the routines will be
discussed in this section. See Figure 14, CP I/O Interrupt
Handler.
Program Interruption Handler - PROGINT
Entrance:
PROGINT
receives- interruption occurs.

controlwhenaprogramOperation:
PROGINT determines the mode of the user's
virtual machine (problem or supervisor> and the causeof the program interruption (paging request, invalid
operation, or privileged operation).

I
I
I

Routines called:
If the program interrupt is caused by aprivileged operation that is in virtual supervisor
mode, PROGINT transfers PRIVLGED to simulate it.

I

Privileged Instruction Simulator - PRIVLGED

I
I

Entrance:
PRIVLGEDPROGINT.

receives

control

via

a

GOTO

from

Operation: For other than I/O instructions, simulation is
performed within PRIVLGED. PAGTRANS is called to bringin pages not in core that are necessary for theprivileged instruction simulation.
When simulation isfinished, exit is taken via GOTO to DISPATCH.
If the privileged operation is an input-output request,
PRIVLGED calls the virtual.
machine I/O executive
program CVIOEXEC), passing the addresses of the firstand second halves of the privileged operation inregisters 4 and 5 respectively.
When control isreturned from VIOEXEC, an exit is taken to the main
dispatcher and control routine (DISPATCH), via a GOTO
macro instruction.

I
I
I
I
I
I
I
I

Virtual Machine I/O Executive Program - VIOEXEC(See Figure 20 for VIOEXEC module processing.)-52-

Entermodule VIOEXEC
entry VIOEXECComputeunit

address

VUNITSCN
Get VCHBLOKVCUBLOKVDEVBLOK

Get typeof 1/0
instruction

HIO

SIO
MVIOEXEC

Set CC= 2
in VPSW

No

No

Clear CE

set CC= 1
store CSW
to VCSW

Set CC= 1 in
VPSW set
Exit

Set CC=1

status to VCSWSet CC=1
move device
status to VCSW

Exitinterrupt

move device

Decrement
count

Figure 20.

Set allbusy

SM and busy
in VCSW

Create IOTASKblock

TASKIRA =VIRA

Issue TRANSQUEVIO
Set VMSTETYSTO IOWAIT

CCWTRANS

macro for
CCW page

set CCW list

VIOEXEC Module Processing (1 of 4)-53-

lssueHIO{real)

No

cc= 2

Get real
deviceaddress

CC= 1

NoMove CSW

status to
VCHCSW

Set CC= 1
set status
in VCSW

SetCC=1
VPSW

Exit

Zero status
in VCHCSW(virtual HIO)

Figure 20.
-54-

VIOEXEC Module Processing (2 of 4)

Entermodule VIOEXEC
entry VIRA

Get users

UTABLE

Get VCH, VCU,VDEV block
pointers
CC= 1

CC= 0

CC=3

Yes

IOISTVCU
Yes

Yes

Move sense
to VCHCSWUNTRANS
Move sense
toVCHCSW

Set CE int.
in VCHBLOK

Reset busy
VCHSTAT

Reset busy
VCUSTATVDEVSTATYes

Set CE int
in VCHBLOK>......:.~--1.r-

IOISTVDE-------FREECCW

Set pending
interrupt

FreeCCWin UTABLE

stringReleaseI OT ASK
block

UNTRANSCHKCUACT

Reset busy
VCUSTAT(
Figure 20.

VIOEXEC Module Processing (3 of 4)-55-

Move CSW
to VCHCSW
and VCSW

Reset busy
VCHSTAT

Reset busy
VCUSTATVDEVSTAT

Reset busy
VCHSTAT

Yes

Reset busy

ReleaseVCUSTATVDEVSTATalt clocks

Yes

Get sense
bytes

Set CCin VPSW

VERROR

RemoveNo

IOWAITstatusAttempt to
START next

CHKCUACTI OT ASK

Yes

Exit

Reset busy
VCUSTAT

Figure 20.

-56-

VIOEXEC Module Processing (4 of 4)

Recorderror

Entrance:
VIOEXEC receives control from .the privileged
operation simulator CPRIVLGED) when a user-requested
I/O operation has caused a program interruption.
Operation: VIOEXEC determines the type of I/O operation to
be executed (SIO,TIO,HIO,TCH) and performs appropriate
processing for each type.
For an SIO operation on a selector channel, VIOEXEC:
Obtains the channel, control unit, and device
addresses, and tests for busy or status pending
conditions on the addressed path. If the ad.dressedchannel is busy, sets condition code 2 in thevirtual PSW and exits. If status is pending or
the virtual control unit or device is busy, storesthe relevant CSW status, sets condition code 1 andexits.
If the path to the device is free, creates an I/Otask block,translating thevirtual channel
address word (CAW) into a real CAW
Calls the CCW translator (CCWTRANS) to translate
virtual CCW's to real CCW's, returning the addressof the start of the chain (TASKCAW)
Sets the I/O wait indicator in the user's VMSTATUS
in UTABLE
Calls the virtual I/O request queueing routine,QUEVIO, to queue the I/O task block on theappropriate channel
Transfers to DSPTCHB (DISPATCH).
When the I/O operation is started, QUEVIO reflects
the condition code to the user, and resets the I/O
wait indicator to zeroFor an SIO operation on a multiplexer channel, VIOEXEC:(See Figure 21 for MVIOEXEC module processing .• );;_57-

Entermodule MVIOEXEC
entry MVIOEXEC

SetCC=O
in VPSW

Determinetype of
1/0 inst.

Locate

Yes

No

Yes

SetCC=3
in VPSW

LocateMYDEBLOKMVDEBLOK

SetCC=2
in VPSWExit

Get users
CCWlistExit

Set CC= 1
in VPSW

Exit

Store CSW
in MVDEBLOKSet CC= 1
in VPSW

RECFREE
Exit

Set CC in VRSW
Set statusinCSW

Get a disk
record address

Store CYL - NO Exit

REC inMY I BUFF

Set CE-DE

Initialize

in CSW

MY I BUFFMYDEBLOK

Set empty fileflag 'DF'

Yes
Get core for

MYIBUFF, flagend of buffer
for reader 'FF'

Set up IOTASKTASKIRA =MVINTR

Figure 21.

-58-

MVIOEXEC Module Processing {l of 4)

Put file
header in
bufferEntermodule MVIOEXEC
entry MVl REC

Enter
MVINTR

Getdataaddressls.sue SVC 16
releasecurrent
save area

,(;'

\~

-MRDIO-Initiate the
1/0 operation

Get users
firstCCW

Issue
check lO
MACRO

No

Set program
check for

Exit
Punch orPrinterSet IOWAIT
in UTABLE

Reset tOWAIT(UTABLE)

Muvt: CCW to
MVICCW

Process for
NOP, sense,or feedGo todispatch

Set UC andintervention
requiredYes

Set CC= 1
in VPSW

Exit

Get next

ccw

Get the desired
SF BLOK fromreaders chain

Set int
pending
in UTABLE

Set UCin CSW

UNPACK

Get the desired
SF BLOK fromreaders chain

Deleteold

Unpack user
data

file

Get userdata area

Free blocks

Move data
to userarea

Get first
spool record
address

Set status
in MVDEBLOK

Delete old
file

Exit

Exit

Get next
non-TIC

Se1cc~1

in VFSW

ccw

(
No

Yes
Exit

Figure 21.

MVIOEXEC Module Processing (2 of 4)-59-

EnterMVIEFIRA

Issue

Move CCWto

CHECKIO
MACRO

MVICCW

SVC16

Yes

No

Get userdata area

releasecurrent
save area

Process for

Chain SF BLOKSENSE NOP,
or CONTROL

to punches
or printers

No

No

Move data fromuser area toGet
non-busy

Get next
non-TIC

ccw

DA TAPMRDEBLOK

Get next
non-TIC

ccw

Set status in
MVDEBLOK

Move data
to disk
bufferSend msg'cards XF-RED'

Set return
TASKIRA =MVIEFIRA

set DE int

MVIREC

Set int
pending in
UTABLEGet reader
MVDEBLOK

Send MSG'start for
output'Set updummy CSW
with DE

continued
flag 'FF'

MRIOEXECStore address
in DATAD(pointer tonext record)

Set status

Yes

in MRDEBLOK

Set int.
pending
in UTABLE

Set program
check incsw

MVIREC

SetCC=lin VPSWSet program
check incsw

Set Pending
int inUTABLE

Exit

Figure 21.
-60-

to readers
chain

Set end of
file flag
'EF'

Set

get a disk
recordaddress

Chain SFBLOKMVIOEXEC Module Processing (3 of 4)

Set pending
int inUTABLEReset
IOWAIT in
UTABLE

Exit

Reset

exit
flag

Clear
break

flag

Set busy(MVDESTAT)
SENSE
NOP

Alarm

Read

•

Write

WRTCONSSet return

Process
NOP orfrom RDCONS
to MVICNRD1

SENSE

Send

initialize
outputalarm

bufferYes

Set terminal
1/0 buffer

Get next

ccw

Store buffer
address in
MVIOB

Yes

set address
in MVIOBRDCONSSet upGet data
address

CSW

No
PLACE

Return afterSet pending

read to terminals
via RDCONS

interrupt
in UTABLE

Set breakConstruct output
line write line if
buffer overflows

flag

MVIONRD1

Return after
Set to go
to consoleQ

Set break

Yes

flag

BREAK

Put in GP
mode

Move datafrom bufferGet

to userdata area

CCW

next

Set returnSet status

Exitfrom WRTCONS
to WRTHMVIYes

WRTCONS

Goto
DISPATCH(

Set ending
statusNo

Get next

ccw

Figure 21.

Set ending
statusMVIOEXEC Module Processing (4 of 4)-61-

Calls themultiplexer
program (MVIOEXEC)

virtualI/O

executive

Transfers to DSPTCBA (DISPATCH).
For a TIO operation, VIOEXEC:
Tests the virtual channel for a pending channel
end; if found, tests for channel end for addressed
device. If channel end is found for the device,
the channel end is cleared, a condition code of 1
is set, the csw is updated, and transfers to
DSPTCHA (DISPATCH).
If a channel end is found,but not for the current device, a condition codeof 2 is set. If this is the second time this has
happened recently, DISDRQ is called to drop a userfrom a queue andthen transfers to DSPTCHBCDISPA'I'CH) •
"

I
I
I
I
I
I
I

If a pending channel end is not foundr the virtual
control unit is tested for pending interruptions.
If foundr a condition code of 1 is set, the csw isupdated, and control is returned to PROGINT.
If a pending control unit interruption is notfoundr the virtual device is tested for pending
interruptions.
If
f oundrthepending
interruptions are cleared, the device status andthe count of pending interruptions are updated, acondition code of 1 is setr the CSW is updated,
and transfers to DSPTCHA (DISPATCH).
If a pending device interruption is not found, acondition code of zero is set, and transfers to
DSPTCHA (DISPATCH).
For a TCH operation, VIOEXEC:
Finds the virtualchannel block

unit address

and thevirtualTests the virtual channel for a pending channel
end.
If a pending channel end is found, acondition code of 1 is set. If the channel isbusy, a condition code of 2 is set; if not, acondition code of zero is set.
Transfers to DSPTCHA (DISPATCH) •For an HIO operation, VIOEXEC:
If I/O is not in progress on the device andinterrupts are not pending, sets a condition code
indicating that the device is available.
-62-

If I/O is in progress, issues an HIO to the device
and reflects the condition code to the virtual
machine. When the I/O is finished, VIOEXEC sets a
condition code indicating interrupt pending.
CCW Translator - CCWTRANS
Entrance: CCWTRANS is called by the virtual machine I/O
executive program (VIOEXEC) when an I/O task block has
been created and a list of virtual CCW's associatedwith a user's SIO request must be translated into realccw•s. (See Figure 22 for CCWTRANS module processing.>(-63-

Entermodule CCWTRANS
entry CCWTRANS

Get VCCW

Yes

list

scan phaser.-------IOTASK-TASKAW

1 ~Cd~~!;~i~es~~~ned~----------T--Translateto RCCW's
each
specifying
data in one page

- - -1 number double-words

ILr~i;:~~~r~~roduce_______

Analysisby deviceTranslate
to realGet next

vccw

ccw

Analysis bycommand
type

Get

No

Next

vccw

r-------.---1..--,
No

I

TIC

I

I

scan
phase

I

I

Get
TIC

I

block

Calculatecore required forreal
CCW list

Get

next
RCCW

translate phase
Get core forr v7cWLITT;r;;;ada;-'RCCWLIST'

1 the CCW's pre-translated.

and set up
headerI has data that crosses a

Yes

I If a read or write cmd

UnflagtheTIC

I ~;I~~ i~~~~d~~~~:r--------1 ofCCW'stoeliminate
Get startof VCCWlist

I this condition. Control
or address data
I associated with a

1 CONTROL, SKIP, SEARCH

TranslateYesNo

cmd is moved to the
I CNTR LST associated

TIC to
RCCW

L w~ ~e ~Cr:!!~·-_

Get next

Flag if TIC

Translatecommandtype

Get next
RCCWlistNo

TIC

commandblock

r------- --,...---.L---.,
UpdateI
I
I

End ofCCWLIST

I
I

returncontrol

I
I
I

I
I

VCAWtoRCAWIOTASKTASKCAW

r-----N

I to scan phase~ ____ ~with untranslated

I virtual TIC

L ____ _address

Test forpage
boundary
condition
on data areaStore
RCCWLIST

address in
IOTASKTASKCAW

Exit

Figure 22.

-64-

CCWTRANS Module Processing

CCWTRANS is called by IOINI' when the I/O operation iscompleted from a self-modifying channel program. The
self-modifying channel program checking portion of
CCWTRANS calls CCWTRANS when retranslation of CCW's isrequired.
Operation: CCWTRANS operates in four phases: a scan phase,atranslatephase,a TIC-scanphase,
andaself-modifying channel program checking scan phase if
the ISAM option was chosen.
The scan phase analyzes the virtual CCW list to
determine the total core storage requirement of thereal CCW list.
Additional real CCW's are required if
the data area specified by the virtual ccw list crosses
pageboundaries.
Somechannel commands
requireadditional doublewords for control information {forexample. seek addresses).
The translation phase reexamines the virtual ccw
list and translates it into a real CCW list.
TIC
commands that cannot be immediately translated are
flagged for later processing by the TIC-scan phase. A
read or write command that specifies data crossing page
boundaries is translated into several CCW's, eachspecifying data in only one page.
The TIC-scan phase scans the real CCW list for
flagged (untranslated) TIC commands and creates a new
virtual ccw list for the untranslated commands. Scanphase processing is then repeated. When all virtual
CCW's are translated, the virtual CAW in the IOTASK
block is replaced by the real CAW (that is, a pointerto the real CCW list created by CCWTRANS), and CCWTRANS
returns control to VIOEXEC. The user protection key ispreserved.
Routines called:
CCWTRANS calls the page handling routine
CPAGTRANS) , via a TRANS macro instruction, to translate
virtual addresses to real addresses, and to lock incore storage pages required by I/O operations.
The self-modifying channel program checking portion of
CCWTRANS calls CCWTRANS to retranslate the channel
program and QUEVIO to start the I/O operation.
OS ISAM Handling - CCWTRAN
Because many of the OS ISAM channel programs are
self-modifying, special handling is required in CP toallow virtual machines to use this access method. The
particular CCW's that require special handling have thefollowing general format:
0

2

4

6

8

+--------+--------+--------+--------+-65-

READDATA

A

C+7

10 BYTES+--------+--------+~-------+--------+

B

c
D
E

F

TIC TO E+--------+--------+--------+--------+

I+--------+--------+--------+--------+

I

I+--------+--------+--------+--------+I
SEEK: SEEK HEAD ON D+--------+--------+--------+--------+SEARCH ON D+2+--------+--------+--------+--------+

The ccw at A reads 10 bytes of data, the last byte ofwhich forms the command code of the ccw at E..
In
addition, the data read ~n forms the seek and searcharguments for the CCW's at E and F.
The normal CP
translated ccw string has the following format:
0

1
2

2A
3
4

2

4

6

8

+--------+--------+--------+--------+READDATA C+7 10 BYTES
I+--------+--------+--------+--------+
TIC TO 3
I+--------+--------+--------+--------++--------+--------+--------+--------+
VIRTUAL ADDRESS OF SEEK AT E+--------+--------+--------+--------+
SEEK: SEEK BEAD ON 6+--------+--------+--------+--------+SEARCH ON D+2
I+--------+--------+--------+--------+

I

5

ETC.

6

+--------+--------+--------+--------+RELOCATED SEEK ARG .•+--------+--------+--------+--------+In order to accomplish an efficient and non-timihg
dependent translated operation for OS ISAM, the virtual
ccw string is modified in the following manner.
The ISAM scan phase of CCWTRAN is entered if, during
normal translation, a ccw ofthe type at A is
encountered. The scan phase locates the TIC at 2 bysearching the translated ccw strings. The TIC at 2
locates the seek at 3.
The virtual address of the virtual seek CCW at E islocated at 2A. The 4 bytes at E and the four bytes at F
are saved in the eight byte area at 6. The TIC at 2 isaltered to TIC to the virtual ccw at E. The CCW address
field at E is translated to reference D.
The 4 bytes
at Fare modified to a TIC to the CCW's starting at 4.
The completed ccw string has the following format:
4682+--------+--------+--------+--------+

0

-66-

1
2

2A

3
4
5
6

READDATA C+7 10 BYTES+--------+--------+--------+--------+
TIC TO E+--------+--------+--------+--------++--------+--------+--------+--------+
VIRTUAL ADDRESS OF SEEK AT E+--------+--------+--------+--------+NOT USED+--------+--------+--------+--------+SEARCH ON D+2+--------+--------+--------+--------+I
ETC.
+--------+--------+--------+--------+I
SAVED ESAVED F+--------+--------+--------+--------+
TRANSLATED CCW's

A
B

c
D

E
F

4
0
6
8
2
+--------+--------+--------+--------+READDATA C+7 10 BYTES+--------+--------+--------+--------+
TIC TO.·E+--------+--------+--------+--------+

I+--------+--------+--------+--------+

I+--------+--------+--------+--------+
SEEK: SEEK HEAD ON D+--------+--------+--------+--------+
TIC TO 4+--------+--------+--------+-~---~--+

VIRTUAL CCW's
It can be seen that the virtual area c, D, E, and F
must reside in one page for the routine to function.
Once the 1/0 operation has completed, an untranslation
scan phase restores the data at E and F and sets thecorrect CSW address if the channel program ended at E.
CCW Untranslator - UNTRANS
Entrance:
UNTRANS is called by VIOINT when a channel end
for auser's virtual
type ofinterrupt occurs
input-output operation.
Its function is to convert thereal CSW information into corresponding virtual CSW
information.

(

Operation:
The real ccw that caused the interrupt islocated from the virtual channel csw (VCHCSW), where
the real CSW is temporarily stored.
Taking into
account the fact that some of the CCW's may besystem-generated andartificially data-chained,avirtual csw is created to represent the csw that would-67-

be expected from the user's virtual CCW list 
 ,.

ccw Return to Free Storage - FREECCW
Entrance: FREECCW is called when VIOINT determines that thechannel has terminated operation on a user's virtuallist.
It returns the real ccw equivalent to thevirtual list to free storage and clears the TASKCAW
entry in the IOTASK block.
Operation: The real CAW is picked up from TASKCAW, which isan entry in IOTASK. From this, the real ccw list withits •header• information is located.
The list isscanned. All I/O commands with data references havetheir referenced pages unlocked, and the received data
for Read Home Address commands for shared disks isunrelocated. When the scanning is complete, the ccw
list is returned to free storage.
Routines called: PAGUNLOK is called
containing the I/O data area.

tounlock the

page

Virtual I/O Request Queueing Routine - QUEVIO
Entrance:
QUEVIO is called by the virtual machine I/O
executive program (VIOEXEC) when an I/O task block has
been created and a virtual ccw list has been translated
into a real ccw list. (See Figure 23 for QUEVIO module
processing. )-68-

Enter

Enter

Enter

module QUEVIO
entry OUEVIO

module OUEVIO
entry QUERIO

module OUEVIO
entry CHFREE

Increment
VIOCOUNT

Increment
RIOCOUNTStore RDEVBLOK
address in
IOTASK block

Flag asCP task

Exit

csw

No

Issue SIO
for sense

Get RCUBLOKStore RCUBLOK
address in
IOTASK block

Get CCW
address andstore inGet next
IOTASK fromIOTASK list

Store IOTASK
address in
RDEVBLOKGet
RCUBLOKRDEVBLOKYes

No

Get RCHBLOKStore channel
pointer incontrol unit

Chain IOTASKto RCHBLOK

Indicate 1/0
started andchannel busy

Unchainactive IOTASKNoStore IOTASK
address in
RDEVBLOK

Turn off armin position
flag

Form unit
address

Exit
Get users
UTABLE

Move in
CAW

SetCC=O
in VPSW

Issue SIO

Unchainactive IOTASKUnchainactive \OTASKIndicate

Set CC= 1

cc= 3

Move CSW
for IRA
routineTASKIRA=(

cc= a

)

IOTASK int
return address

Exit

Reset IOWAIT(
Exit

Figure 23.

QUEVIO Module Processing-69-

Operation: When QUEVIO is entered, register 1 contains theaddress of an I/O task block to be queued on a realchannel, and register 2 contains the address of theappropriate virtual device block.
QUEVIO attaches the
I/O task block to the appropriate channel block,increments the task count, and tests the real channel.
Routines called: If QUEVIO determines that the channel towhich the I/O task block has been attached is free,
CHFREE is called to start the I/O operation.
If theI/O operation is successfully started, the I/O task
block is unchained from the channel blcck and chained
to the real device block. If the I/O operation is not
successfully started, the I/O task block is unchained
from the channel
block, and the task
count isdecremented.
When CHFREE processing is completed, QUEVIO returns
control to its caller - VIOEXEC, after reflecting the
SIO condition code to the virtual PSW, and taking theuser out of IOWAIT.
Figure 24 illustrates the relationships of routines
which process user selector channel I/O requests.

-70-

-~

Virtual Program
Simulatedsupervisor

VirtualHardwareMachineChannelandmode

Device

SID instruction

1/0 inter"rupts
from 1/0 operation

program interrupt-

Control
Program_P !:!9q]_l'iI -Determines programis in supervisor_..Q!~A.If.!::!_ _ _Eventually attempts
to dispatch this user
User has pending
interrupts (UT ABLE)

Call UNSIO

Determines an 1/0
operation attempted

Attempt to dispatch

Dispatch this user
if SIO is successful

Call VUNITSCN----------- ---et(IOWAIT), dispatch
another user

VCHBLOK
VCUBLOKVDEVBLOKlf selector channel, control
unit, and device found andfree, set BUSY

Issue TRANS macro---------.._______j for CAW page__C.f_W.IR3~ __Issue TRANS macro
for CCW pages
Translate virtual
CCW's to real CCW's
Issue TRANS macro
for user data pages
and lock pages

I

FIGURE 24.

SCANUNITIVUNITSCN

Call VUNITSCNVCHBLOK
VCUBLOKVDEVBLOK

Call UNTRANSUNTRANS(FREECCWI
Scans real CCW list
to locate and unlock
user data pages

Call PAGUNLOK

Call FREECCW
Set interrupt pendingin UTABLEStore status in
VCHBLOK,VCUBLOVDEVBLOKUNTRANS----Convert real CSW
to virtual CSW

PAGETRANS(PAGUNLOK)
Unlock user data
page
Note:

Put user in
IOWAIT status

For dedicated MPX devices, the MPX blocks
are restructured as selector blocks; thus the
MPX device is structured as a selector device.
Therefore the logic flow for selector anddedicated MPX devices is the same.

Call OUEVIOOUEVIO---------Get

RDEVBLOKRCUBLOK
RCHBLOKIf channel is free,call CHFREE

I-'
I

V.!._0.§_X.§_CJ.V.!£Aj_ _Call CCWTRANS

Chain I OT ASK to RCHBLOK
-._)

UNSIO
Unstack andreflect theinterrupt

Set up IOTASK block
TASKIRA = VIRA'"I

Get ccw list

Go to DISPATCH

VIOEXEC
Compute unit address

SCANUNIT(VUNITSCN)

Return tff programthat created the
IOTASK TASKIRA =VIRA

this user, should
be runnable now

Call VIOEXEC__D~~~H--~(non~ IOWAITt
If SIO is not successful

IOINT------Locate IOTASK block
Process interrupts

mode and privileged
instruction

PROGINT II

Rea!
DeviceVirtual SIO Selector Channel

OUEVIO (CH FREEi
If control unit isfree, issue SIO
If SIO is successful, takeuser out of IOWAIT

Virtual Channel Interruption Handler - VIRA~

Entrance: When a user-requested I/O operation is started ona selector channel, the interruption return address(TASKIRA) in the I/O task block points to the virtualchannel interruption handler (VIRA).
When the I/O
operation is completed and an interruption occurs, VIRA
receives control from IOINT, the real input-output
interruption handler.
Operation:
VIRA indicates in the user's control table(UTABLE) that an interruption is pending, and storesstatus information in thevirtual channel block,
virtual control unit block, and the virtual device
block whenappropriate.
The I/O task
block isunchained from the real channel block and returned tofree storage if the operation is complete <that is,channel end and device
end or their equivalents
occurred). If an I/O error has occurred, control ispassed to IOERROR. See "Processing of I/O Errors
IOERROR•.
Routines called: VIOINT calls the routines IOISTVCU andIOISTVDE (subroutines within the real I/O interruption
handler) to indicate a control unit end interruption
and a device end interruption respectively.
When
VIOINT processing is completed, an exit is taken to themain dispatcher and control routine (DISPATCH).
Routine to Analyze and Record Errors - RECERROR
Entrance: If an I/O error occurs for a user-requested I/O
operation on a selector channel, VIOINT calls RECERROR
to analyze and record the error.
Operation: RECERROR analyzes the I/O error from information
contained in sense byte zero. The following types of
I/O errors are recorded.
Type of Error

counter Number--------------Bit Position
Within Sense Byte O~------------------Bus out Parity
Equipment Check
Data Check
Seek Check

1
2
3
4

2
3
4

7

counters for each of these types of errors are kept in
the RDEVBLOK for each device. Note that errors are recorded
for dedicated devices operating on a virtual multiplexer
channel (unit record equipment, virtual 2702s>. If theerror is the first encountered of a given type for a given
device, the error is recorded.
If the error causes thecounter to overflow (that is, upon the eighth error of this-72-

type for the device), a counter overflow error record iswritten. 'Ihis error
may represent the failureof acompletely different channel program than the first error ofthis type which was recorded. If the error is neither the
first encountered nor a causeof a counter overflow
condition, control
returns to VIOINT, andthe error
information is reflected back to the user's virtual machine.
The I/O error record has the following 112-byte format:
ORG
LOGSNSELOGCODE
LOGTYPEDSOSDSLOGDATA
CL6
CL1
CL1

LOGVOLIDLOGADDR
LOG DATE
LOGCSWDSOS

LOGCCWS

DS

CL6
CL2
CL6
CL8
CL2
9D

LOGSKLOC

OS

1D

DS

OS
DS

DEFINE I/O ERROR RECORDSENSE INFORMATION
DEVICE TYPEFIRST ENCOUNTERED OR COUNTEROVERFLOW - TYPE OF ERRORVOLID OF DEVICE (IF AVAILABLE)
PHYSICAL ADDRESS OF DEVICEDATE AND TIME STAMP OF ERRORCHANNEL STATUS WORD
UNUSEDFAILING CCW STRING CUP TO NINEOOUBLEWORDS)LAST SEEK ADDRESS CDASD ONLY)

The CCW in the string which failed isasterisk in the unused fifth byte.

flagged with an

After the error record is written, the pointer to thenext available slot on the CE cylinder is updated. Seven
logical records are contained within one 829-byte physicalrecord. Since 15 records may be written on two tracks of a2314, up to 1050 error records may be written on one
cylinder. If the attempt to write the error record fails,
it is retried eight times. Upon continued failure, an error
message "** IOERROR RECORDING FAILURE ON DEV~-" is sent to
the operator. If there is no more room on the CE cylinder
for error records, the message "**CECYL FULL; I/O ERRORS NOTRECORDED **" is sent to the operator. Errors are notrecorded for users with privilege class c in order toprevent the recording of intentional errors produced by CE
diagnostics. Recording will be reinitiated after the CE
executes the CLEARIO function.
Main Dispatcher and Control Routine - DISPATCH
Entrance:
DISPATCH is entered from routines which havecompleted their processing fora user or cannot
continue processing until some other process has been
completed.
(See
Figure 10.1 for
DISPATCH module
processing.)
Operation: DISPATCH checks for pending interruptions
determines which user is to receive control next.

if

· ·~

Routines called:interruption

When DISPATCH determinesispending,
the
I/O

and

that an I/Ointerruption-73-

unstacking routine (UNSTIO) is called. UNSTIO updates
the virtual csw, restores virtual PSW's, and indicatesthe address of the interrupting device.
When UNSTIO
processing is completed, DISPATCH attempts to restart
the current user, if runnable and if his quantum is not
exhausted.
DISPATCH may be entered at 4 locations: DISPATCH,
DSPTCHA, DSPTCHB, and DSPTCHC.
DISPATCH is the normal
entry point used by all routines that are not sure of auser's status. DSPTCHA is entered from routines whichhave gained control after a program interrupt for auser and have changed the user's PSW.
DSPTCHB issimilar to DSPTCHA except the PSW is at most changed inits condition code field. DSPI'CHC is used by routines
which have done some processing for a user but in noway changed his status.
Figures '25-28' illustrate the relationships ofroutines which process an I/O interrupt returned from aselector channel device.

-74-

,~,

-,,_,

VirtualMachineVirtual Program(Simulated
supervisor mode)

510 instruction

Spooling
Device'CLOSEIO'
SIO
Invalid CCW

1/0 interrupts
from writing spooling buffers

program interrupts_J_

MVIOEXEC IMVINTRIIOINTDetermines programis in supervisor mode

SVC 16 release current
save area

Locate 1/0 task block

and privileged

CHECK 10 macro-------PROGi NT

operation

Process interrupts
Return to programthat created the
1/0task
OR-I 10TASK BLK TASKIRAVIOEXEC

Determines an 1/0

operation attempted
DISPATCH

Call VIOEXEC
Go to DISPATCH

Compute unit address
Call MVIOEXEC

User has pending
interrupts (UTABLE)

Attempt to dispatch
this user should
be runnable now

UNSIO

Unstack and reflect
the interrupt------PACK

Compress user's CGW
data

CHECK 10 macro

SVC 16 release current
save area
Chain file block to~punches) or (printers)

Eventually attempts
to dispatch this user

Call UNSIOMVIOEXECIMVIEFIRA)IMVIOEXEC
Scan MVDEBLOK for
MPX device
If device not busy,
issue TRANS macro for
CAW page
If no interrupts pending
set up normal interrupt
condition in MVDEBLOK
for this operation

Get MVIBUFF
Set up MVIOB (IOTASK)TASKIRA = MVINTR

Call MR IOEXEC
if real 1/0 device canbe started[See Figure 11 c)
Reset IOWAIT(UTABLE

MVIOEXEC (MVREC)QUEVIO (QUERIO)

Set up CCW's towrite this buffer
Call QUERIOGET RDEVBLOKRCUBLOK
RCHBLOK

Set IOWAIT(UTABLE)

Chain task to RCHBLOK

Go to DISPATCH

Issue SJO if channel
is free (spooling device)

Issue TRANS macro
for CCW page
Call macro PACK
If buffer is full,call MVREC,
get another bufferEnter packed data
into bufferI

If invalid CCW (EOF)
set TASKIRA = MVIEFIRA.....iU1

Set status in MVDEBLOK

I

call MVREC

Set pending interrupt
in UTABLE

FIGURE 25. Virtual SIO MPX Channel(Nondedicated Punch or Printer>

DISPATCH

This user will wait
for spooling 1/0
operation to complete
Dispatch another user

HardwareDeviceandChannelI-....]

O'\

I

Virtual ProgramI(Simulated
supervisor

I

mode)

VirtualMachineSIO instruction
program interrupt

Spooling
Device! Hardware
ChannelI and
L_Dev~

1/0 interrUpts fromreading spooling buffer

Control Program
IOINT

PROGi NT

Determines programis in supervisor
mode and privileged

Locate I OT ASK block

Process interrupts

instruction
MVIOEXEC (MVINTR)

Return to programthat created the I10
task IOTASK~TASKIRA

SVC 16 Release

current save area

Issue CHECKIO macro
VIOEXEC

Determines an 1/0
operation attempted
DISPATCH

Call VIOEXEC
Go to DISPATCH

Compute unit address
Call MVIOEXECEventually attempts
to dispatch this user
User has pending
interrupts (UTABLE)
Call UNSIO

Attempts to dispatch
this user should
be runnable now

UNSIO

Unstack andreflect theinterrupts

MVIOEXEC

s.,";, MVDEBLOKto;- MPX device

If device not busy,
issue TRANS macro
for CAW page
If no interrupts pending

set up normal interrupt
condition in MVDEBLOK

for this operation

Set up CCW's toIssue TRANS macro

Call QUERIO

for CCW page_P~~(~~C~
Unpack user CCW

data

M~O~X!_C ~~~Cl_

Get MVI BUFF set up
MVIOB TASKI RA;MVINTR

Get a closed filefrom reader chain

read this buffer
Set IOWAIT (UTABLE)
Go to DISPATCHQUEVIO (QUERIO)RDEVBLOKRCUBLOK
RCHBLOK
Chain IOTASK TO RCHBLOK

If channel is free,call CHFREE

Call MVIREC
Call UNPACK

Issue TRANS macro
for user pages
Move data intocurrent page
Set status in MVDEBLOK

Set interrupt pendingin UTABLE
Reset IOWAIT {UTABLE)

FIGURE 26. Virtual SIO MPX Channel
CNondedicated Reader)

DISPATCHQUEVIO (CHFREE)

This user wi II wait
for spaoling 1/0

free, issue SIO

operation to complete(read spooling buffer)

Dispatch another user

If control unit is

.~

Punch
Spooling
Device1/0 interrupt fromreading real device

1/0 Interrupt from
output to real device

Hardware
ChannelandDevice1/0 interrupts from

1/0 interrupts fromwriting spooling buffer

reading spooling buffer

Control Program

IOINT

IOINT

IOINT

Get MRDEBLOK(See overview of virtual

Locate IOTASK block

SIOMPXl

Process interrupts

Get user's UTABLE
MVIOEXEC(MVIEFI RAI

Call MRIOEXEC toprocess interrupts
for the device
Ml RA=PRI RA or PVI RA

Go to DISPATCH

MRIOEXEC

Get operator's UTABL(See overview of virtual

SIOMPX

Return to programthat created the 1/0
task IOTASK-TASKIRA ,,_.,.
____~

Go to DISPATCH

Get MRI BUFF
Set up IOTASKTASKIRA=MRIRINT

DISPATCH

Dispatch any user

Get output buffer

DISPATCH

Get spooling file block

Get device address

Dispatch any user

Call WRTCONS to

output message tooperator
Mi:!_OiX~CJ_M~l~~l.
Issue CHECKIO macro

Call MRDIOPACK (UNPACK)MRIOEXEC (MRDIO)s;, ;;p CcWs t-; -read buffer fromspooling device
Call QUERIOQUEVIO (QUERIO)Get

RDEVBLOKRCUBLOK
RCHBLOK

Chain I OT ASK to RCHBLOK

If channel is free,call CHFREEQUEVIO (CHREE)I

If control unit isfree issue SIO.....J.....J(read spooling buffer)I

FIGURE 27.

Real SIO MPX Channel(Punch or Printer>

Unpack user's CCW
data

Call UNPACK

Move unpacked data
into output buffer
Issue 510 to real
device

I
-...J
00

[

I

..--~___,I

1/0 lnterr~pt

from reading real device

Reader1

Spooling
Device~I~~~

Hardware
Channel

1/0 interrJpt

1/0 interrupt
from writing spooling bufferandDevicefrom reading real device

Control Program--..!9~--!'-1.!!.!.0~~(~l~A.!._
Get operator's UTABLE
Get MRI BUFF

IOINT

IOINT

Get MRDEBLOK
Get user's UTABLE

Get MRDEBLOK

L;;-.;teToTASK bl~

Get user's UTABLE

Process interr_upts

Call MRIOEXEC toprocess interrupts
for the device
MIRA=CRIRA

Call MRIOEXEC toprocess interrupts
for the device
MIRA=CRIRA

Go to DISPATCH

Go to DISPATCH

DISPATCHDISPATCH

Return to program

MRIOEXEC(MRIWINTI- - - - -;---.i

Issue CHECKIO macro
If not end-of-file,process more data

Get 10-Card buffer

Set up 10 TASK

If end-of-file, chain

TASKIRA=MRIWINT

Set up CCW's to read

Dispatch any user

Dispatch any user

10 cards from thereal device

MRIOEXEC ICRIRAI

Issue SIO to thereal device

Get operator's UT ABLE
Call PACK

Move data intospooling buffer

PACK

Compress user
CCWdataIf buffer is fullor EDF, write thisspooling buffer

Call MRDIOMRIOEXEC(MRDIOI

Set up CCW's to write
buffer to spoolingdeviceCall QUERIOQUEVIO (QUERIO)
Get~~I~~~~
If cxmtrol unit isfree, issue SIO(write spooling buffer)

FIGURE 28.

that created the 1/0 Task
IOTASK--TASKIRA
Goto DISPATCH

Real SIO MPX Channel(Reader>

RDEVBLOKRCVBLOK
RCHBLOK

Chain IOTASK to RCHBLOK

If channel is free,call CHFREE

spooling file buffer
to reader's chain

DISPATCH

Call WRTCONS tosend CARDS READ
message to the user

Dispatch any user

PROCESSING USER MULTIPLEXER CHANNEL I/O REQUESTS
When a pseudo-supervisor (that is. a supervisor operating
in a user's virtual machine) requests an I/O operation for adevice attached to the multiplexer channel. the programinterrupt handler (PROGIN'l'). and the virtual machine I/O
receive control.
(See preceding section headed "Processing
User Selector
Channel I/O
Requests".)When
VIOEXEC
deterndnes that an I/O operation has been requested for adevice attached to the· multiplexer channel. the multiplexer
virtual I/O executive program (MVIOEXEC) is called. Figures'29-32' illustrate the relationships of routines which
process user multiplexer channel I/O requests.

(-79-

Hardware
ChannelandDeviceI000I

1/0 interrupts
from write to terminal

1Any Control
Program Module

I- -

•
•
Routine to process

the write if NOR ET
not specified

•

•

- -

--l

Get user's UTABLE

Or if "attention"interrupts, call BREAK

Construct CCW package
for write

Go to DISPATCH

Call STCONSIO~••

I- _ _ E_!SPATC!:!_ _ _,Eventually attempt
to dispatch user that
initiated the write

STCONSIO
1---""""""'.-----Get MRDEBLOK
If previous console
1/0 request outstanding,queue this request
UTABLE-Cl OREO

User has outstanding
CPROUEST (if NORETnot specified)If no requests
outstanding, issue
SIO for this request
and queue this request
UTABLE-CIOREO

Process CPROUEST,
return to location
designated by the
program that called
WRTCONS (return
address in RDCONPKG)JFIGURE 29.

-

Call CONSINT
to process interrupts
for the device
MIRA=CONSINT

Get MRDEBLOK anddevice address

Go to DISPATCH

IOINTGet MRDEBLOK

1---- -----•I .....L___ '!Y_RTCONS - •Call WRTCONS
Set up RDCONPKG if
with or without
I..... I NORET not specified
NORET (no return) option-

Control Program

Real Terminal SIO (Write)-.-----~ _

CONSl~T- _ _ _Get CCW package
Process interrupts
If NORET not s p e c i f i e H
CPSTACK
call CPSTACK- - - -- to set up return
Put RDCONPKG in
If more CCW packages
CPSTACKin stack, start thenext one (issue SIO)~~---r--1/0 interrupts
from read to terminal

Get MDDEBLOK

1--------- -Go to DISPATCH

--

•
•
•
Routine to precess
the read
14•
•

.....

1------ ----I-

Call CONSINT
to process interrupts
for the device
MIRA=CONSINT

Get MRDEBLOK andinitialize for device
type and address
Set up RDCONPKG

i-r--------STCONSIO

If no requests
outstanding, issue SIO
for this request andqueue this request
UTABLE-CIOREOI

Real Terminal SIO (Read)

Get CCW package
Process interrupts

Call CPSTACK

Call STCONSIOD..... ~ -- ~ONS~~ - - Get read data andprocess for EDIT and
UCASE if specified

Go to DISPATCH

Construct CCW package
for read

If previous console
1/0 request outstanding
queue this request
UT ABLE-Cl OREO

FIGURE 30.

Get user's UTABLE

RDCONS

Get MRDEBLOK

co......

Control Programr- -- - IOINT-------

Any Control
Program Module•••
Call RDCONS

Hardware
ChannelandDevicer-

DISPATCHl1---- - -----1
Eventually attempt
to dispatch user that
initiated the read

User has outstanding
CPR OU EST
Process CPROUEST
return to location
designated by the
program that called
RDCONS (return
address in RDCONPKG

If more CCW packages
in stack, start the nextone (issue SIO).-=r-----CPSTACK- ---- -Put RDCONPKG in
CPSTACKVirtual Program(Simulated
supervisor
mode)

..

·-.

SIO instruction

Virtual Machine

progr~terrupt-+------- - - ---_j_-Control Program1--~~NT - Determines program isin supervisor mode andprivileged instructionI- _Determines an 1/0
DISPATCH

1----- --- _Eventually attempts
to dispatch this user...

CallVIOEXEC....I - - - - ! Go to n1<::PATCH

1-- -Compute unit addtess-

operation attempted

MVIOEXEC-iY.!SJEXE~ _Call MVIOEXEC--

User has pending
interrupts (UTABLE)
Call UNSIO

Attempt to dispatch
this user should be
runnable now

---

UNSIO
t---------..

PLACE (FORCE)

I- -

- -

-

-

To print a line
call WRTCONS
with RETURN=FORCERET(See overview of real

terminal $10)

Process CPROUEST,
return to location
designated by theIssue TRANS macro
for CCW page
Call PLACININT

Save buffer address
in MVDEBLOK-MIOB

PLACE
I- - - - Call PLACE
Move user CCW data
1----,.-a•I Process all CCW's if
into 110 buffer
chaining is on-If the end of line,~[---••-t.__:;ca::l~I:_FO~R:::_C=.E_ _ __J..

Go to DISPATCH

r'- program that called~'t" WRTCONS (return.
address in RDCONPKG)--- -Obtain terminal
110 buffer

If device not busy,
issue TRANS macro
for CAW page
If no interrupts pending,set up normal interrupt
condition in MVDEBLOK
for this operation

PLACE(PLACINIT)

f------~

Unstack andreflect theinterrupt_

I - _ DISPATC.!2_ _-- - ---

Scan MVDEBLOK for
MPX device

If any of the line
remaining to force out

1,..-,...,.t-----.r---------, -call WRTCONS with- 1-- _ ~RTC~S _ _i...l----lreturn = WRTNMVI

1----1..
~-;;and go to DISPATCH(See overview of real

terminal SIO)~-- - - - _ _1----

Set device end in
MVDEBLOKPLACE (FORCERET)

1------Test for break and

Set interrupt
pending in UTABLE

process if any
Reinitialize thebuffer~ -DISPATCH

-

-

-

- -

~

~--------MVIOEXEC(WRTNMVI)-~1- - - - - - - -Dispatch any

user

Test for break andprocess if any

Set device end in
MVDEBLOK
Set interrupt
pending in UT ABLE~-----~OR~-----------·~---------------'FIGURE 31.

-82-

Virtual Terminal SIO (Write}-~Virtual Program(Simulated
supervisor
mode)
Virtual Machine

SIO instruction
program jnterrupt

Control Program

PROGi NT

Determines program isin supervisor modeand privileged
instruction_yl.QEJ5.E.£ __MVIOEXEC

Compute unit address

Scan MVDEBLOK for
MPX device_

Determines an 1/0
operation attempted
DISPATCH

Call MVIOEXEC

Call VIOEXEC
Go to DISPATCH

Eventually attempts
to dispatch this user

If no interrupts pending
set up normal interrupt

User has pending
interrupts (UTABLE)
Call UNSIO

condition in MVDEBLOK
for this operation

UNSIO

Issue TRANS macro
for CCW page~-------

Attempt to dispatch
this user should
be runnable now

If device not busy,
issue TRANS macro
for CAW page

Unstack andreflect theinterrupt

RDCONS(See overview of real

terminal 510)

Get terminal 1/0
bufferSave buffer address
in MVDEBLOK-MVIOB
Call RDCONSDISPATCH(See overview of real
terminal 510)

Process CPR QUEST,
return to location
designated by the
program that called
RDCONS {return

address in RDCONPKGIGo to DISPATCH
DISPATCH

MVIOEXEC(MVICNRDl) ......
, 9------~·r-;stf;;:- break and - -Dispatch any

process if any

user

Issue TRANS macro
for user Page
Move CCW data touser page
Process remaining
CCS's if chaining
is on

I

Set device end in
MVDEBLOKCX)

Set interrupt pendingw

in UTABLEI

FIGURE 32.

Virtual Terminal SIO (Read)SIO on a Virtual Multiplexer Channel
When MVIOEXEC determines that an SIO operation has been
executed, the page handling routine CPAGTRANS) is called,
via the TRANS macro, to obtain the user's virtual ccw list
starting address (from the virtual CAW), and an I/O task
block and buffer area are created. If an interruption(device end or channel end) is pending on the virtual
device, an indicator is set in the multiplexer virtual
device block CMVDEBLOK), and an exit is taken to VIOEXEC.
If no interruptions are pending, MVIOEXEC determines thetype of device for which the SIO operation is requested. If
the device is a printer or card punch, the user's ccw data
must be packed Cvia the PACK routine) and placed into aspooling buffer (829 bytes>, preparatory to being written
into a spooling area on a direct access device. If thedevice is a card reader, data will be read from a directaccess spooling area into a buffer; it must then be unpacked
Cby means of the UNPACK routine) to be made available to theuser.
If the device is a user's terminal, the virtual ccw issaved, and the type of command CSENSE,NOP,ALARM,READ, or
WRITE) must be determined; special processing is required
for each command.

Following is a summary of the processing required for SIO
operations for devices attached to the multiplexer channel:
SIO - Printer or Punch: For an SIO operation to a printeror card punch, MVIOEXEC does the following:
Initializes MVIBUFF, which contains a buffer for user•s
packed ccw data, CCW's to write the buffer onto a
direct access device, and control information..
Calls PAGTRANS to bring into
contain the user's CCW data.

core the

pages

which

Calls PACK to compress the user's ccw data.
Enters the packed data into the buffer; when the buffer
is filled, it is written into a spooling file on a
direct access device by calling QUERIO.
calls the multiplexer real
I/O executive program
CMRIOEXEC) to perform the input-output operation when
the spooling file is closed. CThe file may be closed by
the user including an illegal ccw or issuing a CLOSE
command from console functions.) If the real printersand punches on the system are busy, the closed spooled
file is placed in chains starting from PRINTERS or
PUNCHES .•-84-

Note: If CP console function XFER had been previously
initiated, no real deck is punched. Instead, thespooled card deck is set up as an input deck in thevirtual card reader for the userid specified in the
XFER command.
SIO - Card reader: For an SIO operation on
MVIOEXEC does the following:a card reader,

Initializes MVIBUFF, which contains an area into which
the user's packed data will be read. CCW's to read thedata from a direct access device spooling area,
andcontrol inf orrnation. The READER chain on the system isscanned to find a spooled file for the user. If none
are found, the SIO is indicated to have terminated byan intervention-required condition.
Calls QUERIO to read packed data C80-byte card image
records packed into 829-byte physical records) from thedirect access spooling file associated with the user's
ID.
Calls PAGTRANS to bring thecore storage.
Moves data
page Cs).

intorequired user~s pages into

the specified

area

in

the

user'sSIO - User terminal:
Sense Command - User terminal: For a SENSE commanduser terminal, MVIOEXEC does the following:on aCalls PAGTRANS to determine the address of theinto which the sense information will be placed.

area

Moves sense information from the multi~lexer
device block into the provided area.

virtualNOP Command - User terminal: For a NOP co~mand on
terminal, MVIOEXEC does the following:a userScans virtual ccw flags. If the cc or CD flag
the next CCW in the chain is examined.

is on,

Indicates a pending multiplexer interruption in theuser's UTABLE if neither the CC nor the CD flag is on.
-85-

WRITE Command - User terminal: For a WRITE commanduser terminal, MVIOEXEC does the following:I
I

Calls PAGTRANS to obtainwith the I/O transfer.

the user's

to apages associatedMoves the user's data into the output buffeL.
Processes each successive ccw in the chain if thechained data flag is on. All chained data is moved into
the output buffer.
Calls WRTCONS to write the data contained in the output
buffer on the user's terminal. <control is given to
DISPATCH until the real WRITE operation is completed.)

READ command - User terminal: For a READ command for a user
terminal, MVIOEXEC does the following:Calls FREE to obtain an input buffer.
Calls RDCONS to read data into the input buff er fromthe user terminal. (Control is given to DISPATCH until
the real READ operation is completed.)
Calls PAGTRANS to obtain the address
pages into which data will be placed.

of theuser'sMoves data from the input buffer to the specified areasin the user's pages.
Processes virtual ccw flags.
Processes each successive CCW in the chain
chained data or chained command flag is on .•

if

the

ALARM Command - User terminal: For an ALARM command for auser terminal, MVIOEXEC does the following:Calls WRTCONS to write an "alarm" message on the user
terminal (control is given to DISPATCH until the ALARM
is completed> •Processes each successive ccw in the chain
chained data or chained command flag is on.

ifthe'...,. __-86-

When special processing for each type ofcompleted, MVIOEXEC performs the following:
Checks for command
command if on.

chaining

andcommandprocesses the

is
next

Calls PAGTRANS to determine the address of the virtual
virtual csw, and removes the I/O wait
indication from the user's UTABLE.

csw, stores theCalls BREAK if the attention key was activated during aread or write operation.
Returns control to theprogram CVIOEXEC).

virtual machine

I/O executive

TIO on a Virtual Multiplexer Channel
When MVIOEXEC determines that a TIO operation has beenrequested, the multiplexer virtual device block CMVDEBLOK)
is examined to determine whether an interruption (channel
end or device end) is pending for the virtual device.
If a channel end interruption is pending, the channel end
indication is removed from the MVDEBLOK. If a device end
interruption is pending, the device end indication isremoved, and device end is indicated in the virtual csw.
For either type of interruption, a condition code of 1 isset in the virtual PSW.
If no interruptions are pending,the condition code remains zero.
When the condition code has been set, the normal MVIOEXEC
exit is taken:
The virtual csw is stored, and the I/O wait indicationis removed from the user's UTABLE.
The BRKWR or BRKRD routines are called
if an •attention• is seen.
Control isreturned to thee·xecutive program CVIOEXEC).

virtualif required or
machine

I/O

TCH on a Virtual Multiplexer Channel(

When MVIOEXEC determines that a TCH operation has beenrequested, a SCAN macro is issued to obtain the channel
status.
If the channel is not operational Cthat is, nochannel by that number is defined in the virtual machine>, a
condition code of 3 is set. If any interruptions are pending
for the channel, a condition code of 1 is set. If thechannel is busy, a condition code of 2 is set. If no-87-

interruptions are pending for thebusy, a condition code of 1 is set.

channel and

it is

not

When TCH processing is completed, control is returned to
the virtual machine I/O executive program CVIOEXEC).
EIO on a Virtual Multiplexer Channel
When MVIOEXEC determines that an HIO operation has beenrequested, it sets the user's condition code to zero if
there is an interruption pending, and to 1 if there is nointerruption pending.
Pseudo Timer Device - TIMR
When MVIOEXEC detects an SIO to a virtual multiplexer
device type TYPTIMR, it fills in the specified read buffer
with the time of day (hh/mm/ss>. date Cmm/dd/yy>. total
virtual CPU time (VTOTTIME), and total CPU time CTIMEUSED)
used since logging in. No actual I/O operation is performed,
and no real device is associated with this operation. Thereis no interrupt from thisdevice after the data istransferred. The SIO ends with a condition code of zero fora successful operation, or 3 if the pseudo timer does notexist in the user's virtual machine configuration.

PROCESSING DEDICATED MULTIPLEXER DEVICES
If multiplexer
devices are
dedicated toaparticular user, they are structured and handled by CP-67 asthough they were selector type devices. Thus a virtual SIO
to a dedicated printer, for instance, would go through theselectorI/O processing
logic andnot throughthemultiplexer spooling logic. Any CP-67 multiplexer device
can be dedicated to a user at the time he logs in to CP-67
or through the ATTACH capability.
When a multiplexer device is attached to a user on
a nonshared (dedicated) basis, a restructuring of the realand virtual control blocks is required. As an example,
suppose t~e operator is attaching the real printer to a user
as a dedicated device. The real printer is "030" and thevirtual address is "OOE". The user cannot already have a
device of address OOE in either his virtual selector devices
or multiplexer devices. The real multiplexer device block
CMRDEBLOK) for the printer.030 is located.
If the printeris not busy or already attached, the MRDEBLOK is marked as"dedicated". A routine called DEDICATE then creates a real
selector channel, control unit, and device block for the
printer, and chains these blocks with the other real blocks
CRCHBLOK, RCUBLOK, and RDEVBLOK).
Then virtual selector
channel, control unit, and device blocks are created and arelinked to the newly created real blocks by VPNTREAL in the-88-

VDEVBLOK. Since the device is now structured as a selector
device, I/O simulation and interrupt handling will be as
outlined in "Processing User Selector Channel I/O Requests".
This structure will be maintained until the user detaches
the dedicated device or logs out.
In either case, thelogout routine (USEROFF) will detect a dedicated device thatwas structured using DEDICATE and will call RELEASE to free
the real channel, control unitr and device blocks and to
free Cundedicate) the device on the multiplexer CMRDEBLOK)
chains. The device (printer, for example) is now available
for CP-67 spooled output.

PROCESSING VIRTUAL 2702 LINES
Virtual 2702 lines in a user's machine require
special consideration
because of
the natureof theteleprocessing applications that these virtual machines may
run.
For a virtual machine with nondedicated virtual
2702 lines defined in the CP-67 directoryr the virtual I/O
blocks are built as selector I/O blocks. Every virtual 2702
line bas its own virtual selector channel, control unit, anddevice block (VCHBLOK, VCUBLOK, and VDEVBLOK).
The blocks
are structured this way so that a dedicated 2702 line can belinked to them when linkage is initiated by DIAL <see thenext section for DIAL processing). In order to properly
process a DIAL request, the virtual 2702 block must be
initialized. This is under control of the virtual machine.
When the virtual machine issues an "enable" sequence to a
virtual 2702 line, CP-67 performs all the normal handlingfor a user selector I/O request with one major exception.
Since there is no real device on which to perform the I/O
operation when the "enable" is issued, the IOTASK created by
VIOEXEC is held waiting for a DIAL request. The user isgiven the condition that the I/O is started, but it will notcomplete, of course, until a DIAL is handled, simulating acall completion.
The •enable" ccw is changed to a "write
circle C" to effect line behavior as though a call had been
completed. Any SAD commands are made NOP since the realline has already been set by CP-67 and the SAD number could
be different for virtual machines.
The module CCWTRAN
detects I/O to virtual 2702 lines and changes the "enable"
and SAD commands. CCWTRAN also retains the IOTASK (pointed
to by VPNTREAL in the VDEVBLOK for the virtual 2702 line)
and indicates to VIOEXEC (which called CCWTRAN) not to call
QUEVIO since no real device yet exists.
Figure 33 illustrates the processing of virtual
2702 lines before and after a DIAL console function isissued.

-89-

v - 2702
vcu

VCH-------,VDO-VIRT ENABLE

1/0 TASK\\\ENABLE
CCW(s)

\
\
\

\
\

RCH

---

re

?

- -+-

RCH

,,

,,

RCU

RCU

RCH

RCU

9

,,
RDV

MDEV

,,
...-

~
~

0

I

·I

RDV

RDV

/

MDEV

1/0 block chain before ( - - )(- ----1and after

I

0

RDV

--- -

-

l·..._______.MDEV

~

-

- "
-----

MDEV

MDEV

Did a DIAL

a DIAL procedure

FIGURE 33.

-90-

-

Processing a Virtual 2702 Line

_ _j

PROCESSING A DIAL REQUESTThe DIAL method of attaching to a virtual machineis an alternative to LOGIN with a unique userid.
Aftermaking contact with the computer and receiving the message"CP-67 online", a user can enter "dial xxxx", where xxxx is
the userid of a virtual machine with virtual 2702 lines.
The DIAL request can be considered as a self-initiatedrequest to "attach" the terminal to the desired virtual
machine on a dedicated basis. The module DIAL will search
for an "enabled" (virtually> 2702 line that is not in use on
the requested virtual machine. When one is found, DIAL willcall DEDICATE to attach the terminal that entered "DIAL" tothe virtual machine.
DEDICATE will mark the terminal from
the MRDEBLOK chain as dedicated and create real selector
channel, control unit, and device blocks.
These will belinked to the already existing virtual selector channel,
control unit, and device blocks.
The IOI'ASK that was being
held (from the "enable" sequence> is now allowed to proceedby DIAL calling QUEVIO.
I/O interrupts and subsequent I/Orequests to that virtual 2702 line will now be handled inexactly the same fashion as dedicated multiplexer devices.
However, in order to expedite the efficient handling ofdedicated (DIALed) 2702 lines, a further step is taken.
In
CCWTRAN, detection is made when a virtual machine issues adisable to a DIALed 2702 line.
When a virtual "disable" isdetected, CCWTRAN creates a dummy CSW with normal completionand calls VIRA to process what appears to be the completionof the "disable"; however, no I/O operation is performed.
CCWTRAN then calls RELEASE to free the real selector blocks
for the dedicated 2702 line. RELEASE will set processing in
effect to go to OFFHANG in CONSINT. OFFHANG writes amessage to the terminal indicating that the terminal is now
under CP-67 control.
OFFHANG will then either disable theline and then reenable (as done in LOGOUT) or proceed to
IDENT2, which will start with "CP-67 online" and then wait
for a LOGIN or a DIAL (as done in LOGOUT HOLD).
The
alternative is an installation option defined in CONSINT.
Special handling is also required if the virtual
machine with virtual 2702 lines either detaches 2702 lines,
does an HIO to "dialed" or "enabled" lines, or logs out of
CP-67. Since "enabled" lines have IOI'ASK blocks pending,these must be released if the virtual line is to beconsidered no longer active. The VIOEXEC module has special
code to handle an HIO to an "enabled" 2702 line. VIOEXEC
will call VIRA to indicate that the "enable" has been
halted.
HIO to a "dialed" 2702 line is allowed to proceed
in the normal fashion. The RELEASE module Cin USEROFF) also
has code to call VIRA, release the IOTASK block, and returnthe device to the MRDEBLOK chain.

-91-

VIRTUAL RPQ'S
Five special functions are provided by CP- 67 to virtual
machines; these functions either are not available on a real
System/360 or normally would require operator intervention.
RPQ Timer - This is a special device type (TIMR) defined in
the directory to provide time information to a virtual
machine. The device can have any address, but for CMS
it is defined as OFF. The virtual machine issues an SIO
to the device with a •read• ccw using a 24-byte dataarea, which must not cross a page boundary. The
following information is placed in the 24-byte data
area.
Location
0-7
8-15
16-19
20-23

Data
date as MM/DD/YY
time as HH • .MM.SS
value from TIMEUSED
value from VTO'I'TIME

There is no interrupt fromtransfer.

the device after

the data

Readable punch - This function is provided by the XFER
console command.
It routes the output from a user's
spooled card punch to his or another user's spooled
card file input.
This £unction operates simply by
SFBLOK routing. When a user issues CLOSE to a spooled
punch, the SFBLOK is chained on the spool READER chain
for the XFERed userid to read instead of being chainedon the PUNCH chain for real punch output. The XFER fora printer works in a corresponding fashion.
Rereadable reader - This function is provided by the SETCARDSAVE
ON consolecommand.
This functionisaccomplished by exception handling when a spool reader
is CLOSEd by a user.
Instead of scheduling the filefor deletion from the spooling space, the SFBLOK is
maintained on the READER chain so that the file can bereread from the beginning.
Wide card reader - There are two types of special spool card
readers. The first type is a "wide" 2540 reader thatallows the user to read more than 80 bytes from one•card". For instance, this capability is used by CMS
when reading a spool reader, since that reader may
contain 80-byte •card• files or 132-byte "card" files
as a result of XFERed printer files.
The second type
is used to retrieve spool data in special format. This
type (called RPRT or RPUN) is used to read the CP-67
system disk dump, for instance.
It is a spoolingreader that transfers to the user data areas (CCW
addresses> up to 825 bytes of packed spool data. No
attempt is made by CP-67 to analyze op-codes, lengths,-92-.

or data.
Thus, core dumps on disk can be read by avirtual machine having this type of card reader. RPRT
is for reading files normally scheduled for printeroutput, and RPUN is for punch output.
DIAGNOSE - This privileged instruction cannot be simulatedor allowed to execute. Accordingly, this op-code isused as a means of communication at the programming
level between a virtual machine and various CP-67
functions. See"The Diagnose Instruction"
for adescription of each code allowed.

INTERRUPTION HANDLING
Five major types of interruptions must be handled by theControl Program: SVC interruptions, external interruptions,program interruptions, machine check interruptions, and I/Ointerruptions. Handling of I/O interruptions is discussed
under the earlier heading "Processing Control Program I/O
Requests". This section describes how the other four types
are handled.
SVC Interruptions
When an SVC interruption occurs, the SVC interruption
routine CSVCINT) is entered. If the machine is in problem
mode, the type of interruption is placed into register 1q,
and the
REFLECT routine
is called
to reflecttheinterruption back to the pseudo-supervisor (that is, thesupervisor operating in the user's virtual machine). If themachine is in supervisor mode, the SVC interruption code isdetermined, and a branch is taken to the appropriate SVC
interruption handler. See Figure 3q for a flowchart of the
SVC Interrupt Handler.

-93-Entermodule PSA
entry SVCINT

No

Determine

Yes

SVC code

DIE

svco

Save GPR's

Dump
SVC4

Link
SVCS

Get a savearea from'NEXTSAVE'

Goto
OSK DUMP

Save GPR's
12and 13

Load addressof SVCOPSW
in R14Go to
REFLECTRET
SVC 12RLSE
SVC 16Store return

Release savearea toaddress fromSAVEAREAin
SVCOPSW

Release savearea to'LASTSAVE'

Save SVCOPSW
address as
return address

Restore GP R's
12 and 13

Go tocalled routine

LPSW
SVCOPSW

Figure 34. Flowchart of the SVC Interrupt Handler-94-'LASTSAVE'

RestoreGPR 13LPSW
SVCOPSW

SVC O - Impossible condition or fatal error: If the SVC
interruption code is O, the SVCDIE routine initiates an
ABEND by going to the DSKDUMP routine.
SVC 4 - Reserved for future use.
SVC 8 - Link request <transfer control from calling routine
to called routine specified by register 15):
If the
SVC interruption code is B, the SVCLINK routine saves
registers, sets up a new save area, inserts thecontents of register 15 Cthe address of the routine forwhich the link is requested)
into the SVCOPSW {andregister 12), saves the old addressability in the savearea, saves the old save area address in the new savearea, and issues an LPSW instruction for the SVCOPSW torestart the Control Program at the linked address.
SVC

12
Return request Ctransf er control from calledroutine to calling routine): If the SVC interruption
code is 12, the SVCRET routine is entered to restore
registers 12 and 13 (addressability and save area
address saved by SVCLINKJ, places the user's return
address (also saved in the area) back into the SVCOPSW,
and returns control to the calling routine by loading
the SVCOPSW.

SVC 16 - Release current save area from the active chain<and thereby also remove linkage pointers to thecalling routine): If the SVC interruption code is 16,
the SVCRLSE routine releases the current save area byplacing the address of the next higher save area inregister 13, and returns control to the current routine
by loading the SVCOPSW. This SVC is used by second
level interrupt handlers to bypass returning to thefirst level handler under specific circumstances.
SVC 20 - Obtain a new save area: if the SVC interruption
code is 20 the SVCGET routine places the address of thenext available save ar~a in register 13 and the addressof the previous save area in the save area pointerfield of the current save area.
There are 35 save-areas initially set up by CPINIT for use
by the SVC linkage handlers. In addition, if the supply ofavailable save areas drops to O, the linkage handlers willcall FREE to obtain one.

(

External Interruptions-95-

When an external interruption
occurs, the externalinterruption handler (EXTINT) is entered. See Figure 35 foran overview of the ~ternal Interrnytion Handler.

-96-

Entermodule PSA
entry EXTINT

No

Yes

Locate system
operator(UTABOPTR)

Yes

Mark
disconnect

Find
RUNUSER

Yes

No(Idle)LPSW
EXOPSW

Get current
UT ABLE(RUNUSER)

Provide DISPATCH
with operator to be
charged time

Save VGPRS
and VFPRS

Update VPSW
from EXOPSWProvide DISPATCH
with user tobe charged ti me

Goto
DISPATCH

Figure 35. Overview of External Interruption Handler-97-

If EXTINT is entered because of a timer interruption, themachine mode must be determined. If the machine was insupervisor mode,
control is transferred tothe maindispatcher and control routine (DISPATCH>, which will become
idle until another interruption occurs. If the machine isin pro bl em mode, the address of the current user• s UTABLE is
obtained from RUNUSER. The user's current PSW (VPSW)
is
updated from the external interruption old PSW (EXOPSW), theaddress of the current UTABLE is placed in register 11, andcontrol is transferred to DISPATCH.
If EXTINT is entered because of the operation of theconsole interrupt button (EXTERNAL), the following steps aretaken:(1) the current system operator is
located (via
REALOPI'R), and (2) his virtual machine is disconnected. He
may now log in from another terminal. The operation of theconsole interrupt button is used to implement an alternate
operator's console.

Program Interruptions
When
a programinterruption
occurs, theprograminterruption handler (PROGINT) is entered. (See Figure 36
for an overview of PROGINT.)
Program interruptions may
result from
(1) paging requests, (2) privileged operations
CI/O), and (3)privileged operations (non-I/O).
PROGINT
determines the cause of the interruption by examining theinterruption code.
If (3) has occurred, PROGINT transfers
control to PRIVLGED.

-98-

EntermodulePROGi NT

Save GPR's
10- 15 in
TEMPSAVE

Yes

Yes

Get user(RUN USER)

Yes

No

Save Reg's

Segment

Get address

Go to
DSKDUMPSet invalid
addressof simulation

routineGet save areafrom 'NEXTSAVE'
and save GP R's

simulation

routinePage

No

Save VM status
VPSW and YR EG's

Go to
PRIVLGEDr utinYes

Save VM status
VPSW and REG's

Get address
to betranslated

Initiate paging
operation(PARM= BRING+
USED)

Go to
DISPATCH

Figure 36. CP-67 Program and PRIVLGED Interrupt Handler (1 of 4)

-99-

LPSW

SSK

SSM

Get

Get absolutedata address

ISK

EX

Get

SEGTABLEPAGTABLE
SWPTABLE

1/0

VIOEXEC--SEGTABLEPAGTABLE
SWPTABLE

Get absoluteaddress of

Get absolutedata address

DIAG

Initiate I/0
operation

Get DIAG
code

instruction to
be executedMove data to
VPSW (address)

Get key fromuser VGPR

Read key(ISK inst.)

Set the key(SSK inst.)

Store keyin VGPR(pass key to
user)

4

8

Set invalid
operation

code

Store data to
VPSW (MASK)

0

10

20

FMTILOG

FMTMLOG

Format 1/0

Format M/Cerror cyl.

Get CP·67
consolefunction

COMENTRY
Move CPlocations to

VM locations

Execute theconsolefunction

error cyl.

Figure 36. CP-67 Program and PRIVLGED Interrupt Handler (2 of 4)-100-

WriteDIRECT

LRA

Invalid
OP. CODE

Get absoluteinst. address

and register

Get EXTUTAB

Get EXTUTAB

receiving

results

Get virtual
SEGTABLE andPAGTABLE

Get virtual

address

Get data andGet data andnumber of

number of

CREG's to be
moved

CREG's to beMove datafrom VCREG's
to data area

Move datafrom data area
to VCREG's

moved

Store resultsin VGPR and
VPSWFigure 36. CP-67 Program and PRIVLGED Interrupt Handler (3 of 4)-101-

Move firstword of VPSW
to VOPSW

Yes

Issue TRANS
macro forpage zeroMove VPSW
to
VOPSW

Go to
dispatch

Move VNPSW
to VPSW

Move second
word of OPSW
to VOPSW

MoveVNPSW
to VPSW

Set interrupt
code in int.
code location(VIRTUAL)

Set interrupt
code in
VOPSW

No

Set interrupt
code in int.
code location(VIRTUAL)

Set interrupt
code in
VOPSW

Go to
dispatch

Construct

restartVPSW

Go to
dispatch

LPSW
VPSW

Figure 36. CP-67 Program and PRIVLGED Interrupt Handler (4 of 4)-102-

Paging Interruptions
If the program interruption is caused by a paging
request, and if the interruption occurs when a virtual
360/67 is running in extended mode with translation on, a
special processing takes place. See •Running a Virtual 67"
inthe
CP-67 Operator's Guide.
Otherwise,
PROGINT
determines whether a segmentation error Ca segment of the
program missing) has occurred. If the interruption code
resulted from a segmentation error, an invalid addressinterruption code is set, and the interruption is reflectedto the user's virtual machine supervisor.
If a segmentation error has not occurred, the user's
current PSW is updated from the program old PSW CPROPSW),
the address of the current UTABLE is placed in register 11,
and PAGTRANS is called to obtain the required page. Whenthe paging operation is completed, control is returned to
DISPATCH. (See Figure 37 for an overview of PAGTRANS.)

(_
-103-

Entermodule PAGTRANS
entry PAGTRANS

Translatevirtualaddress(LRA inst.)

Load mach. sizein R2, setcondition code
in RO

(Seg excp)

Get
CORT ABLE

00 (in core)

01

entry

Set condition
code= 1Exit

Get SEGTABLE
entry

Get PAGTABLE

entry

Get SWPTABLE

entry

Exit

Set lock bitincrement
lock countFi.id paging
task blockwith matching
page int.

Set condition
code= aLocateCORT ABLE

Exit

entry

Set changed/
used·bits if
requiredExit

Set transit
bit inSWPTABLE

Set lock bitincrem·ent
lock countSet upCORTABLE

search limits

CreateCPEXBLOK

Chain OPEXBLOK
to IOT ASK withmatching
page int.

Issue SVC 16

releasecu.rrent
save area.

Goto
DISPATCH

Figure 37.

-104-

Overview of PAGTRANS (l of 3)

Get CORT ABLE

entry
(next)

SVC 0

Store UTABLE
pointer in

Save thisentry

CORT ABLE

Set transit
bit inCORT ABLE

Get UTABLE

belongingto this user

Get SWPTABLE

for this
page

Calculatephysicaladdress ofpageStore pageaddress in
PAGTABLE

Set PAGEWAIT

increment
PAGEWAITcount

Set transit
bit inCORT ABLE

Set page-notin-core bitin oldSet page-notin-core bitin oldPAGTABLE

PAGEGET
Yes

Yes

PAGTABLE

Set readcode forccws

Store SWPTABLE

pointer in
CORT ABLE

Figure 37.

Allocate space
for a page on
drum or disk

Set write
code forccws

Decrement
PAGEWAIT

count

Overview of PAGTRANS (2 of 3)
-105-

/

Enter

Enter

....

'

/'
module
PAGTRANS
entry PAGEWAIT

odule PAGTRANS
entry PAGDUM

Set up IOTASKblock
TASKIRA=WAITPAGE

Goto
DISPATCH

Put IOTASKRestore REGS

block infor return

paging queue

to caller

Start channel
again if freeNo

Decrement
Get real

devicePAGEWAIT countreset PAGEWAIT
bit when

Exit

type

svco

count= 0

Reset

Build CCWS
for 1/0transit bit(CORT ABLE)

operation__q_UEf'!.!Q._

Issue SVC 16

releaseQueue 1/0

current

task for 1/0

save area

operation

Read

Write

PAGDUM
Chain CPRQUEST
from IOTASKDUm"iTIYcai1tosave regs. anddo defer if
requested

Reset transit

Save

bit
(SWPTABLE)CPEXBLOK

if anyIf shared page

Set PAGEWAIT
and increment

get key 'O'

PASWCT(UTABLE)get key 'F'

Set PAGEWAIT
bit ONNon~shared page

Set changed/
used bits if
required

Set storage
keys(SWFTABLE)_.£~111£~Set lock bitincrement

Put CPEXBLOK
in CPSTACK

lock count~ --~Set up CPRQUEST

block

Set condition
code= O

Exit

Figure 37.
-106-

Chain CPROEUSTfrom IOTASKGotoDISPATCH

Overview of PAGTRANS (3 of 3)

queue

Exit

Privileged Operation Interruptions
If
theprograminterruption iscausedbythepseudo-supervisor issuing a privileged instructionr PRIVLGED
obtains the address of the privileged instruction anddetermines the type of operation requested.
For I/O instructionsr PRIVLGED calls the virtual I/O
executive program(VIOEXEC).
PRIVLGED
simulates valid
non-I/O privileged instructions and returns control to
DISPATCH. For invalid privileged instructions, the routine
sets aninvalid interruption
code andreflects theinterruption to the pseudo-supervisor.
The non-I/O privileged instructions that are simulated
are LPS~J r SSMr SSKr ISKr and DIAG. For the "Virtual 6 7"
optionr the privileged instructions LRAr STMCr and LMC are
also simulated.
The Diagnose Instruction
The diagnose instruction (DIAG) has special handlingunder CP-67. The diagnose command is used for coromunication
between a virtual machine and the Control Programr CP-67.
The machine-coded format for the diagnose command is:
83

R1

R2

CODE

The "CODE" is a base value that is used toparticular specialized CP function.
The codes
assigned and their associated functions are:select acurrently

FUNCTION

CODE
0

Dump CP core

4

Fetch CP location

8

Virtual console functioncPseudo timer

10

Release pages

14

Reserved for future IBM use

18

Disk I/O

lC

Clear I/O error recording

20

Clear M/C error recording

24-FC

Reserved for future IBM use-107-

Note: User defined DIAG Codes:
X'OO' through X'FC'
X'lOO' through X'lFC'

Reserved for IBM use
Reserved for users

Diag code should always be a multiple of 4.
See the module PRIVLGED for analysisof these functions.

I
I
I
I

and/or implementation

The execution of diagnose code Or dump systemr causes a
system abend by issuing SVC 0(dump). This can only be
executed by a privilege class A user. The format of thecommand is:I
I

83000000

I

I
I
I

The execution of diagnose code 4r fetch CP locationsr can
only be issued by users with privilege class A or B. The
format of the command is:

83 Rl R2 0004
Rl contains the virtual address ofaddresses.

a list of CP <rea1)

Rl+l contains a count of entries in the list.
R2 contains the virtual address of the result fieldthat will hold the values retrieved from the CP Creal>
locations.
The execution of function Br virtual console functionr
allows a virtual machine to perform CP-67 console functions.
The format of the diagnose command is:

83 Rl R2 0008
where Rl is a register that contains the address <virtual)of the CP console function command and parametersr and R2 isa register that contains the length of the associatedconsole function inputr up to 132 characters.
The following
function:-108-

example will

illustrate thevirtual console

R6,CPFUNC
R10,CPFUNCL
X'83',X'6A',XL2'0008'

LA

LA
DC
CPFUNC DC
CPFUNCL EQUC'QUERY FILES'*-CPFUNC

The output of the console function is to the user's
terminal, and then execution continues.
Any valid andauthorized console function can be executed in this manner.
completion code is returned to the user as a value in theregister specified in R2. Code 0 is normal, 4 is invalid
command, and 8 is bad argument. Other condition codes may be
used by processing routines in CP-67. LINK, for example,
returns several codes to indicate device status Csee LINK
module).

A

I
I

I
I
I
I

Diagnose code
is:

I
I

c - pseudo timer.

83 R1 00 00

The format of

the commandoc

R1 contains the virtual address that will receive 24
bytes of data in a format identical to the SIO to thepseudo-timer device (for example, 'OFF' in CMS). Thisdata is provided by 'diagnose' as a faster method than
SIO.
Diagnose code 10 - release pages.
is:The format of the command

83 R1 R2 0010
R1 contains the virtual address of the first page to bereleased and R2 contains the virtual address of thelast page to be released. Any of the virtual pages inreal core or auxilliary storage are released.
Diagnose code 14 - reserved.
Diagnose code 18 - Disk I/O. The format of the command is:

I
I
I
I

I

83 R4 R8 0018

R4 contains the device address of the disk.

-109-

R8 points to a standard ccw chain to Read or Write thedisk record of up to 4096 bytes.
Standard CCW string:A

SEEK,A,CC,6
SRCH,A+2,CC,5TIC, *- 8, 0, 0
RD or WRT,DATA,cc,<4096
NOP,0,SILI,1
SEEK and SRCH arguments

The execution of diagnose code lC, clear I/O recording, canonly be issued by a privilege class c user. This code calls
the FMTILOG routine to clear the I/O error recording data on
disk. The format of the command is:

8300001C
The execution of diagnose code 20, clear MC recording, canonly be issued by privilege class c user.
This code calls
the FMTMLOG routine to clear the machine check error
recording data on disk. The format of the command is:

83000020

Machine Check Interruptions
When a machine check occurs in supervisor mode (CP-67
nucleus), a message is printed to the operator, the alarm isrung, and the system will ABEND with a dump.
When a machine check occurs in problem <user> mode, amessage is typed on the operator's console, and a message issent to the affected user. The user's machine is placed inconsole function mode.
If the user enters "BEGIN", hismachine will take a "machine check" by CP loading his
machine check new PSW.
CP-67 and other users are notaffected.
Machine Check Error Recording Routine - MCKERR
See Figure 38 forInterruption Handler.

-110-

an

overviewof theMachineCheckEntermodule PSA
entry MCHEKINT

Save 'GPRs' andFPR'S in'stopped'
status areaNo

Get operator(UTAGOPTRI

Yes

Yes

Get interrupted
user {RUNUSER)

No

Save VGPA'S_ ~s_K~R_!:! _Get console
address

Put machine
check ondisk

UpdatttVPSW
from MCOPSW

Send message

WRTCONS

Sendm7g't0----- -

to operator(multiple
mach. checks)

operator (machcheck CP-67
supervisor mode)

LPSW
wait state_D~~i:!:H_

MCKERAPut machine
check ondisk

Set message(mach. check)

Dispatch until
msg.write
completesvco
Send message
to user

WRTCONS~dm;Qt7;operator lmach
check problem
mode USER ID= I

Goto
DISPATCH

No

Yes

Update VPSW
from MCNPSW

Set message(mach. checkCP enteredrequest, please)Yes

Put user in

CP modeFigure 38. Overview of Machine Check Interruption Handler

(
-111-

All machine checks, whether supervisor or problem state,
are recorded by CP-67. The first two tracks of the CE
cylinder are reserved for machine checks. The format of themachine check error record is as follows:

LOGMDATE
LOGMCODELOGMCPU
LOGMPSW
LOGMGRS
LOGMCRS
LOGMFPRS

ORG
DS
OS
DS
OS
DS
OS
OS

LOGDATA
CL6
CL2
22D
50

16F
16F
40

M/C ERROR RECORDDATE AND TIMEMACHINE CHECK CODE
CPU LOGOUT DATAOLD PSW's
GENERAL REGISTERSCONTROL REGISTERSFP REGISTERS

Two machine check error records are contained within one
physical record.
Thus a maximum of 30 records may becontained within two tracks of a 2314 SYSRES. When themachine check log is full, the message "** CECYL FULL; M/C
ERRORS NOT RECORDED **• is printed at the operator's
terminal, and subsequent machine checks are not recorded
until CLEARMC is run by the customer engineer. Pointers are
kept to the next available slot in the log so that machine
check errors are recorded sequentially. If an I/O error
occurs when attempting to write a machine check error
record, i t is retried eight times. Upon continued failure,
an error message "** IOERROR RECORDING FAILURE ON DEV~- **•is sent to the operator.

INTERRUPTION REFLECTION
When an SVC interruption or a program interruption occurs
and the user's virtual machine is operating in problem mode,
the interruption is reflected back to the user's supervisor(pseudo-supervisor) for handling.
The
programinterruption handler(PROGINT),
upon
determining that the interrupted user is operating in
problem mode, saves the virtual registers and their old PSW(PROPSW).
The current PSW is moved into the old PSW, and theinterruption code is set. If necessary, PAGTRANS is again
called to obtain the address of the new PSW, and the new PSW
is moved into the current PSW.
When adjustment of PSW's iscomplete, control is returned to DISPATCH, which will
eventually allow the user to resume processing.
Figure 39
interrupts.

-112-

illustrates theprocessing andreflection of

Real Machine State
Interrupts

Real Supervisor State

Real Problem State

Virtual Supervisor
State

Virtual Problem
State

OS or CMS

Problem Program

GP

External

Masked off

SVC

For subroutine
linkageStart another user; end of 50 ms time slice for this user.
External
Virtual interrupts
Timersimulated- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ---1
Reflect interrupt to virtual machine----- --- ---- - - - - - - - - - - ---------Program

ABEND

Privileged

Not possible--- - --- - - -+-- - --------- - ----- Machine check

ABEND---------- ------------------1/0

Masked off

Reflect interrupt to virtual machine:. ------:,:;;~~~~~~~.~-------r ~~--

- ---:B~N~---- ----t--A~~:D- -------- - ------ -- --- - -- ---- --- - - - - - - - - -Restart channel.
Record the device status in virtual
machine description if virtual 1/0.

'------------ ------ ----- ------ ·'------------- ------- - - -- - - - - - - Reflect on interrupt:
Current PSW - - - ._Old PSW
New PSW- - - Current PSW
Set interrupt code; decrement timer;
timer interrupt if required.

FIGURE 39.

Processing and Reflecting of Interrupts.-113-

MAIN STORAGE MANAGEMENT (PAGING)
The PAGTRANS routine is responsible for satisfying thepaging demands placed on the system by user programs.
Itsatisfies requests for page access via the TRANS macro fromvarious parts of the control Program, including the programinterrupt
handler CPROGINT>
forpaging faults,
theinput-output string handler CCCWTRANS) for user-initiatedinput-output
operations,
etc.
PAGTRANS
has
theresponsibility for freeing up
main memory space whenrequired, performing the input-output operations necessary
to free the space, and protecting the system against "paging
overload" conditions that may arise during periods of peakdemand for the memory resource.
All calls to PAGTRANS are made through the use of themacro instruction TRANS. If LOCK is not specified in the
TRANS macro and the virtual page is already resident inmemory, there is no need to call PAGTRANS, and the call is
bypassed by the macro generation.
Required Page in Core
When PAGTRANS translates the virtual address
Cvia theLRA instruction) and finds that the page containing theaddress is currently core resident, a test must be made to
see whether the LOCK option has been specified. (Normally,
this will be the case, for the TRANS macro would not havegenerated the call to PAGTRANS for an in-core page if the
LOCK option was omitted.) If lock is requested for the page,the lock count for that page is incremented, and the lock
flag is set in the core table entry for that virtual page.
When the lock flag is set, the page is not available for"swapping• (that is, i t will be retained in storage until
the lock count is reduced to zero and the lock flag iscleared). The lock count cannot be greater than 65,535.
When lock processing is completed (or if LOCK was not
requested), a condition code of zero is set, the translated
address is stored in the calling routine's save area, andcontrol is returnE!d to the calling routine. A conditioncode of zero indicates that the address translation was
successful and that the specified virtual page is in core.
(Note that the TRANS macro will automatically perform an LRA
instruction after the returnfrom PAGTRANS.
In someinstances, it would be possible for the paging routines toreturn a page as in core and have i t chosen for swapping,
and therefore nonresident, before the actual return to thecaller. This is true only in DEFER cases.>Required Page Not in Core
When PAGTRANS translates the virtual address and findsthat the page is not core resident, the entry for that pagein the user Is SWPTABLE is found.
The SWPI' ABLE entry-114-contains the direct access storage address of the required
virtual page. A test is made to determine whether the BRING
option was specified when PAGTRANS was called. If BRING was
not specified, a condition code of 1 is set, and control isreturned to the calling routine.
A condition code of 1
indicates that the required page is not in storage.
Required Page in Transit

I
I
I
I
I
I
I
I
I

If the required page is not in core and the BRING
option is specified, the transit flags in the SWPTABLE entry
are examined to determine whether the virtual page is intransit <that is, a previous request to read in the page ora request to write the page out has not yet been completed.)
If the page is in transit, a Control Program execution
request block (CPEXBLOK)
is created and chained to the
input-output task block (IOTASK) for the pending read or
write operation, and PAGEWAIT is indicated in the VMSTATUS
entry of the user's UTABLE. When the page I/O operation has
completed, the CPEXBLOK is added to the CPRQUEST queue, andcontrol is returned to DISPATCH. If the operation was aread, the PAG~"'WAIT condition is removed and the CPEXBLOK
indicates a return to the initial caller of PAGTRANS. If theoperation was a write, the CPEXBLOK indicates a re-enter to
PAGTRANS to retest the transit flags.
Obtaining Core for a Paging Operation
If the required virtual page is neither in core nor intransit, and the BRING option has been specified, PAGTRANS
must prepare to read the page into storage. An available
page of core into which the required virtual page may beread roust be found.
The table used for managing the real machine core
allocation is called the CORTABLE. There is one 16-byteentry in CORTABLE for each 4096-byte page of real core. See
the description of the CORTABLE control block for the bit
usage.
Each entry of the CORTABLE is examined in a round-robinmanner to determine whether the associated page is available
for a paging operation. The search begins at the first entry
after the last selected page.
The Lock MASK byte must be zero in order
page eligible for paging.

(to have thatOn the first pass each entry is examined, and if eitherofthe following
two conditions
is satisfied,thecorresponding page is selected:
1. An entry with bytes 5-7 equal to X'FFFFFF' (pages
not in use by any user).
2. Neither of the keys for the page has the reference
bit set on.

-115-

I
I
I
I
I
I

If the first pass fails to find an eligible page, thenon the second pass any entry with a Lock MASK of zero isselected, since all such pages are equal candidates forselection. Both passes are initiated and terminated at thenext entry
after the last · one used. All non-locked pages
that are examined and not selected have their reference bits
turned off.
If the selected page has a changed bit on, the page
must be written to its DASD location (that is, swapped)
before the new virtual page is read in. The DASD address isobtained from the corresponding
swap table entry, an
input-output task block is created, the page table entry forthe page is marked •not-in-core•, and the IOTASK block isqueued for execution.
The address of the page selected for the paging
operation is stored in the page table, and the not-in-coreflag is set in the page table entry.
Reading a Required Page into core
When an available page of real core has been found, thepage address is stored in the page table entry and thenot-in-core flag is set. The transit flag is set in thecorresponding swap table entry, and the transit bit is set
in the core table entry.
The DASD address of the required virtual page is
obtained from the SWPTABLE, and an IOTASK block and achannel command word (CCW) list for reading the page in are
created: the routine QUERIO is then called to queue the task
to the input-output task list.
The "recompute" flag is used when a new swapping DASD
address is to be used when the page is changed.
At logintime (and at a re-IPL for a virtual machine> the swap table
entries are all set to the DASO address of a "zeros• page on
the CP-67 system residence volume.
The recompute bit is set in each entry by LOGIN so thatthe page will be assigned an appropriate secondary storage
location when it is referenced.
This process, called
dynamic page allocation, ensures that only those pages in auser's virtual machine which change and must be rewritten
are assigned paging space on drum or disk. When a page is tobe written out for the first time (that is, the recompute
bit is set>, a routine called PAGEGET is called.
Thisroutine finds an available location on drum or disk Cin thatsequence> and saves the address of that DASO location in the
SWPTABLE entry for that page. This DASD address will be
used on all subsequent reads or writes of that page for theduration of the user's session. If the user logs out or
re-IPL's a system, a routine called PAGEREL is called. Thisroutine returns all of the user's paging DASD locations to
the available pool and resets each SWPTABLE to zeros. Only
those user pages which have actually been written out to-116-

secondary storage (that is, for which theoff) are reclaimed at PAGEREL time.

recompute bit is

Returning control
When all other PAGTRANS operations are completed, theused and changed flags are set in the SWPTABLE entry for thepage being read.
If the LOCK option was specified when
PAGTRANS was called, the lock count is incremented, and thelock flag in the core table entry is set.
If the DEFER option was not specified when PAGTRANS wascalled, control is returned to the calling routine. If the
DEFER option was specified, PAGEWAIT is indicated in thecurrent user's UTABLE, a Control Program execution request
block is created, and a pointer to the request block isplaced in the IOTASK block which was created to read in therequired page. Control is then returned to DISPATCH.
When the page has been read in, the PAGEWAIT bit isreset in the UTABLE, and the Control Program execution
request block is added to the CPRQUEST queue. The next time
DISPATCH is entered, the control Program execution request
block will be honored, and since the required page is now
resident in storage, the completion of the paging operation
will be indicated.
Shared Pages
When more than one user is using a given operating
system such as CMS, which has reentrant pages, it becomes
possible to share those pages among those users. In order toallow CP to share these pages, the operating system must be
IPL'd by name (for example, IPL CMS).
When the first user of a shared system issues the IPL
command, all the shared pages are brought into core andlocked to prevent their being swapped out. When a subsequent
user IPL's the same system, no paging is required, but the
PAGTABLE of such a user is set to point to the shared pages.
For store protection of the shared pages, the users are
run with protection key = F. All shared pages' storage keys
are set to zero and all other pages belonging to these users
have storage keys = F.
Note: The module SYSTEM has to be assembled to indicate
which of the pages of a given system are shareable. If none
are so indicated, no pages will be shared.

FREE STORAGE MANAGEMENT(

Note: &TRACE(4) option must be chosen atorder to gather statistics in FREE/FRET .•sysgen time

in

-117-

The FREE routine is responsible for the efficientmanagement of free storage, as heavily used within CP-67 for
I/O tasks, CCW strings, various I/O buffers, and the like.
It is used, in fact, for practically all such applications
except real channel, control-unit, and device-blocks, andthe CORTABLE.
Block sizes of 29 double words or less, constituting
about 99 3 of all calls for free storage, are grouped into
ten subpool sizes, and are handled by very fast LIFO <pushdown stack) logic.
Blocks of greater than 29 double words are strung off achained list in the classic manner.
Subpool blocks are generally obtained, when none areavailable, from the first larger sized block at the low
sized end of available free storage. Large blocks, on theother hand, are obtained from the high-numbered end of thelast larger block.
This procedure tends to keep thevolatile small subpool blocks separated from the large
blocks, some of which stay in core for much longer periodsof time, thus undue fragmenting of available core is
avoided.
The various cases of calls to FREE for obtaining freestorage, or to FRET for returning it, for subpool sizes andlarge sizes, are handled as follows:
Call to FREE for a Subpool Size:
Subpool Available:
If a call for a subpool size is made and a block of thesuitable size is available, the block found is detached fromthe chain, the chain patched to the next subpool block of
the same size (if any>, and the given block returned to thecaller.
Subpool Not Available:
If there is no suitable block when a call to FREE is
made for a subpool size, then the chained list of freestorage is searched for a block of equal or larger size. The
first block of larger or equal storage is used to satisfy
the call Can equal-size block taking priority), except thatblocks within pages previously obtained from EXTEND areavoided if at all possible.
If no equal or larger block isfound, all the subpool blocks currently not in use are
returned to the main free storage chain, and then the freestorage chain is again searched for a big enough block tosatisfy the call. If there is still not a big enough block,then EXTEND is called to obtain another page of storage, andthe process is repeated to obtain the needed block.
Call to FREE for a Large Block:If a call to FREE is made for a block larger than 29
double words, then the chained list of free storage issearched for a block of equal or larger size.
If an equal-118-

size block is found i t is detached from the chain and given
to the caller.
If at least one larger block is found, thedesired block size is split off the high numbered end of thelast larger block found,and given to the caller. If noequal or larger block is found, EXTEND is called to obtain
another page of storage, and the above process is repeated
Cas necessary) to obtain the needed block.
Call to FRET for a Subpool Size:
If a subpool size block is given back via a call to
FRET, the block i~ attached to the appropriate subpool chain
on a LIFO Cpush down stack) basis, and return is made to thecaller.
If, however, the block was in a page previously
obtained from EXTEND, the block is returned to the regularfree storage chain instead.
Call to FRET for a Large Block:If a block larger than 29 double words is returned via
FRET, i t is merged appropriately into the regular freestorage chain. Then, unless exactly one page was given back<i.e. by EXTEND), a check is made to see if the area given
back (after all merging has been done) is a page previously
obtained from EXTEND. If so, it is returned via PAGFRET for
use by the remaining programs in CP for their use.
The FREE/FRET logic as described above allows thenumber of pages allotted for main storage to "breathe" asnecessary, expanding via calls to EXTEND when extra pages
are needed, and contracting via PAGFRET when such pages haveall been FRET'd and are no longer needed.
Initialization
The number of pages allocated to free storage depends
upon the number of core boxes upon which CP is running, andis initialized by CPINIT. A special entry FRETR in the
FREE/FRRI' routine is used by CPINIT and EXTEND to return
blocks to the regular free storage chain regardless of theirsize.

EXECUTION CONTROL
When all interruption handling routines complete theirprocessing, they transfer control <via a GOTO macro> to themain dispatcher and control routine (DISPATCH).
DISPATCH
charges time used within thecontrol Program to theappropriate user and determines which user is to receive
control next.

(

Each time DISPATCH is entered, the time used by thecurrent (interrupted) user within the Control Program iscomputed and added to the TIMEUSED entry in the user'•s
UTABLE. If the current user has not exhausted his allottedtime for this quantum, he will be restarted. In this case,his pending interrupts are reflected, and then if runnable
he is restarted. If no time remains for the interrupted-119-

user, any CPRQUEST's
chosen for running.

are honored.

Thenanother user

The following checks are made by DISPATCH uponentry to it and prior to the running of a new user:

is
each

The queueof Control Program
execution requests
CCPRQUEST) is examined for any pending work.
If anyrequests are found, the appropriate execution request block
CCPEXBLOK) is used to load the registers and dispatch
control to a specified section of the Control Program. Thissection will return control to DISPATCH via a GOTO macro.
If the current user is not runnable andstack is empty, a new user is selected to run.

the CPRQUESTIn order to prevent paging overload, the system allows
only a subset of the users to run at any given time.
Interactive users are in Ql, and the users who put a heavy
load on the system in terms of CPU cycles required or amountof nonterminal I/O done are in Q2. There is a maximum limit
on Ql. A table in the module EXTEND is used to set the
maximum for Ql, depending upon the real core size. The limit
of users in Q2 is dynamic and is dependent on current paging
activity.
A user will be in one of the following fiveany given time:
In Ql
Waiting to get into Ql
In Q2
Waiting to get into Q2
Dormant, not requiring system resources

modes atMoreover, a user may or may not be runnable, regardlessof whether be is in the queues. A user is not runnable if heis waiting for:A page to be brought in
An I/O operation to be started
A CP console function
A VM interrupt (VM in wait state)
The next user to be run is selected according to thefollowing priorities:
1. current user if runnable
2. First member of Ql encountered
3. Oldest runnable candidate for Ql if Ql is not full
4. Oldest runnable candidate for Q2 if Q2 is not full
5. Oldest member of Q2 not CPU-limited
6. Oldest member of Q2 if CPU-limited
To start Cor restart> a user, DISPATCH loads theappropriate control registers from the contents of thechosen user's UTABLE entries, loads the interval timer withthe user's quantum (or the unused portion of it>, and gives
control to the user by entering the problem mode.

-120-

Queue Management
Definitions:

I
I
I
I

Dispatching of users is described in terms of their movementfrom one state to another. The four states are described asfollows, as well as the definition of an interactive andnon-interactive user.

I
I
I
I

State 1- runnable in Q:
virtual machine not in wait state
not in page wait
not in I/O wait

I
I
I
I
I

State 2- not runnable in Q:
virtual machine in wait state, but enabled for
an I/O interrupt on a busy channel
in page wait
in I/O wait

I
I
I
I
I
I
I
I

State 3- runnable not in Q:

I
I
I
I

State 4virtual machine not in wait state
not in page wait
not in I/O wait
but CPU time exceeded (.4 or 5 seconds) andnumber of interactive users at maximum, or
paging activity index when added with in Q
users will exceed system paging index.

- not runnable not in Q:- virtual machine in wait state and disabled or
enabled with no busy channels; stopped, CP
console function mode - 'ATTN' on terminal.

Interactive user:interrupt from terminal
use less than .4 seconds of CPU time
have a priority between 0 and 15
Non-Interactive user:
no terminal activity
use more than .4 seconds of CPU time
have a priority between 16 and 215

I
I
I
I
I
I
I
I
I
(

A user goes from runnable (in Q) to eligible {runnable, notin Q) when his CPU time (.4 for Ql, or 5 seconds for Q2) is
exceeded; in order to be runnable Cin Q), he must not be in
I/O, console function or page wait, or virtual machine waitstate. When any of these conditions pertains, he will be
dropped to a non-runnable (whether in Q or not in Q) status.
A user is advanced from eligible (runnable, not in Q) to
runnable Cin Q) on the basis of interrupt status or virtual
machine priority.

Movement from state to state is illustrated in detail in the-121-following chart:
From
State
1

To
State

----> 2

Pagewait; IOwait; VMwait-IOactive
CPU time exceeded (.4 or 5 seconds>
VMwait-no IO active; VM stopped-CFwait----> 1

Scheduled by Interrupts or priority
Not possible
VM stopped-CPwait

1 ----> 3
1 ----> 43

3 ----> 23----> 4I
I
I
I

2 ----> 1II

4 ----> 1----> 3
2 ----> 4
2

4
4

I

causing
condition----> 2----> 3PageIO; IOstarted; IOinterrupt
Not possible
VM stopped-CFwait
Not possible
Not possible
AsynIOint; VM not stopped-begin

I

Note:

3 = 'eligible'

Users within states 1, 2, and 3 are ordered by priority.
Priority is determined by a combination of paging activity
index, user directory priority, and system priority number.
Number of in Q users:
interactive users limited bybased upon real machine size;
i.e.
512K machine = 6768K machine = 91024K machine = 12

I
I
I

I
I

a

specific

maximum

I
I
I
I
I
I

non-interactive users limited by paging activity
index so that a system paging index is not exceeded.
System paging index is a function of real machine
size;
i.e.
512K machine = 40
768K machine = 70
Figure 40 is a state diagram illustrating the flow ofusers from one state to another.

I
I
I
I
I
I

Virtual timers are maintained in one of two ways. The
default method is to increment a user's virtual timer(virtual location hex 50) by only the amount of virtual CPU
time the user uses. A 'real timer' option is also available
which will also update a user's virtual timer"by the amountof time the user spends in virtual wait.
Note: this does-122-

not supply the user with atimer that runs

the same as 'wall clock'. For instance, the virtual timer
is not incremented by the amount of time a user spends
waiting for his chance to run while appearing runnable tothe system.
'Real Timers•
The real timer option attempts to provide a clock forsystems maintaining time-slice
environments.
For this
purpose the 'timer' (virtual location 50) is updated by thetime spent in virtual execution Call virtual timers are
updated by this value) and the time the virtual machinespends in virtual wait (or voluntary wait). The clock is
not updated for elapsed time while the virtual machine is in
IOWAIT or PAGEWAIT or while the virtual machine is runnable
but cannot run because CP-67 has given control to some otheruser with a higher priority. This enables time-slicing
systems to give reasonably constant time-slices independentof the activity going on in the overall CP-67 system.
The critical facility that 'real timers' supply that
ordinary timers in CP-67 do not is the ability to have thetimer cause an external interrupt while the virtual machineis in virtual wait. To
provide this facility,
CP-67
maintains on 'elapsed binary timer'. When a virtual machineenters waitstate, it is 'time stamped' with a value equal to
the sum of its virtual timer plus the value of the binary
timer, if the virtual timer value is positive.
This
represents the time when the virtual machine will expect anexternal interrupt. The lowest time stamp value is always
kept by the real timer routine and every time the binary
timer is updated it is compared against the lowest timestamp value. If the binary timer value exceeds the lowest
time stamp value, the real timer routine is entered to
update the virtual machines with real timers; otherwise,
normal processing continues.
Figure 41
Algorithm.

is anoverview of

the Dispatcher

Scheduling-123-

Time-slice interrupt

1/0 WAIT
Accumulated time> 0.4 sec.

without console operation

Console1/0 and
WAIT

Runnable and
01 not fullAccumulated
time> 5 sec.

Runnable and

02 not full

Console operation and WAIT

1/0 WAIT ortime-slice
interrupt

FIGURE 40.

-124-

State Representation of Scheduling Algorithm~---

1/0 Wait

Time slice
interrupt ---~

Dispatched fromconsole 0
Time in 0 > 0.4
sec. without
console operation

Console operator
and wait
Current

Time inQ > 5 sec.
Dispatched from
non-consoleaConsole operator
and wait

Dispatch from thisQ if current
user nonrunnablel/Owaitor
time slice int.

Dispatch from thisQ if no runnablecandidate in console Q

User in

User inconsole 0nonconsole Q

Reset

Runnable andin Q

Q not full

Runnable and0 not full

Reset
in Q
statusstatusUser waiting

User waiting

to enterto enterconsole Q

nonconsole Q

UT ABLE+ CB= TIMING
A user is considered
in a 0 if TlMINQ + 2 = 01

(set and reset by dispatch)

Time at which
the user is to be

80 = console (100 ==non-CONS 0

removed from 0(cut-off time)

FIGURE 41.

overview of the Dispatcher Scheduling Algorithm

Handling of a Virtual 67
Six areas are discussed in this section:
1. Control blocks
2. Different format of the PSW
3. Special processing of the reset function
4. New instructions
5. Handling of the virtual dynamic address translation
6. Restrictions
Control Blocks.f

I~.

EXTUTAB is created at LOGIN time •Each time a virtual 6 7

enters extended PSW, by loading-125-

control register 6 with bit 8 set to 1 Cby means of the LMC
instruction or STORE X6 console function), space is reserved
for the shadow segment table and one shadow page tablebelonging to segment O.
If the virtual 67 uses segments 1 to 15, a "copysegment table", an "image segment table" and the necessary
number of additional shadow page tables will be allocated.
All those tables, if any, except EXTUTAB, will be
returned to free storage each time the virtual 67 leaves
extended PSW mode by loading control register 6 with bit 8
set to O, or by the reset function.
Different Format of the PSW
The format of the PSW in a 360/67 running in extended
mode (that is, bit 8 of control register 6 set to 1) differsfrom that of a standard System/360.
Contents of certain
reserved lower core locations
are different after aninterrupt has
occurred.
(See
IBM System/360 Model 67
Functional Characteristics, A27-2719). The following modules
have been modified to take into account that difference:
CFS MAINDISPATCH
IOI NT
MVIOEXECPROGINTPSAQUEVIOUNSTIOVIOEXEC

Reset Function
When a reset function is executed for a virtual 360/67,
control register 6 is reset to COOOOOFF, and all the control
blocks specified for a 67, except EXTUTAB, are returned tofree storage. The module affected is RESINT.
New Instructions
Among the five new instructions, two are nonprivileged
and areexecuted normally CBAS,BASR), andthree areprivileged and thus simulated CLRA,LMC,STMC).
LRA modifies the condition code and the contents of thefirst operand register, according to the contents of thesegment and page tables, which are located in the virtual
machine core and pointed to by <virtual) control register 0.
For LMC and STMC, only control registers 0,2,4, and 6
are retained in EXTUTAB: the others always contain zeros andcannot be modified by LMC.
When loading control
exception is reflected.

-126-

register0,apossibledataWhen loading control register 6, bit 8 is examined andthe mode (normal or extended) is set according to its
contents.
The module affected is PRIVLGED.
Handling Virtual Dynamic Address Translation
In this description the following terminology is used:
First level memory.

The memory of the real 360/67.

Second level memory.

The memory of a virtual 360/67.

Third level memory. The memory of a virtual machine runningunder the virtual 360/67.
Shadow segment and paqe tables. Segment and page tables usedby the real machine. When CP gives control to a virtual 67
running in extended mode with translation on, these tables(in first level memory) will describe the third level memory
and will be used to control the real address translation
hardware.
Copy segment table. A copy, in first level memory, of thesegment table, in second level memory, used by the virtual
67 when running in extended mode with translation on.
Irnaqe seqment table. A copy, in first level memory, of the
shadow segment table, with 00 in the first byte of eachentry, and bit 31 set to 1 (unavailable bit) in each entry.
Monosegment machine.
A
through 15 are not used.

virtual

67 in

which

Multiseqment machine. A virtual 67 which has
at least one segment other than segment O.

segments

1

already used

For example, a virtual
360/67 running CP-67 andgenerating any number of virtual
machines will be amonosegment machine so long as all these virtual machines
use a core size less than or equal to one megabyte. Thatmachine will become (dynamically> a multisegment machine assoon as it runs a virtual machine using more than one
megabyte.
Monosegment virtual machines are handled withmuch less overhead than multisegment virtual machines.
Each time CP-67 gives control Cby means of DISPATCH) toa virtual 67 running in
extended mode and with thetranslation control bit on, it checks the validity of the
shadow tables: if those tables have been invalidated by aprevious loading of control register 0 or by a previous
paging interrupt, the following steps are taken:-127-1. For a multisegment machine, a copy of the actual
segment table is brought from second level memory into
the copy segtable.
For a monosegment machine, the first entry of theactual segment table is brought from second level
memory into IMAGESGT, and the size of the actual thirdlevel memory is updated into COPYSEGT.
2. For a multisegment machine, the image segment table
is copied into the shadow segment table in order toreset it quickly with all the entries flagged with theunavailable bit on.
For a monosegment machine the single shadow page table
is reset with the first n entries flagged with theunavailable bit on, n being the page table length.
If the shadow tables have been invalidated because apage of the virtual 67 has been removed from first level
memory, only step 2 is taken.
(See Figures 42 and 43)

I

I

Second Level Memory

First Level MemoryI~

i_ ____ -·- ------···-·/

Segment
Table

I
I

Page Table

I
I

FIGURE 42.

-128-

--

I

I

.._

VCR 0

VCR 2

VCR4

VCR 6

SHADVCR 0

I l

CDPYSEGT

IMAGESGT

Shadow Segment
Table

Shadow
Page

Table
Note:

COPYSEGT contains the length of the actual third level memory size

available (computed from the page table length), and IMAGESGT
contains the first entry of the virtual segment table, brought from thesecond level memory.

Virtual 67--Monosegment Machine

I
I
Second Level MemoryIr--~--s====~--ttFirst Level Memory

--

A

VCRO

VCR2

VCR4

VCR6

SHADVCROI

COPY SE GTI

IMAGESGT
EXTUTAB

I
I

I

I

Copy Segment

Table

Table

-D

I
I
I
I
I
I

Page Tables

Shadow
Segment

Image Segment
Table

I

I
Shadow
Page

TablesFIGURE 43.

Virtual 67--Multisegment Machine

When a paging interrupt takes place, if the virtual
machine interrupted is a 360/67 using the virtual dynamic
address translation, the processing is the following:
If the interrupt is a page exception (interrupt code11) a check is made to see whether the interrupt should
be reflected; if it should not, a request is issued forthe missing page, if necessary; otherwise Cif the pageis already in first level storage), the proper entry in
the right shadow page table is loaded, and the virtual
machine restarted.
If the interrupt is a segment exception (interrupt code10) a check is made to see whether the interrupt should
be reflected. If it should not, and if a shadow pagetable has already been
allocated to the segment-129-

originating the interrupt, the unavailable bit isremoved from that entry of the shadow segment table,
the page table length is loaded, the corresponding
shadow page table, according to that length, is resetwith the unavailable bit in each entry, and theprocessing continues as for a paging interrupt for a
multisegment machine.
If a shadow page table has not yet been allocated, onesuch table is allocated and, furthermore, if the virtual 67
is switching from rnonosegment to multisegment machine, thecopy and image segment tables are allocated and initialized;then control is given to the dispatcher.
The modules modified to handle this algorithm aremainly DISPATCH and PROGINT and also CFSDBG and PAGTRANS.

Virtual 67 Restriction
A virtual machine may be a 360/67
simplex CPU, with 24-bit addressing.

-130-

provided it

has aCONSOLE FUNCI'IONS
When aconsole interruption
occurs becausetheattention key has been activated at a user's terminal, theI/O interruption handler (IOINT) calls the CONSINT routine.
CONSINT then calls BREAK in CFSMAIN if the terminal has alogged-on user.
BREAK determines whether the user was executing or was
waiting for completion of a console function when the"attention" occurred. If the user was waiting for a console
function, the "attention" is reflected to the user's machineas an online console attention button interrupt. If the user
was executing, the routine RDCONS is called to read theconsole function request, and control is returned to theinterrupted routine. If the user was receiving output from a
console function request when the attention button wasdepressed, that output function is terminated, and the
keyboard is unlocked waiting for another console function
request.
When the console function request has been read, theconsole function processor CFSMAIN is entered to analyze therequest. CFSMAIN determines the type of function requested
and gives control to the appropriate subroutine.
When allconsole functions have been processed, control is returnedto the calling routine.
The console functions can also be executed from thevirtual machine level by the diagnose instruction (code 8)
and the required buffers.
(See "Program Interruptions"earlier in Section 2.)
The following console function descriptions
four privilege classes of users:
A B C D -cover theoperatoradministrator
customer engineer
a normal user

Also included is the system operator class, which
belongs to the first user to log in with privilege class A.
Normally he is the operator of the Model 67.
The following console functions are described:
ACNT

punch and reset accounting information for
active users
ATTACH - attach a device to a user or to the system
BEGIN - initiate execution of a virtual machine
CLOSE - give logical EOF on unit record equipment
DCP - display contents of real memory and registers
DMCP - dump contents of real memory and registers
DETACH - remove a unit from a virtual machine or fromthe system
DISABLE - inhibit 2702 line access to the system
DIRECT - allow and inhibit system DIRECTORY access-131-

DISCONN - disconnect a terminal from a running virtual
machineDISPLAY - display contents of memory and registers
DRAIN - quiesce a unit record input or output
DUMP - dump contents of memory and registers
D_U_M_P - cause a system ABEND dump
ENABLE - enable 2702 lines for access to the system
EXTERNAL - give virtual external trap
IPL - perform an initial-program-load sequence; reset
virtual memory to binary zeros
IPLSAVE - perform an IPL without resetting virtual
memory to ZEROKILL - log a user off the system
LINK - attach a DASD device using a directory unit
description
LOCK - lock selected user pages in core
LOGIN - log into the system
LOGOUT - log out of the system
MSG - send a message to the user
 or operator
PURGE - delete a user's spooled input or output files
QUERY - query the status of the system
READY - ready a virtual device
REPEAT - repeat the output of a currently active fileon the real unit record devices
RESET - reset the interrupt status of a virtual machine
Sh"'T - establish system parameters or machine status
SHUTDOWN - bring the system to orderly shutdown
SLEEP place a terminal in dormant state to receive
messages
SPACE - force printed output for a file to single space
SPOOL
direct and control spool input and output
START - commence unit record output after a drain orwhen requested
STCP - store into real memory locations
STORE - store into memory or registers
TERM - terminate current unit record operation
UNLOCK - release previously LOC:Ked pages
WNG - issue a warning message to user

XFER
transfer spooled punch output to a user's
spooled reader input

Console Function Subroutines

The following brief descriptions cover some ofimportant subroutines in console function processing.

the

CON START
this routine is entered after the console
function has been read by RDCONS. It analyzes the data andgoes to COMANL to scan the command list for the desired
function.
SCANFLD - this routine will return to the caller <via BAL}
the starting location and the length of the next field in-132-

the commandexists.

input, oranindicationthat no

more

data

BEGIN
this routine releases the read buffer and large savearea, resets the user's CFWAIT status, and exits.
BREAK - this routine is the entry point called when the user
actuates the attention key.
It will get a 17-doubleword
buffer used by RDCONS to read the console function and a
17-doubleword large save area, which is used on subsequent
call by CONSOL to other routines and as general working
storage for various functions.
SIMATTN - this routine is entered if the user actuates theattention key while in console function mode, thus giving an"attention" to his virtual machine.
FINDUSER - this routine will search the chain of UTABLES fora specified "userid". A message is given if the user is notfound, or his UTABLE address is returned in register 10.

The module CFSMAIN contains all these subroutines.
CFSMAIN remains addressable through register 12 for allcommand processing.
Individual commands are placed together
in several other modules,
each module addressable byregister 9.

{
l

-133-

Console Function Descriptions
The following conventions are used throughout thesedescriptions:(1) variable information is indicated inlowercase letters, and system keywords are indicated inuppercase letters, whereas either case may be used whencommunicating with the system;(2) "<"and ">" are used tobracket choices when applicable in the description (forexample, "MSG <userid,ALL>" would be used to indicate that"MSG userid" or "MSG ALL" could be used), whereas thebrackets are not typed when communicating with the system.

ACNT (ACNT) - class A and B
ACNT
The following steps are taken:
for each UTABLE in the system call ACNTIME
accounting to each userII

to give- call ACNTOFF for each user to punch
card and reset the accounting dataan accounting

Note: ACNT does not punch an accounting card
accounting data for dedicated devices.

or reset the-134-

ATTACH (A) - class A and B
ATTACH CCU TO userid AS xxx
ATTACH CCU TO SYSTEM AS valid
ATTACH RDR I PRT I PUN TO userid AS xxx
The following steps are taken when attaching auser or to the system.

device to a

- scan the selector device chain for the device "ccu"check that
attached

the device

is not"owned" or- issue a sense command for DASO types
that the device is "ready"already

to determine

check that the •userid"
the system

is currently logged

check that the "userid"
device of address "xxx"does notin toalready have- create the virtual device blocks for thelink them to any existing blocksauser and- call DEDICATE if the device being attached is in thereal multiplexer chain. DEDICATE will create andchain a set of real selector device blocks.
link the virtual and real
attached Cnonshared) basis

device blocks- send a message to the "userid" thatbeen attachedonanthe device has

if the device is being attached to the system, CP
will read and verify the "valid" and check that thevolume is not already mounted- ATTACH will check the "owned list" Cin the CPDSK1
allocation table) to see whether the attachedvolume has a CP allocation table
if the attached volume is "owned", the allocationtable is linked to the real device block and to theallocation table chain
if a "spooling" device CRDR PRT PUN) is being
attached to a user, a virtual multiplexer block is
created and chained to the user's virtual device
chain
various diagnostics are issued
error conditions that can occur

fora variety

of

(
-135-

BEGIN CB) - any user (class A,B,C,D)
BEGIN<hexadd>

This command transfers control from CP console function mode
to running the virtual machine.
The following steps are taken:- set the user's virtual PSW to the address specified,
if any- free the console functions read buff er- free the console functions large save area
- take thewaitvirtual machine out ofexit to run the user

-136-

"console function"

CLOSE CC) - any user (class A,B,C,D)
CLOSE

CCU

The CLOSB command completes a user's spooled operation forthe current file and schedules it for output, or clears thebuffers for input.

The following steps are taken:- locate the specified virtual
multiplexer chain

device in

the user's- call MVICLCR or MVICLPR or MVICLPN to close a reader
or printer or punch, respectively
output files will be scheduled for printing or
punching or the punch file may be chained to areader input if it was XFERed- readers
input.

are cleared to accept the next
Remaining input is flushed.

spool file-137-

DCP (DCP) - class A and B
DCP

argl arg2 ••• argN

where
the
location< s > •arguments (argl ••• argN)arereal
The output goes to the terminal.

memoryThe following steps are taken:
1.

-138-

The steps are the same as those for DISPLAY, exceptthat the data is taken from real memory instead of
virtual memory.

r

DMCP (DMCP) - class A and B

r

DMCP

argl arg2 ••• argN

where the arguments are the same as those for the DCP
Console Function. The output goes to the first virtual
printer defined in the user's virtual machine.
The following steps are taken:
1.

The flag in the output buff er is set
the output is to go to the printer.

to indicate that2.

The remainder of the steps are the same as those for
DISPLAY. except that the data is taken from real memory
instead of virtual memory.

(
-139-

DETACH (DET) - any user <class A,B,C,D), except for certain
functions
DETACHCCU

The DETACH command allows any user to delete
device from his current configuration.

any virtual

The following steps are taken:
the virtual device block(s)user's chain of devices

are located- a check is made to ensure that nofor this device

in

the

tasks are queued- the virtual device blocks Cf or either selector or
multiplexer devices) are removed from the chain andreturned to free storage- call RELEASE; if it is a nonshared device, RELEASE
will make the real device available for use byother users.
If the real device blocks werecreated by DEDICATE, the blocks are released tofree storage, and the real multiplexer device ismarked available (undedicated).
- amessage is sent todevice is detachedthe user indicatingthat the- a message is sent to the operator if the DETACH has
freed a previously dedicated device- an operator (class A) can detach a device from auser by entering DETACH Rccu, where ccu is the real
device address. The device must not be in use to
do this.

-140-

DISABLE CDISA) - system operator only
DISABLECCU CCU CCU

ALLThis command allows the operator to selectively or generally
inhibit access to the system from communication lines.
The following steps are taken:- scan the MRDEBLOK
terminal lines- set the DISABLE
blockchain forbit inthe selected

the MRDESTATCor ALL)

field oftheif the line is in use, return
if the line is not in use, issue an SIO and HIO of asense to kill any enables and force an interrupt- CONSINT will handle the interrupt, detect the DISABLE
bit and "disable" the line

-141-

DIREcr (DIR) - class A and B
DIRECT<lock,unlock>This command inhibits or allows access
DIRECTORY. The following steps are taken:

to

the

system- locate the directory lock byte and open file count
if the directory is in use, exit with a diagnostic
if the directory is not in use, set or reset the lockbyte
- issue diagnostics if the byte was not already locked
Clock) or unlocked (unlock)-142-

DISCONNECTDISCONN(DISC) - any user <class A,B,C,D)<xxx>

This command is used to release the user's terminal from his
virtual machine but allow the virtual machine to continue
running.
The terminal is then free to log in as anothervirtual machine or to reconnect at a later time .•The following steps are taken:- write a "disconnect• message to the user's terminal:
if the optional field is present, do not disable
the phone connection
set thefield)DISCNBIT inrelease the •console
large save area

theuser's UTABLE

functions•

CTIMERMOD

read bufferand- write a "disconnect• message to the operator- exit to run the virtual machine

(
-143-

DISPLAY (D) - any user (Class A,B,C,D)
DISPLAY CD) argl arg2 arg3 arg4 ••• argN
where the arguments Cargl ••• argN) specify virtual memory
locationCs>, general-purpose
registerCs>, floating-point
register(s}, control registerCs>, storage keyCs), and/or
PSW. The output goes to the user's terminal.
The following steps are taken:
1.

An 18 double
Storage.

word output

buff eracquired from2.

The maximum number of characters to be displayed is set
based upon the user's terminal type--16 bytes for
teletype, 32 bytes for all other terminals.
A BAL to subroutine DISWRITE to output
full buffer and reinitialize the buffer.

I
I
I
I
I

Free

any partially3.

The location and length of the next argument isobtained by doing a BAL to SCANFLD. If there are no
more arguments the output buffer is returned to Free
Storage and return is made to READI in CFSMAIN.

4.

The first character of the argument is inspected for a
type code CP, G, Y, L, T, K, or x>.
If none is foundan L is inserted in front of the argument. The code isused to select the routine to branch to branch to, toperform the unique processing for each type of display.

5.

Each routine sets the default ending address andaddress increment and does a BAL on register 7 tosubroutine DISINIT to determine the beginning andending addresses of the data to be displayed.

6.

Each routine loads the next four bytes of data to be
displayed into register 3 and branches to DISCOMM.
DISCOMM does a BAL to subroutine DISHEAD to build theheader for the line if the buffer is empty .•7.

The data is then converted to hexadecimal and stored in
the next location in the output buffer.

8.

If the buffer is full, a BAL isDISWRITE to output the buffer.

9.

The next address to be displayed is computed by adding
the increment address to the current address.
If thisaddress is greater than the ending address, the next
argument is fetched (step 3). If this address is not
greater than the ending address, the n~xt four bytes
are displayed by returning on register 7 Cto step 6).

Subroutines:-144-

done tosubroutine

DISINIT scans the argument for a hyphen or a blank. A
hyphen indicates that a range of addresses is to be
displayed.
If the ending address is larger than thedefault ending address, the default address is used to
end the display. If the beginning address is larger
than the ending address, a "BAD ARGUMENT XX" message issent to the user and the display terminated.
If eitherthe beginning address or ending address is omitted thedefault for that address is used in the display.
DISHEAD builds the header and trailer sections of each
output line. For a register display, the registercharacter identification is woved to the first threebyt€s of the output buffer and the register number isstored in bytes 5 and 6. For a display of core storage
the next line to be displayed is compared to the lastline.
If both lines are the same, the "SUPPRESSEDLINES" message is built in the buffer.
If the lines
are not the same, the last line is outputed and thecurrent line is saved. For a display of core, the line
is also translated to EBCDIC and moved to the trailer
portion of the buffer. Before returning to the callingroutine, the buffer pointer is set to the 8th byte of
the buffer and the buffer count set to 7.
DISWRITE outputs the buffer either to the user's
terminal or virtual printer based upon a flag in thebuffer. After the I/O completes, the pcinter is set
back to the start of the buffer, the byte count is set
to zero, and the buffer is cleared with blanks.

-,145-

DRAIN(DR) - system operator only

DRAIN

<xxx • . • nnn>

This command will cause the specified unit record devices tostop processing at the completion of the currently active
spool file.
The following steps are taken:- find the specified real multiplexer device block, or
locate each device in the chain if doing all
devices- set the MRIDRAINMRDEBLOK

bit in the

MRIFLAG fieldof theif the device is not busy, print a message
operator indicating the device is drained

to the- loop for all devices (readers, punches, printers> ifdraining all-146-

DUMP (iJU) - any user (class A,B,C,D)
DUMP argl arg2 ••• argN
where the arguments are the same as those for the DISPLAY
Console Function. The output goes to the first virtual
printer defined in the user's virtual machine.
The following steps are taken:
1.
The flag is set in the output buffer
the output is to go to the printer.
2.

The remainder
DISPLAY.

of the steps are

to indicate thatthe same as

those for-147-

D_U_M_P <D_U_M_P) - system operator only
DUMP
This command will issue SVC O to cause a system ABEND dump.
The following steps are taken:- verify complete command typed (no abbreviation>- issue SVC O-148-

ENABLE CEN) - system operator only
ENABLE

CCU CCU CCU •

•

•

•

ALL
This command allows the operator to selectively or generally
enable 2702 lines for communication with CP-67.
The following steps are taken:- scan the MRDEBLOK (multiplexer real device block)chain for the selected, or for every, 2702 line
type
- determine whether the device is alreadyotherwise in use; bypass if it isenabled or- reset the DISABLE bit in the MRDFSTAT fieldissue an SIO
interrupt

and

HIO

of

a

sense to

force

an

CONSINT will receive the interrupt, issue therequired Cif any) SAD and ENABLE commands, and set
the ENABLED bit in MRDESTAT- set the return address (MIRA) to IDENTIFY
termination of the ENABLE

for the'\-149-

EXTERNAL (EX) - any user (class A,B,C,D)
EXTERNAL
This command simulates the operation
button to the virtual machine.

of theCPU interrupt

The following steps are taken:
set a pending external interrupt statususer's UTABLE (PENDING flags)in- exit to BEGIN2 to run the user's virtual machine

-150-

the

IPL (I) - any user (class A,B,C,D)
IPL

xxx

This command will cause the loading and execution of aControl Program of the user's choice, where xxx is a virtual
device containing an IPLable Control Program or is apresaved system name of a potentially shareable Control
Program or "operating system".
The following steps are taken:- call RESINT to reset the virtual machinethat is, no interrupts pending- call PAGOUT to clear the user's pagenecessary system CORETABLE entries

status;table and the- set the swap table entry for the user's virtual page
number hex 20 (or the page at half virtual memory
size, whichever is the smaller) to the location on
the SYSRES volume of the IPL simulator page
- find the user's virtual device blockby system name

if not IPLing- set the virtual address of the IPL simulator in theuser's VPSW and exit to run the virtual machine
CIPL simulator>- if IPLing by system name, bring in the SYSTEM module
which contains the table of system names and isactually the module, SYSTEM- search for the desired system name- move into the user's swap table entries
locations of the saved system

the DASD- set a pointer to the shared page table, if any- set the user's VPSW to the saved system execution
address, and exit to run the virtual machine

r(
-151-

IPLSAVE CIPLS) - any user (class A,B,C,D)
IPLS

xxx

This command will initiate execution of the CP-67 IPL
simulator in the user•s virtual memory space for a device
specification in xxx. xxx may be the name of a presaved
system.
The following steps are taken:
call RESINT to reset the virtual machine statusbypass the callnonzeroed

to PAGOUT

so user's- proceed as in IPL (after call to PAGOUT)-152-

pages remain

KILL CK) - system operator only
KILL

useridThis commanduser.

is usedto force thelogout ofa particular

The following steps are taken:- locate the desired user by linking to FINDUSER
call the module ADSET
logout of the user

Cin USEROFF)

the user receives a message
logout by the operator

to force

indicating atheforced(-153-

LINK (LI) - any user <class A,B,C,D)
LINK

useridxxx

yyy<W R> <CNOPASS)I PASS=

password>

The link command will attach to the user a virtual DASD
block of the specified address Cyyy> from information
contained in the system directory for user "userid" and his
device, xxx. The user may request read or write status andmay be prompted for a password. The user may also link tohimself without a password. If LINKing to himself, the user
may specify* for "userid". LINK can also be used as a
virtual console function with a special (PASS= password)form to provide the password with the command.
The following steps are taken:- retrieve all the parameters from the input command- issue a "protected"
linking to himself

read forthe password

if not- set up the parameters for, and then call LINK module- on return, index on an error code to give a message- the LINK module will grant the desired
set up the necessary device blocks

access and

The access modes
permitted by the LINK
command aresummarized in 2. Note that when linking to one's own
userid, access allowed is the same as at LCGIN. WRMULT is
examined only when linking to oneself. The table assumes
that the password supplied is correct and the device isshareable for the requested access mode.

-154-

Table 2.

Summary of Access Allowed by LINK

Directory
AccessSpecification Requested

Existing
Links

Access Mode Established
Link to
Link to
Another User id
Oneself

RDONLY WRMULT------------------------------------~~--------------------------

No

No

Read

None
Read
Write

Read
Read
None

Read
Read
None

No

No

Write

None
Read
Write

Write
Read
None

Write
Read
None

Yes

No

Read or Write

None
Read
Write

Read
Read
None

Read
Read
None

No

Yes

Read

Any

Read

No

Yes

Write

Any

Write

Yes

Yes

Read or write

Any

Read

(
-155-

LOCK

CLOC) - system operator only

LOCK

useridxxx

nnn

This command is used to lock specified pages of a user's
virtual machine in core so that they will not be paged.
The following steps are taken:
locateCP-67

the desired userr who

must be logged

in to- starting with the specified page <xxx>r and looping
for a number of contiguous pages Cup to andincluding page nnn>, call PAGTRAN if the page is
not in core to BRING. Calculate the CORTABLE entryof the specified page and set the LOCKM bit in its
CORTABLE entry.

-156-

LOGINCL) - any user (class A,B,C,D)

LOGIN

useridThe LOGIN command is used to initiate a terminal session.
Although included here with console functions, the LOGIN
command is processed by the LOGON module, and technically is
not a CONSOL command.
When the connection between the terminal and the system isestablished, a recognition message will be sent from thesystem c•cP-67 Online•) indicating that the system is readyto receive users.
If the attention key C2741) or the breakkey (1050) is depressed, the system will respond with acarriage return, and i t will unlock the keyboard waiting for
an attempted logon process.
The format is
LOGIN
useridwhere "userid" is theeight-characteror less
external identificationcode
assigned to the user by the systems administrator. If theuserid is not found in the directory CU.DIRECT>, a message
is sent to the terminal and the terminal is reinitialized.
If the external identification is found in the directory, arequest is made for the user to enter his password:
ENTER PASSWORD:

I
I
I
I
I
I
I
I
I

and the printer is disabled in preparation for the receipt
of his password. In the case of a TTY terminal, each spaceof the eight-character input area is preprinted with an H,*, and s to hide the password. For the the 1050, and for the2741 not equipped with the print inhibit feature, the same
password protect characters can be obtained by either of thefollowing methods:
issue an x after your userid:
login 'userid' x
or
hit RETURN
printed.

after

the

message

ENTER

PASSWORDis

The password is checked against the directory, and if amatch is made, the user is informed of the message of the
day CLOGMSG), if any, and of any failures in allocating his
virtual machine.
Finally, the time and day of login are
indicated at the terminal. If the password does not matchthe one in the directory, an appropriate message is issued.
Duringthe
LOGIN
procedure, CP-67
uses
the
2702
read-with-time-out function to prevent unnecessary line
tie-up.

-157-

LOGOUT (LOG) - any user (class A,B,C,D)
LOGOUT<xxx>

where <xxx> is any nonblankdisconnect of the line.

character.

xxx will

prevent/

This command will cause the user's
deleted from the CP-67 system.

virtual machine

to be

The following steps are taken:- free the CONSOL functions read buffer and large savearea
- call ADSET to process the machine logout-158-

MSG (M)MSG

useridtext-of-message

any user <class A,B,C,D)

MSG

ALL

text-of-message

class A and B(class A or B)

This command is used to communicate with other users
currently logged in to CP-67.
The users with operator
privileges (privilege class A or B) can send a message toall users by specifying ALL for a userid.
The following steps are taken:
find the desired user; if the ID issystem operator"CP", find the- format the message to identify the sending user
- call WRTCONS to send the text to the user's terminal
if ALLusers

is specified,

repeat the

WRTCONS for

all

send a message to the issuing user if the desireduser is not currently accepting messages-159-

PURGECP) - any user (class A,B,C,D)

PURGE

RDR

1 PRT I PUNThis command will delete all the user's particular
files that are still awaiting processing.

spool

The following steps are taken:
starting from the PRINTERS, PUNCHES, or READERS
chain, find the spool file blocks for the user
- call MRIDEL to delete the spool file block and torelease all the records used by this spool file- call WRTCONS to give the user a confirmation message-160-

QUERY CQ> - any user Cclass A,B,C,D), except for certain
functions
QUERY

parameterwhere parameter is either USERS, NAMES, PORT, userid,
LOGMSG, MAX, Q2, DEVICE, FILES, or TIME. The parameters canbe abbreviated to a unique value, for example, Q F will givethe file status.
The following
parameter:
USERS -

steps

are

taken

prints the number
users

for

processingof logged oneachand "dialed"

NAMES - prints the "userid" and 2702 line address of
all currently active terminals with virtual
machines. Terminals in the process of LOGIN
and virtual machines that are DISCONNECTED
are shown. The names are displayed four to aline .•"userid"

if the user is logged in, a message of the"NAMES" format is given; if not, "USER NOT ON
SYSTEM" is given

LOGMSG - the current LOGMSG is printedMAX

the current setting for maximum users is given(class A and B)

Q2

the current size of the "nonconsole" queue <see
"DISPATCH" in Section 5) is given <class A
and B)

DEVICE- the address and status of the particulardevice or of all DASO and TAPE devices isgiven (operator and subsystem operator class
A and B)

PORTS - the address and status Cuserid associated withline, or **FREE**) of the particular line orof all lines, or of all "free" lines is given
as requested (class A and B)FILES - the number of reader, printer, and punch spool
files awaiting processing for the user. For
the system operator, the status given is for
all users, that is, the total number offiles.
TIME - gives the connect, virtual and total time used
so far by the user
DUMP - prints address of theand B)ABEND dump unit (class A-161-

VIRTUAL - interrogates virtual machine configuration:'all' as an option Cor null option> elicits
entire configuration;'core' for core size,
only; 'ccu' for specified device.

-162-

READY {R) - any user (class A,B,C,D)
READY

xxx

where xxx is a virtual device address.
The READY command will set a "device-end"in the virtual device block.

interrupt status

The following steps are taken:- locate the user's virtual device block
set a "device-end" status in the block (VDEVSTAT>
set a"pending"

interrupt

status intheuser•sUTABLE-163-

REPEAT (REP) - class A
REPEAT

CCU<nn>

This command will cause the currently active output of thespecified device to be repeated nn times C1 is default> •The fo1lowing steps are taken:- find the specified device block, MRDEBLOK- if the device is notoperator

active, print a message to the- in the current spool fi1e block,set a bit and acount to indicate that, upon reaching the end, theoutput should be restarted-164-

RESET (RES) - any user (class A,B,C,D)
RESET
This command performs a"system reset" of all
virtual devices. All interrupts are cleared.

the user's

The following steps are taken:- call the module
virtual devices

RESIN!' to performa reseton all

-165-

SET

CSET) - any user (class A,B,C,D), except for certain
functionsSETparameterwhere parameter is either WNG ON, WNG OFF, MSG ON, MSG OFF,RUN ON, RUN OFF, CARDSAVE ON, CARDSAVE OFF, MAX=nn, LOGMSG,
or Q2=nn. The parameters cannot be abbreviated.
The following steps are taken to process each parameter:
WNG

ON -

WNG OFF

reset the WNGBIT in the user's TIMERMOD
field of the UTABLE to allow receipt of•warnings•, that is, priority messages- set the WNGBIT in the user's UTABLE field
CTIMERMOD) to inhibit receiving "warnings"

MSG ON - reset the MSGBIT to receive messages
MSG OFF - set the MSGBIT to inhibit receiving messages
RUN

ON -

RUN OFF

set the RUNON bit to allow the virtual
machine to keep running in •coNSOL function"mode (after "ATTN9 interrupt)- reset the RUNON
machine operation,on "ATTN"

bit for "normal" virtualthat is, to stop running

CARDSAVE ON - set the MVIFSAV bit in the MVIFLAG fieldof all the users' virtual card readers
CARDSAVE OFF - reset the MVIFSAV bit in all the users''
virtual card readers
TRACE ON - initiate tracing functions as specified by
the included parameters

I

TRACE OFF - terminate tracing functions

I
I

ADSTOP xxxxxx - stop execution at virtual instruction
address xxxxxx
ADSTOP OFF - terminate an address stop function.
The following functions are for class A and B only:
MAX=nn - for the system operator
for the maximum number
log on CO=no limit>

only; to set a valueof users allowed to

Q2=nn - for the system operator only; to set a value
for the "non-CONSOL" dispatching queue <see•oISPATCH" in Section 5)-166-

LOGMSG - to set or add to the system LOGMSGLOGMSG

to delete
NULL
messagetheentireexisting

log

LOGMSG n - to set or delete LOGMSG line n
DUMP xxx - to change dump unit and core area dumped-167-

SHUTDOWN(SH) - system operator only

SHUTDOWN
This command willwith no messages.

immediately

terminate system

operation

The following steps are taken:- set the CPID word to SHUT to indicate shutdown- go to the DSKDUMP routine at RESTART to force an IPLof the system so that CHKP can save the machine
status-168-

SLEEP(SL) - any user <class A,B,C,D)

SLEEPThis command places the terminal in athat i t may receive messages.

"prepared" status so

The following steps are taken:- GOTO the DISPATCHER leaving(nonrunnable)

the user in CEWAIT mode

- an ATTN will awaken the user

(
-169-

SPACE (SPA) - class A
SPACE

CCU

This command will cause the current output on the printer<spool file) to be forced to single spacing. This will
avoid excessive forms skipping.
The following steps are taken:- find the specified printer real
block
set theMRDEBLOK-170-

MRISPACE

bit inthemultiplexer device
MRIFLAG

field

Of

SPOOL(SPO) - any user (class A,B,C,D)

SPOOL
SPOOL

ccu
ccu

<ON xxx, OFF><CONT, OFF>This command is used to direct the output of a user's
virtual printer or punch to a specific real printer orpunch. The command can also specify "continuous" input for
virtual card readers.
The following steps are taken:- find the user's virtual device block <ccu>- find the system real device block <xxx>- set the MVIFRMTMVDEBLOK

bit in the

MVIFLAG of

the user's- store the address of the desired MRDEBLOKMVPNTREL field of the MVDEBLOK

in thereset these bits if no real device is specified
for a virtual card reader, set the MVICONT bit in
the MVIFIAG field of the MVDEBLOK; or reset the bit
for no "CONT" specified

(
-171-

START(STA) - system operator only

START

<xxx • • • yyy>

This command isrecord device.

used tostart apreviously drainedunit

The following steps are ,..taken:- the same logic of DRAIN is followed todesired device or devices

locate thethe MRIDRAIN list is reset in the device block- a-172'"'."

dummy •device end• CSW is created and a call ismade to MRIOEXEC• this will cause any closed spool
file blocks to commence output on the device

STCP (STCP) - class A and B
STCP

arg1 arg2 ••• argN

where the arguments (argl ••• argN) are a real memory locationand the data to be stored.
The following steps are taken:
1.

The steps are the same as those for STORE except thedata is stored in real memory instead of virtual
memory.

(-173-

STORE

CST) - any user Cc1ass A,B,C,D)

STORE

argl arg2 ••• argN

where the arguments Carg1 ••• argN) specify a virtual memory
1ocation, a genera1-purpose
register, a floating-point
register, a control register, and/or PSW and the data to be
stored.
The f ol1owing steps are taken:
1.

Fetch the next argument and branch to the routine tohandle that particu1ar store function by doing a BAL to
subroutine STOSCAN.

2.

Each store routine sets the increment address and doesa BAL to subroutine STOADDR to convert the beginning
address to binary.

3.

A BAL to STOSCAN is done to obtain the next argument.

4.

If the current address is greater than the maximum
allowable for the type, a "BAD ARGUMENT XX" message issent to the user and the store function terminated.

5.

The argument is converted to binary andcurrent address.

6.

The increment address is added to the current address
to obtain the next address, and the store continues byfetching the next argument Cstep 3).

stored at theSubroutines:
STOSCAN does a BAL to SCANFLD to obtain the locationand length of the next argument. The first character of
the argument is inspected for a type code CP, G, Y, L,
or x>. The code is used to se1ect the routine to branch
to, to perform the unique processing for each type ofstore.
If no valid code is found, the argument isassumed to be data and return is made to the callingroutine to continue the store.

I
I
I
I
I
I
I
I

STOADDR converts the beginning address to binary, saves
it, and returns to the caller.

-174-

TERMINATETERM(TERM) - system operator onlyxxx

where xxx is the real address of a unit record device whose
output i t is desired to terminate.
The following steps are taken:- find the MRDEBLOK for the specified device
set theMRDEBLOKTERMINAT

bit inthe

MRIFLAG

field

of

(
-175-

UNLOCK(UN) - system operator only

UNLOCK

useridxxx

nnn

This command will unlock a previously LOeKed page.
The following steps are taken:
the same logical steps as in LOCK, but turn off the
LOCKM bit in the core table entry it the §peqifiE}dpage is in core

-176-

WNG.

CW> WNG

class A and B

useridALLtext-of-message

The "warning" function operates thea priority call is made.

same as MSG except that

The following steps are taken:
find the specified •userid",
or if
specified, do the following for allusers:"ALL"islogged~on- format the message to identify the originator- call PRIORITY to
immediately

send themessage tothe usersend a message to the originator if a user is notreceiving warnings

(
-177-

XFER

CX) - any user Cclass A,B,C,D)
XFER
XFER

CCU
CCU

TO useridOFFThis command is used to transfer a punch spooled file to thereader input spool files of the specified user.
The following steps are taken:- find the desired punch device Cccu)
call USERLKUP to search the CP-67
determine that the •userid" is valid

directoryto- move •userid" to the MVIXUSER field in the MVDEBLOK- set the MVIXFER bit in the MVIFLAG of the MVDEBLOK- for the OFF option of the XFER command,
MVIXFER bit and blank the MVIXUSER field

reset the

-~.

-178-

_/

SECTION 3:

PROGRAMMING CONVENTIONSTo allow for the orderly maintenance and growth of the
CP-67
operatingsystem, theprogramming
conventions
described should be followed by anyone working with CP-67
programs.

MAINTENANCE
The CP-67 system is maintained using the Cambridge
Monitor system. A set of catalogued procedures <EXEC files)
are distributed with the system Csee the CP-67 Installation
Guide for their descriptions).
ASSEMBLY DECK FORMATS
All decks contain a TITLE card as the physically firstcard with a unique label field and a suitable title in theoperand field.
The primary entry point of a routine is indicated witha START card, which is the second card of the assembly deckin the absence of macro definitions or comments <required by
the loader).
Unless required otherwise, alllocated at the end of the deck.

COPY

statements

are

The END card must not have any operands.
The loader
will accept only one of such type, and this must be the one
in SAVECP.
Information used by more than one routine will becontained in the file CPMACS MACLIB. This file will containthe macro definitions, equivalence packages, and control
block definitions CDSECTs). All parameters and flag bits
should be assigned symbolic names and defined in theappropriate equivalence package.

EQUIVALENCE PACKAGES AND CONTROL BLOCK DEFINITIONS
These packages will be included in an assembly by meansof the COPY pseudo-operation.
CPFDEF

defines the CPFILE control blocks.

DEVTYPES

defines the CP-67 device type codes.
A printout of DEVTYPES follows this list.

EQU67

defines references to physical lower core,-179-

channel command words, CALL parameters,
CPEXBLOK definition, etc. A printout Of EQU67
follows this list.
IOBLOCKS

defines the input-output control blocks
and IOTASK block.

OPl'IONS

contains assembly option switches andmacro definitions.

LOCAL

contains assembly option with settings forthe particular installation.

UDIRECTdefines the directory blocks MDENT and UFDENT.

UTABLE

defines the UTABLE and EXTUTAB blocks andincluded flag bits.

Obtain a listing of the appropriate ASP360 or COPY file fromthe CP-67 distributed system for a detailed and accurate
description of the contents of each file.

-180-CP-67 DEVICE CODES********************************************************
I·**
CP-67 DEVICE TYPE CODES*************************************************************
TYP1052 EQU
0
TYP1050 EQU
TYP2250T EQU'l'YP2260T EQU'rYP2741T EQU
TY'P 1052T EQU
TYP2703T EQU
TYP2702T EQU
T'lP2701T EQU
T :!'PTT3 ST EQU
TYPTTY35 EQU
TYPTIMER EQU
TYP1403 EQU
T'.!P2540P EQU
TYP2540R EQU
TYP2671 EQU
TYPRMPRT EQU
TYPRMPUN EQU
TYPM20EQU
TYP1800 EQU
TYP2311 EQU
TYP2314 EQU
TYP2302 EQU
TYP2321 EQU
TYP2301 EQU
TYP2303 EQU
TYP2250 EQU
TYP2260 EQU
TYP2400 EQU
TYP2404 EQU
TYP2402 EQU
TYP2403 EQU
TYP7340 EQU
TYP2701 EQU
TYP2701L EQU
TYP2702L EQU
TYP2703L EQU
TYP2700L EQU
TYP2702D EQU

4
8

12
16
20
24
24
24
28
TYPTT35T
44
48
52
60
64
X'44'
X'48'
96
100
128
132
136
140
144
148
180
184
192
192
192
192
204
208
208
208
208
208
212

MPX/2702

2741
1052

MDL 35 TELETYPESIMULATED CHRONOLOG

REMarE PRINTER READERREMOTE PUNCH READER

GENERAL MAG TAPE

L IS A DEDICATED LINED IS A DIAL CONNECTED LINE**********************************************************:-181-

CP-67 EQUATE PACKAGE - EQU67**************************************************************************

CP-67 EQUIVALENCE AND MACHINE DEFINITION PACKAGE*****************************************************************************PROBMODE EQU
WAIT
MCHEK
ASCII

EQU
EQU
EQU

*
*
MODE32

BITS IN STANDARD PROGRAM STATUS WORD
X' 01''
X' 02 I

X'04'
X'08'

PROBLEM MODE BIT.
WAIT BIT.
MACHINE CHECK.
ASCII BIT.

*

BIT ASSIGNMENTS IN EXTENDED PROGRAM STATUS WORD

EQU
TRANMODE EQU
I OMA SKEQU
EXTMASK EQU

X'08'
X'04'
X'02'
X'Ol'

*
*

DEFINED BITS IN CHANNEL STATUS WORD

*

ATTN
SM
CUE
BUSY
CE
DE
UC
UE

*

PCI
WLR
PRGC
PRTC

*
*
*CD

cc
SILI
SKIP
PCIF

*
*
*RCXISRCSUDO.
RCUTICRCIO
RCGEN
RCDATARC02-182-

24/32 ADDRESSING MODE BIT.
DYNAMIC TRANSLATION MODE BIT.
OVERALL I/O MASK BIT.
OVERALL EXTERNAL INTERRUPTION MASK BIT.

EQU
EQU
EQU
EQU
EQU
EQU
EQU
EQU

X'80'
X'40'
X'20'
X'lO'
X'08'
. XI 04 I
X' 02''X'Ol'

ATTENTION BIT.
STATUS MODIFIER BIT.
CONTROL UNIT END BIT.
BUSY BIT.
CHANNEL END BIT.
DEVICE END BIT.
UNIT CHECK BIT •UNIT EXCEPTION BIT.

EQU
EQU
EQU
EQU

X'80'
X'40'
X'20'
X'lO'

PROGRAM-CONTROLLED INTERRUPT BIT.
WRONG-LENGTH-RECORD BIT.
CHANNEL PROGRAM CHECKCHANNEL PROTECTION CHECKFLAGS DEFINED IN CHANNEL COMMAND WORDS
EQU
EQU
EQU
EQU
EQU

X'80'
X'40'
X'20'
X'lO'
X'' 08''CHAIN DATA FLAG.
CHAIN COMMAND FLAG.
SUPPRESS INCORREcr LENGTH INDICATOR FLAG.
SUPPRESS TRANSFER OF INFORMATION.
PROGRAM-CONI'ROLLED-INTERRUPT FLAG.

FLAGS DEFINED IN FIFTH BYTE OF CCW TO AID CCW TRANSLATION
EQU
EQU
EQU
EQU
EQU
EQU
EQU

X'U 80''
X' 40'
x•20•
X'lO'
X'08'
X'04'
X' 02'CHECK ISAM INDICATORPSEUDO 2311 INDICATORUNTRANSLATED TIC
I/O CCWCP GENERATED ccw
CP GENERATED CHAIN DATARESERVED FOR FUTURE USE

RC01

*
*
*IPLPSW

EQU***RUNUSER**MONTHS
DAYS
YEARS
HOURS
MINUTESSECONDS*START IMBIN TIMEDISPSW**
ASYSWRM

*

(

0
8

14
24
32
40
48
56
64
72
80
88

96
104
112
120
128
304

INITIAL PROGRAM LOAD PSW.
INITIAL PROGRAM LOAD CCWS.
INI'ERRUPI'ION CODES (EXTENDED)
EXTERNAL INTERRUPT OLD PSW.
SUPERVISOR CALL INTERRUPT OLD PSW.
PROGRAM INTERRUPT OLD PSW.
MACHINE CHECK INTERRUPT OLD PSW.
INPUT-OUTPUT INI'ERRUPT OLD PSW.
CHANNEL STATUS WORD.
CHANNEL ADDRESS WORD.
MACHINE INTERVAL TIMER.
EXTERNAL INTERRUPT NEW PSW.
SUPERVISOR CALL INTERRUPT NEW PSW.
PROGRAM INTERRUPT NEW PSW.
MACHINE CHECK INTERRUPT NEW PSW.
INPUT-OUTPUT INTERRUPT NEW PSW.
DIAGNOSTIC SCAN-OUT SECTION.
CHANNEL LOGOUT AREA (2860,2870)

STORAGE LOCATIONS USED BY THE CONTROL PROGRAMEQU
CPSTATUS EQU

VMDONE*IOMASKRESERVED FOR FUTURE USE

DEFINED LOCATIONS IN MACHINE (EXTENDED AND STANDARD)

EQU
IPLCCWEQU
INTCODES EQU
EXOPSWEQU
SVCOPSW EQU
PROP SWEQU
MCOPSWEQUIOOPSW
EQU
csw
EQU
CAW
EQU
TIMER
EQU
EXNPSWEQU
SVCNPSW EQUPRNPSWEQUMCNPSWEQU
IONPSWEQUSCANOUT EQU
CHANLOG EQU**CPIDLE

X'Ol'

X'160'
RUNUSER+4
BITS DEFINED IN CPSTATUS

x' 80''

EQU
EQU
EQU

X'40'
X'02'

EQU
EQU
EQU
EQU
EQU
EQU

CPSTATUS+1
MONTHS+l
DAYS+1YEARS+l
HOURS+l
MINUTES+l

EQU
EQU
EQU

HOURS+4
STARTIM+8
BINTIME+4

ON •• FOR I~o ENABLED PROCESSORNOTE: MUST BE DOUBLE WORD BOUNDARYCP POINTERS FOR CPINIT, CHKPT AND BUZZARD

EQU
ASYSINF EQU
ASYSCNSL EQU
CPID
EQU
ARMXSTEQUARECBUF EQU
AZ VOLEQU
APRINI'EQUAP UNCH
EQU
AREADERS EQUAMREALEQU

DISPSW+8
ASYSWRM+4
ASYSINF+4
ASYSCNSL+4
CPID+4
ARMXST+4
ARECBUF+4
AZVOL+4
APRINT+4
APUNCH+4
AREADERS+4

WARM START CYL ADDRESSLOGMSG START1052 CONSOL ADDRESS LOC
CP-67 IDENTIFIERREAL MPX CHAIN STARTSPOOL BUFFER STARTZERO VOLUME DEVICE
PRINTER FILE CHAIN
PUNCH FILE CHAIN
READER FILE CHAIN
ACCOUNTING CARD CHAIN-183-

ARCHSTRT EQU.AMREAL+4

REAL SEL CHAN START

EQU
EQU
EQU
EQU

ARCHSTRT+4
CPUTAB+23
CPUTAB+27
CPUTAB+31

TABLE OF CPU'S AND PREFIXED PAGE 0
CPU IDS OF OTHERSCPU ID WITHOUT EXTRANEOUS BITS
SCRATCH BYTE FOR CPUL/F*TEMPSAVE
EQU

CPUTAB+48

TEMPORARY SAVE FOR INTERRUPT HANDLERSBALRSAVE EQU*TEMPSAVE+64

FAST LINKAGE SAVE •• 80 BYTES*BALRSAVE+80

WORK AREA FOR DISPATCH (8 WORDS)DISPATWK+32
RUNINTIM+4
DSCR0+4
KALG+4
LOCKOUNT+2

1 SECOND INTERVAL BINARY TIMERCURRENT SEGMENT TABLE ORIGIN
PAGING ACTIVITY CONTROLCOUNT OF CURRENTLY LOCKED PAGES
MAX. VALUE OBTAINED BY LOCKOUNT*CPUTAB
CPUOTHCPU IDCPUSCRDISPATWK EQU*

RU NI NT IM EQU
DSCRO
EQU
KALG
EQU
LOCK OU NT EQU
MAXLOCK EQU*******
*
*****
*
*
*
CPTIMEPSA ASSEMBLED DATA STARTS AT X'340'.
CURRENT DEFINITION OF STAT COUNTERS STARTS AT X'' 350''.

TIMING MEASUREMENTS:
EQU
X'350'CPU TIME IN SUPERVISOR STATEPROBTIME EQU
CPTIME+4
CPU TIME IN PROBLEMSTATE
PROBTIME+4
CPU TIME IN WAITSTATE
WAITTIME EQU*

OVERHEAD EQU
WAIT IDLE EQU
WTPAGE
EQU
EQU
WTUSR
WTUSRAEQU****KPGEXPG READPGSWAPQCOUNT

WAITTIME+4
OVERHEAD+4
WAITIDLE+4
WTPAGE+4
WTUSR+4

SUPVR TIME NOT CHARGED TO USERSWAIT TIME FROM PERIODS GTE 1/4 SEC.
TIME SPENI' WAITING FOR A PAGE
TIME SPENT WAITING WITH N-IN-Q RUNNABLE USERWTUSR * NUMBER OF NON-IN-Q RUNNABLE USERS

CPU EVENT COUNTERS:
EQU
EQU
EQU
EQU

WTUSRA+4
KPGEX+4
PGREAD+4
PGSWAP+4

COUNT OF PAGING EXCEPTIONSPAGES READ IN
PAGE SWAPSCOUNTER: USER IN Q LOST PAGE**
INSTALLATION USER (4 WORDS):**INSTWRDl EQU QCOUNT+4
INSTWRD2 EQU
INSTWRD3 EQU
INSTWRD4 EQU

INSTWRD1+4
INSTWRD2+4
INSTWRD3+4***
USER EVENT COUNTERS:*STATUSER EQU INSTWRD4+4
COUNTERS FOR USER INSTR. STREAM EVENTS.
***********************************************************************

*

-184-

*

*
*

*

DEFINITION OF STATISTICS COUNTERS IN CP CORE -COUNTERS OF USER EVENTS.

**************************************************************************STATINST EQU
STATUSER* COUNT OF INTERRUPTSSTATUEXT EQU
STATINSTSTATUSVC EQUSTATUEXT+4
STATUPGM EQU
STATUSVC+4
STATUIOI EQUSTATUPGM+4

COUNT OF USER EXT INTERRUPTS REFLECTEDCOUNT OF USER SVC INTERRUPTS REFLECTEDCOUNT OF USER PGM INTERRUPTS REFLECTEDCOUNT OF USER I/O INTERRUPTS REFLECTED* COUNT OF PRIVILEGED INSTRUCTIONS*STATSSK EQU
STATUIOI +lJ
COUNT OF USERSTATISK EQU
STATSSM EQU
STATLPSW EQU
STATDIAG EQU
STATDDSK EQU
STATS IO EQUSTATTIO EQUSTATHIO EQUSTATTCH EQUSTATSSK+4
STATISK+4
STATSSM+4
STATLPSW+4
STATDIAG+4
STATDDSK+4
STATSI0+4
STATTI0+4
STATHI0+4

I SSK'INSTRUCTIONSCOUNT OF USER 'ISK' INSTRUCTIONSCOUNT OF USER 'SSM' INSTRUCTIONSCOUNT OF USER I LPSW' INSTRUCTIONSCOUNT OF USER 'DIAGNOSE' INSTRUCTIONSCOUNT OF DIAGNOSE DISK IO INSTRUCTIONSCOUNT OF USER 'SIO' INSTRUCTIONSCOUNT OF USER 'TIO' INSTRUCTIONSCOUNT OF USER 'HIO' INSTRUCTIONSCOUNT OF USER 'TCH' INSTRUCTIONS**PRIVILEGED INSTRUCI'IONS FOR VIRTUAL 67
STATWRD EQU
STATTCH+4
COUNT OF 67 USER 0 WRD' INSTRUCTIONSSTATSTMC EQU
STA'l'WRD+ 4
COUNT OF 67 USER 'STMC' INSTRUCTIONSSTATSTMC+4
COUNT OF 67 USER 'LRA' INSTRUCTIONSSTATLAA EQU
COUNT OF 67 USER 'LMC' INSTRUCTIONSSTATLMC EQU
STATLRA+IJ**

MODULE COUNTERSSTATDSP EQU
STATLMC+4***BRING

COUNT OF CALLS TO CKUSR IN DISPATCH

BITS DEFINED FOR CORE MANAGEMENT ROUTINESBRING REQUESTED PAGE IN.
EQU
X'Ol'
STORAGE KEY r
PAGE CHANGED
EQU
X'02'
X'04'
STORAGE KEYr
PAGE REFERENCED
EQU
RETURN CONTROL ONLY AFrER PAGE IS IN CORE
X'08'
EQU
S~~ LOCK BIT ON REQUESTED PAGE.
X'10'
EQU
BITS SE'I' IN SWPTABLE ENI' RIES*PAGE IS SHARABLEr SET IN SWPTABLESHAREDEQU
X'lO'
TRANSIT BIT FOR CORE HANDLER ROUTINESTRANSIT EQU
X'80'
X'40'
RECOMPUTE DASD ADDRESS IN SWPTABLE
RECOMP
EQU
BITS SET CORTABLE ENTRIES**TRANSIT EQU X'80'
SAME AS SWAPTABLE
X'40'
NON-ZERO LOCK COUNT FOR THIS PAGE
LOCK ONEQU
LOCK COMMAND SET FOR THIS PAGE
LOCK CMEQU
X' 20'
CHANGED
USED
DEFER
LOCK

*
*
*EDIT

(

EQU
EQU
UCASE
NOR ET
EQU
DFRET
EQU
NO AUTOEQU
OPERA'I'OR EQU
EQU
ALARM

PARAMETER VALUES PROVIDED TO 'RDCONS' OR 'WRTCONS'
1
2
4
8

16
32
64

PERFORM LINE EDITING FUNCTION.
TRANSLATE LOWER TO UPPER CASE.
DON'T RETURN WHEN THROUGH.
PERFORM 'FRET' OF SPECIFIED AREA.
NO AUTOMATIC-CARRIAGE-RETURN WANTEDMESSAGE TO/FROM OPERATORSEND ALARM TO USER TERMINAL

*
-185-

REGISTER EQUIVALENCES

*

*

RO
Rl
R2
R3

EQU
EQU

0
l

EQU
EQU

2
3

R4

EQU

4

RS

EQU
EQU
EQU
EQU
EQU

5
6
7
8
9

EQU
EQU

10
11

EQU
EQU

12
13
14

R6

R7
R8

R9
RlO
Rl 1.
R12
R13

R14
R15

EQU
EQU

15

*

CPE.kBLOK DSECTCPEXNEXT DSCPBXADD DS
CPEXRLGS DS
CPEXtViISC DS

lF
lF
16F
2F

CONTROL PROGRAM EXECUTION REQUEST BLOCK
POINTER TO NEXT REQUEST.
ADDRESS TO RECEIVE CONTROL.
REGISTERS TO RESTORE (EX. 15)
UNASSIGNED.

*(*-CPEXBLOK)/8
EQU**************************************************************************CPEXSIZ-186-SUBROUTINE CONVENTIONS AND REGISTER USAGE
Except for certain isolated instances, the following
conventions relative to subroutine calling sequences andaddressability apply throughout CP-67.
Addressability is via register 12. subroutines may
assume that register 12 is properly loaded at the time thesubroutine is entered.
The first instruction of a normally called subroutine
should be the ENTER macro described in the section on macro
usage. The return point of the subroutine should use the
EXIT macro.
Register 13 points to a valid save area usable by theroutine being called. It is 24 words in length. The first
three words are reserved and used by the call linkage
handler to save return information. Word 1 is the return
address, word 2 is the caller's R12 (return base>, and word
3 is the caller's R13 {return save area>. The remainder ofthe space is used as the called routine sees fit. The ENTER
and EXIT macros will store the saved registers into the area
beginning at the fourth word of the save area. The called
subroutine may not change the contents of register 12 or 13.
Any registers that are changed must be restored, with the
exception of registers 14 and 15, which may be considereddestructible.
Subroutines expecting to return to the calling program
should be called with the CALL macro. Subroutines which arecalled with the CALL macro and which will not return via the
EXIT macro should perform an SVC 16 to return the currently
assigned save area back to usable storage. This type of codeshould be avoided, if possible. It is used by second levelinterrupt handlers to bypass returning to the first level
handler under specific circumstances.
Unconditional transfers to routines which expect noreturn should be made via the GOTO macro. The routine thus
called has access to the same save area which the callingroutine used.
Parameter transfers to subroutines will generally be
via general purpose registers to enhance the ease of coding
in a reentrant fashion. The specific calling sequences
depend upon the subroutine being called, with the exceptionthat if the PARM= parameter of the CALL macro is used,register 2 will be modif~ed within the CALL macro.
Register 11
being serviced.

contains the UTABLE

address forthe user-187-

SYSTEM MACRO USAGE

The following
explained:

macrosaredefined

and

their

usage

CALL

establishes subroutine
linkages via
SVC
interrupt
CPUF, CPUL - CPU lock protect for multiprocessing <notnow functioning>
ENTER, EXIT - save and restore registers at entry andexit of system routines
GOTO - same parameters as CALL, but no return fromcalled routine
TRANS -

facilitates translation of virtual to physicalmemory address, with necessary paging

BAS, BASR, LMC, STMC, and LRA
Macros BAS, BASR, LMC, STMC, and LRA are merely defined
to be equivalent
to the machine instructions
to beassembled. These macros are provided in the absence of thecorresponding mnemonics of the F-level OS/360 Assembler so
as to include them in its operation dictionary.

-188-

CALL
Subroutine linkages in the Control Program <with the
exception of the call to SVCINIT in CPINIT) are made via the
CALL macro, which generates the appropriate call (via SVC
interrupt) to the supervisor, enabling automatic generationand stacking of save areas, etc. The format is:llabellCALL<subr,gpr>,IEXTERNALl,IPARM=(arg1+arg2+ •.• >I

where "label"refers to the first
generated machine
instruction in the expansion; "subr" refers to a subroutinename <either defined internally or externally>, or "gpr"refers to a general purpose register number <self-defining,not "R1"). "EXTERNAL" as an optional argument indicates thata V-type address constant is to be generated. The optional"PARM" argument, if included, provides for the loading of
GPR 2 with the parameters indicated (specified normally as
EQU values).
If all parameters are to be turned off, PARM=O
must be specified; otherwise, GPR2 will not be set in themacro expansion.

(
-189-

ENTER and EXIT
The ENTER and EXIT macros are placed at the entry andexit points of system routines within the control Program.
They perform the function of saving and restoring registers
and exiting to the calling program. Their format is:llabell

ENTER
EXIT

l<regl l.reg21>1

With the standard calling sequence under the CALL macro
description above. provision is made for the standard supplyof save areas in an efficient manner. The ENTER and EXIT
macros enable easy use of this facility.
If no arguments are provided. no saving of registers
takes place at entry to the routine. If a single register
is stated. it alone is saved in the provided save area at
12C13). If a range is provided. these registers are saved
beginning at 12(13). The first three words of the save area
are never to be modified except by the SVCINT routine.
Sufficient space isprovided for the savingof allregisters. Care must be taken that the registers arerestored Cvia the EXIT macro) in the same manner as they
were stored in the ENTER instruction. The parameters formatching ENTER and EXIT pairs should be identical.

-190-

Garo
'Ihe format of the GO'I'O macro is:

I label I

GOTO<subr ,gpr> I,, PARM= Cargl +arg2+arg3+ .•. > I

The parameters are identical to those of the CALL macro<see "CALL"}. The difference is that the routine doing theGaro will not expect a return from the called routine.
Therefore, no provision is made for the generation of a savearea address.
The called subprogram may make use of thesame save area as the calling program.

-191-

TRANSThe TRANS macro is used whenever a virtual address is
to be translated to a physical memory address, and the page,
if not core resident, may be required to be paged in.
Itsformat is as follows:
llabellTRANS

rgpr,vgprl,OPT=CaC1),aC2>, ••• >1

where •rgpr• is the register to receive the translated
address;•vgpr• is the register containing the virtual
address. OPT is
an optional parameter which
has assubparameters those options provided to the PAGTRANS routine
via the CALL macro.
These options will be passed in theevent a call to PAGTRANS is required. They are discussed
below.
Note:•rgpr• and •vgpr• cannot be the same register.

If LOCK is specified, PAGTRANS is called as it would benormally.
If BRING is specified, the LRA instruction isused to determine whether the page is currently resident.
If i t is not, PAGTRANS is called as i t would be normally;otherwise the call is bypassed.
If neither is specified,the LRA alone is used and the condition code set. Note that
if a call to PAGTRANS is required,registers 1,2, and 15
will not be preserved overthe macro.
If DEFER is
specified, control will not be returned until the page is incore. If USED is specified, the used bit will be set for the
specified page.
If CHANGE is specified, the changed bit
will be set for the specified page.
The following conditional branch macros are defined:
BCN)PECR)
B(N)RE(R)B (N) SE CR)-192-

Branch on Cno) page exception CRX, RR>;
Branch on Cno) reloc. exception CRX, RR>:
Branch on Cno) segment exception CRX, RR).

SECTION 4: TABLES AND CONTROL BLOCK FORMATS

This section contains illustrations representing
the formats of blocks and tables used by the control
program. A brief description of the contents and useof the tables is also given. Further details may befound in the preceding and following sections. <In thelist below, •1/• means one per user, device, etc.>
The following control blocks are described:
ALLOCTBL- index to DASO space available to CP for
paging and spooling
CCWPKG - one for each request for a CP-67 terminal reador write
CORTABLE
eight-byte entry/pageof real memory,
indicating resident virtual page, user, andreal page lock condition
CPEXBLOK - request for some CP-67 program executionthat has been previously def erred pending an
event
CPFDENT CPFILE. system dictionary entry containing
file name and location of first record
CPFFDBLK - a file descriptor block/open file in CP File
Systemroutines(CPFILE),
describing
read/write status, etc.
CPFRECRD
record format of CPFILE records <user
directory files,machine
descriptor files,
system directory) on systems tracks
EXTUTABone for each virtual 360/67. It is anextension of
the U'I'ABLE
containing theinformation peculiar to a virtual 67a
IOTASK - 1/active user selector channel task and each
CF-initiated I/O operation
LOGCDATA describes the format of the error records
saved by CP-67 for channel checks
LOGIDATA describes the format of the error records
saved by CP-67 for I/O errors
LOGNDATA - describes the format of the error records
saved by CP-67 for machine checks~.lJENT - machine description entry
created by DIRECT todescribe a device in a user's virtual machine
MRDEBLOK - 1/real multiplexer device defined in thesystemMRIBUFF - buff er for spooled packed data when handled
for real equipment; chained from MTASK in
MR.DEB LOKMVDEBLOK - 1/virtual multiplexer device attached to auser's UTABLEMVIBUFF - buffer for spooled packed data; chained fromMVIOB in MVDEBLOKPAGTABLE describes status and main storage addressof a virtual memory page
RHEADR, RCCWLIST - 1/user CCW list describing location-193-

and number, etc., of CCW's in user list
- 1/real channel, describing pending tasks,
channel address and status, attached control
units, etc.
RCUBLOK 1/real control unit, describing channel anddevices attached as well as control unit
status, address, etc.
RDCONPKG one for each request for a CP-67 terminal
read; contains return status information
RDEVBLOK
1/any real device, describing address,
device type, control unit, task block., etc.
RECBUF1/cylinder, describing records available/inuse, cylinder number., etc.
SAVEAREA - format of the active and inactive save areasused in subroutine linkage
SEGTABLE - 1/user, describing user page table entries
SFBLOK - one for each •closed" file for spooled input
and output
SWPTABLE - 1 entry/PAGTABLE entry., describing page swap
area addresses
TREXT - built as a UTABLE extension when user invokes
tracing functions
UFDENTuser
file
directory user
information
CID,password,etc.) and user system accessinformation (privilege class., priority code)
UTABLE - 1/user; primary control block onto which otheruser blocks are strung., reflecting complete
virtual machine status
VCHBLOK - 1/virtual channel for each user., describing
channel status., address, attached control
units, etc.
VCUBLOK - 1/virtual control unit describing control
unit status, address., attached devices., etc.
VDEVBLOK 1/virtual device for each user., describing
device address, status., corresponding real
device control block., etc.
RCHBLOK

I
I
I

-194-

" /

ALLOC
There is an allocation block for each volume which is"owned" by the system for uses such as paging and spooling.
The module TMPSPACE scans down a list depending on device
type (T2311 for 2311 disks, T2301 for 2301 drums, etc.>.
The format of the allocation table block in free storage is
as follows:204+--------+-----~--+O I Pointer to next I+--------+--------++--------+--------+
8
4 f Pntr. to RDEVBLOKI

Allocation
Data

256 Bytes - 2301
200 Bytes - 2303
202 Bytes - 2311,2314+----+---+--------+I OF I+----+
where:
The first word is a pointer to the next block
allocation queue for this type of device.
The second word is a pointer to theon which this volume is mounted.

in thereal device block

The allocation data for the drum consists of one bitfor every page on the drum indicating whether the pageis available for system paging (bit contains a 0) or inuse (bit contains 1).
The allocation tables are
preformatted so that only those pages on a given drum
track which are available for paging are initialized tozero. For the 2301 drum, one byte represents one drum
track. Since five pages may fit on even track address
and four on odd track address, the allocation table isinitialized to X'270F070F ••• 070FFF so that unavailable
pages or illegal addresses are not selected as swapping
space.
The halfword at location 212 contains the count ofallocated records on this device and the 9 words
located at bytes 220-256 contain pointers to the first
IO task which references the corresponding records 1
through 9 on the drum.

(

For
the
2303
drum,
the
mask
is
set
to
X'2FOFOFOF •••• OFOFFF'. The value FF indicates the endof the allocation table.
The

allocation

data

for

the

2311

and

2314

disks
-195-

consists of one byte per cylinder indicating whether
the cylinder is available for temporary use.
If thecylinder is available, the byte contains OO: if not, it
contains 08.
The
OF indicates the endof theallocation table for this device.
/

For 2311 and 2314, any cylinder on an "owned" volume
can be allocated for "temp" use (paging or spooling>:•perm" Cnot available>: •tdsk" (for T-disk allocation>:or •drct• Cfor directory. use>. Only those cylinders
marked •temp• cx•oo•> are available for spooling or
paging.

-196-'

CCWPKG
There is one CCWPKG for each terminal I/O request <reador write) generated by CP-67 or the virtual machine (virtual
1052 I/O). The CCWPKG's are chained from each user's UTABLE
at CIOREQ.
6
8
0
4
2
O+--------+--------+-~-----•+--------+I

NEXTCCWPIJSPAREINUMWDCCWI

8+--------+--------+--------+--------+I
PNTRDCONIJDEVICEI
16+--------+--------+--------+--------+I
CCWLIST
I
I
I+--------+--------+--------+--------+
where:
NEXTCCWP
is a pointer to the next CCWPKG or zero
if it is the last.
JSPAREare flag bytes for processing; the second
byte contains the parameters Chits in R2 24-31) of
the call to RDCONS or WRTCONS for the I/O. forexample. NORET=X'04'• OPERATOR=X'20'.
NUMWDCCW
isdoublewords.

the

size

of

this

packagein

PNTRDCONis a pointer (zero if none)
to a
RDCONPKG which becomes a CPEXBLOK for CPSTACK uponcompletion of this I/O operation.
JOE VICE

is the terminal address.

CCWLISTis one or more (depending upon terminal
type and operation) CCW's to perform the I/O.

(
-197-

CORT ABLE
The CORTABLE contains a 16-byte entry for each 4096
bytes of real memory.
It is created by CPINIT at system
initialization time, depending on the size of real memory.
The relative position of the entry indicates the core
address of the page described. Its format is as follows:
0

0

2

4

+--------+--------+--------+--------+
Pointer to SWPTABLE Entry
I+--------+--------+--------+---~----+UTABLE PointerI

4 !Lock MSKI+--------+--------+--------+--------+
Unused+--------+--------+--------+--------+c I Unused
Lock CNT+--------+--------+--------+--------+
8 I

where:
The first four
bytes contain a pointerto thecorresponding SWPTABLE entry for the virtual page whichcurrently occupies this real page (or zero if not inuse).
The Lock MSK is a one-byte availability indicator. The
bit X'80' indicates that the page is in transit. The
bit X'40' indicates a nonzero Lock CNI'. The bit X'20'
indicates that the lock command has been issued forthis page.
The UTABLE Pointer points to the user whose page is inthat core space. A value of X'OOFFFFFF' indicates thatthe page is available. If the UTABLE Pointer contains*CP*, that core space contains the CP nucleus; if FREE,i t is for CP's free storage.
The Lock CNT is an integer indicating the number ofoutstanding locks on this real page for input-output
purposes. The maximum lock count is 65,535.

-198-

CPEXBLOKA CPEXBLOK represents a request for some CP-67 program
execution that has been previously def erred pending an
event.
The CPEXBLOKs are chained to the desired user's
UTABLE. and have the following format:

4

0

8

+--------+---------+ICPEXNEXT ICPEXADD I+--------+---------+
8 ICPEXREGS
0

I
I+------~-+---------+

481CPEXMISC+------------------+

where:CPEXNEXT
any.

is a pointer to the next CP request block if

CPEXADDisexecution.

the

instruction address

toresumeCP

CPEXREGS
are the 16 general registers saved when thedeferred execution request was set up.
CPEXMISC
is for miscellaneous use by the routine thatcreated the block.

-199-

CPFDENTThe CPFDENT block is the description of an entry in thesystem file directory which resides on the system residence
volume. It is contained in a data record which is describedin CPFRECRD. Its format is as follows:
0

2

4

6

8

+--------+--------+--------+--------+CPFDNAME+--------+--------+--------+--------+8 I
CPFVOLlf xxxxxxxxf+--------+--------+--------+--------+CPFDPOS101+--------+--------+--------+--------+
0 I

where:CPFDNAME is the eight-character file name.
CPFVOLl is the volume label
containing the first record.

of

the

disk

volumeCPFDPOS is the position within the first volume of thefirst record - in the format BBCCHHRx.

-200-

CPFFDBLK'!'here is one CPFS file descriptor block for each open
file in the Control Program File System routines CCPFILE).
Its format is as follows:
0
0

8

2

6

4

8

+--------+--------+--------+--------+CPFNEXTCPFRDEV+--------+--------+-------~+--------+I

CPFNAME+--------+--------+--------+--------+CPFVOLIDI C*l I C*2 I+--------+--------+--------+--------+
18
CPFFDPOS+--------+--------+--------+--------+
20 ICPFUPDPTICPFRDPT ICPFBYTERlxxxxxxxxl+--------+--------+--------+--------+
28
CPFBUFADCPFPQUE+--------+--------+--------+--------+
10 I

where:CPFNEXT points to the next open file.

CPFRDEV points to the real device of the current record
being read.
CPFNAME is the eight-character file name.
CPFVOLID isrecord.

the volumeidentification of

the current

C*l - CPFSTAT is the file status:
X'80' indicates file open for writing;X'40' indicates file open for reading.
C*2 - CPFLOCK is the file
updating).
CPFFDPOS is thereal device.

lock (for use by writing andposition of the current

record on the

CPFUPDPT is the pointer for the update function.
CPFRDPT is the pointer for the read function.
CPFBYTER is the count of the bytes remaining to be reador updated.
CPFBUFAD is the buffer address for this open file.
CPFPQUE is theimplemented).

queue

of

locked file

requests

Cnot

(
-201-

CPFRECRD
The following is a description of the record format of
all CPFILE records on system-owned tracks:
0

2

4

6

8

+--------+--------+--------+--------+
0
CNEXTVOL
lxxxxxxxxl+--------+--------+--------+--------+
8
CNEXTPOS+--------+--------+--------+--------+CRECLNG
10+--------+--------+- 829 Bytes
CPFDATA+--------+--------+--------+------~-+

where:CNEXTVOL is the label of the pack containing the next
record. (Note: A zero entry indicates that this is thelast record.}
CNEXTPOS is the position ofpack specified by CNEXTVOL.

the next record within the

CRECLNG is the number of valid data bytes in CPFDATA.
CPFDATA is the actual data in the record, which may beuser directory files, machine description files, or thesystem directory itself.
Note:

All
physical records
are CPRECSZ
bytes long(currently 829}
• CRECLNG establishes the end of thevalid data in the buffer.
Logical records, which areof a length defined by the calling program to CPFILE,
are not split over physical records.

-202-

EXTUTAB
There is one EXTUTAB for each virtual 67 in the system.
It contains all the information peculiar to a virtual 67;
its format is as follows:
0

I
I
I
I
I
I
I

2

4

6

8

+--------+--------+--------+--------+
I
VCRO
I
VCRl
I
/-----------------+-----------------//-----------------+-----------------/
I
VCR14
I
VCR15
I
+-----------------+-----------~-----+I

SHADVCROIE*11E*21COPYPAGT I+-----------------+-----------------+I COPYSEGTIMAGESGT+-----------------+-----------------+
where:
VCRO to VCR15 are the contents ofregisters O to 15.

the virtual control

SHADVCRO is a pointer to the shadow segment table.
LSTBYTST CE*l) is the last byte of the free storage
area address reserved for the shadow segment table.
NBVSEGT CE*2) contains 0 if the virtual machineusing only segment O, and 1 if not.

is

COPYSEGT contains the length of virtual segment O<minus 1) if the virtual machine is using only segment
O; otherwise, it contains the address of the copy ofthe virtual segment table currently in use.
If.'".iAGESGT contains the first virtual segment table entry
if the virtual machine is using only segment O;
otherwise, it contains the address of the image of the
shadow segment table, with the unavailable bit in eachentry.

(-203-

IOI'ASK
There is one IOTASK block for each user selector
channel task active in the system. A task is active from thetime the user performs the SIO operation Cat which time theblock is created from free storage and queued onto theappropriate channel task list) until the device is freed Cat
which time the block is returned to free storage).
Itsformat is:
0

2

4

6

8

+--------+--------+--------+------~-+0TASKRDEVTASKRCU+--------+--------+--------+--------+8TASKPNT
ITP* ITF* ITASKVADD I+--------+--------+--------+--------+TASKCAW10TASKUSER+--------+--------+--------+--------+18
TASKIRAITASKMISC+--------+--------+--------+--------+
I+--------+--------+--------+--------+
where:TASKRDEV is the pointer toblock for this task.

thereal device

control

TASKRCU is a pointer to the real control unit on which
this task is being executed.
TASKPNT is the pointerstrung on the channel.

to the next

task onthe listintheposition
TP*-TASKPATH
contains
a
bit
on
which
the
task iscorresponding to the control unit
to be executed;
this bitis used to scan foravailability of the control unit.
TF*-TASKFLAG contains a bit pattern tostatus. The following bits are defined:
XI 80'

X'40'
X'20'
X'10'

x' 08'
X' 04'

x '02'
X'Ol'

reserved for future use
reserved for future use
error in this I/O operation
CP-67 I/O Cpaging,spooling,etc.)
CP-67 split seek
channel free on this interrupt
processing CC 1 for this task
stand-alone seek operationTASKVADD is
the addressof theoriginating the input-output request.
TASKUSER is a pointer to-204-indicate task

virtualdevicethe appropriate user's UTABLE

block.
TASKCAW is a pointer to the real
for this operation.

channel command list

TASKIRA is a pointer to the routine which will be given
control on any interrupt resulting from this operation.
If a nonzero condition code is encountered on the SIO
for this task within the CHFREE module, control will bepassed to the TASKIRA. with register O containing thecondition code.
on an interrupt, register O willcontain a zero to so indicate.
TASKMISC is a slot which may be used by the originatorof the IOTASK block for whatever purposes required.
For user selector channel operations, TASKMISC holds
the values of registers 6. 7, and 8 (three words) which
are the addresses of the virtual channel, control unit,
and device blocks respectively.
These values are used
to re-load the same registers upon receiving the I/Ointerrupt.
Note:
The IOTASK for CP-initiated I/O functions isgenerally associated with other control blocks and isoften integrated with them (for example, MVIBUFF) .• In
these cases. only the first four doublewords of the
IOTASK are present.

-205-

LOGCDATALOGCDATA is a description of the format ofrecords saved by CP-67 for channel checks:
0

2

4

6

the error

8

0 +--------+--------+--------+--------+I
LOGSNSEI LOG I LOG I
I

ICODEITYPI

8+--------+--------+--------+--------+I
LOGVOLIDILOGADDR I
16+--------+--------+--------+--------+I
LOGDATE
I unused I
24+--------+--------+--------+--------+I
LOGCSWI
32+--------+--------+--------+------~-+II

LOGIOPSW

40+--------+--------+--------+--------+I
LOGCHLOG
I
64+--------+--------+--------+--------+I
LOGCAWI
68+--------+--------+--------+--------+
where:LOGSNSE, LOGCODE, LOGTYPE, LOGVOLID, LOGADDR, LOGDATE
and LOGCSW are the same as in the LOGIDATA control
block.
LOGIOPSW is the oldtime of the error.

I/O PSW which

was stored

at theLOGCHLOG contains the channel logout data.
LOGCAW contains the channel address word at the time ofthe error.

-206-

LOG I DATALOGIDATA is a description of therecords saved by CP-67 for I/O errors:format of

6

0

2

I
I

LOGSNSEthe error

8

O+--------+--------+--------+--------+ILOG ILOGIICODEITYPI

8+--------+--------+--------+--------+I
LOGVOLIDILOGADDR I
16+--------+--------+--------+--------+I
LOGDATE!unused I
24+--------+--------+--------+--------+I
LOGCSWI
32+--------+--------+--------+--------+I
LOGCCWSI
104+--------+--------+--------+--------+I
LOGS KLOC
I
112+--------+--------+--------+--------+
where:LOGSNSE contains the six I/O sense bytes.
LOGCODE contains the type of I/O or channel error.

LOGTYPE is ·theoccurred.

type ofdevice uponwhich theerror

LOGVOLID is the volume serial nurrher of the device uponwhich the error occurred (if known to CP>.
LOGADDR
device.

isthechannel/unit address

of

the

erringLOGDATE contains the date and time of the error.
LOGCSW contains the channel status

word at the time ofthe error.
LOGCCWS contains

the failingccw string(up tonine

CCW's).
LOGSKLOC contains
failure.

the last seek

address prior

to the(-207-

LOGMDATALOGMDATA is a description of the format ofrecords saved by CP-67 for machine checks:
0

2

4

6

the error

8

O+--------+--------+--------+--------+I
LOGMDATEI LOGMCODE I
8+--------+--------+--------+--------+I
LO GM CPUI
184+--------+--------+-------..;+--------+I
LOGMPSW
I
224+--------+--------+--------+--------+I
LOGMGRSI LOGMCRS
I
352+--------+--------+--------+--------+I
LOGMFPRSI
384+--------+--------+--------+--------+
where:
LOGMDATE
check.

contains thedate andtimeof themachine

LOGMCODE contains the machine check code.
LOGMCPU contains the CPU logout data.
LOGMPSW contains the five old PSW's at the time of themachine check (external, SVC, program, machine check,and input-output).
LOGMGRS contains the values of the general registers at
the time of the failure.
LOGMCRS contains the values of the extended
registers at the time of the failure.

control

LOGMFPRS contains the values of the floating
registers at the time of the failure.

point

-208-

MDENT
MDENT is the machine description entry created by
DIRECT to describe a device in a user's virtual machine. It
is pointed to by a UFDENT entry.
The format of MDENT is asfollows:
0

2

4

6

8

+--------+----+---+--------+--------+I MDADR IM*l IM*21
MDID+--------+----+---+--------+--------+
8 I MDID lxxxxxxxxl MDRELN I MDSIZE I+--------+--------+--------+--------+10 I
MDRDPASS+-----------------------------------+18
MDRWPASS+-----------------------------------+
0where:MDADR

is the virtual device address.

M*l - MDSTAT is the unit status information:
UNITEMPX'80'
indicates
temporarydeviceallocation.
UNITDED
X'40' indicates thatthe real device
specified in MDID is to be dedicated tothis user.
UNRDONLY X'20' indicates a read-only volume.
UNITRMT X'10' indicates that spooled output is tobe sent to the real device specified byMDID.
UNRWRIT
X'08' if on denotes that the device isshareable in write mode.
UNCONT
X'04' if on denotes that the virtual card
reader will read all spool files as one.
UNRWMULT X'02' if on denotes that multiple writeusers are allowed.
UNRDSHAR X'Ol' if on, denotes that the device isshareable for read-only.
M*2 - MDTYPE contains the virtual device type.
MDID contains a six-byte volume label for DASO volumes.
If UNITDED or UNITRMI' is on, MDID is of the form
•roccu•, where •ccu• is a real device address.
MDRELN is the cylinder offset for a shared DASD device.
MDSIZE is the size of the virtual device.
MDRDPASS is an eight-byte password usedeligibility for read-only sharing.

to determine

MDRWPASS is an eight-byte password usedeligibility for write sharing.

to determine-209-

MRDEBLOK
There is one MRDEBLOK for each multiplexer device
defined in the system. The definition is contained in the
REALIO module by macros. Its format is as follows:
0

0
8
10

18

2

4

6

8

+--------+--------+--------+--------+MRDEVPNTIMRDEVADDIM*l IM*21+--------+--------+--~-----+--------+

MUSER

I

MIRA

+--------+--------+--------+--------+MRDEVIOIMTASK+--------+--------+--------+--~-----+

MRPNTVIR

IM*31

MRDCSWAD+--------+--------+--------+--------+

20 IMRDERRCTIM*41M*5 IM*6IM*7 IM*8 lxxxt+--------+--------+---~----+--------+

where:MRDEVPNI' is a pointer to the next real device block.
MRDEVADD is the device address of this real device.
M*l - MRDESTAT is the real device status:
X'80'
X'40'
X'20'
x'lO'
X'08'
X'04'

indicates prepare issued (2702 only)
indicates HIO issued (2702 only>
indicates sense issued
indicates not readyindicates enabled (2702 only)
indicates ATS terminal (2741 only)
X'02' indicates device is dedicated
X'Ol' disable line
M*2 - MRDEVTYP contains the real device type number.
MUSER contains

the UTABLE addressof theinterruption

address

user owning

this device.
MIRA isdevice.

thereturnfor

thisfiles for

this

contains a pointer to open MRIBUFF blocks
this device (for spooling operations only).

for

MRDEVIO contains a pointer to closed
device (for spooling operations only).
MTASK

MRPNTVIR contains a pointer to the virtual device
equivalent to this device (for nonspooling operations
only).
M*3-210-- MRDESENS

contains

thesense byte

information

(2702).
MRDCSWAD
contains apointer
information (2702 only).

to

the

csw

saved

MRDERRCI' contains the count of errors on this device.

M*4 - MRREI'RY is therecovery.

retry counter for attempted error

M*S - MRFI'R contains device or line
the SAD number 0,1,2,3, or 4.

features, such as

M*6 - MRIFLAG is the flag for MRIOEXEC:MRIDRAIN X'08' drain spooling operations
MRISPACE X'04'
force printer to single space
TERMINAT
X'01'
terminate spooled
I/O
when
interrupt comes in
UNSPOOL X'02' punch available for unspooled I/O,
that is, accounting cards.
M*7 - MRWRTFLG
terminal.

isused by

M*8 - MRDEBRCI'

is reserved for future use.

CONSINT

to identify

the

-211-

MRI BUFF
The following buffers and their descriptions apply tothose blocks used in the "unspooling• operations associatedwith MRIOEXEC and the real hardware.
MRIBUFF is the buffer for spooled packed data when being
handled for the real equipment. It is chained from MTASK in
the multiplexer real device block CMRDEBLOK). Its format is:
0

2

4

6

8

+--------+--------+--------+--------+IOTASK

0+--------+--------+--------+--------+I

20 I

MRICAWl

I+--------+--------+--------+--------+
48 I
BB
CC
HH
R lxxxl+--------+--------+--------+--------+
so IMRICOUNTI+--------+DATAD+--------+--------+--------+--------+I

3901

MRICAW2

I+--------+--------+--------+--------+I

3E81

DAT AP

I+--------+--------+--------+--------+REGSAVE
BADDR
4701+--------+--------+--------+--------+I

4781

MRIFILEC

I+--------+--------+--------+--------+
where:IOTASK is the IOTASK block associated with bringing
this buffer to and from the disk; four doublewords
only.
MRICAWl are the CCW's required to bring the buffer off
the disk or write it to the disk; five CCWs: SEEK,SEARCH, TIC *-8, RD or WRT, NOP.
MRINEXT is the pointer to the-212-

next buffer on the disk;

BBCCHHRx. x is device table code <index).
MRICOUNT is the pointer within the buffer
byte to be processed.

to the next

DATAD is the packed data read or written on disk.
MRICAW2 arebuffer.

the unit

record ccw•s

required for

this

DATAP is the output buffer for the PACK routine <cardreader) or the output buff er for the UNPACK routine(printer and punch).
REGSAVE is a temporary register save area.
BADDR is a pointer tofor unit record data.

the unpacked input-output buff er

MRIFILEC is a three-doubleword pointer for DASD record
address. It contains data to build the SFBLOK when thefile is completed (reader only).

The following is a description of the buffer
unit record operations chained from BADDR of theblock (preceding):
0
0

8

2

4

6

for theMRIBUFF

8+--------+--------+--------+--------+ICUR. CCWICUR. DATI CAW
1xxxxxxxx1+--------+--------+--------+--------+
DATA+--------+--------+--------+--------+

t

··~

-213-

MVDEBLOK
There is an MVDEBLOK for each virtual multiplexer
device attached to a user's UTABLE (from VMXSTART);its
format is as follows:
0

2

6

4

8

+--------+--------+--------+------~-+08

I

MVDEVPNTIMVDEVADDIM*l IM*21+--------+--------+--------+-------~+I

MVPNTRELMVIOB+--------+--------+--------+--------+
MVCSW+--------+--------+--------+--------+
18
MVDEVIO
IM*3 IM*41M*51M*6 I+--------+--------+--------+--------+
20
MVIXUSER+--------+--------+--------+--------+
10

where:MVDEVPNT is a pointer to the next virtual device on thevirtual multiplexer channel.
MVDEVADD is the virtual device address.
M*l MVDESTAT is the virtual device status; the bit
definition is the same as the bit definition of byte 4of a csw, for example, CE=X'08', BUSY=X'lO'.
M*2 - MVDEVTYP is the virtual device type number.
MVPNTRELis(MRDEBLOK) •thepointer

to

the

real

terminal

MVIOB is the current buffer address for this device;
MVIBUFF for unit record: or terminal I/O buffer.
MVCSW is the virtual CSW for this subchannel.
MVDEVIO is the pointer to closed files for this virtual
device (spooling
operations only>:
for terminals<virtual 1052), address of current ccw.
M*3 - MVSENSE is the sense information for the device.
M*4 - MVIFLAG are miscellaneous status bits:
MVIFCCW X'Ol' current CCW is first in chain
MVIFCLOS X'02' file closed by CONSOL function
MVIFRMT X'04' spooled output to go to MVPNTRELMVIFSAV x•os• keep virtual card reader files
after use
MVIXFER X'lO' punch file to be made a card reader
file for MVIXUSER-214-

MVIEXITMVICONT

X'20'
X'40'
X'80'

M*S key.

MVIOKEY is

MVIOEXEC has done EXIT, go to DISPATCH
continuous card spoolingreserved for future use

the virtual

CAW storage

protection

M*6 MVIOBRK is a flag to indicate CX'FF')
that theattention key was hit during virtual console I/O.
MVIXUSER for punch or printer; contains userid totransfer output if MIVXFER list in MVIFLAG is on; forterminals (virtual 1052), contains current CCW being
processed.

-215-

MVIBUFF
This section is a description of the various buffers
used by the spooling mechanism of the control Program.
MVIBUFF is a buffer for packed spooled data.
It ischained from MVIOB in the multiplexer virtual device blocks
and has the following format:
0

2

4

6

8

+--------+--------+--------+--------+Io I

IOTASKI
I+--------+--------+--------+--------+I

20 IMRICAW1

I
I
I
I

I
l
I
I

+--------+--------+--------+--------+MVINEXT+--------+--------+--------+--------+
50 IMVICOUNTI+--------+
48

I
I
I

DATAD

+--------+--------+--------+--------+
MVICCW+--------+--------+--------+-------·+
3981
Temporary save Area+--------+--------+--------+--------+
I
I
3901

3AOI

DATAPACI

I
I+--------+--------+--------+--------+
I
I

3COI

I

DATAP

I
I

+--------+--------+--------+--------++--------+ MVIFILEC

448IMVIRECS I+--------+--------+--------+--------+
where:IOTASK is the task control block for reading or writing
the disk buffers; four doublewordsords only.
-216-

MRICAWl are the CCW's required to write or read thebuffer to secondary storage;
five CCW's: SEEK, SEARCH,
TIC •-8, RD or WRT, NOP.
MVINEXT is the pointer towhere x is device code.

the next

record; BBCCHHRx,

MVICOUNT is the byte address within the following dataarea, DATAD, of the next byte.
DATAD is the buffer of packed data (830 bytes long>.
MVICCW is the user's current ccw.
DATAPAC is the output buffer•pAcK• in Section 5).

for the PACK routine (seeDATAP is the input buff er for the PACK routine or the
output buffer for the UNPACK routin~, depending on thespooling function being performed.
MVIRECS (MVIFILEC):
When the file is open, i t is the number of records
in this file (two bytes).
When the file is closed, it is a three-doubleword
pointer for DASO record address. It is used tobuild an SFBLOK when the file is completed.

£

'

-217-

PAGTABLE
There is one
follows:

PAGTABLE for each user; its

012format is as15+-----------+-+----+SWPTBL PNT+-----------+-+----+
I Page Add. I lxxxxl+-----------+-+----+II
I up toI 256 Entries
I 512 Bytes maximum
I
I
I+-----------+-+----+
I I+-----------+-+----+
where:SWPTBL PNTis a pointer to the SWPTABLE associatedwith this PAGTABLE, one fullword in size. The
remainder is made up of halfword entries .• Each entry
describes the status and main storage address of avirtual memory page, as follows:
Bits 0 through 11 are the address
real memory (if resident).

of apage in

Bits 12 through 15 are a control field:
Bit 12 indicates status of the page:
0 indicates core resident.
1 indicates not in core.
Bits 13-15 are reserved forbe zero for the 360/67).

-218-

future use <they must

RCCWLIST
There is one RCCWLIST
format is as follows:for each

2

0

user

ccw list;

6

4

its

8

+--------+--------+--------+--------+
VLIST
TADDR
+--------+--------+--------+--------+
8VCNT
RCNT I IDENT
SCNT+--------+--------+--------+--------+
10 IR*ll RADDRI R * 2 I R * 31 RB YTE+--------+--------+--------+--------+
0where:VLIST is the location of ccw•s in user•s program.
TADDR isnone).

the real address ofthe next CCW list

(0 if

VCNT is the number of user•s CCW's in this list.
RCNT is theuser's list.
!DENT isx•FFFF'.

numbertheofhalfword

SCNT is the number ofdata.

CCW's requiredtorepresent

markerin

UNTRANS>;(used

doublewords reserved for control

R*l - RCOMND is the actual CCW op-code for the channel.
RADDR is the real (translated) addresstransfer or argument.
R*2 ccw• s.

RFLAG is the real

for theflag field fordata

the channel

R*3 - RCNTL is the control field used by CCWTRAN and
UNTRANS to identify certain types of CCW's:
RC XISRCS UDORC UTICRCIORC GENRCDATA
RC02
RCOl

x•so•
x• 40•
x•20•
x•10•
X'08'

x• 04•x•o2•
x• 01 •

check for ISAM read
pseudo 2311 or 2314
untranslated TIC
I/O CCW
CP-generated ccw
CP-generated CD
reserved for future use
reserved for future use

RBYTE is the real ccw data count.

-219-

RCHBLOK
There is one RCHBLOK foris as follows:each real channel: its format
'

0

0

2

4

6

8

+--------+--------+--------+~-------+RCHANPNTRCULIST+---~----+--------+--------+~-------+8TASKLIST

IR*11R*2 IRCUCOUNTI+--------+--------+--------+--------+TASKLAST+--------+--------+--------+--------+IRCHCOND IR*31R*4 IR*51R*6 IRF.sERVEDI

10 IRCHANADDI TASKCNTI+--------+---~----+--------+--------+

where:RCHANPNT is the pointer to the next channel .•RCULIST is the pointer to connected control units.
TASKLIST is the pointer to pending tasks.
RCUACT CR*l} is the active control unit mask.
RCHSTAT CR*2} are channel status bits:
X'80' indicates channel busy.
X'40' indicates rescan required in CHFREE.
RCUCOUNT is the count of attached control units.
RCHANADD is the real channel address.
TASKCNT is the count of pending tasks.
TASKLAST is the pointer to last task on this channel.
RCHCOND is channel status after a channel error(**>.
R*3
R*4
R*5
R*6

RCHDATCK count of channel data checks
RCHCONCK count of channel control checks
RCHIFCC count of interface control checks
RCHANCC count of channel chaining checks<**> channel error is defined as any error indicated by
R•3, R*4, R*S, or R*6.

-220-

/

RCUBLOK
There is one RCUBLOK forformat is as follows:02each real control

4unit; itsa6+--------+--------+--------+--------+RC UP NTRDEVLIST0+--------+--------+--------+--------+
8
RACTCHAN
IR*llxxxxxxxxxxxxxl+--------+--------+--------+--------+
10 I RCUADD I RCUSTATIRTAILCNTIRDECOUNTI+--------+--------+--------+·-------+
18
RCUTAILl
RCUTAIL2+--------+--------+--------+------•-+
where:RDEVLIST is the pointer to connected devices.
RCUPNTis the pointer to next control unit.

RACTCHAN is the pointer to active channel; zero value
initially; filled in from RCUTAILl after SIO.
R*l - RCUPATH is the path for this control unit.
RCUADD is the real control unit address.
RCUSTAT is the real controlused) •

unit status <not currently.RTAILCNT is the tail count for thiscurrently used).

control unit <not

RDECOUNT is the count of devices on this unit.
RCUTAILl is the pointer to channel for tail 1.
RCUTAIL2 is thecurrently used).

pointer tochannel for

tail 2

(not

-221-

RDCONPKG
There is one RDCONPKG for each CCWPKG that requires
control to be.returned upon completion of the associated I/O
operation. Its format is:
0

2

4

6

8

O+--------+--------+--------+--------+I
NEXTCPRQI
JSRETADDI
8+--------+--------+--------+--------+.
I
JS REGS
I+--------+--------+--------+--------+I
JSPARE3I
JSPARE4
I
48+--------+--------+--------+--------+
where:
NEXTCPRQ
is a pointerby CPST ACK) •(always zero until queued

JSREADDis the return address
in CPEXBLOK).

-222-

JSREGSare registers for return.

JSPARE3

is a spare.

JSPARE4

is a spare.

(becomes CPEXADD

RD EV BLOK
There is one RDEVBLOK foris as follows:0each real device; its format
4

2

6

8

+--------+--------+--------+------~-+

08

RDEVPNTRDEVCU+--------+--------+--------+--------+RDEVTASKIRDEVADD IR*l IR*21+--------+--------+-----~--+--------+10 I

RVOLSERIRDEVCODEI+--------+--------+--------+---·----+RDEVALLNIRDEVERCTIRDEVSTATI+--------+--------+--------+--------+20 I
RDEVUSER
IRATTVADDIR*3 IR*41+--------+--------+--------+--------+I
RDEVSENIC*O IC*21+--------------------------+--------+RDEVTMON

18 I+-------+---------+------~-+--------+

where:RDEVPNT is a pointer to the next device on the chain.
RDEVCU is a pointer to the real control unit.
RDEVADD is the real device
device portions only).

address (control

unit andR*l - RDEVTYPE is the device type code.
R*2
RDECUPTH isdevice.
RDEVTASK isactive).

thea pointer tocontrolunit path

for

this

the attached task

block (ifRVOLSER is the six-character EBCDIC volume
DASD volume and attached to the system).

label (ifRDEVCODE is the halfword identification
into RDEVTABL).
RDEVALLN is
CP-owned).

the pointerto thenumber (index

allocation table

Cif

RDEVERCT is the error count for this device ..
RDEVSTAT is the real device status:
RDEVOWND X'80'
only).
RDEVATTD X'40'
device.

indicates CP-owned
indicates

dedicatedvolume(DASD(nonshared)-223-

RDEVDED X' 20'
indicates channel, control unit,
and device block
dynamically created by
DEDICATE.
RDEVSEEK X'08' indicates a seek is in progress.
RDEVPOSD X'04' indicates 2311,2314 comb positioned
for next read/write operation.
RDEVSYS X'02' device attached to system.
RDEVUSER is the UTABLE pointer for(for dedicated devices>.
RATTVADD is the current user's
dedicated devices).

the current

user

virtual address(for

R*3 - RDEVFTRReal device features. Used
dedicated communication lines SAD value.
R*4 - RDEVSLENRDEVSEN

to describe

device sense byte countcontains up to six sense bytes for device

C*O - command reject counterC*2 - bus out parity error counterC*3 - equipment check error counter
C*4 - data check counter

C*1 - seek check <sense bit 7, byte O> counter
RDEVTMONis the attached time
(MMDDYY HHMM).

-224-

for a dedicated device

RECBUFOne RECBUF block of the following format is created foreach cylinder.
The start of the RECBUF block's chain is
RECSTART. Its format is:

2

0

4

+--------+---·----+O I Pointer to next I+--------+--------+
4 IR*1 IR*21CNUMIDCDI+·-------+--------+
DATA

8- 202 Bytes+--------+--------+
where:
The first word is the pointer to the next RECBUF block.
CR*1) is the number of records in use on this cylinder.
CR*2) is the maximum
this cylinder.

number ofrecords available

inCNUM is the cylinder number of this cylinder.
DCD is the real
cylinder.

device code forthe device

for this

The remaining bytes are:For a 2314, two bytes for each pair of even-odd
tracks. There are 15 records per pair of tracksr
and eachbit (0-14)
indicates whether
thecorresponding record (1-15) is available. Bit 15
is always set to 1.
For a 2311r two bytes for each track. There are
four records per track. Bits 4 through 15 are set
to 1. A 1 indicates that the corresponding record
is in use.

(.-225-

SAVEAREA
The active SAVEAREA format is:
/

0

8

4

+-----------------+-----------------+I RETURN ADDRESS I CALLERS R12+-----------------+-----------------+I CALLERS R13+-----------------+
I 21 WORD REGISTER SAVEAREA
I

and WORKAREA+-----------------------------------+
where:
RETURN ADDRESS is the instruction address immediately
following the SVC 8 call which obtained the current
save area.
CALLE.RS Rl2
routine.·

is

the

base

registerofthecalling

CALLERS R13 is the address of the active save area.
21 WORD REGISTER SAVEAREA and WORKAREA is normally usedby the ENTER macro to save the caller's registers. Up
to 16 registers can be saved, although only registers
0-11 are significant.
Words not used for registersaving can be used as a scratch area by the called
program.
The inactive (available) SAVEAREA format is:048+-----------------+--------------·--+I NEXTSAVEI+-----------------+-----------~-=---+

I
I
I

I
I
I

+-----------------------------------+
where:NEXTSAVE is a pointer to the next 24-word save area inthe chain of available save areas. The pointer is
updated in the last save area on the chain when a savearea is released by SVC 12 or SVC 16.

-226-

'

SEGTABLE
CP-67 contains one
is as follows:
0

1

SEGTABLE for each user;

its format

4+--------+------------------------+I PAGE CNT I
PAGE TABLE ADDRESS+--------+------------------------+
I
I
I
I
I

16 Entries
64 Bytes+--------+------------------------++--------+------------------------+
Each four-byte entry defines a page table, as follows:
Byte 1 - Number of page table entries Cless 1).
Bytes 2-4 - Address of page table origin.

-227-

SFBLOKSFBLOK is a control block for a closed spool file.
format is as follows:
0

2

The

4

+--------+--------+I Pointer to next I+--------+--------+
BB
cc+--------+--------+HH
I R 1codel+--------+--------+MRDEBLOK+--------+--------+
User id+--------+--------+

When this file is being used by MRIOEXEC, the pointer isremoved from the chain and hooked up to MRDEVIO in themultiplexer real device block CMRDEBLOK).
MRDEBLOK is filled in if the spooled
to a particular device.

output is directed

The high-order byte of this field is also used for arepeat of the output in MRIOEXEC.
An x'80' means output isdirected to the MRDEBLOK address in the remaining threebytes. An x'4x' means repeat the output up to x times.

-228-

SWPTABLE
The SWPTABLE contains an eight-byte entry for eachentry in a user's PAGTABLE. It is generated at LOGON time,
its length depending on the size of a user's virtual memory.
It is in the following format:
0

1

2

3

4

+--------+--------+--------+--------+IS*l
I VPAGNO I KEY1
KEY2+--------+--------+--------+--------+IRDEVCODEICYLHEAD I RECORD I+--------+--------+--------+--------+
where:
S*1 has the following meaning:
X'80': Transit bit, page in transit Cin>
X'40': Recompute bit, DASD address is source ofpage, get new DASD address if write isrequired
X'20': Transit bit, page in transit Cout>X'lO': Shared bit, page is shared and protected
X'08': first half page was used since last SSK Cifin core>X'04': first half page was modified since last SSK(if in core>
X'02': second half page was used since last SSK(if in core)
X'Ol': second half page was modified since last
SSK (if in core>
VPAGNO is the virtual page number of the user using the
page.
KEYl and KEY2 are the virtual keys for
top halves of this page, respectively.

the bottom and

RDEVCODE is the realcontaining this page.

ofdevicecode

thedeviceCYL, HEAD, and RECORD are the physical location of thenonresident page on the device indicated by RDEVCODE.

(
-229-

TR EXTThis control block is built as a UTABLE
user invokes tracing functions.
02

4extension when the

68+--------+--------+--------+--------+I TRSVCI I TRBRI I TRSTI I T*llT*21+--------+--------+--------+--------+
IT*3 IT*41 UNUSED ITRSVCIA+--------+--------+--------+--------+TRBRIATRSTAD+--------+--------+--------+--------+TRSTSVTREXINSI+--------+--------+--------+--------+
UNUSEDI+--------+--------+--------+--------+TRSVLCO+--------+--------+--------+--------+
I
TRPWK
I
+--------+----~---+--------+--------+

I
I

/

TRLIN

I
I

/

/

/

I
I

I
I

+--------+--------+------·-+--------+TRSVCI -saved 2 bytes of next instruction.

TRBRI -

saved 2 bytes of branch-to instruction.

TRSTI -

saved 2 bytes of address stop instruction

T*l-TRCNSL -console tracing options.

T*2-TRPRT -printer tracing options.

T*3-TRINTF -interrupt type flag.

T*4-BRSW -processing control switch.

TRSVCIA -next instruction address.

TRBRIA -branch-to instruction address

TRSTAD -address stop location.

TRSTSV -address of executed NSI.

TREXINS -executed NSI contents.

TRSVLCO -saved location zero 8 bytes.

-230-

TRPWK -pack data work area.

TRLIN -

output data buffer.

-231-

UFDENTThe following is a de8cription of an entry in the user
file directory (U.DIRECT) which contains information about
the user and his access privileges to the system:
0

2

4

6

8

+--------+--------+--------+--------+
UFDID+--------+--------+--------+--------+
8
UFDPASS+--------+--------+--------+--------+
10
UFDACCT+--------+--------+--------+--------+
18
UFDMDEF+--------+--------+--------+--------+
20 IU*ll u•21xxxxxxxx1+--------+--------+
0where:UFDID is the eight-character user identification.
UFDPASS is the eight-character user password.
UFDACCT is the user accounting information.
UFDMDEF is the eight-character filemachine description file.

name of the user's

U*l - UFDPRIV is the user's privilege class code .•U*2 - UFDPRIOR is the user's priority code Cl-9) .•-232-

UTABLE
There is one UTABLE block for each user in the system.
It is the primary control block from which all user blocks
are strung.
It completely reflects, with the virtual I/O
blocks, the status of the virtual machine.
Its format is:
2

0

4

6

8

+--------+--------+--------+--------+
VGPR's0+--------+--------+--------+--------+
VFPR's40+--------+--------+--------+--------+
VPSW+--------+--------+--------+--------+
68
SEGTABLE
VMACHSIZ+--------+--------+--------+--------+70
VCHSTART
IVCHCOUNTI PENDING!
60+------~-+--------+--------+--------+

78 IULOCKSf VMSTATUSITIMEUSED+--------+--------+--------+--------+
80
NEXTUSERVTIMER+--------+--------+--------+-------~+USERID88

I+--------+--------+--------+--------+
90
DVTOT
I
USYSTABI+--------+--------+--------+--------+
98
VMXSTARTIVMXPOINT+--------+--------+--------+--------+UTREXT
AO IULOCKL IU*1 IU*21+--------+--------+--------+--------+
A8
CIOREQINCIOREQ IDNMPAGE I+--------+--------+--------+--------+
BO fVMXCOUNTISEGTBDSPIADEXTAB+--------+--------+--------+--------+
B8
TIMEON+--------+--------+--------+--------+
co
ACCTNG+--------+--------+--------+--------+C8 I
TIMINQI NUMPAGES I PRIOR IT I+--------+--------+----~---+--------+DO I

VTOTTIMEIU*S IU*6 IUPIOCNTI+--------+--------+----+---+--------+DB IUVIOCNT I
UCPCOMND+--------+--------+--------+--------+FO
TIMSTAMP
NEXTRTMR
I+--------+--------+--------+--------+
F8
NXTQ
PRVQ
I
+--------+--------+--------+--------+
VMUSER1
VMUSER2
100 I+--------+--------+--------+--------+
1081
VMUSER3
VMUSER4-233-

+--------+--------+--------+--------+USERINSTTRSW+--------+--------+--------+--------+
1241
VMSSIOVMPNCHI

1161+--------+--------+------~-+--------+

1321

VMLINSIVMCRDS+--------+--------+--------+--------+
1401
VMPGRDRESERVED+--------+--------+----~---+--------+RESERVED

1481+--------+--------+--------+--------+RESERVED

1561+--------+--------+---~----+--------+

where:
VGPR's are the user's
saved on an interrupt.

16

general purpose

registers

VFP.R's are the user's
point registers.

four double-precision

floating

VPSW is the user's virtual PSW .•SEGTABLE is a pointer to 'the user's segment table.
VMACHSIZ is the size of the virtual machine <last valid
address +1).
VCHSTART isblock.

a pointer

VCHCOUNI' is theattached.

number of

PENDING contains a bit
pending interrupt.
ULOCKS

to thefirst selector

channelvirtual selector

channels

for eachchannel whichis reserved for future use.

VMSTATUS is a halfword containing bits
state of a user machine:
Byte 0PAGEWAIT X'80'
IOWAIT
X'40'
CFWAIT
X'20'
SYSOPBIT X' 10'
UARPQ
X'08'
VIRCOMSW X'04'
INLOGOFF X' 02'
INLOGON X' 01'
Byte 1
X'80'

X'40'
-234-

has a

reflecting theuser waiting for a page or pages
user SIO being analyzed
user in console function mode
user is system operator
reserved for future use
virtual console function in
executionuser in logoff processuser in login process
indicates that the current runuser
has not been charged for virtual timereserved

X'08'
X'04'

user is runnable
user is in a Q
X' O2'
us er is running shared system
TIMEUSED is the total time used since logon <problem
state plus CP overhead).
NEXTUSER is the pointer to the next user's UTABLE.
VTIMER is the user's virtual timer.
USERID is the eight-character user identification.
DVTOT is the VTOTTIME value on entry to a queue or thevirtual time used during the last time in a queue.
USYSTAB is the pointer towhich this user is sharing.

the table

for thesystemVMXSTARI' is the pointer to the first virtual
block on the virtual multiplexer channel.

deviceVMXPOINT is reserved for future use.
ULOCKL is reserved for future use.
U*l - UOPTDEF is the user options from the DIRECTORY:
RTIMR
ISAM
V67

U*2 -

X'80' - real timer
X'40' - self-modifying DASO ccw checking
X'20'
user
can operate in virtual
extended PSW mode

PRCLASS islevel:

the user's

SYSCTLOP X'80'
SYSADMIN X'40'
SUBSYSOP X'20'
operator.
SYSUSER X'10'

privilege classand priority

indicates system operator.
indicates system administrator.
indicates subordinate system
indicates system user.

The low-orderfour
priority level Cl-9).

bits

contain

theuser'sUTREXT built when user invokes tracing functions.
CIOREQ is therequests.

pointertopending console

operation

NCIOREQ is the number of pending console operations.
DNMPAGE is paging activity value for this user.
VMXCOUNT is theuser.

count of multiplexer devices

SEGTBDSP is the displacement of
free storage block.

for this

SEGTABLE from start of-235-

ADEXTAB is the address offor a virtual 67.

the UTABLE

extension, used

TIMEON is the user time on.
U*3 - TIMERMOD is the virtual timer mode switch:
DISCNBIT x'80' user terminal disccnnected
PRIDISP x'40'
request for priority dispatch
RUNCP
x'04' virtual machine running withconsole function read active
MSGBITx•20• user set MSGOFFWNGBIT
X'lO' ignore warnings
MULTCH
X'08' more than one virtual channel
may exist with same channel address
U*4

PAGWCNT
requests.

is

the

count

of

user

outstanding

page

ACCTNG is the user accounting information.
TIMINQ is used by DISPATCH for scheduling.
NUMPAGES is number of pages the user has in core.
PRIORIT is priority to reenter the queue.
VTOTTIME is thesince login.

total problem state timeused by user

U*S - WORKSET is not presently used.
U*6 - CNTRLMOD is the status of the virtual 360/67:
EXTCM X'80'
indicates theextended control mode.

virtual machine

INVCRO X '2 0'
indicates that all
describing the third-level memory
rebuilt.

the
have

is in
tablesto be

INVSHADT X'10' indicates that the shadow segment
and page tables have to be rebuilt.
UPIOCNT is the number of page reads done for this user
while in a queue. Reset to zero each time on entry toa queue.
UVIOCNT isuser.

the number ofvirtual sros issued

UCPCOMND is
the user.

the last CP

console function'I'IMSTAMP is time stamp at status change.
NEXTRTMR next user with a real timer.
-236-

by thisexecuted byNXTQ next user in this runnable list.
PRVQ previous user in this eligible list.
VMUSER1-4 for installation use .•USERINST for saving privileged instructions.
TRSW trace switch.
VMSSIO number of selector channel SIO's.
VMPNCH number of spooled cards punched.
VMLINS number of spooled lines printed.
VMCRDS number of spooled cards read.
VMPGRD number Of pages read.

-237-

VCHBLOK
There is one virtual channel block for eachchannel on each user. Its format is as follows:
0

0

2

6

4

virtual8+--------+--------+--------+--------+VCHANPNTVCULIST+--------+--------+--------+---~----+8

IVCHANADDIVCUCOUNI'I V*llxxxlV*2 txxxt+--------+--------+--------+--------+
10 IVCEUNIT fVNPNDCUitxxxxxxxxxxxxxxxxxt
18+--------+--------+--~-----+--------+VCHCSW+--------+--------+--------+--------+

where:VCHANPNT ischannel.

the pointerto thisVCULIST isblocks.

the pointer touser's next

the connectedvirtualcontrol unit

VCHANADD is the virtual channel address.
VCUCOUNT is the count of virtual control units attachedto this channel.
VCHSTAT CV*l> is the virtual channel status; bitdefinition for channel status is the same as the csw,
byte 4; for example, BUSY=X'lO', CE=X'08'.
VCHFLAG CV*2) is reserved for future use.
VCEUNIT is the address of the unit forpending channel end, if any, occurred.
VNPNDCUI is
theinterruptions.

numberofpending

VCHCSW is the virtual channel status word
end type interruptions.

-238-

which

the

control

unit

for channel

VCUBLOK
There is one virtua1 control unit block
virtual control unit; its format is as follows:
0

2

4

for

6

8

the

virtualeach+--------+--------+--------+--------+
0VDEVLISTVCUPNT+--------+--------+--------+--------+8I VCUADD IVDECOUNTI VCUSTATlxxxxxxxxt+--------+--------+--------+--------+
10 IVCUEUNITIVNPNDDEilxxxxxxxxxxxxxxxxxl+--------+--------+--------+--------+
where:VDEVLIST is
the pointer toconnected to this control unit.

devices

VCUPNT is the pointer to the next virtual control unit
in the chain from the virtual channel.
VCUADD is the virtual control
or device included).

unit address <no channel

VDECOUNT is the number of virtual devices attached.
VCUSTAT is the status of the virtual control unit; bitdefinition is the same as the CSW, byte 4; for example,
BUSY=X'lO'.
VCUEUNIT is the unit for which
condition, if any, is pending.

acontrol unit

end

VNPNDDEI is the number of pending device interruptions.

-239-

VDEVBLOK
There is a virtual device block for each virtual device
for each user in the system• its format is as follows:
0

2

4

6

8

+--------+--------+--------+--------+VDEVPNTIVDEVADD IV*l IV*21+--------+--------+--------+--------+8 I
VPNTREALIVDEVREL IVDEVBND I+--------+--------+--------+--------+10 I
VDEVPOS+--------+--------+--------+--------+
18
VDEVSNSE
IV*3 IV*4 I+--------+--------+--------+--------+
0where:VDEVPNT is the pointer to thefrom the control unit.

next device on the chain

VDEVADD is the virtual device address.
V*l - VDEVSTAT is the virtual device status; bit definitionis the same as thecsw, byte 4; for example,
BUSY=X'lO', DE=X'04'.
V*2 - VDEVTYPE is the virtual device type code.
VPNTREAL is the real device control block corresponding
to this virtual device.
VDEVREL is the relocation factor within the real device
for the start of this virtual device Cfor DASD only).
VDEVBND is the size of this virtual device CDASD only>.
VDEVPOS is the current
device (as BBCCHH).

virtual arm

position of

this

VDEVSNSE is the virtual
device sense information(filled when an error is detected on the virtual device
to save the conditions for shared devices.)
V*3 - VDEVFLG contains miscellaneous device status bits:
TEMPDEV X'Ol' indicates a TDSK allocation
READONLY X'02' indicates read-only status
VSHARED X'04' reserved for future use
VDVENBL X'08' virtual 2702 line is enabled
VDVDIAL X'lO' virtual 2702 line is in use
V*4 - VDEVSLEN is the sense byte count.

-240-

SECTION 5:

SYSTEM MODULES

This section consists of descriptions of the modules
contained in both CP-67 and the stand-alone utilities. They
are arranged in alphabetical order according to module name.
Listed below are the module names with a brief descriptionof each.
Table 3 gives the module entry points for each
module.

ACCTONforindividual installations, additional
processing and/or checking of users at
LOGIN time
ACNTIME computes and prints on user's terminal the
total connect, virtual and actual CPU
time
ACNTOFF - for individual installations, a replaceable
module foraccounting functionsat
LOGOUT time
CCWTRANS prepares user CCW's for execution by realmachine, and creates user ccw at end ofoperation
CFS COM
contains the commands WNG, MSG, READY,LOGOUT, SLEEP, and DISCONNECT
contains the commands DCP, DUMP, DMCP,CF SDBGDISPLAY, STCP, and STORE
CF SI PL
contains the commands IPL and IPLSAVECFS MAIN
calls user console functions and operator
functions; enteredduring BREAK
onuser's terminal, or virtual machine idle
state
CFSPRV
contains the commands ENABLE, DISABLE, LOCK,UNLOCK, SHUTDOWN, KILL, ACNT, DIRECT,and D- U- M- P
CFSQRYcontains the command QUERYCFS SET
contains the command SET
CFSSPL- contains the commands TERM, CLOSE, XFER,SPACE, DRAIN, START, PURGE, SPOOL, and
REPEAT
CFSTACH
contains the commands ATTACH, DETACH, and
LINK
CHKCUACT determines control unit status at channel
end time based on last ccw executed bychannel program and device on which it
was executed
CHKPT
saves accounting records and in-core spool
pointersondisk afteranABEND
condition
CONS INT
initializes and identifies remote terminals
and processes their interrupts
CONVRT
data conversion routines CBINHEX, FPCONV,BINDEC, etc.) for CP-user communication
CPCORE
currently contains constants for the IPL
command-241-

CPFILE

enables CP-67 to open, read, and close
various internal working disk files
CPINIT- volume recognition and initialization ofcore Cset new PSW's, compute real coresize, etc.> for CP-67
CPSTACK- queues requests for CP service (CPRQUEST
blocks)CPSYM - resident loadmap of CP-67 modules and major
entry points
DEDICATE - switches device from MRDEBLOK's to selector
channel real device blocks for dedicateduse
DIAGDSK - responds to diagnose call for a specialized
I/O task on a 2311 or 2314
DIAL
removes user terminal from CP control andattaches it as a dedicated device to an
existing virtual 2701, 2702, or 2703
line
DISPATCH
at completion of interrupt processing,searches forpending job
CCPRQUEST
queues,interrupted
user,
higherpriorityuser>, theneitherloads
runnable user or enters idle condition,
after totaling times in various states
DSKDUMPfor debugging; takes core dump of CP and
performs a software re-IPL
EXTEND- calls PAGFREE to obtain pages for CP common
buffer space, called Free Area
FREE
- maintains and allocates units of system freestorage, with minimum fragmentation
IOERROR - analyzes and records selected I/O errors andretries CF-generated I/O to selector
channel devices
IOINT- receives control from the I/O new PSW,
determines further action, and normallyexits to IOTASK block's TASKIRA
IPL
virtual memory resident; simulates andinterprets various IPL sequences forseveral devices
LINK- processes the CP console function "LINK"
used by CMS for file sharing
LOGFILES
counts the number of spool file blocks
awaiting processing and returns addressof a message to caller
LOGIN
allocates free storage control blocks andmachine resources required in setting up
and logging in a new user
MRIOEXEC
entered fromunit record
interrupt;
completes reading of cards, printing andpunching of pending data in disk buffers
MVIOEXEC - handles all virtual I/O operations to user's
multiplexer channel, including terminaland spooling functions
PACK- packs and unpacks blanks from the spoolingdata used by MRIOEXEC and MVIOEXECPAGEGEI'- allocates and deallocates DASD areas forpaging
PAGTR- handles page sharing and page releasing-242-

PAGTRANS

handles all functions which require aknowledge of the nature of the mapping
device<virtualaddress translationr
storage key settingr etc.)

PRIVLGEDPROGINT

I
I
I
I
I

I
I

simulates privileged instructions
entry from program interrupt new PSW;
determines type of interrupt CCP-issued
simulated instructionr or user-issued
privileged
instruction>
and
takes
appropriate action
PSA- handles SVCr externalr and machine checkinterrupts
QUEVIO- queues selector channel I/O requestsr checks
positions DASO
channel availabilityr
initiates
I/O
accessarmsr
andoperations
RDCONS
creates a ccw "package"r according toterminal typer that can be stacked as aread request for that terminalRDS CAN- determines whether a virtual DASO device iscurrently
attached tothevirtualmachine of an active user (that isr a"link" exists)
RECFREE - handles spooling requests for available disk
records in much the same way as freestorage handles main memory
RES INT
performs virtual
systems reset
when
explicitly asked or when implied by an
IPL request
SAVECP
writes core-image of CP-67 onto system
residence volume at end of card or tapeload of CP-67 into core; procedure isreversed at IPL time<read in core
image)SCANUNIT - for a real or virtual device addressr scans
appropriate list and sets up pointers tovarious level blocks
SCHEDULE
maintains real timer and runnable list
chains at logon and logof f and clock
maintenance at 60 second intervals.
SCREDATcontains 10 bytes of EBCDIC for system
identification
STCONSIO - starts an I/O request to a console or stacks
it if there are outstanding requests(entry via PRIMSG gives priority in thestack)TMPSPACE dynamically allocates DASO cylinders fromdevices of specified type
TRACER - performs analysis and output formatting ofuser specified tracing functions- unstacks and reflects virtual I/O interrupts
UNSTIO
from both
selector andmultiplexer
devices
UNTRANS - computes from hardware csw the virtual csw tobe reflected to the user
USERLKUP - finds the entry in the U.DIRECT file for a-243-

USEROFFVIOEXECVSERSCHWRTCONS

specified userid- functions associated with logging off a userfromthesystem<initiate
logoutsequence, delete virtual machine fromsystem, log user off, detach nonshared
I/O device)intercepts virtual I/O commands: itself
handles selector channel requests andpassesmultiplexer requests
onto
MVIOEXEC
searches RDEVBLOK's for a given volumeserial number- allows a remote terminal to be used for
output as though it were an operator's
1052 console·-....<

-244-

.. /

Table 3. system Modules with Entry Points

Module Name

Entry Point Cs)------~-------

ACCTONACNI'IME
ACNTOFF
CCWTRANSCFSCOM
CF SDBG
CFS IPLCFSMAINCFSPRVCFSQRYCFSSE.'T
CFSSPLCF STACHCHKCUACTCHKPTCONSINTCONVRTCPCORECPFILECPINITCPSTACKCPSYM
DEDICATE
DIAGDSKDIALDISPATCHDSKDUMPEXTENDFREEIO ERRORIO INTIPL
LINK
LOGFILESLOGIN
MR IO EXECMVIOEXEC
lfi
·.~

PACK
PAGEGETACCT ON
ACNTIME
ACNI'OFF, DEVOFFCCWTRANS, VSMCPIR, CP6IRA
WNG, MSG, READY, LOGOUT, SLEEP, DISCONN
DCP, DUMP, DMCP, DISPLAY, STCP, STOREFREEPST, FRETPSTCFSIPL, IPISAVEBREAK, BRKRD, BRKWR, COMENTRY
ENABLE, DISABLE, LOCKC, UNLOCK, SHUTDOWN,
KILL, CFSACNT, CFSDIR, ABEND
QUERY
SET
TERM, CLOSE, XFER, SPACE, DRAIN, START,PURGE, SPOOL, REPEATATTACH, DETACH, CLINKCHKCUACTCHKPTCONSINT, IDENTIFY, PREPLINE, RTN41WT,
RTN52WT, RTN41ND, RTN52ND,
OFFHANG, OFFEN!', CPIENTBINHEX, HEXBIN, DECBIN, BINDEC, FPCONV,DATETIMECPCORECPFOPENR, CPFOPENW, CPFCLOSE, CPFREAD,
READTASK, WRITTASK, CPFDLKUP, CPFDCLOSCPI NITCPSTACKCPSYM
DEDICATE
DIAGDSKDIALDISPATCH, DSPTCHA, DSPTCHB, DSPTCHC,DISDRQ, DISIO, DISACTDSKDUMPEXTEND
FREE, FRET, FRETRIOERROR, VERROR, RECERROR, MCKERR,FINDLOG, FMI'LOG, LOGRETN, FINDMC,
FINDIO, FMI'MLOG, FMTLOGM, FMTILOG, FMTLOGIIOINT, IOISTVDE, IOISTVCUIPLLINK
LOGFILESLOGON, OPMSG, AUTOLOGONMRIOEXEC, RPUNCH, PRIRA, CRIRA, PUIRAMVIOEXEC, MVICLPR, MVICLPN, MVICLCR,
MVIPRINT
PACK, UNPACKPAGEGET, PAGERLE.-245-

PAGTR
PAGTRANSPROGINTPRIVLGEDPSAQUEVIORDCONSRDS CANREC FREERESINT
SAVECPSCA NU NITSCHEDULESCREDATSTCONSIOTMPSPACE
TRACERUNSTIOUNTRANSUSERLKUP
USEROFF
VIOEXECVSERSCHWRTCONS-246-

PAGSHARE, PAGOUT, PAGFRETPAGTRANS, PAGUNLOK, PAGFREE,
CORUSER, DRMWAIT, CORTENT, WAITPAGE
PROGINT, REFLECTPRIVLGEDSVCINT, SVCINIT, EXTINT, MCHEKINT, SVCDUtQUEVIO, QUERIO, CHFREE
RDCONS
LINKSCAN, RDSCAN, DEVSCANRECFREE, RECFRETRESINT, RESIRASAVECPRUNITSCAN, VUNITSCANSCHEDULE, SCLOCKSC RE DATPRIMSG, STCONSIOTMPSPACE, TMPRET, T2311, TMPERTNTRACER, TRINT
UNSTIOUNTRANS, FREECCWUSERLKUP
USEROFF, ADSET, ADSETOUT, RELEASE, RUNRETVIOEXEC, VIRAVSERSCHWRTCONS, PRIORITY, OPTIMEACCTON!

Module name:

ACCTON

Entry point:

ACCTON

Purpose:To provide individual installations with theability to add additional processing and/or checking ofusers at LOGIN time.

-----------------------------------------------·---Entry conditions: Called from LOGIN after all otherfunctions are complete except for message to operator
and writing of LOGMSG to user.
Exit conditions:

Condition code 0 - continue.
Condition code not O - log off user.

(
-247-

•

ACNTIME

Module name:

ACNTIME

Entry point:

ACNTIME

Purpose: This module computes the total connectr virtualr
and actual CPU time used by the user and prints aformatted message on the user's terminal.
Registers 0-15 are saved upon entry to this module.

Entry point:

ACNTIME

Entry conditions:

GPRll pointing to user's UTABLE

Exit conditions:

None

-248-

ACNTOFF

Module name:

ACNTOFF

Entry points:

ACNTOFFw DEVOFF

Purpose:To provide individual
installations with areplaceable module for performing accounting functionsat LOGOUT time.

--------------------------------------------------------Entry point:

ACNTOFF - punch accounting card for USER.

Entry conditions:

GPR 11 points to the UTABLE.

Registers 0-11 are saved upon entry.
Exit conditions:
Entry point:
device.

None

DEVOFF - punch accounting card for a dedicatedEntry conditions:
RDEVBLOK.

GPR 11 points to

UTABLE; GPR 2 points toRegisters 0-11 are saved upon entry.
Exit conditions:

None

-249-

CCWTRANS

Module name:

CCWTRANS

Entry points:

CCWTRANS, VSMCPIR, CP6IRA

Purpose:The CCWTRANS module prepares the user program
channel command words for
execution by the realmachine, and creates the user program's channel status
word on termination of the operation.

Entry point: CCWTRANS - translate user's virtual
into an equivalent real list.

ccw list

Entry conditions:
GPR 1 is 0, indicating no I/O is to be
performed, or it points to the IOTASK block which will
represent this task.
GPR 6 points to the virtual
device block (VDEVBLOK) on which the operation is to be
performed. The TASKCAW entry in the task block points
to the user's virtual ccw list.
Exit conditions: The TASKCAW points to the real ccw list.
The TASKFLAG in the task block indicates whether any
multi track CCW's are present.
Other registers arepreserved.
Entry point:

VSMCPIR - restart ISAM I/O operation.

Entry conditions: GPR9 points to the IOTASK
points to the channel status word.

block.

GPR10

Registers 0-15 are saved upon entry to VSMCPIR.
Exit conditions:
Entry point:
original
CCW's.

None

CP6IRA - restore user's virtual core to its
condition after executing certain OS ISAM

Entry conditions:

Same as VSMCPIR

Exit conditions:

None

-250-

CESCOM

Module name:

CFSCOM

Entry points:

WNG, MSG, READY, LOGOUT, SLEEP, DISCONN

Purpose: Each entry point corresponds to a console commandand contains logic for that command.

Entry conditions:Register 9 is used for addressing thismodule, and register 12 for addressing a branch tablelocated in CFSMAIN. See "Console Functions" in Section
2 for individual command processing.
Exit condition:
Return to CFSMAIN
handling command.

via branchtable after

-251-

I

I

CFSDBG

Module name:

CFSDBG

Entry points:

DCP, 'DISPLAY, DMCP, DUMP, STCP, STORE

Purpose: Each entry point corresponds to a console command.

I
I
I
I
I
I
I
I
I
I

DCP - displays real core storage on the operator's
console.
DISPLAY - displays virtual core storage, etc. on
the user's terminal.
DMCP - dumps real core to the printer.
DUMP - dumps virtual core, etc. to the user's
virutal printer.
STCP - stores into real core from the operator" sconsole.
STORE - stores into the user's virtual core, etc.

I
I
I
I
I
I
I
I
I
I

Entry conditions: Register 9 contains the address of theentry point in this module. It is immediatelychanged to point to the beginning of csect CFSDBG,
in order to provide addressability to the entire
module. Register 12 contains the base address ofa branch table in CFSMAIN.
This table is used tobranchtovarious subroutinesin
CFSMAIN.
Register 13 contains the address of an 18 double
word savearea. Register 11 contains the address of
the UTABLE for the user issuing the command.

I
I

Exit conditions: Return is made to CFSMAIN via
table after handling the command.

I

External routines used--

the branch

I
I
I
I

Called routines:
PAGTRANS, WRTCONS,MVIPRINT, BINDEC,
BINHEX,DECBIN, HEXBIN, FPCONV, DISPATCH, FREE, FRET,FREEPST, FRETPST.

I
I
I

Routines in CFSMAIN which are branched or
linked to:
SCANFLD, BADCOM, BADARG, READ!.

I
I

References to other locations in the CP nucleus:
RMACHSIZ, TREBCDIC.

-252-

branch andCFS IPL(

Module name:

CFSIPL

Entry points:

CFSIPL, IPLSAVE\

Purpose: Each entry point corresponds to a console commandand contains logic for that command.

Entry conditions:Register 9 is used for addressing thismodule, and register 12 for addressing a branch tablelocated in CFSMAIN. See •console Functions• in Section
2 for individual command processing .•Exit condition:
Return to CFSMAIN
handling command.

via branchtable after-253-

CFS MAIN

Module name:

CFSMAIN

Entry points:

BREAK, BRKRD, BRKWR, COMENTRY

Purpose:The
CFSMAIN module calls theuser console
functions and the operator functions. It is enteredwhen a BREAK occurs on the user's terminal or thevirtual machine goes idle (detected in DISPATCH).
---------------------------------------~------------------

Entry

point: BREAK
attention key.

- entered

when auser activatestheEntry conditions: GPR 6 points to the terminal's MRDEBLOK.
GPR 10 points
to the csw informationfrom theinterrupt.
Registers 0-15 are saved upon entry.
Exit conditions:None. CONSOL exits by making the user
runnable and returning to DISPATCH, after a BEGIN or
IPL command, or if ATTN key actuated while in console
function mode. Also exits immediately after a virtual
console function .•Entrypoint:
COMENTRY
entered fromDIAGNOSE instruction specifyingafunction has been detected.

PROGINT
virtualwhen aconsoleEntry conditions:
GPR2 points to a buffer containing thecommand line. GPR3 contains the number of bytes in the
input line. GPRll points to the user UTABLE.
Registers 0-15 are saved upon entry.
Exit conditions: GPR2 contains an error code as follows:
O - No errors
4 - INVALID CP REQUEST (message not printed by CP)
8 - BAD ARGUMENT (message not printed by CP)
x
Code dependent upon specific function <error
message usually printed by CP-67)-254-

CFSPRV

Module name:

CFSPRV

Entry

ENABLE, DISABLE, LOCKC, UNLOCK,KILL, CFSACNT, CFSDIR, ABEND

points:

SHUTDOWN,

Purpose: Each entry point corresponds to a console commandand contains logic for that command.

Entry conditions:Register 9 is used for addressing thismodule, and register 12 for addressing a branch tablelocated in CFSMAIN. See "Console Functions" in Section
2 for individual command processing~
Exit condition:
Return to CFSMAIN
handling command.

via branchtable after-255-

CFSQRY

Module name:

CFSQRY

Entry point:

QUERY

Purpose: Each entry point corresponds to a console commandand contains logic for that command .•Entry conditions:Register 9 is used for addressing thismodule, and register 12 for addressing a branch tablelocated in CFSMAIN. See "Console Functions" in Section
2 for individual command processing .•Exit condition:
Return to CFSMAIN
handling command.

-256-

via branchtable after

CFS SET(

Module name:

CFSSET

Entry point:

SET

Purpose: Each entry point corresponds to a console commandand contains logic for that command.
----------------------------------------------~·------------

Entry conditions:Register 9 is used for addressing thismodule, and register 12 for addressing a branch tablelocated in CFSMAIN. See "Console Functions" in Section
2 for individual command processing.
Exit condition:
Return to CFSMAIN
handling command.

via branchtable after-257-

C.FSSPL

Module name:

CFSSPL

Entry

TERM. CLOSE. XFER.
PURGE. SPOOL. RE.PEAT

points:SPACE.

DRAIN.

START.

Purpose: Each entry point corresponds to a console commandand contains logic for that command.
-------------------------------------~---------------------

Entry conditions:Register 9 is used for addressing thismodule. and register 12 for addressing a branch tablelocated in CFSMAIN. See •console Functions• in Section
2 for individual command processing.
Exit condition:
Return to CFSMAIN
handling corornand.

-258-

via branchtable afterCF STACH

Module name:
Entry points:

CFSTACHATTACH, DETACH, CLINK

Purpose: Each entry point corresponds to a console commandand contains logic for that command.
------------------------------------------------------~---

Entry conditions:Register 9 is used for addressing thismodule, and register 12 for addressing a branch tablelocated in CFSMAIN. See "Console Functions" in Section
2 for individual command processing.
Exit condition:
Return to CFSMAIN
handling command.

via branchtable after-259-

CI:KCUACI'

Module name:

CHKCUACT

Entry point:

CHKCUACT

Purpose: CHKCUACT will examine the last ccw executed by achannel program and decide whether. for the device typeon which the sequence was executed. the control unit isfreed at channel end time.
Registers 0-4 are saved upon entry to CHKCUACT.

Entry point:

CHKCUACT (BALR)

Entry conditions: GPR 6 points to the virtual channel block
for which the input-output operation was executed. GPR
8 points to the virtual device block for which theoperation was executed.
Exit conditions: The condition code is set nonzero if thecontrol unit remains busy
after the channel end
occurring on the indicated ccw operation code,
It is
set to zero if the control unit may be considered free.

-260-

CHKPT

Module name:

CHKPT

Entry point:

CHKPT

Purpose:To save user accounting informationspool pointers on disk.

and in-core------------------------------------------------~-

Entry point: CHKPT
Entry

conditions: If low core location CPID <hex 'lFC')
contains "CP67" or "SHUT", records will be written
to disk; otherwise no action is taken.

Exit conditions: If CPID does not contain "SHUT", CP-67 will
be IPL'ed by software; otherwise CHKPT will enter
the wait state.

-261-

CONS IN!'

Module name:CONSINT

Entry points: CONSINT, IDENTIFY, PREPLINE, RTN41WT, RTN52WT,
RTN41ND, RTN52ND, OFFHAND, OFFENT, CPIENT
Purpose:This module initializes and identifies remoteterminals and processes all interrupts from thoseterminals.
(Terminals presently supported are 1050,
1052, 2741-1, and 2741-2.)

Entry point:

CONSINT

Entry conditions: All 1052 console interrupts are serviced
via this entry point. GPR 10 is the location of the
CSW associated with the interrupt, and GPR 6 is the
MRDEBLOK for the interrupting device.
Exit conditions:
If the previous I/O terminated normally,another I/O is initiated.
If only a CE has been received, the DE is waited for.
If an irregular ending occurred, the "ready" interrupt
or the •termination-of-sense" is waited for.
Control is returned to DISPATCH via IOINT.
Entry point:

IDENTIFY

Entry conditions: The 2702 lines once they are enabled havetheir first interrupt enterat IDENTIFY.
GPR 6contains the address of the terminal's MRDEBLOK and
GPRlO points to the relevant csw.
Exit

conditions:
The terminal
is identified and its
MRDEVTYP stored or it is indicated to be an unknown
type. The line is initialized with a "Prepare" commandand is waiting for a "login" attention break.

Entry point:

PREPLINE

Entry

conditions:
GPR 6 points to the MRDEBLOK of aterminal of known device type CMRDEVTYP). The terminalline is then initialized with a "Prepare" command.

Exit

conditions:
The line sits in a "prepared"
waiting for a "login" attention break.

Entry points:

state

RTN41WT, RTN52WT, RTN41ND, RTN52ND

Entry conditions:
GPR6 points to a terminal MRDEBLOK of
known device type that has completed an I/O operation-262-

by HIO, ATTN, or carriage return.

i

Exit conditions: the next I/O operation is started, if any,or the line is put in •prepare• status .• control is.
returned to DISPATCH via IOINT.

l

Entry points:

OFFHANG, OFFENT

Entry conditions:
GPR6 points to a terminal MRDEBLOK. A
message is written to the' terminal and an interrupt
return address (OFFENT) is set up.
Exit condition:

Return is to the caller (CCWTRAN>.

(
-263-

CONVRT

Module name:Entry

points:DATE TIMECONVRT
BINHEX,HEXBIN,DECBIN,BINDEC,FPCONV,

Purpose: CONVRT is a collection of data conversion routines
to assist CP-67 in communicating with the user.

Entry point:

BINHEX

Entry conditions: GPR 1 contains the number to be converted
from binary to hexadecimal notation.
Exit conditions: GPR's 0 and 1 contain the converted number
in hexadecimal
notation withleading zeros
notsuppressed.

Entry point:

HEXBIN

Entry conditions: GPR 1 contains a pointer to a string ofeight or fewer characters in hexadecimal notation(EBCDIC) which are to be converted. The length of thestring is in GPR O.
Registers 0-5 are saved upon entry.
Exit conditions:
The condition code is set nonzero if an
illegal hexadecimal character is encountered in thestring: otherwise, the condition code is zero.
Theconverted number is returned right-justified in GPR 1.

Entry point:

FPCONV

Entry conditions: GPR 2 contains a pointer to a doubleword
which contains the floating point word to be converted
to standard floating point notation Cfor example,.00000000000 E 00) and GPR 1 contains a pointer to an
output buffer of at least 17 characters.
Registers 0-5 are saved upon entry.
Exit conditions: The routine will fill the buffer pointed
to by GPR 1 with the number in standard floating point
notation.

-264-

Entry point:
Entry

BINDEC

conditions: GPR 1 contains a binary number toconverted to the equivalent in decimal notation.

beExit conditions: BINDEC returns the low-order eight decimal
digits in GPR's O and 1.

Entry point:

DECBIN

Entry conditions:
GPR 1 points to a field containing the
EBCDIC form Of a decimal number which is to beconverted to binary equivalent. GPR 0 contains thelength of this field (in bytes>.
Exit conditions: The condition code is set nonzero if thespecified string contains invalid decimal information,or the length exceeds 15; otherwise, the condition code
is set to zero. GPR 1 is returned with the convertedn~b~.

Entry point:

DATETIME

Entry conditions:
GPR 1 points to a field into which thedate will be entered (as mm/dd/yy>.
GPR 2 points to a
field into which
the time will beentered <ashh.mm.ss>. The date and time data are obtained fromtheir locations in lower memory.
If either pointer iszero, that parameter will not be provided.
Exit conditions:

The fields are filled in as specified.

-265-

CPCORE

Module name:

CPCORE

Entry point:

CPCORE

Purpose:Contains only constants, no executable code.
currently contains constants for the IPL command,(DASDIPL - disk address of IPL module, DASDIPLN - disk
address of SYSTEM module, and CMSTABLE - table for CMS
shared system).

-266-

CPFILE

Module name:
Entry

CPFILE

points:CPFOPENR, CPFOPENW,CPFCLOSE,
READTASK, WRITTASK, CPFDLKUP, CPFDCLOSCPFREAD,

Purpose: CPFILE is the mechanism by which CP-67 reads thevarious internal working disk files required, forexample, system and user file directories and machine
description
files.
Variousroutine entries
areprovided to allow opening, reading, and closing various
files.

Entry point: CPFOPENR - open a file for reading.
Entry conditions:
name.

GPR

3 points to aneight-character file

Registers 0-8 are saved upon entry.
Exit conditions:
GPR 2 points to a control Program File
System (CPFS) block which will be used to control
access to the file.
(Note: this must be preserved forlater use in calling for actual file input-output>.

Entry point:

CPFOPENW - open a file for writing.

Entry conditions: This routine is not implemented yet - itscalling conditions will be identical to CPFOPENR.
Registers 0-8 are saved upon entry.
Exit conditions:
Entry point:
file.

None

CPFREAD- read data froma previously opened

Entry conditions: GPR 0 contains the number of bytes to beread.
GPR 2 points to the CPFS block which wasprovided when the file was opened (see CPFOPENR).
Registers 2-7 are saved upon entry.
Exit conditions:
GPR 1 points to the desired data <which
resides in a
CPFS-owned buffer> or zero
if an
end-of-file condition was encountered.

-267-

Entry point:

CPFCLOSE - close a previously opened file.

Entry conditions: GPR 2 points to the appropriate CPFS filedescriptor block.
Registers 0-5 are saved upon entry.
Exit conditions:

None

Entry point: READTASK
Entry conditions: GPR 1 points to a buffer at least CPRECSZ
bytes long (currently 829 bytes). GPR 2 points to thereal device block. GPR 3 points to the record to beread (as BBCCHHR).
Registers 0-15 are saved upon entry.
Exit conditions: None. If the operation was not completed
successfully, IOERROR is called to attempt recovery.

Entry point:

WRITTASK - perform a write operation to disk.

Entry conditions:

Same as READTASKExit conditions:

Same as READTASK

Entry point:

CPFDLKUP - finds specified directory entry.

Entry conditions:
name.

GPR

3 points to aneight-character file

Registers 3-6 are saved upon entry.
Exit conditions: Condition code=O for file found, and GPR 1
points to DIRECTORY CPFRECRD; GPR 2 points to DIRECTORYCPFDENT.
Otherwise, condition code=l for file notfound·, and GPR 2 points to first empty entry.
Entry point:

CFDCLOS - closes open directory file.

Entry conditions:

GPR 2 points to CPFFDBLK.

Registers 0-3 are saved upon entry.
Exit conditions:

-268-

None

CPI NIT

Module name:

CPINIT

Entry point:

CPINIT

Purpose:This is the CP-67 initialization module.
Itsfunction is to create the necessary control blocks suchas CORTABLE and allocation tables cased upon the
hardwareconfiguration
present. Foradetailed
description of the functions performed see the section•control Program Initialization• in section 2.

Entry point:
Entry

CPINIT

conditions:
GPR
2 contains a pointerto theallocation table address ofthe system residence
volume.
GPR 6 contains the device address of theresidence volume.

Exit conditions:

Exits to DISPATCH.

(
-269-

CPSTACK

Module name:

CPSTACK

Entry point:

CPSTACK

Purpose:This routine queues requests for CP execution(CPREQUEST blocks def erred pending an event occurrence>on the request stack (CPRQFST) defined in DISPATCH.
Registers 0-3 are saved upon entry to CPSTACK.

Entry point:

CPSTACK - queue CPRQUEST blocks (BALR)

Entry conditions:

GPR 1 points to a CPRQUEST block.

Exit conditions:

None

-270-

CPSYM

Module name:

CPSYM

Entry point:

CPSYM

Purpose: The CPSYM module does not contain executable code.
It is essentially an in-core load map of the CP-67
nucleus.
It contains the EBCDIC name and hex addressof each CP module as well as some of the more important
entry points and control words.

(
-271-

DEDICATE.Module name:

DEDICATE

Entry point:

DEDICATE

Purpose: This module creates from CP-67 free storage a setof RCHBLOK, RCUBLOK, and RDEVBLOK control blocks todefine a dedicated (nonshared) multiplexer device. The
control blocks are chained on to the existing chain ofcontrol blocks pointed to by RCHSTART. The .MRDEBLOK isflagged (in MRDEFLAG) as being dedicated (MRIDED>; theUTABLE address of the owning user is stored in MUSER.

Entry conditions: GPR 11 contains the UTABLE address.
GPR 1 contains the real device address.
Exit conditions:
Successful:

Condition code 0 - GPR 1 contains theaddress of the RDEVBLOK created.
Unsuccessful: Condition code 1
Nonexistent real
devicecondition code 2 - Device in use-272-

DIAGDSK
Module Name:DIAGDSK

Entry Point:

DIAGDSK

Purpose: This module is entered from PRIVLGED when a user
has issued a diagnose call for a specialized I/O task
to be performed on a 2311 or 2314. DIAGDSK checks forvarious calling errors; if none is present, an I/O task
is made up and scheduled for execution by calls to
QUERIO and DISPATCH. Upon completion, a condition codeof O indicates to the user that the I/O has been
completed with no errors <no csw being returned to theuser). Errors are signalled to the user as indicatedbelow. The use of DIAGDSK for simple I/O provides asignificant speed improvement for CMS or other users
who have a ccw string of similar format.

Entry point:

DIAGDSK

Entry conditions:
GPR5 points to user's "R1", which must
hold the device address. GPR4 points to user's "R2",
which must point to a ccw-string of the following
format:
(1)
(2)
(3)
(4)
(5)
(6)

SEEK
BBCCHHR(below)
SEARCH EBCCHHR+2(below)
TIC BACK TO SEARCHREAD OR WRITE OF UP TO 4096 BYTESCup to 824 bytes for CMS)
NO-OP
BBCCHHR
SEEK/SEARCH ARGUMENTS (7 bytes)

Exit Conditions:

CUpon return to user via DISPATCH)

Condition-Code CCC)= 0:

I/O complete with no errors.

cc = 1:

SIO failed, CSW stored.
(CSW+4 6 CSW+5 returned to user>

CC = 2:Either an attempt to write on a read-only disk
<program-check returned to user>orother I/O error on completion
csw CS bytes) returned to user
<sense bytes available if user does a 'SENSE'>

cc = 3:

Not attached, neither 2314 nor 2311,
or invalid DIAGNOSE call by user.
Error-code returned to user in his R15, as follows:
1 = Not attached (error from VUNITSCN in CP)
2 = Device is neither 2314 nor 2311
-273-

I
I
I
I
I
I
I
I
I
I

3 = Pointer to user's ccw-string not dbl-word aligned
4 = SEEK/SEARCH arguments not within user core
5 = Read/write CCW neither read (06) nor write COS>
6 = Read/write byte-count = 0
1 = Read/write byte-count greater than 4096
8 = Read/write buff er not within user core
9 = condition-code 2 <busy> on actual SIO
as attempted by CP
10 = condition-code 3 (not operational) on actual SIO
as attempted by CP

-274-

DIAL

Module name:

DIAL

Entry point:

DIAL

Purpose: Attaches user's terminal as a dedicated device toan existing virtual 2701, 2702, or 2703 line in thevirtual machine specified. The UTABLE and MVDEBLOK are
returned to free storage and the user terminal isremoved from CP control.
Registers 0-11 are saved upon entry to DIAL.

Entry conditions: Entry is from LOGIN after a DIAL command.
GPR 10 points to an eight-character userid. GPR 11
points to a UTABLE.
Exit conditions:

If successful, GPR 11 is set to zero.

-275-

DISPATCE

Module name:DISPATCH

I
I

Entry points: DISPATCH, DSPTCHA,DISDRQ, and DISIO

I
I
I
I
I
I
I
I
I
I
I

DISPATCH is entered when some process has been completed orcannot continue any further until some other even~ hascompleted (an I/O operation).
It updates the user'• scontrol blocks to reflect his current status. If auser was running, DISPATCH attempts to restart him. If
it cannot restart the running user or if there wasnone, DISPATCH will dequeue any CP-67 deferred work
requests and start them. When all CP requests are
exhausted DISPATCH will run the highest priority,
runnable, and in queue user if there is one, or it willenter enabled wait state.

DSPTCHB, DSPTCHC, DISACT,

Entry point: DISPATCH
Entry conditions: GPR 11 points to a valid UTABLE to be
charged for time spent in CP-67 since the last charge.
Entry point: DSPTCHA
Entry

conditions: Same as DISPATCH except entered after
processing a program interrupt from a running user
where processing has not changed the virtual PSW.

Entry point: DSPTCHB
Entry

conditions: Same as DSPI'CHA
changed the virtual PSW.

Entry point:

except processing

has

DSPTCHC

Entry conditions: No change to user pointed to by R11 .•Entry point: DISACT,Entry condtions: Charge user for CPU time usedcharge. Called when a routine has changedof a user.
Exit conditions:

-276-

None.

since last
the status

Entry point: DISDRQ - drop a user from a queue (called>
Entry conditions: GPR 11 points to user to be dropped from aqueue.
Exit condtions:

None.

Entry point: DISIO (called)

I
I
I
I
I

Entry conditions: GPR 11 points to user that has had his
status changed. Called by routines which have updated auser's status and are not returning or going to
DISPATCH (either directly or indirectly>, with GPR 11
pointing to this user.

-277-

DSKDUMP

Module name:

DSKDUMP

Entry point:

DSKDUMPPurpose:This module is entered from module PSA when CP-67
issues an SVC 0 ABEND, on activation of the PSW
restart button, or from PROGINI' for a system program
error. The module contains code to dump core' to a
printer, tape or disk. The dump will be of all core
or of only those pages marked as *CP* or FREE in the
CORT ABLE.

Entry point:

DSKDUMP

Entry conditions:

General registers are stored at GREGS.

Exit conditions: An exit is taken by performing a software
re-IPL of the system.

/

-278-

EXTEND!

Module name:

EXTEND

Entry point:

EXTEND

Purpose: EXTEND is used to obtain a number of pages for
CP-67 common buffer space called Free Area.
It has atable, EXT1, to indicate the number of pages required,depending upon the rea1 machine core size.
It calls
PAGFREE repeatedly to get these pages. It is called by
FREE.
Registers 0-15 are saved upon entry to EXTEND.

Entry point:

EXTEND

Entry conditions:
Exit

None

conditions: GPR 1 points to an area which may beincorporated into the free storage zone. GPR 0 contains
the length of this area in bytes .•

-279-

I

(See Figure 44 for an overview of FREE processing.)

I
I

Note: 'TRACE(4) option must be chosen asorder to gather statistics in FREE/FRET.
Module name:

FREE

Entry points:

FREE, FRET, FRETR

sysgen time

in
\....

Purpose:To maintain and allocate uni ts of system free.
storage, with minimum fragmentation. Free storage isutilized by
CP-67 forI/O tasks,
ccw strings,
buffers--in fact, for all but real channel-control
unit-device blocks, CORTABLEs, and save areas.
The most frequently used storage block sizes, some 29
in number, constituting about 99~ of all FREE/FRET
calls, have been allocated into ten subpools.
All
FREE/FRET calls for the doubleword block size listed in
the leftcolumn below receive~hecorresponding
doubleword block in the right column:
Number of double words
called for

Subpool size actuallyused-~-------------------

1

2 or 34
5

6, 7 or 8
9 or 10
11 - 1415 - 18
19 - 23
24 - 29

1
3

4
5
8

10
14
18
23
29

A block from the subpool chain is given priority in acall to FREE for a subpool size; a block is selectedfrom the regular free storage chain only if none isavailable from the subpool chain, or if the call to
FREE is for a block greater than 29 doublewords. A
FRET call, likewise, is checked for subpool size; if it
corresponds, the block returned is patched into thechain on a LIFO (last-in-first-out> basis, that is,
push-down stack.

A special entry, FRETR, enables CPINIT andbypass subpool consideration whether or not
being returned is subpool size.

EXTEND to
the block

Various statistical information is now kept in the FREE
routine, starting at entrypoint FREELIST. The code forstatistical information can be removed by revision of a
SETA symbol, if speed of performance takes precedence-280-- _,./

over statistics gathering: by assigning SE'TA a value of
1, statistics are included; a value of O causes theirremoval. The following is a partial list of pointers,
counters, and statistical quantities of interest (thenames in parentheses are labels of these quantities):
end of highest subpool block given out (ENDSUB)
address of lowest regular block given out (BEGINREG)
end of free area in lower core (ELOFREE)
beginning of free area in high core (BHIFREE)
subpool FRET calls requiring regular FRET CSBFRTREG)
table of pointers to subpools (SUBTABLE)
number of times subpools returned (SUBRETN)
number of times EXTEND is called (EXTCALL)
Other
statisticalquantities (fordebuggingandoperations research, only)
maximum value attained by FREENUM (MFREENUM)
FREE/FREI' calls for sizes not in subpools (FREEUSED,FRETUSED)
counts of satisfied and unsatisfied FREE subpool calls(SUBFREE,USUBFREE)
count of successful FRET subpool calls (SUBFRE'T)
Statistical counters for each subpool size
number of subpool blocks in use; number left CSUBLEFT)
maximum value attained by SUBUSED CMSUBUSED)
cumulative times spent in FREE and FRET CTIMEFREE,TIMEFRET)
count of subpool-range sizes referenced CSIZEREF)

Entry

point:CBALR>

FREE

Entry conditions:requested.

allocate a
GPR 0 contains

regionof freestoragethe number of doublewords

Registers 0-15 are saved upon entry.
Exit conditions: GPR 1 contains a pointer to the region of
the size requested. This region will always be on adoubleword boundary.

Entry point:

FRET - return a region to free storage CBALR>

Entry conditions: GPR 0 contains a count of the number ofdoublewords being returned. GPR 1 contains a pointerto the initial doubleword of the region. This pointermust always be on a doubleword boundary.
Register 0-15 are saved upon entry.

-281-

Exit conditions: None. No reference may be made to a region
after it has been returned to free storage.
Entry point: FRETR
return a region to free storage. Sameas FRET except does not attempt to use subpool logic(BALR)

Entry conditions: Same as FRET
Exit conditions: Same as FRETEnter
module FREE
ontry FREE

Yes

EXTENDNo

No

Extend SW

storage
Estend.______.sw..

not . .

Search freestorage ~ocks
for one bigger
than needed

Save this block
as a possible(looking for
lmt large block)No

Remove requested

Yes

size from hiW!
end of lastlarge block

Remove requested
size from thisblock

Update freestorage block
size andpointer

Update freestorage block
size andpointer

Save block
address forcallerSave block

address forcallerExit

Figure 44. CP-67 FREE (1 of 2)-282-

address
for caller

Exit

Convert DBL
word request
to bytes

extend free

Save block

Searcllsubpools

Enterf

module FREE

I

entry FRET

Update pointersin subpool tableYes

to include
this block

Chain block
off free list
store size

Exit

in blockGet beginningof chain

Yes
Scan FREE

storage
chain

No

Yes

No

Yes

Increment
error

count

Get pointerand size fromsucceedingblock

Get last
block in

chain

Exit

Get pointerand size frompreceding
block

No

Figure 44.

Merge sizes
update pointersand size

CP-67 FREE (2 of 2)-283-

IO ERROR

Module name:

IOERROR

Entry points:
IOERROR, VERROR, RECERROR, MCKERR, FINDLOG,FMTLOG, LOGRETN, FINDMC, FINDIO, F.MI'MLOG, FMTLOGM,FMTILOG, FMTLOGIOn entry to each, registers 0-11 are saved.
Purpose:The IOERROR
routineanalyzes andretriesCP-generated
I/O
errors incurred
while
paging,spooling, or reading the directory .• Selected I/O errors
and machine check errors are recorded on the SYSRES
volume at a predefined location. Warning messages aresent to the operator when repeated I/O errors occur on
a device used by CP-67 for paging, spooling, ordirectory space. The routine also contains code tolocate and/or format the error-recording records to be
used. The locate function is initiated by CPINIT. The
format function (actually erasing any previous data> isperformed by a special diagnose code executed by aprivilege class c user only.

Entry point:
Entry

IOERROR

conditions: GPR 6 contains a pointer to the real
device block for the device
on which the error
occurred. GPR 9 contains a pointer to the IOTASK block
which did not execute properly.

Exit conditions: If retry is successful, control returns to
the program which issued the original I/O request(return address in TASKIRA). If 64 retries of the I/O
are all unsuccessful, exit is to the dispatcher, andthe system will ABEND.
Entry point:

VERROR

Entry conditions: GPR
device block.
Exit conditions:
Entry point:

to the virtual

None

RECERROR

Entry conditions:-284-

8 contains a pointerCalled by IOERROR and VERRORExit conditions:
The appropriate counter in the real or
virtual device block will be updated to reflect theerror. If the error is the first of its type to be
encountered for this device, or the error counter
overflows, the CE LOGREC will be updated to reflect thelatest error.
Entry point:

MCKERR

Entry conditions: Entered whenever a machine check occurs,
whether in supervisor or problem state.
Exit conditions: Returnhandler, MCHEKINT.
Entry point:

is to the machine

FINDLOG

Entry conditions:

Called by CPINIT

Exit conditions:

Returns to caller

Entry point:check interrupt

FMTLOG

Entry

conditions:
Called by FINDLOG and "Diagnose•
customer engineer to clear and format CE cylinder

by

Exit

conditions:
If successful, return topermanent I/O error, system will ABEND.

If

caller..

-285-

IOINI'

Module name:

IOINT

Entry points:

IOINT, IOISTVDE, IOISTVCU

Purpose: IOINT receives control from the I/O new PSW. It
saves the state of the running user's machine, if any,
and determines what further action is required,.
In
normal processing, an exit is taken to the IOTASK
block's TASKIRA.
If the &TRACE (2) and/or the &TRACEC3) options are seiectedin the LOCAL COPY file, then the IOINT module also generates
entries in the selector and/or multiplexor trace table
respectively.

Entry point:

IOINT

Entry conditions:

Receives control from the I/O new PSW.

Exit conditions: Exits through a call to TASKIRA followed
by a transfer to DISPATCH with GPR 11 pointing to thechargeable user.
Entry

point: IOISTVCU
count CBALR)

increment

control unit

pending

Entry conditions: GPR 6 points to a virtual channel block.
Exit conditions: None.
Entry point: IOISTVDE - increment device pending count andcontrol pending count if device count was zero CBALR)
Entry conditions: GPR 7 points to a virtual control unit
block and GPR 6 points to a virtual channel block.

-286-

IPL

Module name:

IPL

Entry point:

IPL

Purpose: The IPL module is responsible for simulation andcorrect
interpretation ofvarious IPL
sequences
supported for several devices. It is unique in that it
resides in virtual memory. The virtual memory locationis the page boundary closest to half the virtual memory
size or page X'20000', whichever is the smaller.

Entry point:

IPL

Entry conditions: The IPL module resides in virtual memory
and its parameters are passed by the control program
through the use of the first 24 bytes of page zero ofthat virtual memory.
(Note: Since the IPL sequence
destroys these bytes on the real machine, no alterationof behavior from the real machine is seen .• >The
information passed consists of Cl) the virtual device
address and (2) the virtual device type code.
Exit conditions:
The IPL module transfers control to thesystem just IPL'ed via user's lower core location zero.

-287-

LINK

Module name:

LINK

Entry point:

LINK

Purpose: To dynamically attach virtual DASO devices basedon a machine description entry (MDENT) found in theappropriate machine description file. Supports the LINK
console function. Called from CPSTACH. link command.

------------------------------------------------------------Entry point:

LINK

Entry conditions:
GPR 1 points to a parameter list as follows:
DC CL8'userid'.CL8'password'.XL2'XXX'.XL2'YYY'
where XXX is the virtual address to be foundin the directory, and YYY is the address to
be used in attaching the device.
GPR 2 contains zero for read-only access. 1
for read/write access.
GPR 11 contains UTABLE address of requesting user.
Exit conditions:
GPR 2 contains an error code as follows:
O - Successful. attached as requested
1, 2 - Not used
3 - 'userid' found. address XXX not in directory
4 - Device YYY already attached5 - Password is bad or the device is not shareable
for the given access mode
6 - 'userid' is in INLOGON state
7 - A write link to XXX already exists. LINK denied.
8 - The required volume is not mounted or not
attached to system
9 - Attached in read-only. not in write as requested
10 - 'userid' not in directory
11 - Address XXX not a DASD device
12 - Directory locked-288-

LOG FILES

Module name:

LOGFILES

Entry point:

LOGFILES

Purpose: This module counts the number of spool file blocks
awaiting processing for the user and returns th~
address of a message to the caller. Called by LOGIN and
CFSQRY Cqueue files command).
Registers 0-15 are saved upon entry to LOGFILES .•-------------------------------------------~-----------~----

Entry point:

LOGFILES

Entry condition:

GPR11 pointing to user's UTABLE

Exit condition:

None

\_

-289-

LOGIN

Module name:

LOGIN

Entry points:

LOGIN, OPMSG, AUTOLOGIN

Purpose: The LOGIN module is responsible for setting up andlogging in a new user, creating from free storage thosecontrol blocks required and allocating the required
machine resources.

Entry point:

LOGIN - to log in a new user .•Entry conditions: GPR 6 contains a pointer to the MRDEBLOK
desiring entrance to the system.
Registers 0-15 are saved upon entry.
Exit conditions:
GPR 11 contains the address of the newuser UTABLE if the logon was successfully completed;otherwise GPR 11 contains zero.

Entry

point: OPMSGLOGOUT activity.

Informsystem operatorof

LOGIN,

Entry conditions: GPR 11 contains address of UTABLE; GPR 7
contains character string CL4' OFF' or CL4'' ON•.
Registers 0-11 are saved upon entry.
Exit conditions:

None

Entry point: AUTOLOGIN - sets up pointers for automaticallylogging on a specified user, and joins standard logon
code. Called from CPINIT.
Entry conditions:

Same as LOGIN

Registers 0-15 are saved upon entry.
Exit conditions:-290-

Standard LOGIN exit

MRIOEXEC

Module name:

MRIOEXEC

Entry points:

MRIOEXEC, RPUNCH, PRIRA, CRIRA, PUIRA

Purpose:
These routines are entered when an interrupt
occurs on the unit record equipment..
For a reader
interrupt, all of the cards are read and stored. For aprinter or punch interrupt, the corresponding disk
buff er is checked, and if there is pending data in thebuffers, i t is printed or punched.

Entry points:

MRIOEXEC, PRIRA, PUIRA, CRIRA

Entry conditions:
All of these entries are entered fromIOINT on the appropriate interrupt. GPR 6 contains theaddress of the corresponding MRDEBLOK, and GPR 10
contains a pointer to a doubleword of CSW informationfrom the interrupt.
Exit/,,..-

After performing their functions, allconditions:entry points return to DISPATCH with GPR 11 pointing to
the user for whom the input-output operation was being
processed.

Entry point:

RPUNCH

Entry conditions: GPR 4 points to the buffer containing theaccounting information to be punched.
Exit conditions: The accounting information is punched whena punch is available.

-291-

MVIOEXEC

Module name:

MVIOEXEC

Entry points:

MVIOEXEC, MVICLPR, MVICLPN, MVICLCR, MVIPRINT

Purpose:TheMVIOEXEC module
handlesallvirtualinput-output operations tothe user's multiplexer
channel.
This
includesterminal
andspooling
functions.
--~---------------------------------------------------~---

Entry

point:MVIOEXEC
handlevirtual input-output
requests to the multiplexer. Called by VIOEXEC.

Entry conditions:
GPR 4 points to the first half of the
instruction. GPR 5 points to the second half,. GPR 9
contains the virtual device
address.
The user's
virtual CAW is pointing to the virtual ccw list.
Exit

conditions:
The user's condition codereflect the status of his virtual device.

Entry points:
files.
Entry

MVICLPR, MVICLPN -isclose printer

set

to

and punch

GPR
8 contains the address of theconditions:virtual device block for which the file is to beclosed.

Exit conditions: If there was an open file, it is closed;that is, it is put in the closed file chain, and real
output is initiated if the corresponding device isavailable.

Entry point:

MVICLCR - close file on card reader.

Entry conditions:same as for MVICLPR

Exit conditions: If there was an open file, it is closed;that is, any remaining data in that file is discarded
and the next file, if any, is made accessible.

-292-

'-, /

Entrypoint:
printer.

Entry

conditions:
GPR 1 is the address of a buffer
containing data for printer output. GPR 0 contains thebyte count of the data.

Exit

conditions:
file.

MVIPRINT

Data

print ais packed

line

and putonthein thevirtualspooled

-293-

PACK

Module name:

PACK

Entry points:

PACK, UNPACK

Purpose: To pack and unpack blanks fromused by MRIOEXEC and MVIOEXEC.

Entry point:

the spooling data

PACK - compress blanks from input data .•Entry conditions: GPR 1 is the address of a byte containing
input data count, followed by the input data. GPR 2 isthe address of the output buffer.
Registers 0-7 are saved upon entry.
Exit

conditions:First byte of output buffer
output data count, followed by output data.

Entry point:

contains

UNPACK

Entry conditions: GPR 1 contains the address of the input
buffer, in the same format as the output buffer for
PACK. GPR 2 contains the address of the output buffer.
Registers 0-6 are saved upon entry.
Exit conditions:buffer.

-294-

The unpacked data

appears in

the output

PAGEGET/

Module name:

PAGEGET

Entry points:

PAGEGET, PAGERLE

Purpose:The module handles DASD storage
paging.

requirements for----------------------------------------------------~---

Entry point: PAGEGET - allocate
by PAGTRANS.
None.

space for one page. Called

Entry

conditions:entry.

Registers 0-12

Exit

conditions: GPR 2 contains device index and DASO
address, if found. If not found, GPR 2 contains o.

Entry point:
PAGERLE - releaseuser. Called by PAGOUT.

are

saved

paging DASD area

upon

for this

Entry conditions: GPR 11 points to this user's UTABLE andregisters 0-12 are saved upon entry. GPR 5 points toa SWPTABLE entry containing the address of therecord to be released.
Exit conditions:

None

-295-

PAGTR

Module Name:

PAGTR

Entry points:

PAGOUT, PAGFRET, PAGSHARE

Purpose: This module handles functions which require
knowledge of the nature of the mapping device.

a-----------------------------------------------·-----------Entry

point: PAGOUT
remove a user's
Called from CFSIPL or USEROFF.

pages fromEntry conditions: GPR 11 points to the UTABLE ofwhose pages are to be scrapped,.

core.

the user

Registers 0-13 are saved upon entry .•Exit conditions:

None.

Entry point: PAGFRET
Entry conditions: GPR 2 points to first page to beavailable for users, and GPR O is count of pages.
Exit conditions:

made

None.

I
I
I

Entry point: PAGSHARE - called by CONSOL for first user of a
named system to bring into core and lock any shareablepages.

I
I
I
I

Entry conditions: GPR 1 = first shared page number; GPR 5 =PAGTABLE address; GPR 6 = count of saved pages: GPR 7 =address of first entry of saved SWPTABLE; GPR 11 =UTABLE address.
Registers 1-7 are saved upon entry.
Exit conditions: None.
locked.

-296-

All required pages arein core andPAGTRANS

Module name:

PAGTRANS

Entry points: PAGTRANS, PAGUNLOK, PAGFREE, CORUSER, CORTENT,WAITPAGE, DRMWAIT
Purpose:This module handles functions which require
knowledge of the nature of the mapping device.

Entry point: PAGTRANS - translatein, if required.

avirtual address and page

Entry conditions: GPR 1 contains the virtual byte address.
GPR 2 contains control parameters in byte 3 as follows:
BRING, to bring the page into core; LOCK, to lock thepage in core <implies BRING) ; - DEFER, to prevent returnto caller until page is in core; CHANGE, to set changed
bit for this page; USED, to set used bit for this page.
Registers 0-15 are saved upon entry.
Exit conditions:

Entry point:

GPR 2 contains the real byte address.

PAGUNLOK - unlock a virtual page CBALR>

Entry conditions: GPR 2 contains a real byte address within
the page to be unlocked.
Registers 0-7 are saved upon entry .•Exit conditions:

None

Entry point: PAGFREE - obtain free page
Called by EXTEND.
Entry

conditions:entry.

None.

Registers

3~11

for free storage.
are

saved

upon

Exit conditions: GPR 1 points to the page address which canbe included in the free area.

-297-

'

/

Entry point: CORUSER
Fullword containing address of first page available tousers, set by PAGFREE. Initialized value is ACCPEND>.

Entry point: CORTENT
Fullword containing address of end
PAGFREE.

of CORTABLE, set by

Entry point:
WAITPAGE - reflects
Called by IOINT.

completion of

Entry conditions:

IOTASK; GPR 10 points to

GPR 9 points topage I/O.

csw.
Registers 0-15 are saved upon entry.
Exit conditions:

None

Entry point: DRMWAIT - After a 2301 drum paging interrupt,
stacks CPREQUEST blocks for each additional page if the
I/O operation involved more than one page.
Chainstogether any IOTASKS queued off the allocation blockand calls QUERIO.
Entry conditions: GPR

csw.

9 points to IOTASK; GPR

10 points to

Exit conditions: Transfers to WAITPAGE.
/

-298-

PRIVLGED
Module Name: PRIVLGED
1-~

Entry points: PRIVLGED, FREEPST, FRETPST

I

Purpose: Provide non-I/O privileged instruction simulation.

I
I
I
I

If the ~TRACE(5) option is selected in the LOCAL COPY file,then the PRIVLGED module accumulates statistics in low core<defined in STAT COPY) about the number and type ofprivileged instructions executed.

I

Entry point: PRIVLGED

I
I

Entry

I
I
I

Exit conditions: Viaa GOTO to VIOEXEC if the instruction
is for I/O or to DISPATCH after the instruction issimulated.

conditions: R13 points atprivileged instruction.

Entry point: FREEPST page tables.

the realcreates realaddress ofcopies ofthevirtual 67

Entry conditions: Register 11 points to UTABLE.
Registers 0-4 are saved upon entry.
Exit conditions: None.

I
I

Entry point: FRE'TPST - releases
page tables.

real copies ofvirtual 67

Entry conditions: Register 11 points to UTABLE.
Registers 0-5 are saved upon entry .•Exit conditons: None.

-299-

PRO~INT

Module name:PROGINT

Entry points:

PROGINT, REFLECTI

Purpose: PROGINT is entered from the program interruption
new PSW.
·It attempts to determine
whether theinterruption occurred from the Control Program issuinga simulated instruction (f~ exampler SLT) or the user
issuing a privileged i:t)Struction; in the latter easer
control is passed to/PRIVLGED, which interprets andsimulates user-issued privileged instructions.

Entry point:
Entry

I
I
I

PROGINT

conditions:
PROGINT
interrupt new PSW.

is entered

from

the

program

Exit conditions:
If the interruption occurred as the result of aprogram interruption in the Control Program indicating
program trouble, a terminal system dump occurs. If the
program interruption was the result of a user issuing aprivileged operation <the usual condition>r control ispassed to PRIVLGED.
Entry point:

REFLECT - reflect an interrupt to the user.

Entry conditions:
GPR 13 points to the old PSW forinterruption condition which is to be reflected,.
user's registers have already been saved.

the
The

Exit conditions: After making changes in the user's UTABLE
to reflect the interrupt, REFLECT transfers control to
DISPATCH with GPR 11 pointing to the affected user.
Note:

The use of register 13 in this case to point to theproper old PSW is a deviation from standard calling
sequence practice.

/

-300-

PSA

Module name:

PSA

Entry points:

SVCINT, SVCINIT, EXTINT, MCHEKINT, SVCDUMP

Purpose:I
I

To initialize and maintain the save areas provided
as a part of the calling protocol maintained within
CP-67.
SVCINIT is called to initialize the saveareas, and SVCINT is entered by the SVC interrupt
occurring, indicating a request for linkage or
return by a CP-67 module. Also handles external andmachine check interrupts.

If the ~TRACE(1) option is selected in the LOCAL COPY file,then PSA also places entries in a trace table for CP SVC's.

Entry point:

SVCINIT - initialize save area.

Entry conditions:Entered via a BALR 14,15
the save areas from CPINIT.
Exit conditions:
Entry point:I
I
I

to initialize

Initialized save areas.

SVCINT

Entry conditions: Entered via an SVC O, 4, 8, 12, 16, or 20
to perform, respectively, DIE, DUMP, LINK, RETURN,
RELEASE, or SAVEGET.
Exit conditions:
Entry point:

See "SVC Interruptions" in Section 2.

EXTINT

Entry conditions:Eritered from the external interrupt new
PSW.
If the interrupt occurred because of theexternal interrupt pushbutton, the system operator
is logged out. This allows him to log in again froman alternate console.
If the interrupt occurredbecause of a timer interrupt, the running user, ifany, is saved, and an exit is taken to DISPATCH todetermine whether there is any work.
Exit conditions: Exits to DISPATCH under normal conditions
with GPR 11 pointing to the interrupted user.
E~trypoint:MCHEKINT

Entry conditions:

Upon detection of a hardware malfunction.
-301-

Exit

conditions:
After printing
warning messages, if
machine check was in CP-67 mode, terminate allprocessing. If machine check was in user mode, theuser is informed that a machine check has occurred.
The machine check is reflected back to the virtual
machine, which is placed in CP console function
mode; this enables a console function to be issued.

Entry point:
SVCDUMP - branched to from within PSA on an
SVC 0 or entered from a PSW restart. Branches to
DSKDUMP to abnormally terminate.
Entry conditions:

None

Exit conditions:

None

/

-302-

QUEVIO

Module name:QUEVIO

Entry points:

QUEVIO, QUERIO, CHFREE

Purposes:This module queues requests for input-output
operations on the selector channels, determines whether
the channels are available, prepositions access arms on
direct access devices, and initiates the input-output
operations.

Entry point:

QUEV10 - queue virtual task block CBALR)

Entry conditions: GPR 1 points to an IaI'ASK block which is
to be queued. GPR 2 points to the virtual device block.
Registers 0-14 are saved upon entry.
Exit conditions: None. Transfer isoperation of the task.

Entry point:

to CHFREE,

to initiate

QUERIO - queue real task block CBALR)

Entry conditions: GPR 1 points to an IOTASK block which is
to be queued. GPR 6 points to the real device block onwhich the input-output operation is being performed.
Registers 0-14 are saved upon entry.
Exit conditions: None. Transfer isoperation of the task.

Entry point:

to CHFREE,

to initiate

CHFREE - start idle channel CBALR)

Entry conditions: GPR 1 points to a real channel block forwhich input-output operations are to be initiated, if
possible.
Registers 0-14 are saved upon entry.
Exit conditions: None. If the operation can be started, azero condition code from the SIO operation causes theuser to be removed from the IOWAIT condition if theoperation originated from a virtual machine.
For anonzero condition code, CHFREE calls the TASKIRA withthe condition code indicated in GPR 0. CHFREE can also
call itself recursively if it determines that theoperation just initiated has freed the channel.

-303-

RDCONS

Module name:

RDCONS

Entry point:

RDCONS

Purpose: This module creates a CCW "package" (according to
the type of terminal it is servicing> that can bestacked as a read request for that terminal. It allows
the different remote terminals to be treated as thougheach were a 1052.
Registers 0-10 are saved upon entry to RDCONS.
----------------------------------~-----------------------

Entry point:

RDCONS

Entry conditions: GPR 1 contains the address of the input
buffer (132 bytes). GPR 2 holds the options that arerequested when RDCONS is called: EDIT, OPERATOR, or
UCASE.
If EDIT is
specified, character or line
deletions are performed as specified.
If UCASE is
specified, all lowercase letters are translated toequivalent
uppercaseletters.
If
OPERATORisspecified, a read is performed from the operator's
terminal.
GPR 3 contains the address to which theControl Program will return control after completion of
the console I/O. GPR 11 points to the UTABLE of theuser to whom the read is directed.
Exit conditions: The return is made from RDCONS immediately
with all registers restored. At the termination of theread operation, GPR 0 contains the byte count of the
input message; GPR 2 contains an error condition code,
if any. Control is returned to the address specified
in GPR 3 at the call to RDCONS.

-304-

RI:SCAN(

Module name:

RD SCAN

Entry points:

LINKSCAN, RDSCAN, DEVSCAN

Purpose:To determine whether a virtual DASD device iscurrently attached to the virtual machine of an active
user (that is, a •1ink" exists>. Definition: Twovirtual devices having the same RDEVBLOK and relocation
factor are the same.
Registers 0-9 are saved upon entry to this module.

Entry point:

LINKSCAN

Entry conditions: GPR 11 is the UTABLE address of thecurrent user, not to be included in the search. GPR 10
is the UTABLE address of the first user to be scanned.
GPR 0 is the relocation factor of the virtual device,
and GPR 1 is the address of the RDEVBLOK.
Exit conditions:
Condition code O
Condition code 1
Condition code 2

No link exists ..
Read-only linkCs> exists.
Read/Write link exists-

GPR 10 is the UTABLE address of the user having thelink. For no link, GPR 10 is equal to GPR 11.
Entry point:

RDSCAN

Entry conditions:

Same as LINKSCAN

Exit conditions: Same as LINKSCAN except that if all links
are read-only, no return is made until all user
machines have been examined or a read/write link isencountered.
Entry point:

DEVSCAN

Purpose: To determine whether any link exists to the real
device regardless of the relocation factor.
Entry

conditions: Same as LINKSCAN except GPR O is not
used. To include current user in search, set GPR 10
equal to GPR 11.

Exit conditions:condition code 0 - No link exists.
Condition code 3
A link exists .• GPR 10 points to
UTABLE of first link encountered.

-305-

REC FREE

Module name:

REC FREE

Entry points:

RECFREE, RECFRET

Purpose: To handle the spooling requests for available disk
records in much the same manner as free storage handles
main memory.

Entry point:

RECFREE - obtain free record.

Entry conditions:None. Registers 2-6 are saved upon entry.

Exit conditions:
GPR 0 = 1; GPR 1 is the address of adoubleword containing the DASD record address anddevice code in the following format: bytes 0-1 arezero; bytes 2-3 contain the cylinder number; bytes 4-5
contain the track number; byte 6 contains the record
number; and byte 7 contains the device code.

Entry point:
Entry

RECFRET - return disk record to free storage.

conditions:
GPR
1contains
doubleword in the RECFREE format.

Registers 0-7 are saved upon entry .•Exit conditions:

-306-

None

the

addressofaRES INT

Module name:RESINT

Entry points:

RESINT, RESIRA

Purpose:This module performs a virtual system reset.

Entry point:

RESIN'!'

Entry conditions: GPR 11 points to the UTABLE
for whom the reset is desired.

of the user

Registers 0-11 are saved upon entry.
Exit conditions: None

Entry

point: RESIRA
interrupt return address set by
RESINT for IOTASKS queued up for a user to be reset:
clears interrupt without resetting virtual machine
status; entered from IOINT.

Entry conditions:csw.

GPR 9 points

to IOTASK.

RIO

points toRegisters 0-11 are saved upon entry.
Exit conditions:

None

-307-

SAVECP

Module name:

SAVECP

Entry point:

SAVECP

Purpose: This module writes the core image of CP-67 onto
the system residence volume (currently specified by a
REP card in the SAVECP module) at the end of a card ortape load of CP-67 into core. At IPL time the SAVECP
function is reversed and it reads in the core image.

Entry point:

SAVECP

Entry conditions: The module requires that the disk address
be loaded with it, and that the device be a 2311 or
2314. The addressability of the module is contained in
GPR 3 (not 12 as in the norm>.
Exit conditions: The disk address is stored in word O, andthe address of the location containing the label isstored in GPR 2, when control is transferred to CPINIT
after SAVECP-restore. After a SAVECP-save a DISK LOAD
OK message is printed.

/

-308-

SCAN UNIT

Module name:

SCANUNIT

Entry points:

RUNITSCN, VUNITSCN

Purpose:To accept a device address. either real or
virtual, and scan down the appropriate list. setting up
pointers to the various level blocks.
Registers 0-8 are saved upon entry to this module.

Entry point:

RUNITSCN - scan for real device block CBALR)

Entry conditions:for.

GPR 8 contains the address to be searched

Exit conditions:
GPR 6 contains the pointer to the realchannel block, if found. GPR 7 contains a pointer tothe real control unit block. if found. GPR 8 contains
a pointer to the real device block. if found.
The
condition code is set as follows:
0 1 2 3 -Entry

all blocks foundchannel block not found {no pointers valid)
control unit block not found {channel pointer valid)device block not found {channel and control unit
pointers valid

point:VUNITSCN

scan

for virtual

deviceblock

CBALR)

Entry conditions: GPR 8 contains the address to be searchedfor. GPR 11 points to the user whose blocks are to be
searched.
Exit conditions: Same as for RUNITSCN except
to virtual blocks.

pointers are-309-

SCHEDULE
Module name: SCHEDULE
Entry points: SCHEDULE, SCLOCK
Purpose: Contains extended DISPATCH functions.

Entry point:

SCHEDULE

Entry conditions: Rl is non-zero if the UTABLE pointed to by
Rll is in logon and is to be added to the real timer
chain if that option is specified. Otherwise, Rl iszero and the Rll UTABLE is in logoff and it is to be
removed from all chains that it currently may be on.
Exit conditions:

None.

Entry point: SCLOCK
Entry

conditions: Entered once a minute on a call fromDISPATCH to update the decimal clock and to recalculate
the paging activity variable.
Also once an hour it
resets the elapsed binary timer and any other locations
dependent on its current value.

Exit conditions:

-310-

None.

SCREDAT
Module Name: SCREDAT
Purpose: Contains system identification information that may
be changed for each system created.

-311-

STCONSIO

Module name:

STCONSIO

Entry points:

PRIMSG, STCONSIO

Purpose: This module will start an I/O request to a console
or stack it if there are outstanding requests.
If
entered via PRIMSG, the request is stacked ahead of all
current outstanding requests.

Entry point:

STCONSIO

Entry conditions: GPR 6 contains the address of the console
I/O request to be started or added. GPR 8 contains thedevice address and GPR 11 points to the appropriate
user's UTABLE.
Exit conditions: The address of the CIOREQ pointer in the
UTABLE will be changed to that of the current request,
if the operation can be started immediately.

Entry point:

PRIMSG

Entry conditions:

Same as STCONSIOExit conditions: Same as STCONSIO,
except the operation isalways started and CIOREQ entry is always altered.

-312-

TMPSPACE

Module name:

TMPSPACE

Entry points:

TMPSPACE, TMPRET, TMPERTN, T2311

Purpose: TMPSPACE dynamically allocates cylinders
devices from devices of a specified type.

on DASO

Registers 0-11 are saved upon entry to this module.

Entry point:

TMPSPACE - obtain free cylinder.

Entry conditions: GPR O contains the number of contiguous
cylinders desired.
GPR 1 contains the desired device
type code. GPR2 contains the type of space desired <forexample, paging or spooling space, T-disk space, or
directory space).
Exit conditions:GPR O contains the relocation factor of
the allocated cylinder.
GPR 1 points to the RDEVBLOKof the selected device. If space is not available, GPR
1 is set to zero.

Entry point:

TMPRET - return a cylinder to free storage.

Entry conditions: GPR O contains the relocation factor oftheallocated cylinder.
GPR 1
points totheappropriate RDEVBLOK. GPR 2 contains the number ofcontiguous cylinders.
Exit conditions:
Entry

None

point: TMPERTN - interrupt return address for an
IOTASK that erases TRK 00 of a T-DISK that has beenreleased; entered from IOINT.

Entry conditions:

GPR 9 points to IOTASK.

GPR 10 points to

ccw.
Registers 0-11 are saved upon entry,.
Exit conditions:

None

-313-

TRACER
Module Name:

TRACER

I

Entry points: TRACER. TRINT

I
I
I
I
I
I
I
I
I
I

Purpose: This module handles the analysis and formatting ofuser
specified
tracing,functions.
Tracingiscontrolled by a table extension to the UTABLE. This
table is located by the UTREXT entry in the OTABLE.
The trace functions are controlled by a one-byte switch
named TRSW defined in the UTABLE. The trace extension
block called TREXT is defined in the UTABLE COPY.
It
contains control words. storage areas, and output
buffers for the trace function.
The TREXT block is 25
double words in size.

Entry point: TRACER - output trace data
Entry conditions:buffer.

GPRl contains theaddress ofthe output

Exit conditions: The buffer is cleared to all C132) blanks
after being passed for console and/or printer output.

I

Entry point: TRINT - trace interrupt

I
I
I
I
I

Entry conditions:
GPRl - virtual old PSW address
GPR3 - interrupt code
GPR4 - SVC extended interrupt code
GPR6.7 - SVC extended old PSW contents
Exit conditions: Trace buffer has been formatted and printed
by calling TRACER.
All necessary instructions havebeen restored and any •trace-following• SVC's have beenset.
The virtual machine PSW is ready to run from thecorrect location.

-314-

UNSTIO(See Figure 45 for an overview of UNSTIO processing.)

Module name:UNSTIO

Entry point:

UNSTIO

Purpose:To unstack andinterrupts from bothdevices.

reflect virtual input-output
the selector and multiplexer

Registers 1-8 are saved upon entry to this module .•---------------------------------------------------------Entry point:

UNSTIO

Entry conditions: GPR 11 points to a user who has at least
one enabled interrupt condition .•Exit conditions: The user's UTABLE and virtual page 0 havebeen altered to reflect the appropriate interrupts.

-315-

Entermodule UNSTIO
entry UNSTIO

Get
interrupting

channel

Yes

No

No

Move MVCSWNo(MVDEBLOK)
to virtual

csw

Move MVDESTAT(MVDEVBLOK)
to virtual
CSW

Move interrupt

device tovirtualMove MVDESTAT(MVDEVBLOK)
to virtual CSW

Move VPSW
to VIODPSW

Remove attn

Move VIONPSW
to VPSW

from VCSW

Exit

Leave attn
in MVDESTATFigure 45.
-316-

CP-67 UNSTIO (1 of 2)

No

Get next
VCUBLOCKPAGTRANSNo

Get next
VDEVBLOK

Move int
unit (VCUEUNIT)
to virtualMove int
unit tovirtualMove VPSW
to VIOCPSW

Move VIONPSW
to VPSW

Yes

Move int
device andchannel tovirtualMove VDEVSTAT(VDEVBLOK) tovirtual CSW

Remove attn
and UC fromvcsw

Leave attn

Resetpending in
UTABLEand UC in
VDEVSTAT

Move int
device andchannel tovirtualExit

Figure 45.

CP-67 UNSTIO (2 of 2)-317-

UNTRANS

Module name:

UNTRANS/-

Entry points:

UNTRANS, FREECCW

Purpose:The module computes from the hardware CSW thevirtual csw to be reflected to the user. The real ccw•s
are released to free storage.
Registers 0-12 are saved upon entry to this module.

Entry point:

UNTRANS CBALR)

Entry conditions: The GPR6 is pointing to the VCHBLOK whichcontains the csw..
Exit condition:
Entry point:

The VCHBLOK contains the translated CSW.

FREECCW

Entry conditions: GPR8 points to the user's
GPR9 points to the IOTASK block.

VDEVBLOK, andExit conditions: All I/O pages are unlocked, the RHA data
is relocated, and the real
ccw lists have beenreleased.

-318-

USERLKUP

Module name:

USERLKUP

Entry point:

USERLKUP

Purpose:To find the entry in the U.DIRECI' file for a
specified userid.
Registers 0-5 are saved upon entry to this module.

Entry conditions:
GPR 1 points to an eight-byte userid.
GPR 2 points to a buffer of size greater than or equal
to UFDENTLN (the size of the UFDENT DSECT) •Exit conditions:
Condition code

Condition code

nonzero: Userid found in directory.
Caller's buffer contains a copy ofthe user file directory entry CDSECTUFDENT).
zero: Userid not found .•-319-

USEROFF

Module name:

USEROFF

Entry points:

USEROFF, ADSET, ADSETOUT, RELEASE, RUNRET

Purpose: The USEROFF module handles
a user off the system.

Entry point:
system.

USEROFF - Deletes the virtual machine from the

Entry conditions:
Exit conditions:

Entry point:

the details of logging

GPR 11 contains UTABLE address.
GPR 11 set to zero .•ADSET - initiate the logout sequence.

Entry conditions: GPR 11 points to the user's UTABLE. GPR 2
is set to 1 if the logoff is forced Cline error or
hangup). GPR 2 is set to 2 if called by KILL or
SHUTDOWN. Otherwise, GPR 2 is set to zero.
Registers 0-10 are saved upon entry.
Exit conditions: INLOGOFF bit isexit taken.

Entry Point:

set in VMSTATUS and normal

ADSETOUT - log user off the system.

Entry conditions:User has no outstanding
GPR 11 points to the user's UTABLE.
Registers 0-10 are saved upon entry.
Exit conditions:-320-

GPR 11 contains zero.

I/O operations.

Entrypoint:
device.

RELEASEdetacha nonshared

input-output

Entry conditions: GPR 11 points to the user UTABLE. GPR 2
points to the RDEVBLOK of the device to be detached. If
the device is a tape unit, the volume mounted isrewound and unloaded. If the device is a dedicatedmultiplexer unit, the selector channel real I/O blocks
are returned to free storage, and the original MRDEBLOK
is restored to the list.
Exit conditions:Noneinterrupt return address for an
point: RUNRET
IaI'ASK that rewinds and unloads a tape after being
detached.

Entry

Entry conditions:

GPR 9 points to IOTASK.

GPR 10 points to

csw.
Registers 0-15 are saved upon entry .•Exit conditions:

None

-321-

VIOEXECModule name:

VIOEXEC

Entry points:

VIOEXEC, VIRA

Purpose: VIOEXEC is responsible for intercepting virtual
input-output corrunands and determining how they will behandled. It performs operations required for handlingselector channel
requests andpasses multiplexer
requests onto MVIOEXEC.

Entry point:

VIOEXEC

Entry conditions:
GPR 4 points to the first half of the
input-output instruction which caused entry to VIOEXEC.
GPR 5 points to the second half. The virtual CAW will
point to the virtual ccw list to be executed.
Registers 0-10 are saved upon entry.
Exit conditions: Goes to DSPTCHB. The condition code in thevirtual PSW is set as follows:
0 - I/O initiated or performed
1 - csw stored
2 - device busy
3 - device not operational

Entry point:
VIRA - generalized interrupt return addressfor IOTASK performing user-dedicated I/O operations;sets condition and stacks a virtual pending interrupt.
Entry conditions:csw.

GPR 9 points to IOTASK.

Registers 0-15 are saved upon entry.

-322-

GPR 10 points toVSERSCH

Module name:

VSERSCH

Entry point:

VSERSCH

Purpose:Searches RDEVBLOK's
number.

foragiven volumeserialRegisters 0-11 are saved upon entry to this module.

Entry point:
Entry

VSERSCH

conditions:
GPR 1 points
to a six-byte
containing the volume serial label desired.

field

Exit conditions: GPR 1 points to the desired RDEVBLOK. If
the given label is not currently recognized by thesystero, this register will be zero.

f
-323-

WRTCONS

Module name:

WRTCONS

Entry points:

WRTCONS, PRIORITY, OPI'IME

Purpose: This module allows each remote terminal to be used
for output as though it were an operator's 1052
console. It will create and stack a CCW package for aapriority status,
if
specificterminal <withrequested).
---------------------------------------------------------~

Entry point:
Entry

WRTCONS

conditions: GPR 0 contains the byte count of theoutput message (must be nonzero). GPR 1 contains thestarting address of the output message <see DFRET note
below). GPR 2 contains 0 or parameters as follows:
NORET specifies that no return is to be made oncompletion of the operation, that is, GPR 3 (below> is
not set up. ALARM specifies that the audible alarm is
to be given, if available, at the completion of theoperation.
DFRET causes the output buffer to be
automatically
returned tofreestorage atthecompletion of the operation. (Note:
In this case, thedata in GPR•s 3 and 1 must be appropriate for return to
the FRET routine; that is, GPR 1 is on a doubleword
boundary, and GPR 3 contains the number of doublewords
to return to free storage.> OPERATOR specifies that themessage is to go to the operator's terminal,
GPR 11
need notbe established for thiscall.
NOAUTO
specifies that the message is to be written without anautomatic carriage return following the message. GPR 3
contains thereturn address,
if NCRET
was not
specified. It contains the number of doublewords to be
returned to free storage if NORET and DFRET were
specified.
Registers 0-4 are saved upon entry.

Exit conditions: An immediate return is made from WRTCONS
before the operation is completed. All registers are
saved here.
Upon completion of the operation, GPR 2
contains an error code, if any. Return (if NORE'I' was
not specified) is to the location specified by GPR 3.

-324-

Entry point:

PRIORITY

Entry conditions:

Same as for WRTCONS

Exit

conditions: Same as for WRTCONSr except that theconsole write is requested to be queued ahead of any
other currently stacked I/O for that terminal.

Entry

point: OPTIME
terminal.

Entry conditions:- writes

time ofday tooperator's

None

Registers 0-15 are saved upon entry~
Exit conditions:

None

-325-

UTILITY MODULES

The CP-67 utility
stand- alone except
follows:

modules, all of which arefor VDUMP, are provided as

BUZZARD - upon abnormal system failure,
Cl> saves accounting
cards forbilling, and (2) saves starting
OASD address of spooled printer,punch andvirtual card
readerfiles.
DIRECT
writes
the
user
file
directories onto
SYS RES volume;
allocates space on DASO devices
used as system device.
FORMAT - formats DASO
system device •devices usedas

. SAVESYS - writes a pageable core image
copy of an operating system, suchas CMS, which is run in a virtual
machine under CP-67; enables the
saved operating system to be IPL'ed
by name.
VDUMP

-326-

- runs in a virtual machine toretrieve any system ABEND dumps
from the system disk.

BUZZARD

Utility module name:
Entry point:

BUZZARDBUZZARD

Purpose: The BUZZARD module is responsible for performing
three distinct functions.
It saves the accounting
records on disk after an abnormal system failure. The
system LOGMSG is also saved so that when the system is
re-IPL'ed with the WARM start option, this message willappear on the user's console at login time. Moreover,
if there were any files in the spooled area of thesystem waiting to be printed or punched, it saves atable of the starting DASD address of such files andwrites out the table on CP-67 system residence disk,
cylinder 202. It also saves virtual card reader files
in the same way. When the system is IPL'ed the nexttime and the WARM start option is specified, thespooled output is continued.

---------------------------------------------------------Entry point:

BUZZARD

Entry conditions:

None

Exit conditions: Prints completion message on
and goes into wait.

1052 console-327-

DIRECT

Utility module name:
Entry point:

DIRECT

DIRECT

Purpose:The DIRECT
program writes
the userfile
directories onto the system
residence volume andallocates space on that volume and other volumes which
are to be used for permanent file residence. paging.
and spooling ..

Entry point:

DIRECT

Entry conditions: Entered from stand-alone loader ... No otherentry conditions ..
Exit conditions:
Sets WAIT state PSW after completion of
all allocation and directory creation activities. andtermination wessage to operator console.

-328-

FORMAT

Utility module name:
Entry points:

FORMAT

FORMAT

Purpose: To format any DASD device that CP-67 uses for asystem device (that is, for residence, paging or
spooling>.
currently those devices are 2311, 2314,
2303, and 2301.

Entry point:

FORMAT

Entry conditions:
All required variable data is collectedby the program interrogating the operator for (1)device type, (2) device address,(3) volume label, (4)start address (optional), and (5) end address ofcylinders or tracks to be formatted.
Exit conditions:

Program prints FORMAT ENDS.

(
-329-

SAVESYS

Utility module name: SAVESYS

'"- /
___

Entry point: SAVESYS
Purpose:This module is used to write a pageable core
image copy of an operating system such as CMS, which is
run in a virtual machine under CP-67. The operating
system <such as CMS) is IPL•ea on a bare machine, with
an appropriate address stop set. Then the program
SAVESYS is IPL•ed from the card reader. The control
card describes the core limits to be saved and thedevice and cylinder address of where to save it. <seeOperator•s Guide for procedure.)
The module SYSTEM has to be set up to reflect
the page numbers and cylinder addresses where the core
image was saved. This allows the user to IPL thevirtual system by name, such as
IPL CMSThe advantage of IPL•ing by name is in speed
since it requires less I/O and paging than normal IPL.
Moreover, in order to share CMS system pages amongusers, it is necessary to IPL by name.

-330-

VDU MP(:Utility module name:
Entry point:

VDUMP

VDUMP

Purpose:This module runs ina CMS virtual machine
specially configured to retrieve the system ABEND dumps
from disk.
Only the user specified for a SYSDUMP in
the SYSGEN macro can operate this program. That user•svirtual machinemust have defined in
the CP-67
directory a special spool file reader defined as:
UNIT

0 Fl• RPRT

as well as a standard CMS machine.
VDUMP will resideon that user•s P-disk. The program uses the special
reader COF1) to access any system dumps. The dump
input is then formatted and printed on the CMS printer
COOE>. which is spooled. As VDUMP proceeds. it prints
a message indicating each 10,000 bytes of core printed
as:
DUMPING STORAGE LOCATION xxxx
Upon completion. VDUMP prints END
the virtual printer.

OF DUMPand closes-331-

APPENDIX A:SAVE AREAS

Register 13 normally points to a 96-byte save area.
The first 12 bytes are reserved for use by the SVC handler
for keeping linkage information. Modules normally use thenext 12 to 16 words for saving the registers of the callingroutine (the ENTER macro generates an STM of the specified
register
 into an area whose beginning is displaced 12
bytes off register 13). The remaining bytes are optionallyused as a work area. The first word of an active save area
will contain the interrupt return address in the callingroutine. The second word contains the caller's register 12,
and the third word the caller's register 13.
Very seldom
are more than registers 0 through 11 saved since Cl) 14 and
15 are normally work registers, and <2> 12 and 13 havealready been saved by the SVC handler. Inactive save areas
will contain a pointer to the next inactive area in thefirst word of the save area.
A word in the SVC handler
points to the first available (inactive> save area.
Note: In OS, register 13 normally points to a 20-wordsave area for use by the called routine.
If a calledroutine wishes to call, it will provide core or dynamicallyobtain core for its called routine·• s save area. In CP-67,
register 13 points to a save area for the currently active
routine, containing the saved registers of the callingroutine and the necessary linkage information to return.
The maintaining of linkage information and chains for active
and available save areas is all done by the SVC handler.
There is one exception to this rule: in CFSMAIN, theroutine obtains its own, extra large save area, and it
temporarily replaces the normal save area in the chain withthe extra large one.

-332-

APPENDIX B:

REGISTER USAGE

Register0

variable Cmany times count of doublewords for
FREE or FRET linkage)1

variable (many times pointer to temEorary storage
obtained from FREE)

2

CALL macro parameters if PARM is used

3-5

variable

6variable CI/O routines use commonly as channel
block pointer)

7

variable CI/O routines use commonly as control
block pointer)

8

variable CI/O routines use commonly as device
block pointer)

9-10

variable11

pointer to the user•s status table CUTABLE) for
the user CP is currently working on

12

base

13

save area pointer14

variable Csome use as BAL, BAS, etc. within
particular modules)

15

variable (address of entry point of currently
active module or last called module, set
by CALL macro>

Registers O and 1 are commonly used to pass arguments to
subroutines. Registers 14 and 15 are not preserved over a
subroutine call and therefore should not be used for any butvery temporary use.

-333-

APPENDIX C:CORE LAYOUT

The following items are of particular importan~e indebugging CP-67. For a complete description of lower core
see the listing of EQU67 COPY file from the CPMAX macro
library. (EQU67 is listed in •ep-67 Equate Package - EQU67•
in Section 3: Programming conventions of this manual.>
See Figure 46 for a diagram of real low core.
Hexadecimal
Address0

Eight-byte PSW restart

E

External old PSW interrupt code

10

SVC old PSW interrupt code

12

Program old PSW interrupt code

14

Machine check old PSW interrupt code16

I/O old PSW interrupt code

160

UTABLE address of the currently active or last
run user340

Address of CPSYM module.. CPSYM contains a twelvebyte entry for each CP module, an eight-byte
EBCDIC name. and a four-byte ADCON.

CPEND

Address variable depending on system, represents
highest address of permanently resident CP
code. Beginning on the first 32-byte aligned
boundary following CPEND is the CORTABLE, one
16-byte entry for each 4K page in the machine.
Following the CORTABLE, beginning on the first
following 32-byte boundary are the initial 100
96-byte save areas.

-334-

000

IPLPSW

008

IPLCCW

010

1

SVC INT. CODE

018

PROG. INT. CODE......

1/0 INT. CODE

MCK. INT. CODEOLDPSW'S

040

CSW

048

CAW

050
058

l

EXT. INT. CODE

TIMER

I

T

....

..l.,

NEWPSW'S

0801--------------11,..

SCAN 0

160

168
170

RUNUSERHOURSI

MINUTESISECONDS

188
190
198
1AO
1A8

CPSTATUS

ll

MONTHS

l

DAYS

]

YEARS

STARTIMSTARTIM

178

180

uT

BINTIMEDISPSW

ASYSWRM

ASYSINF

ASYSCNSLCPID

ARMXST

ARDEVTAZVOLAPR INTAP UNCHAR EADE RS

AM REAL

ARCHSTRT

Figure 46. CP-67 Real Low Core (1 of 2)-335""'."

180

IEO

220

270

l

I

1
[

CPUTABTEMPSAVEII

BALRSA\lE

I

I

DISPAGWK

1

290

DSCRO

298

KALG

LOCKOUNTI

MAX LOCK

~

350

358
360
368
370
378
380
388

CPTIMEPROBTIMEWAITTIME

OVERHEAD

WAITIDLEWTPAGE

WTUSR

WT US RAKPGEXPG READPGSWAPOCOUNT

INSTWRD1

INSTWRD2

INSTWRD3

INSTWRD4390
STATUSER

Figure 46. CP-67 Real Low Core (2 of 2)·-336-

APPENDIX D:

CP-67 ABENDThe first occurrence to check for in an ABEND dump is
an SVC O Ca halfword zero in the SVC interrupt code at
location hex 10), and supervisor state in the SVC old PSW
CPSW at hex location 20 does not contain problem state bit,
bit 01, byte 1). There are two possible SVC O's whichshould be eliminated before proceeding any further:(1) anSVC O issued by the machine check handler when there has
been a machine check while in supervisor state, and (2) the
SVC O issued by the command handler in response to theoperator command D_U_M_P.
If an SVC O is not found, the second possibility tocheck for is a program interrupt in supervisory mode. The
program old PSW Chex address 28) will not contain the
problem state bit.
The third possibility is that the operator has pushed
the STOP and PSW RESTART buttons on the CPU.
In this casethere should be additional information provided by theoperator on what CP-67 was doing to force the operator totake an ABEND dump.

-337-

APPENDIX E:

CP-67 MEASUREMENT HOOKS

Low Core Cdef ined in EQU67)
RUNUSER - running user
MONTHS, DAYS, YEARS, HOURS, MINUTES, SECONDS current date and time accurate to one second
STARI'IM - system IPL date and time
BINTIME - binary timer; one hour elapsed time
RUNINTIM - binary timer; one second elapsed time
LOCKOUNT - number of "locked" pages
MAXLOCK - maximum number of "locked" pages
CPTIMECPU time in supervisor state
PROBTIME
CPU time in problem state
WAITTIME - CPU time in wait state
OVERHEAD - supervisor time not charged to users
WAITIDLE
wait time system idle
WTPAGE
wait time while paging
KPGEX- count of paging exceptions
PGREAD- pages read in
PGSWAP- pages written out
QCOUNT
pages stolen from in Q users
INSTWRDl
installation counter
INSTWRD2 - installation counter
INSTWRD3
installation counter
INSTWRD4 - installation counter
Low Core Cdef ined in STAT)STATUEXT STATUSVC STATUPGM STATUIOI STATSSK STATISK STATSSM STATLPSW STATDIAG STATDDSK STATSIO STATTIO STATHIO STATTCH STATWRD STATSTMC STATLRA STATLMC STATDSP -user external interrupts
user SVC interrupts
user program interrupts
user I/O interrupts
user SSK instructions
user ISK instructions
user SSM instructions
user LPSW instructions
user DIAG instructions
user diagnose disk I/O instructions
user sro instructions
user TIO instructions
user BIO instructions
user TCH instructions
virtual 67 user WRD instructions
virtual 67 user STMC instructions
virtual 67 user LRA instructions
virtual 67 user LMC instructions
count of calls to CKUSR in DISPATCH

User Data Cdef ined in UTABLE)
TIMEUSED TIMEONPRIORIT VTOTTIME -338-

total CPU time user
login time CMMDDYYHHMMSS)
priority to enter Q
virtual CPU time used

UPIOCNTUVIOCNI'
VMUSERl
VMUSER2
VMUSER3
VMUSER4VMSSIOVMPNCHVMLINSVMCRDSVMPGRD-pages read while in queue
virtual SIO countinstallation counter
installation counter
installation counter
installation counterselector channel SIO
spool cards punchedspool lines printed
spool cards read
pages read

DISPATCH
NUMUSERS - current logged in user count
MVIOEXEC
VMIO- total user MPX SIO count

QUEVIO
VIOCOUNI' - total user SIO count
RIOCOUNT - total CP SIO count

-339-

I

CP-67 CONTROL BLOCKSAPPENDIX F:

T2311 or 231400
AVAILABLE TEMP08ASSIGNED TEMP
01
PERM (USER) SPACE
02
T DISK AVAILABLEOA T DISK ASSIGNED
04- DIRCETORY AVAILOC=OIRECTOAY ASSIGN HJ
OF= ENO,
2301 &
0- REC AVAIL
1- REC ASSIGNED
07-FF REC 1 to 5

c

T2311

r+'"'--,-oin-..-,""'.,-,-..-,-...;'
4

Pntr. to RDEVBLOKt---~o VCH~NPNT

Allocation
Data

18

rl__ SUBPOOL SIZE GROUP

L

REfUFIN ADO RESSB

vcuAooVCUEUNIT

I

xxxxxxxxxxxxxxxxx

VNPNOOE1

VCUBlOK

8

0r--.!f--__v.;:.o; .;EV_P_NT__4l....:.:vo:::':::VA.;:.O;;.;O-+-v;;.;·;;.;1lLv;;.;·~2~1---v_PN_T_RE_A_L_ __.l_v_o,_v_RE_L....t....V_o_Ev_s_N-lo

0

~

10
tB

2

6

VDEVPOSI

2

3

VPAGNOlRDEVCDDE_j_

CYL

J

KEYi
HEAD

4

l

J

RECORD10

RCHANA01 TASKCNTRCHCOND

0

I I
w3

R·4

2

4

6

~1---"-"_'v_'_'''---+--..--"-'-"'-'-'----1,.....!-f--_.;:.R;;.;A;;.;CTrCH.;:.A;;.;N_-j;;.;R;;.;'1;;.;lLXC:XC:X~XX.;:.X.;:.XX.;:.X.;:.X.;:.XX.:::.jX

TASKLAST

10R·sJ wsJ RESERVED~RCUAODl

RCUSTAT---ADEVPNT12

RCUBLDK

)

1

4

R·1

I

RADDR

J

R·2

R'3l

II

1~0~0 ~'l.2.L

r

TASKRCUTASKPNT

r1£1
TASK USERTASKCAW~
181---TA-S-Kl-RA--+---TA_SK_M_IS_C_ __,ABYTE

RCCWLIST

i....t---2.'!.~---v'-"~''_AR_r_-+_v_cH_co_u_NT_J~•-EN_o1_NG---<" 1-"-'o_c_,_s~I._v_M_si_•r_u_s+---"-"'-"-''-'---t
NEXTUSER ~VTIMERBO
USE.RID
SE GT ABLE

NEXTCPROJSREGS~
0oz

NEXTCCWP'

AO

J u·1lu·2

u1ccKLs

JSPARE INUMWDCCWs

1:
T~------"-w_"'_'_____~T=========JO=E:Vl=CE====BO

CS

TIMINGOil

VTOTTIMEDB

CCWPKGUVIOCNT

I

s

s

MUSER

t---2.!..

MRPNTVIR

MIRA

20

M'J

MROERRC~ M'41M'5

r-,___ _,_,_xr_ _---<l

MRDCSWAO

M'6Jw1J M·sJ

xxx

I
~
L-".._BOl-----'---+4---'~__.--lBl---i---------------.....-+-i'--------------,---MVDEVPNTMVDEVAOOI M'l

MVPNTREL

MVIOB

IQ

TERMINAL 110 BUFFER

MVCSW

L..f-----------------~----;-( READERS )

SIZE

l

~
~

IOTASK

All· UTABLE

MAICAWl

R12 BASE
R13 SAVEAAEA

48

BB

l

CC

2
HH

~~

lOTASK

l

R

lxxx

HH
OAT AO

4

0

l
I

48

2

50

Pointer to nextl-M-V_IC_OU_N_T_J..-----------1
DAT AOCC
A IcooE

MROEBLOKB

DATA~------~RECEUF390

MVICCW398

1--------------<3AO

DATAPACJCQOAT AP

UseridMRICAW2

MVINEXTCPRQUEST)

Temporary S<ive Area

SF BLOKJES

0OAT AP

4

CPEXNEXT
47Q

REGSAVEIB
CPEXADOBAOOR

448
CPEXREGS

418

48
MRI BUFF

MVIAECSJMVIFILECMRIFILECCPEXMISCCPEXBLOKMIJIBUFF

UPIOCNTNEXTRTMR

C

")_

_}_

PAVO

VMUSE.RZ
VMUSER4l

USE RINSl

1.:11

TRSW

VMLIN\VMCRDS

VMPGHURESERVED"Hi1-------'-H_~•_H_v1_u_ _ _ _ __,UTABtE~~"----''---,'.-----'-----.'
~
I
~
VI.HO

VCH14
SHAOVCHIJ~1---'-'_int_"T'"-"'-"--1
BB

MRICAWI

20

RECSTART )PRIORITU'6

UCPCOMNO

BB~------------~MVDEBLOKMROEBLOKt-

VMPNCH

M·2~1---•_vo_E_v1_0_ __,_•_·_Jl....__"_"'_l~"-·-'l....__•_·'-1''~-----•-v_1x_u_s•_•_______,l

I I

VMUSER3
llti

L--..!,NUMPAGESU'!>TIMSTAMPVMLJSi:R1

4

DNMPAGEAOEXTABBBl-----Tl-ME_o_N____l~u-·3~1-u_-._,
ACCTNGco1-------..---..-----t

RMXSTART )2l

NCIORE.Q

VMXCOUN~ SEGTBOSP~---------------~--...~--------------------------------------------------------------------'1illlo

UTREXT

CIOREONXTOTUSYSTAB

OVTOT

90

~8

,--!.!!.l---M-R~o,-v-10--+----.-,.-,,--~l-i

l

VPSW

~1---SE-GT_A_Bl_E--,.----V-M-AC_H_Sl_Z_--tl§II
1 1~:====PN=T=RO=C=O=N.::..:...._____'
I -----=:.:.;'
JSRETADD____,__'

48}1----J,-,.-,-,,--,1---J-sP_A_RE-,---tJ

IDT ASK

L.2.i---.-,O~E-VP_N_T_--.-.-.o-,-V-AO-oJT-.-.-,Ir,-,.-.,

FREE LIST

VFPR'S

SQ~~--V-MX_ST_A_R_T--+--V-M-X-PO_IN_T_--t~~

LAST SAVEl

PAGE TABLE ADDRESSPAGTABLE6TASKRDEV

40I
PAGECNTlI

c·oJ c·2

ROEVBLOK

TAODR

0~r-'-""'-Ad_'l_....___J...._x_xx_x-1

ROEVTMONVLIST[RD CON PKG-340-

RUNUSER

VGPA'SRDEVCOOERVOLSERRDEVSEN

4

15

SliPTBL PNTRDEVCUSUBTABLE

1.-1,____,_,_x'-----<

SVCO ABEND DUMPSVCB UNKSVC12 RETURN
SVC16 RELEA~
SVC20 GET SAVEAREA!--!-----{-(UT ABLE Pointer
Unused'--1---"-'_'v_A_u_N__I+-•-o_Ev_E_RC_T-+-R-OE_vrsT_A-lT,-1---'-"-'v_u_SE_•__l.._•_•_n_v_•o_o-+-"-·'-l+-•·-1'

ACUTAIL2SUBPOOL SIZE GROUP

10

NEXT

I

c.__ _u_""-~-'--~I.____,_"_''-'-'---'

1-"-"'_v_•o_o_,_•_.,_J...._R'_2l..___•o_E~vr_•_"_---1l-i

RTAILCNT lRDECOUNTRCUTAlll

RCHBLOKOJ

Lock MSKCORT ABLE

6
8---i
4
L...-r0 ----'2~--rl ----""---'iw6r-"1.l--VC_N_T__,l,..--RC-NT--+--,O-EN-T--,l,..--sc-NT--1

NEXT

2
PointNtoSWPTABLEEntry

8

v·4

4

2

2

SIZE

4

SWPTABLE

RCHSTART )~l---RC_H_A_NP_NT---+--..--R-CU-l~IST----1

21 WORD REGISTER SAVEAREA
Jnd WO AK AREA

J!'i AVAIL SAVE AREAS

0

~

KEY2

v·31

VOEVSNSEVDEVBLOK

r-,___ _,_,_xr_ ___,CALLERS R13ls•1

1-----------.--..---l

1

CALLERS Al?

4

VCHBLOK,.......!.f----'-•';.,',:.";;.;"---+-"-·-1l._•_·2.Jl1..."-'-"'-'-"'~'

tr{

vcu:NTl voecouNr vcusrAT Ixxxxxxxx

a
10

VCHCSW.-{

24 '.'<'OROS

v·2I

l

4

VOE:LIST

ALLCC

NEXTSAVENEXTµ- .-J.i

vcu:IST

a VCHANADDivcucouNT v·'C{ xxx}
xxx
VCEUNITVNPNOCUI
xxxxxxxxxxxxxxxxx

10

~

4

COPYSEGT

VCHI

l
I
I

VCR1~
E"".I l·t

EX TUT AB

I

COPYPAGT

IMAGESGTAPPENDIX G:
Alphabetical Listing of System Modules by Entry PointABEND
ACCTON
ACN'l'IME
ACNTOFFADS ET
AD SE TOUT
ATTACHAUTOLOGON
BIND EC
BINHEX
BREAK
BRKRD
BRKWR
CCWTRANSCFSACNTCFSDIR
CFS IPL
CHFREECHKCUACT
CHKPT
CLINK
CLOSE
COM ENTRYCONSINTCORT ENT
CORUSERCPCORECPFCLOSECPFDCLOSCPFDLKUPCPFOPENRCPFOPENW
CPFREADCPI ENTCPI NITCPSTACKCPSYM
CP6IRADATETIME
DCP
DECBIN
DEDICATE
DETACHDEVOFFDEVSCANDIAGDSKDIAL
DISABLEDIS ACTDISCONNDISDRQDIS IODISPATCHDISPLAYCFSPRV
ACCT ON
ACNTIME
ACNTOFF
USEROFFUSE ROFFCF STACH
LOG ONCONVRTCONVRT
CFSMAIN
CFS MAINCFSMAIN
CCWTRANSCFSPRVCFSPRV
CFS IPLQUEVIOCHKCUACTCHKPI'CFSTACHCFSSPLCFSMAINCONS INT
PAGTRANSPAGTRANSCPCORECPFILECPFILECPFILECPFILECPFILECPFILECONS INT
CPINITCPS TACKCPSYMCCWTRANSCONVRTCFSDBGCONVRT
DEDICATE
CFSTACHACNTOFFRD SCANDIAGDSKDIALCFSPRVDISPATCH
CFS COMDISPATCHDISPATCHDISPATCHCFSDBG
-341-

DMCP
DRAIN
DRMWAITDSKDUMPDSPTCHADSPTCHBDSPTCHCDUMPENABLEEXTEND
EXT INTFIND IO
FIND LOGFINDMCFMTILOG
FMI'LOGFMTLOGI
FM!' LO GM
FMTMLOGFORCEFORCEAFPCONVFREEFREECCWFREE PST
FRETFRETPSTFRETRHEXBINIDENTIFYI OE RR OR
IO INT
IOISTVCUIOISTVDEIPL
IPLSAVEKILL
LINK
LINKSCANLOCKCLOGFILESLOGINLOGOUT
LOGRETNMCHEKINT
MCKERRMRIOEXECMSGMVICLCRMVICLPN
MVICLPR
MVIOEXECMVIPRINT
OFFENTOFF HANGOPMSG
OPT I ME
PACK

-342-

CFSDBGCFSSPLPAGTRANSDSKDUMPDISPATCHDISPATCHDISPATCHCFSDBGCFSPRVEXTENDPSA
IO ERRORIOERRORIO ERRORIOERRORIO ERRORIOERRORIO ERRORIOERRORPLACEPLACECONVRTFREEUSERLKUPCFSDBGFREE
CFSDBGFREECONVRTCONS INTIOERRORIO INT
IOI NTIO INTIPL
CFS IPLCFSPRVLINKRDS CANCFSPRVLOG FILESLOGINCFS COMIO ERRORPSA
IO ERRORMRIOEXECCFS COMMVIOEXECMVIOEXECMVIOEXECMVIOEXECPACKCONS INTCONSINTLOGON
WRTCONSPACKPAGEGETPAGERLEPAGFREEPAGFRETPAGO UTPAGSHARE
PAGTRANSPAGUNLOKPIACEPLACINIT
PRE PLINEPRIMSGPRIORITYPR IRAPRIVLGED
FROG.I'm'PRTINIT
PU IRAPURGEQUERIOQUERYQUEVIORDCONSRDS CANREAD TASKREADYREC ERRORREC FREERECFRETREFLECTRELEASEREPEATRES INTRES IRARP UNCH
RTN41ND
RTN41WTRTN52ND
RTN52WTRUN IT SCAN
RUNRET
SAVECPSCHEDULESCLOCKSCREDATSETSHUTDOWN
SLEEP
SPACE
SPOOL
START
STCONSIO
STCP
STORE
SVC DUMP
SVC IN IT
SVC INTTERM

PAGEGETPAGEGET
PAGTRANS
PAGTR
PAGTR
PAGTR
PAGTRANSPAGTRANS
PLACE
PLACE
CONS INT
TMPSPACE
WRTCONSMR IO EXECPRIVLGEDPROGINTPLACEMRIOEXECCFSSPLQUEVIOCFSQRYQUEVIORDCONSRDS CANCPFILECFS COMIOERRORREC FREERECFREE
PROGINTUSE ROFFCFSSPLRESIN!'RES INTMRIOEXECCONS INTCONS INTCONSINTCONS INTSCANUNITUSE ROFFSAVECPSCHEDULESCHEDULESCREDATCFS SETCFSPRVCFS COM
CFSSPLCFSSPLCFSSPLSTCONSIOCFSDBGCFSDBGPSA
PSA
PSA
CFSSPL-343-

TMPERTN
TMPRET
TMPSPACE
TRACER
TRINI'T2311
UNLOCKUNPACKUNSTIOUNTRANSUSEROFFVERRORVIOEXECVIRA
VSERSCHVSMCPIR
VUNITSCAN
WAITPAGE
WNG'WRITTASKWRTCONSXFER

TMPSPACE
TMPSPACE
TMPSPACE
TRACER
TRACERTMPSPACE
CFSPRVPACKUNSTIO
UNI' RANSUSEROFFIOERRORVIOEXEC
VIOEXECVSERSCHCCWTRANSSCANUNITPAGTRANSCFS COMCPFILEWRTCONSCFSSPL

Obtaining ~ cross-Reference Chart of CP

I
I
I
I

To obtain a cross-reference chart of CP, run CP nucleus text
decks through the OS linkage editor, then run the OS utility
LMODMAP. This produces a cross-reference listing of all CP
control sections and entry points.

-344-

READER'S COMMENT FORM
Control Program-67 /Cambridge Monitor System(CP-67 /CMS) Version 3.1 PLM

GY20-0590-1

Please comment on the usefulness and readability of this publication, suggest additions anddeletions, and list specific errors and omissions (give page numbers). All comments and suggestions become the property of IBM. If you wish a reply, be sure to include your name and address.

COMMENTS

fold

fold

fold

fold

• Thank you for your cooperation. No postage necessary if mailed in the U.S.A.
FOLD ON TWO LINES, STAPLE AND MAIL.

GY20-0590-1

YOUR COMMENTS PLEASE •••Your comments on the other side of this form will help us improve future editions of this publication. Each reply will be carefully reviewed by the persons responsible for writing and publishing this material.

fold

fold

........................................................................................................

()

0

~

2.

FIRST CLASS"O

0PERMIT NO. 1359

~

"'3
Oi
-J

WHITE PLAINS, N. Y.

n
"'3
a:

g-

BUSINESS

REPLY

MAIL

~

s:

NO POSTAGE NECESSARY IF MAILED IN THE UNITED STATES

0

:i

;:+

Q
en

<

....
"'

POSTAGE WILL BE PAID BY ...

(!)

3

0"O

I BM Corporation

Oi

--s:
<
..
"'o·
-J

1133 Westchester Avenue()~

White Plains, N.Y. 10604(!)

Attention: Technicol Publicotions:i~.......................................................................................................
fold

"O

r

s:

..

"O

fold

3'
....
(!)

c.
:i

c

i:n

~

G'l

-<

"'6
0

$
~

•I

International Buainaaa Machin11 Corporation
Data Proceaaing Diviaion
1133 W11tch11ter Avenue, White Plaina, New York 10604[U.S.A. only]
I BM World Trade Corporation
821 United Nationa Plaza, New York, New York 10017[International]

"ti

r

s:

International Business Machines Corporation
Data Processing Division
1133 Westchester Avenue, White Plains, New York 10604(U.S.A. only)
IBM World Trade Corporation
821 United Nations Plaza, New York, New York 10017(International)

IBM®

Technical Newsletter

Base Puhl. No.

GY20-0590-1

This Newsletter No.
Date

GN20-2502

January 24, 1972

Previous Newsletter Nos.

None

Control Program - 67 /Cambridge Monitor System(CP-67 /CMS) Version 3.1
CP-67 Program Logic Manual
Program Number: 3600-05.2.005
This Technical Newsletter, a part of Version 3, Modification Level 1, of Control Program - 67 /Cambridge
Monitor System, provides replacement pages for the subject manual. These replacement pages remainin effect for subsequent versions and modifications unless specifically altered. Pages to be inserted
and/or removed are listed below.

1, 2
73, 74181, 182
207,208
223,224
239,240
339,340
Minor additions and changes have been made to provide program support information on the
IBM 3420 Magnetic Tape Unit.
A vertical rule in the left margin indicates that a change has been made to either text or illustration.
Please file this cover letter at the back of the manual to provide a record of changes.

IBM Corporation, Technical Publications Dept., 1133 Westchester Avenue, White Plains, N. Y. 10604
Printed in U.S.A.

.

(

SECTION 1: INTRODUCTION TO CP-67
CP-67 is a control Program designed for execution on an
IBM system/360 Model 67. Its objective is to create anenvironment in which many users can simultaneously perform
work and in which each user can perform his own work under
the supervision of the programming system of his choice. It
achieves its objective by generating a "virtual computer•for each user and by sharing the resources of the realcomputer (CPU time, main storage, etc.> among the virtualcomputers for all users that are concurrently logged into
the system.
When a user identifies himself from a terminal, theControl Program "creates• for his personal use a virtualcomputer from a predefined configuration.
(Before thesystem becomes available to users, the systems administrator
defines the configuration of each user's virtual machine.
He may define different configurations for different users.>
To the user, his virtual computer appears real and he uses
it as if it were. The Control Program also provides, as partof thevirtual computer, commands thatparallel thefunctions of the buttons and switches on an operator's
console. The user issues these commands from his terminal,
and, thus, the terminal becomes a pseudo-console for his
virtual machine.
After the control Program has created the virtualcomputer, the user equips it with the programming systemthat gives him the desired functional capabilities. He does
this by issuing a command from his terminal. CP-67 is
designed so that the user can run the programming system(for example, Operating System/360) of his choice on his
virtual computer. The user who desires a terminal-oriented,
conversational programming
system that allows
him todirectly monitor his work will choose CMS.

MACHINE CONFIGURATION
Devices Supported by CP-67
CP-67 is structured to run on an IBM System/360
The minimum machine configuration for CP-67 is:Model 67.

2067-1 or 2067-2 Processing Unit
Recommended feature:#4434 Floating Storage Addressing (Model 1 only>
2365
1052
1403

Processor storage
Printer-Keyboard Model 7
Printer- 1 -Page of GY20-0590-1
Revised January 24, 1972
By TNL GN20-2502

2540 Card Read Punch
3 2311 Disk storage Drives or 2314 Direct Access Storage
Facility (2 drives minimum)· I 2400 or 3420 Nine-Track Magnetic Tape Unit, 800 or 1600 bpi
2702 or 2703 Transmission Control or
2701 Data Adapter Unit
Terminals Supported by CP-67 as
Machine Operator's console
1051/1052 Model 1 or Model 2 Data communication System
Features and Specifications:
Data Set Attachment (#9114)
IBM Line Adapter (#4647)
Receive Interrupt (#6100 or RPQ E27428) required
Transmit Interrupt (#7900 or RPQ E26903) required
Text Time-out Suppression (#9698) required
1056

card Reader Model 32741-1,-2 Communication Terminals
Features and Specifications:
Data Set Attachment (#9114)
Data Set Attachment (#9115)
IBM Line Adapter (#4635, #4647)
Dial-Up (#3255) required
Receive Interrupt (#4708) required
Transmit Interrupt (#7900 or RPQ E40681)
Print Inhibit (#5501) desirable
Line control for teletypewriterwith the IBM Telegraph Terminal(8-level ASCII code at 110 bps).

requiredterminals <*> compatible
control Type II Adapter

Transmission Control Un~ts Supported
by CP-67
2701 Data Adapter Unit
Terminals
8-level A«>CII,
110 bps•2701 Adapter
7885

2702

Transmission Control
Terminal
Terminals
Control Base2741s, 1050
8-level ASCII,
110 bps•- 2 -9696 or 7935
9697 or 7935

Terminal
controlLine
Adapter

4615, 9684, 8200••
7912

3233
3233

Page of GY20-0S90-l
Revised January 24, 1972
By TNL GN20-2S02

type for the device>, a counter overflow error record iswritten. This error
may represent the failureof acompletely different channel program than the first error ofthis type which was recorded. If the error is neither the
first encountered nor a causeof a counter overflow
condition, control
returns to VIOINT, andthe error
information is reflected back to the user's virtual machine.
The I/O error record has the following 112-byte format:
LOGSNSELOGCODE

I

ORG
DS
DS

LOGDATA
CL6
CLl

DS

CLl

DS

CL6

DS

CL2

LOGTYPELOGVOLIDLO GADDRLOG DATE
LOGCSW
LOGCCWSLOGSKLOC

DS

lD

DS

CL6

DS

CL8

DS

CL2

DS

9D

DEFINE I/O ERROR RECORDSENSE INFORMATIONFIRST ENCOUNTERED OR COUNTEROVERFLOW - TYPE OF ERRORDEVICE TYPEVOLID OF DEVICE (IF AVAILABLE)
PHYSICAL ADDRESS OF DEVICEDATE AND TIME STAMP OF ERRORCHANNEL STATUS WORD
UNUSEDFAILING CCW STRING (UP TO NINEOOUBLEWORDS)LAST SEEK ADDRESS (DASD ONLY)

For a 3420 device type (LOGTYPE = X'C4') 24 bytes ofsense data are recorded. This is done by preserving the 24
sense bytes in the first 3 double words at LOGCCWS. The remaining 6 double words are used to contain the failing CCW
string, up to the last six CCW's only. The LOGSNSE field fora 3420 is not used.
The ccw in the string which failed isasterisk in the unused fifth byte.

flagged with an

After the error record is written, the pointer to thenext available slot on the CE cylinder is updated.. sevenlogical records are contained within one 829-byte physicalrecord. Since 15 records may be written on two tracks of a2314, up to 1050 error records may be written on one
cylinder. If the attempt to write the error record fails,
it is retried eight times. Upon continued failure, an error
message ••• IOERROR RECORDING FAILURE ON DEV• is sent to
the operator. If there is no more room on the CE cylinder
for error records, the message •••CECYL FULL; I/O ERRORS NOTRECORDED ••• is sent to the operator. Errors are notrecorded for users with privilege class c in order toprevent the recording of intentional errors produced by CE
diagnostics. Recording will be reinitiated after the CE
executes the CLEARIO function.
Main Dispatcher and Control Routine - DISPATCH
Entrance:
DISPATCH is entered from routines which havecompleted their processing fora user or cannot
continue processing until some other process has been
completed.
(See
Figure 10.1 for
DISPATCH module
processing.>-73-

Operation: DISPATCH checks for pending interruptions
determines which user is to receive control next.

andRoutines called:
When DISPATCH determines that an I/Ointerruptionispending,the
I/Ointerruption
unstacking routine (UNSTIO) is called. UNSTIO updates
the virtual csw, restores virtual PSW's, and indicatesthe address of the interrupting device.
When UNSTIO
processing is completed, DISPATCH attempts to restart
the current user, if runnable and if his quantum is not
exhausted.
DISPATCH may be entered at 4 locations: DISPATCH,
DSPI'CHA, DSPTCHB, and DSPTCHC.
DISPATCH is the normal
entry point used by all routines that are not sure of auser's status. DSPTCHA is entered from routines whichhave gained control after a program interrupt for auser and have changed the user's PSW.
DSPTCHB issimilar to DSPTCHA except the PSW is at most changed inits condition code field. DSP'.I'CHC is used by routines
which have done some processing for a user but in noway changed his status.
Figures '25-28' illustrate the relationships ofroutines which process an I/O interrupt returned from aselector channel device.

-74-

Page of GY20-0590-1
Revised January 24, 1972
By TNL GN20-2502

CP-67 DEVICE CODES
I

.•

'"'-

**********************************************************
CP-67 DEVICE TYPE CODES*************************************************************

TYP1052 EQU
TYP1050 EQU
TYP2250T EQU
TYP2260T EQU
TYP2741T EQU
TYP 1052T EQU
TYP2703T EQU
TYP2702T EQU
TYP2701T EQU
TYPI'T35T EQU
TYPTTY35 EQU
TYPI'IMER EQU
TYP1403 EQU
TYP2540P EQU
TYP2540R EQU
TYP2671 EQU
TYPRMPRT EQU
TYPRMPUN EQU
TYPM20EQU
TYP1800 EQU
TYP2311 EQU
TYP2314 EQU
TYP2302 EQU
TYP2321 EQU
TYP2301 EQU
TYP2303 EQU
TYP2250 EQU
TYP2260 EQU
TYP2400 EQU
TYP2404 EQU
TYP2402 EQU
TYP2403 EQU
TYP3420 EQU
TYP7340 EQU
TYP2701 EQU
TYP270l:j:. EQU
TYP2702L EQU
TYP2703L EQU
TYP2700L EQU
TYP2702D EQU

0
4
8
12
16
20
24
24
24
28
TY'PTT35T
44
48
52
60
64
X'44'
X'48'
96
100
128
132
136
140
144
148
180
184
192
192
192
192
196
204
208
208
208
208
208
212

MPX/2702

2741
1052

MDL 35 TELETYPESIMULATED CBRONOLOGREMOTE PRINTER READER
RF.MOTE PUNCH READER

GENERAL MAG TAPE

L IS A DEDICATED LINED IS A DIAL CONNECTED LINE*********************************************************-181-

CP-67 EQUATE PACKAGE - EQU67***************************************************************************
CP-67 EQUIVALENCE AND MACHINE DEFINITION PACKAGE**************************************************************************
BITS IN STANDARD PROGRAM STATUS WORD**
X' 01''PROBMODE EQU
PROBLEM MODE BIT.
WAIT
MCHEK
ASCII

EQU
EQU
EQU

*
*
*
MODE32

*
*
*

*

PCI
WLR
PRGC
PRTC

*
*
*CD

cc

SILI
SKIP
PCIF

*
*
*RCXIS-RCS UDO
RCUTICRCIO
RCGEN
RCDATA
RC02
-182-

X'04'
X'08'

WAIT BIT.
MACHINE CHECK.
ASCII BIT.

BIT ASSIGNMENTS IN EXTENDED PROGRAM STATUS WORD

EQU
TRANMODE EQUIOMASK
EQU
EXTMASK EQU

ATTN
SM
CUE
BUSY
CE
DE
UC
UE

X' 02'

X' 08'

X'04'

x•o2•

X'Ol'

24/32 ADDRESSING MODE BIT.
DYNAMIC TRANSLATION MODE BIT.
OVERALL I/O MASK BIT.
OVERALL EXTERNAL INTERRUPTION MASK BIT.

DEFINED BITS IN CHANNEL STATUS WORD
EQU
EQU
EQU
EQU
EQU
EQU
EQU
EQU
EQU
EQU
EQU
EQU

X'80'

X'40'
X'20'

X'10'
X' 08'x•oq•

X' 02"
X' 01'
X' 80'

X'40'
X'20'
X' 10'ATTENTION BIT.
STATUS MODIFIER BIT.
CONTROL UNIT END BIT.
BUSY BIT.
CHANNEL END BIT •DEVICE END BIT.
UNIT CHECK BIT •UNIT EXCEPTION BIT.
PROGRAM-CO~TROLLED INTERRUPT BIT.
WRONG-LENGTH-RECORD BIT.
CHANNEL PROGRAM CHECKCHANNEL PROTECTION CHECKFLAGS DEFINED IN CHANNEL COMMAND WORDS
EQU
EQU
EQU
EQU
EQU

X'80'

X'40'
X'20'

X''10'
X" 08''CHAIN DATA FLAG.
CHAIN COMMAND FLAG.
SUPPRESS INCORRECT LENGTH INDICATOR FLAG.
SUPPRESS TRANSFER OF INFORMATION.
PROGRAM-CONTROLLED-INTERRUPT FLAG.

FLAGS DEFINED IN FIFTH BYTE OF CCW TO AID CCW TRANSLATION
EQU
EQU
EQU
EQU
EQU
EQU
EQU

x'• 80 11
X' 40'
X' 20 11
X' 10''
X' 08'
X' 04'
X' 02'CHECK ISAM INDICATORPSEUDO 2311 INDICATORUNTRANSLATED TIC
I/O CCWCP GENERATED CCW
CP GENERATED CHAIN DATARESERVED FOR FUTURE USE

Page of GY20-0590-1
Revised January 24, 1972
By TNL GN20-2502

LOG I DATALOGIDATA is a description of therecords saved by CP-67 for I/O errors:
2

0

4

format of

the error

8

6

O+--------+--------+--------+--------+I
LOGSNSEI LOG I LOG I
I

ICODEITYPI

8+--------+--------+--------+--------+I
LOGVOLID
f LOGADDR I
16+--------+--------+--------+--------+I
LOGDATE!unused I
24+--------+--------+--------+--------+I
LOGCSWI
32+--------+--------+--------+--------+I
LOGCCWSI
104+--------+--------+--------+--------+I
LOGS KLOC
I
112+--------+--------+--------+--------+
where:LOGSNSE contains the six I/O sense bytes.
this field is unused.

For a 3420 device,

LOGCODE contains the type of I/O or channel error.
LOGTYPE is theoccurred.

type ofdevice uponwhich theerror

LOGVOLID is the volume serial number of the device uponwhich the error occurred (if known to CP).
LOGADDR
device.

isthechannel/unit address

of

the

erringLOGDATE contains the date and time of the error.
LOGCSW contains the channel status
the error.

word at the time of

LOGCCWS contains the failing CCW string (up to nine ccw•s. For
a 3420 device, the first 3 double words contain the 24 sense
bytes. The remaining 6 double words contain the failing CCW
string (up to 6 CCW 1 s).
LOGSKLOC contains the last seek address prior to the failure.

-207-

LOGMDATALOGMDATA is a description of the format ofrecords saved by CP-67 for machine checks:
0

2

6

the error

8

O+--------+--------+--------+--------+I
LOGMDATE
ILOGMCODEI
8+--------+--------+--------+--------+I
LOGMCPUI
184+--------+--------+--------+--------+I
LOGMPSW
I
224+--------+--------+--------+--------+I
LOGMGRSI LOGMCRS
I
352+--------+--------+--------+--------+I
LOGMFPRSI
384+--------+--------+--------+--------+
where:
LOGMDATE
check.

contains thedate andtimeof themachine

LOGMCODE contains the machine check code.
LOGMCPU contains the CPU logout data.
LOGMPSW contains the five old PSW's at the time of themachine check (external, SVC, program, machine check,and input-output>.
LOGMGRS contains the values of the general registers at
the time of the failure.
LOGMCRS contains the values of the extended
registers at the time of the failure.

control

LOGMFPRS contains the values of the floating
registers at the time of the failure .•

point

-208-

Page of GY20-0590-1
Revised January 24, 1972
By TNL GN20-2502

RD EV BLOK
There is one RDEVBLOK foris as follows:02each real device; its format
486+--------+--------+--------+--------+0 I
RDEVPNTRDEVCU+--------+--------+--------+--------+
8 IRDEVADD IR*l IR*21
RDEVTASK+--------+--------+--------+--------+
10
RVOLSERIRDEVCODEI+--------+--------+--------+--------+18 I
RDEVALLN
I RDEVERCT I RDEVSTAT I+--------+--------+--------+--------+20 I
RDEVUSER
IRATTVADDIR*3 IR*41~----~~--+--------+--------+--~-----tlc*olc*2 lc*3 Jc*4 lc*7

IRDEVTMONII (CONT) I

I+--------+--------+--------+--------+RDEVSEN

I+--------+--------+--------+--------t
I RDEVSEN = 24 SENSE BYTESI

I FOR 3420 RDEVBLOK ONLYI+--------+--------+--------+--------i
I
I(UNUSED)I
I·--------+--------+--------+--------+

where:RDEVPNI' is a pointer to the next device on the chain.
RDEVCU is a pointer to the real control unit.
RDEVADD is the real device
device portions only>.

address (control

unit andR*l - RDEVTYPE is the device type code.
R*2
RDECUPTH isdevice.
RDEVTASK isactive>.

thea pointer tocontrolunit path

for

this

the attached task

block (ifRVOLSER is the six-character EBCDIC volume
DASD volume and attached to the system).

label Cif

RDEVCODE is the halfword identification
into RDEVTABL) •RDEVALLN is
CP-owned).

the pointerto thenumber (index

allocation table(if

RDEVERCT is the error count for this device .•RDEVSTAT is the real device status:-223-

Page of GY20-0590-1
Revised January 24, 1972
By TNL GN20-2502

RDEVOWND X'80' indicates CP-owned volume CDASD
only).
RDEVATTD X'40' indicates dedicated Cnonshared)
device.
RDEVDED X' 20'
indicates channel, control unit,
and device block
dynamically created by
DEDICATE.
RDEVSEEK X'08' indicates a seek is in progress.
RDEVPOSD X'04' indicates 2311,2314 comb positioned
for next read/write operation.
RDEVSYS X'02' device attached to system.
RDEVUSER is the UTABLE pointer for(for dedicated devices>.
RATTVADD is the current user's
dedicated devices>.

the current

user

virtual address(for

R*3 - RDEVFTRReal device features. Used
dedicated communication lines SAD value.
R*4 - RDEVSLEN

to describe

device sense byte countC*O - conunand reject counterC*2 - busout parity error counterC*3 - equipment check counter
C*4 - data check counterC*7 - seek check (sense bit?, byteO) counter
RDEVTMONis 5 bytes for the attached time for a
dedicated device (MMDD~YHHMM)

RDEVSEN

contains the sense bytes for the device
following a unit check. Ail devices
except 3420 have only 6 sense bytes
maximum available. For 3420 devices,
the RDEVBLOK is generated with 3 more
double words at the end. The RDEVSEN
field is considered to be 24 bytes longfor 3420's with 6 unused bytes at the end.

-224-

VCUBLOK
There is one virtual control unit block
virtual control unit• its format is as follows:
0

2

for

6

8

the

virtualeach+--------+--------+--------+--------+VDEVLISTVCUPNT0+--------+--------+--------+--------+8I VCUADD IVDECOUNTI VCUSTATlxxxxxxxxl+--------+--------+--------+--------+
10 IVCUEUNITIVNPNDDEilxxxxxxxxxxxxxxxxxt+--------+--------+--------+--------+
where:VDEVLIST is
the pointer toconnected to this control unit.

devices

VCUPNI' is the pointer to the next virtual control unit
in the chain from the virtual channel.
VCUADD is the virtual control
or device included).

unit address <no channel

VDECOUNI' is the number of virtual devices attached.
/

VCUSTAT is the status of the virtual control unit• bit
definition is the same as the csw, byte q• for example,
BUSY=X' 10' •VCUEUNIT is the unit for which
condition, if any, is pending.

acontrol unit

end

VNPNDDEI is the number of pending device interruptions.
VDEVBLOK
There is a virtual device block for each virtual device
for each user in the system 0 its format is as follows:
0

2

6

8

+--------+--------+--------+--------+
0VDEVPNTIVDEVADD IV*l IV*2 I+--------+--------+--------+--------+
8
VPNTREALIVDEVREL IVDEVBND I+--------+--------+--------+--------+10 I
VDEVPOS+--------+--------+--------+--------+18 I
VDEVSNSE
1v•3 1v•q I+--------+----~---+--------+--------+-239-

Page of GY20-0590-1
Revised January 24, 1972
By TNL GN20-2502

where:VDEVPNT is the pointer to thefrom the control unit.

next device on the chain

VDEVADD is the virtual device address.
V*1 - VDEVSTAT is the virtual device status; bit definitionis the same as the
CSW,byte 4;for example,
BUSY=X'10', DE=X'04'.
V*2 - VDEVTYPE is the virtual device type code.
VPNTREAL is the real device control block corresponding
to this virtual device.
VDEVREL is the relocation factor within the real device
for the start of this virtual device <for DASD only>.
VDEVBND is the size of this virtual device (DASO only>.
VDEVPOS is the current
device (as BBCCHH).

virtual arm

position of

this

VDEVSNSE is the virtual
device sense information(filled when an error is detected on the virtual device
to save the conditions for shared devices.>
If the virtual device type is a dedicated 3420 tape (VDEVTYPE
then the function of VDEVSNSE is different.
Since the3420 provides 24 sense bytes, extra space is required to containthem. This is accomplished in the following manner. When aunit check occurs on the 3420, 3 double words are obtained fromCP FREE storage. The address of the 3 double work area forthe 24 sense bytes is saved in the word located at VDEVSNSE in
the VDEVBLOK. Once the sense data is presented to the virtual
machine through a virtual sense operation, the 3 double word
area is FRETed (in CCWTRAN). The function is repeated for further unit checks on the 3420 device.
= X'C4')V*3 - VDEVFLG contains miscellaneous device status bits:
TEMPDEV X'01' indicates a TDSK allocation
READONLY X'02' indicates read-only status
VSHARED X'04' reserved for future use
VDVENBL X'08' virtual 2702 line is enabled
VDVDIAL X'10' virtual 2702 line is in use
V*4 - VDEVSLEN is the sense byte count.

-240-

UPIOCNTUVIOCNI'
VMUSER1

VMUSER2
VMUSER3

VMUSER4VMSSIOVMPNCB
VMLINSVMCRDSVMPGRD•-pages read while in queue
virtual SIO countinstallation counter
installation counter
installation counter
installation counterselector channel SIO
spool cards punchedspool lines printed
spool cards read
pages read

DISPATCH
NUMUSERS - current logged in user count
MVIOEXEC

VMIO- total user MPX SIO count

QUEVIO

VIOCOUNI' - total user SIO count
RIOCOUNT - total CP SIO count

(

f

-339-

Page of GY20-0S 90-1
Revised January 24, 1972
By TNL GN20-2502

APPENDIX F:

CP-67 CONTROL BLOC:KS\,

T2311 or1314
00 AVAILABLE TEMP
08 ASSIGNED TEMP
01 PERM IUSERI SPACE
02 T DISK AVAILABLEOA T DISK ASSIGNED
04 ·DIRCETDRY AVAILOC=OIRECTORY ASSIGNED
Df..ENO
2301 &
0-RECAVAIL

I· REC ASSIGNED

c

0

~
•

T2311

~
•
~

2
PointerlORIXI

Pntr. to RDEVBLDK

.

.

r--

AllOC11tion• r--••f-J ,....]!

0...L
VCULIST

I

a VCHANADDIvcucouNT v·1J xxx v•2J xxx
VCEUNIT l VNPNDCUI xxxxxxxxxxxxxxxxx•

2
VO EV LISTl V~ECOUNT8

VCUADD10

VCUEUNITI

VCUST ATr--<•

4
SUBPDOL SIZE GROUP~IICALLERS Rl2

•

c l
•

,......

~•

2
RCHANPNT

10

6
RCULISTn·1J n·2

TASK LISTRCHCOND_l R*3 _l R*4

J RcucouNT

10

R"51 R"6lRESERVED~RDEVLISTRACTCHANI

RCUADD

R"1

l

---·
hlVALIN

RCUILOK

NEXT

j

'

,...!!
10

···1

l

RCNT

IOENT

l

···J •.,l

RADDR

SVCI LINK

L........2.

1

1

r-

NEXT

TASKRCUTASKRDEVRBYTE,-.!.Q.

TASK USER

18

TASKIRA

TP"'l lTASKPNT4~..r

UTAIU"i"t"......

lln....

I
ct"TUUROEVTASKTP

0loll:.. CfilTTASKMISC

L',........!£.
18
t-4

:111

4

6

MRDEVPNTMROEVADiij_ M•1l M•2

MUSER

MIRA

MROEVID

MT ASK··•I

MRPNTVIR

MROERRC~ M•4I M•s

8

h

~

2

I•DIVlllCT
IllATTVADO••

M·sIM·1} M·e}xxx

6

IOTASK.,

MRICAWl

•• I

cc

HH

JR JxxxSJ~

MVOEVADOJ u·1~l M•2
MVIDB

VFPR'S60

VP9N'"+-!~SEGTABLE

VMACHSIZ~

VCHSTARTVCHCOUNTI PENDl~GULOCKS lvMSTATUS

TIMEV.Sf:D

NEXTUSER~VTIMER...
IUTAIU

L;

•t-J

.i
NEXTCPRQ

1

Q

4~

•

.L

~·~

_j_

JSRETAOO

JSREGS

JSPARE3

I

90

OVTOT

USYSTAIVMXSTART

VMJtl'OINT

AO

JSf'ARE4

ROCOlllKG

I T

2NEXTCCWP

PljlftQCON

6

..!..

l

JSPARE lNU"4!WDCCW

I
CeYlllST•JOEVICE·~

CCllll'KG

l u·1lu·2

UICCKL

MVIJ;USER

20

••co

8

~
~
•
•
'
~
•• l cc

RECSTART)0

Pointer to nextl• Jc·~

2
Paintertonaxt•

R•1In-2 JcNu~oco

I

DATA

•

RECEUF

3111

UseridMRICAW2

CPROUESTSFILDK'"0OAT AP

CPEXNEXTREiGSAVEBADDRMRIFILEC•
48

MRIBUFFl•)

CPEXREGS

ACCT NGca

TIM1NO00

VTOTTIMEUVIOCNTNUMPAGEsJ PRIORIT

u·sI u·sl

J

UPIOtNTUCPCOMNOFO

TIMSTAMf'

F8

NXTQ

100

VMUSERl

VMUSER2

1ll8

VMUSERJ

VMUSER4

NEXTRTMR.L.

....)_IUSERINSTTRSW

VMPNCHVMSSICJVMLINSVMCRDSVMPGRDRESERVED•2~

IDTASK

20

MRICAW1..
60

MVINEXTMVICDUNTj

MVICCW

398

Temporary Snt Ar9'3AD

DATAPAC

OATAP

3CO
MVIRECS

6•"'

RESERVEDRESERVED

1~6q

UT ABLE

4

6

VCRO

I

VCR1

VCR14

I

VCR15

SHADVCROI

E·1I t·2 IcoPYPAGT'

COPYSEGT

I•

1

IMAGESGT

EXTUTU'"

448

f

TERMINAL l/D BUFFER

..i

PRVO

"'

J
MV!FILECCPEXMISCCPfXILOK~

lu·3Iv·•

TIMEON

140

8CPEXAODDNMPAGE132

OA:rADMRDEBLOK

SVC16 RELEASE'SVC20 GET SAVEAREAIAOEXTAB00

READERS)NCIOREOJ1.J··,I···I ..,I···UTREXT

CIOREQ

80 VMXCOUN1 SEGTBDSP08•USERIO~.

PAGTAILE

l\INUllOI

MVCSW
MVDEVIOHH

DAT AD

478

II

ftOEYllN • 14 . . . I.,._ hw 3420 ROIYIL.OIC only

l

40

iO

MVOEBLOK

4

2

~

470

ml PAGET ASLI: ADD RESS

l

8

6

t--1

IDIYITAT...•.,I..._. ·•4'

VG PR'S,,

6

M.VPNTRELID~

MRDCSWAD

4MVDEVPNTMRDEBLDK

SIZE

~

)

4

I

PAGE

lllDEVCODlTASKVADOTASKCAW...,.~ lxxxx

41

flDEVCU

1l

RUNUSER

-116

2

..r

l
•

_j_

4

"

.!1.

RMXSTART)

SVCl2 RETURN-340-• "'~11$• I

c

•

.L

c'O.Lc"2_lc•,_L c••_L c'J
ROIYlllM
ICQ1ITl J_

IOTASK48

svca ABEND/DUMP

2

NEXT

0

0

R11·UTABLE
R12·BASE
R13 • SAVEAREA

0
8

8
NEXT

l

SCNT

RCCWLIST

L--.!.

SIZE

TAOQR

VLIST
VCNT

•

6·

4

4

FREE LISTNEXT!Wtt« 111 $WT All.E EntryI

SWl'rBL PNTRD EVIL OK••

RECOROJy•3jy•4•VOi.ii•l RDECOUNTRCUTAIU

RCUTAlll•'

RDEY'ff'T

ftOIVADO j_R•1J ••2J

XXXXXXXXXXXXX

RTAILCNT

RCUSTAT

L....,

RCUPNT-LASTSAYE
0

HEM)

I

4

__1_

KIY2~

IWf'TAl~E

YOEVSNSE

•

•

•

2

~
,....!..

4•

Ji AVAIL SAYE AREASl•lEY 1 I00 •TASKLAST

RCHANAODI TASKCNT

0

,....

.l.

2

VPAGllO I
CYL

RD EV CODE

RCHSTART)RCHILOK

21 WORD REGISTER SA VEAREA
ar1dWORKARE A

0I

YDEVILOKSUBTABLECALLERS Rll

VDEVBND,.,YDEVPOS"VCUILOK0;+(·voEVADOVPNTREALVCHILOKSUBPOOL SIZE GROUP

RETURN ADDRESS

4VOEVPNT,....!,

lxxxxxXXK

xxxxxxxxxxxxxxxxx

VNPNODEI

VCHCSW~' v•1lv•2 •Jl VOEVflEL

20

6
VCIJPNT

ALLCC

24WOROSI•VCHANPNT

18··~

NEXTSAVE

NEXT

L
10

~

07-FF REC 110S•

MVllUFF•