TOPS 20_Monitor_Field_Service_Training_1979 20 Monitor Field Service Training 1979

TOPS-20_Monitor_Field_Service_Training_1979 TOPS-20_Monitor_Field_Service_Training_1979

User Manual: TOPS-20_Monitor_Field_Service_Training_1979

Open the PDF directly: View PDF PDF.
Page Count: 865

DownloadTOPS-20_Monitor_Field_Service_Training_1979 TOPS-20 Monitor Field Service Training 1979
Open PDF In BrowserView PDF
TOPS-20 MONITOR
Course Number: J 1183-A

Educational Services
Digital Equipment Corporation
Marl boro, Massachusetts

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR

Copyright © 1979 by Digital Equipment Corporation

The material in this document is for
informational
purposes a~d is subject to change without notice;
it should
not be construed as a commitment by Digital Equipment
Corporation.
Digital
Equipment Corporation assumes no
responsibility for any errors that may appear in this
document.
The software described in this document is furnished
under a license and may only be used or copied in accordance
with the terms of such
license.
Digital
Equipment
Corporation
assumes no responsibility for the use or
reliability of its software on equipment that is not
supplied ,by Digital or its affiliated companies.
The following
are
trademarks
of
Corporation, Maynard, Massachusetts:
COMPUTER LABS
DBMS-II
DEC
DECSYSTEM-20
OIBOL
FLIPCHIP
LAB-8
-OS/8
RSTS
TYPESET-10
UNIBUS

COMTEX
DSMS-20
DECCOMM
DECtape
DIGITAL
FOCAL
MASSB US
PDP
RSX
TYPESET-II
DECSYSTEM-2020

Dig i tal

Equi pment

DBMS-10
DDT
DECsystem-10
DECUS
EDUSYSTEM
INDAC
OMNIBUS
PHA
TYPESET-8
TYPESET-20

«For Internal Use Only»

TOPS-20 MONITOR

DIGITAL

NOTE

The material in this course is intended
for
internal
use
only by Digital
personnel. The material in this course
is not to be duplicated nor distributed
to customers or prospective customers.

i

«For Internal Use Only»

TOPS-20 MONITOR

DIGITAL

This page is for notes.

ii

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR

CONTENTS

Student Gu ide •••••••••

• • SG

Software In t rod uc t ion

• SI

Moni tor Overv iew

.MO

Coding Conventions

.CC

....... . . ... ....... .... ...... . . ... .SER
Troubleshooting ... ......... .. . ...... .... •• TS
PHYS 10 - Disk / Tape ...... .... . . . . .. ... .. .DT
Front End/Term inal s . ... . . . . . ........ ... . . .FE
SYSERR

Storage Management ••••••••••••••••••••••• • 8M

Monitor Logic

. . .. . . . . . . . . . . . . . . . . . . . . . . . . . .
Manual . .. . . . .. .. . . . . .. . .. .

Mi sc ell aneo us

.MIS

Appendix

.APP

Monitor Tables

I

Appendix II

. . .. .. . . .. .. . . ... . .. . ... . . .. . . . .
~

Appendix III

iii

«For Internal Use Only»

TOl?S-2QJ MONITOR

DIGITAL

iv

«For Internal Use Only»

TOPS-20 MON ITOR
Student Guide

DIGITAL

TOPS-20 MONITOR
Student Guide

CONTENTS
Course Description

. ............. .. .. ••••• SG-l

Prerequisites •••••••••••••••••••••••••••• SG-l
Course Objectives •••••••••••••••••••••••• SG-l

............. ................ ••• SG-2
Ou tl ine ......... . . . . . . . . . . . . . . . . •• SG-3
Evaluation Form
... ............ •• SG-9

Resources
Co ur se
Course

Appendix A - Course Map •••••••••••••••••• SG-13

SG-i

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Student Guide

This page is for notes.

SG-ii

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Student Guide

COURSE DESCRIPTION

This course is addressed to regional and district
support personnel and is designed to help in their task of
determining and isolating system faults occurring in the
TOPS-20
operating
system.
The
approach focuses on
troubleshooting,
fault-finding,
and
error
analysis.
Following an overview of the major monitor structures and
coding conventions is a general discussion of debugging
techniques, including the BUGHLT features of the TOPS-20
system.
Several of the available tools
are
covered
thereafter, for example, MDDT and SYSERR. The remainder of
the course is devoted to the main functions of TOPS-20.

PREREQUISITES

The regional or district support specialist is expected
to have completed the courses leading to the the Diagnostics
course in this curriculum, including Software Concepts, ALP,
and Specialist.

COURSE OBJECTIVES

Upon completion of this course,
able to:

the

student

will

be

1.

Describe how the monitor drives the hardware and,

2.

Compare this to the way the diagnostics drive it.

3.

Identify the portions of the data base related to a
given problem and,

SG-l

«For Internql Use Only»

DIGITAL

TOPS-20 MONITOR
Student Guide

4.

Use FILDDT to examine these parts of the monitor's
data base to extract information related to the
problem.

5.

U$e (or create) the tools to determine which of the
devices are causing system problems (even when the
diagnostics identify none) •

6.

Determine
hardwa re.

what

is/was

happening

with/to

the

COURSE RESOURCES

Each student should be given a copy of:
1.

The course materials book incl ud ing:

1.

The Student Guide

2.

The Modules

3.

The Moni tor Tables

4.

The Moni tor Log ic Manual

2.

DECsystem-10/DECSYSTEM-20 Hardware Reference Manual

3.

TOPS-10 and TOPS-20 SYSERR Manual

4.

TOPS-20 Microfiche Assembly Listing

SG-2

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Student Guide

COURSE OUTLINE

Software Introduction
I.

II.

Review of Operating System Principles
A.
Approaches
B.
Functions
1.
Sched ul ing
2.
Storage Management
C.

Virtual Memory
1.
Pag ing

D.
E.
F•

Fi 1 e System
Interrupt Handling
Accounting

TOPS-20 Hardware/Software Interface
A.
Virtual Address Translation - General
B.
User Page Map
C.
Hardware Page Table - Addressing
D.
Pointer Types
E.
Stor ag e Add resses
F.
KL Pag ing
G.
Process Overhead Pag es
H.
Special/Shared Page Tahle (SPT)
I.
Summary of Paging

Moni tor Overv iew
I•
II.
III.

IV.

Mo n i to r Ca 11 s
Storage Management
A.
Block Diagram
Pager
A.
Hierarchical Storage Considerations
B.
Implementation - Mapping
C.
Inter-Level Da ta Flow
D.
Updating Lower Levels
Scheduler

SG-3

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Student Guide

V.

File System
A.
Data Structure

VI.

Job/Fork Structure

VII.

VIII.

IX.

Disk And Magtape Service
A.
Hardware Principles
B • Mo n i to r Mo d u1 e s
C.
I/O Requests
Front End Service
A.
TTY Input
B.
TTY Line Buffers And Echoing
C.
Line Printer Output
Appendices

Coding Conventions
I.

Us ing MACSYM
A.
Symbol Definitions
B. Macros To Manipulate Field Masks
C. Instructions Using Field Masks
D.
DEFSTR -- MSKSTR Data Structure Facilities
1.
LOAD
2.
STOR
3.
Examples
E.
F.
G.

II.

I I I.

Subroutine Conventions
Named Variable Facilities
Miscellaneous

TOPS-20 Coding Standards
A.
Subroutine' Calling - JSYS
B. Subroutine Calling
C. AC Definitions
D. AC Saving and Restoration
E.
Subroutine Documentation
F. Multi-line Literals
G.
Numbers
Append ices

SG-4

«For Internal Use Only»

TOPS-20 MONITOR
Student Guide

DIGITAL

SYSF.RR
I.

II.

The SYSERR Program
A.
Running the SYSERR Program
B.
Examples of SYSERR Output
SYSERR Module Internals
A.
SYSERR Block format
1.
He ader
2.
Da ta
B.
C.
D.

Creating a SYSERR Entry
The Job 0 SYSERR Task
The SYSERR JSYS

Tro ubleshoot ing
I.

II.

III.

IV.

CTY Output
A.
Explanation of KLERR Output
B. Sample KLERR Output
Getting a DUMP
A. How To Get a Dump
B.
Where ROOT Land s
SYSERR
A.
Overview of SYSERR Functions and Data Base
B.
Queued SYSERR Blocks In A Crash
C.
Moving SYSERR Blocks From·~ Crash To ERROR.SYS
BUGHLT
A.
BUG Macro
B. BUGHLT Contents

V.

Push Down Lists And Related Data BaSes
A.
How To Look At a Stack
B.
Push Down List / Machine State
C • S t a c k Usa 9 e Fo r Lo c a I S tor ag e
D. Stack Adjustment

VI.

Machine States and Relevant Data Bases
A.
PC Storage
B.
AC Storage

SG-5

«For Internal Use Only»

DIGITAL

c.
D.
E.
F.
G.
H.
VII.

TOPS-20 MONITOR
Student Guide
Fork Scheduled, Or Not
Fork NOSKED
Extended vs. Non-extended Addressing
Sizes (Resident, Non-resident, Total)
M.DDT Pag e
Relevant Data Base for Each Machine State

DDT's
A.
FILDDT
B.
Relevant DDT/FILDDT Commands
C. MDDT
D.
EDDT

PHYSIO - Disk/Tape
I.

II.

Ill.

IV.

PHYSIO
A.
Data Structure
B.
Que ue ing an IORB
C.
Scheduling an IORB
D • . Starting I/O
E.
Interrupt Handling
Disk Allocation
A.
Data Structure (DSKBTTBL)
B.
Space allocation
C.
Space Deallocation
D.
Drum Allocation
E.
BAT Blocks
DISK Dependent I/O
A.
Data Structure
B. Disk-Dependent Code
C. Disk Interrupts
D.
Disk Errors and Abnormal Conditions
MAGTAPE Dependent I/O
A. Magtape Data Base
B. Mag tape IORB
C.
CDB, KOB, and UDB
D.
Interface to PHYSIO
E.
Magtape I/O Wait
F.
CLOSF Device-Dependent Functions
G.
Magtape Interrupts
H.
Error and Abnormal Conditions

SG-6

«For Internal Use Only»

DIGITAL

TOPS-20M ONITOR
Student Guide

Front End/Terminals
I.

II.

TTY/PTY Device-Dependent Code
A.
TTY Data Base
B. TTYIN - TTY-Dependent Input
C. TTYOUT - TTY-Dependent Output
D.
TTCH7 - 20 ms. Overhead Task
DTE
A.
B.
C.

Device-Dependent TTY Code
DTE Data Base
DTE Terminal Output
DTE Interrupts

Stor age Manag ement
I.

II.

Storage Management
A.
Introd uction
B. Data Structures
C.
CST Tabl es
D.
SPT and Parallel Tables
E. Working Set Management
F. System-Wide Page Management
G.
Page Faulting
H.
Adjustment Of the Balance Set
I.
SWPIN and SWPOUT
~JSB/PSB

A.
B.

c.
D.

Space
Context switching the
JSB and PSB Maps
Use of JSB Space
Use of PSS Space

SG-7

~JSB

and PSB

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Student Guide

This page is for notes.

SG-8

«For Internal Use Only»

DIGITAL

TQPS-20 MONITOR
Student Guide

COURSE EVALUATION FORM
After finishing the course, please complete and
this form to the course instructor.

return

Additional comments, whether they deal with a
specific
question on the evaluation or are of a general nature, are
most helpful to Digital in improving cours~s.
1.

The most valuable aspect of this course was •••

2.

The least valuable aspect of this course was •••

3.

If you were to add or delete material
the course, what would it be? Why?

Please make any additional comments you
page.

SG-9

wish

to

on

or

from

the

next

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Student Guide

Additional ~omments:

SG-10

«For Internal Use Only»

TOPS-20 MONITOR
Student Guide

DIGITAL

COURSE EVALUATION (cont.)

For each module and question intersection in, the grid
below, insert a number from 1 to 5, where 1 indicates "very
little" or "poor" and 5
indicates
"very
much"
or
" ex c ell en t " •

Modul es:
S

Questions:

A

S MC E T D F S L

I 0

C

R S T

E

ML

My effort
Demand on my time
Content matched my need to know
Learning objectives met
Reference mater ial s
Mod ul e exerci ses
Mod ul e labs
Modul e test
Enough time to cover material
Did modul e stimulate ideas?
Overall quality
Did I meet prerequisites?
~To

uld I recommend this cour se?

SG-ll

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR

Student Guide

SG-12

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Student Guide

APPENDIX A
COURSE MAP

MR-2717

SG-13

«For Internal Use Only»

TOPS-20 MONITOR
Student Guide

DIGITAL

This page is for notes.

SG-14

«For Internal Use Only»

TOPS-20 MONITOR
Software Introduction

«For Internal Use Only»

TOPS-20 MONITOR
Software Introduction

DIGITAL

COURSE MAP

MR-2717

SI-i

«For Internal Use Only»

TOPS-20 MONITOR
Software Introduction

DIGITAL

This page is for notes.

SI-ii

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Software Introduction

Software Introduction
--------INTRODUCTION - - - - - - - - - .

Over the years the operating system has
evolved into what some people say is the
most complex piece of software ever devised.
However,
it
is not fair to speak of
operating systems only in terms of software
because today hardware is often designed
with particular aspects of the operating
system in mind.
The operating system acts
as
the
interface between the computer user and the
hardware.
The system must perform many
tasks
including
multiprogramming,
scheduling,
memory
management,
file
management, spooling, and device handling.
In so doing, the operating system provides
various services to computer users. Several
types of operating
systems
have
been
developed to handle different user needs.
These include batch, timesharing, and real
time systems.
This module briefly reviews the various
types of operating systems and the functions
they perform. The emphasis, however, will
be on time-sharing systems such as TOPS-20.
Many functions will be related directly to
hardware
features
(such
as
address
translation and device handling) to give you
a feel for the operating system's role in
relation to the hardware.
TOPS-20 virtual
address
translation will be covered in
d eta i I i nth ism od ul e.
The operating system not only serves
the users and controls the hardware, it also
detects and reports error conditions in the
machine. To understand what caused an error
which is reported by the operating system
reports,
you
must understand what the
operating system expects of the machine.

SI-1

«For Internal Use Only»

TOPS-20 MONITOR
Software Introduction

DIGITAL

. - - - - - - - LEARNING OBJECTIVES - - - - - - - .

Upon completion of
student will be able to:

this

module,

ph i 1 0 so ph i e s
0 f
bat c h ,
and real-time operating

1•

Discuss the
timesharing,
systems.

2.

Describe the following functions
operating system:

3.

1.

Sched ul ing

2.

Fi 1 e

3.

Memory management

4.

Device handling

5.

Accounting

0

the

of

an

r g an i z a t ion

Describe the functions
actions
performed by,
portions of the virtual
system:

of, and
the
the following
memory pag ing

1.

The Microcode

2.

A Pag e Map

3.

The Hardware Page Table

4.

The Three Pointer Types

5.

Storage Addresses

6.

The Base Registers

7.

The Special/Shared Page Table (SPT)

8.

The User
Tables

and

8I-2

Executive

Process

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Software Introduction
MODULE OUTLINE

Software Introd uc tion
I.

II.

Review of Operating System Principles
A. Approaches
B. Functions
1. Sched ul ing
2. Storage Management

c.

Virtual Memory
1. Paging

D.
E.
F.

File System
Interrupt Handling
Accounting

TOPS-20 Hardware/Software Interface
A. Virtual Address Translation - General
B • Use r P ag e Ma p
C. Hardware Page Table - AddresSing
D. Pointer Types
E. Storage Addresses
F. KL Pag ing
G. Process Overhead Pages
H. Special/Shared Page Table (SPT)
I. Summary of Paging

8I-3

«For Internal Use Only»

TOPS-20 MONITOR
Software Introduction

DlGITAL

This page is for notes.

8I-4

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Software Introduction

REVIEW OF OPERATING SYSTEM PRINCIPLES
An operating system can be summarized as a manager of
resources.
These resources consist of the processor, the
memory, disk storage, and
the attached devices.
The
operating
system must give some portion of these resources
to each process that runs on the machine;
it must schedule
the use of these resources when several processes are
competing for them and collect them when a process is
finished.
SMALL SYSTEMS
A small operating system provides basic services for
the user's programs. These include device handling routines
and a
simple scheduling approach
(the
allocation
of
resources may simply consist of giving everything to the
executing process). The number of devices supported is
usually small and the variety of devices is restricted.
LARGE SYSTEMS
A large operating system provides a wide range of
services to the uper.
A sophisticated scheduler is used
with resources shared or divided among several active
processes. Protection for the system is substantial and the
accounting keeps track of nearly everything. A large number
of various devices are supported with a sophisticated file
manipulation capability built in.
Network communications
between computers are often supported.
There is no clear dividing line between large and small
systems.
Almost
any operating
system may have some
attributes which are characteristic of larger systems and
some
which are not.
Both TOPS-10 and TOPS-20 would
generally be considered large systems.

SI-5

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Software Introduction

.Approaches
In addition to coming in different sizes, operating
systems have various philosophies on the treatment of users
and on the processing of jobs. The variety of philosophies
results from computer users' differing ideas on what to do
with a computer and varied types of processing, each making
different demands ori processors. Some users want a system
capable of reasonable turnaround time on jobs that require a
great deal of input or output (I/O bound) or require long
arithmetic processing
(compute bound).
Others want
a
computer system designed to service a large number of
concurrent users in an interactive environment.
Still
others want a system to use as a command and control device
to regulate machinery and respond to changing situations
when reaction time is limited.
BATCH
A batch operating system consists of three components:
spooling
system,
scheduler,
and
dispatcher.
These
components work together to get a user
job through the
system.
In an operating system that combines batch and
timesharing, as in TOPS-10 and TOPS-20, these components are
slightly modified and not very distinct. The batch system
for these two operating systems is called Galaxy.
TIMESHARING
A timesharing operating system is designed to give
service to a considerable number of users at the same time.
The object is to allow these users quick and frequent
interaction with the computer in such a way that each user
has the illusion of having the exclusive attention of the
whole system.
Since one processor cannot actually be
handling more than one user
job at a
time, a service
approach very different from that of a batch system must be
used to produce this illusion. Time is shared, that is,
instead of allowing a few users to monopolize the processor
for long periods of time as might happen under batch, each
user is given a small amount of time on a regular basis.
The amount of time is called a time slice.
If a strict

SI-6

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Software Introduction

rotation of users is followed and there are N users, each
user gets the processor l/Nth of the time.
This situation
is referred to as round-robin processing.

81-7

«For Internal Use Only»

tj
H
G)
H

8

)1/

J:""l

Memory

Tl :

Terminal 1
Terminal 2

"
"

"
"

'I

/I

T4

----'

------t-~IMemoryl

Terminal N

I

_I

L 1 -- r

T2 :
I
----I

Sched-

I

uler

Tn

I

I

-_-

Terminal K

T3

r-- ---

Tk

Printer

-L..I- - - - J .

Cf)
H

I

co

/\
/\
t'1j

o

Current ~
job pointer ~

Output
Processor

Unspooler

1"'1

Cf)

o

H

::s

I'"h
c1"

c1"
CD

~

1"'1

OJ

::s

M8 0227

OJ

1'18
(1)0

~

"tI
HCf)

::s

c:::
en

CD

o

I

c1"N

Figure SI-1. Timesharing Operating System

I"'1ISl

o

0.3:

::s

co

'<
v

rtH

~

v

OZ

....·8
00

::s:o

DIGITAL

TOPS-20 MONITOR
Software Introduction

A large timesharing system necessarily requires a great
deal
of overhead, due to the fact that the system is
performing so many functions
for a large
number
of
concurrent users. Their jobs may be short but that does not
mean they are small.
Memory management is
a
prime
consideration with many users on the system. Changing from
job to job, accounting, and communications between jobs all
require time and space.
Consequently,
few timesharing
systems can support a large number of users without visibly
d eg r ad ed res po ns e tim e •
Both TOPS-10 and TOPS-20 are principally timesharing
operating systems. The Galaxy batch control system is added
to form a hybrid system.
On TOPS-20 and TOPS-10, batch jobs
are treated the same as timesharing
jobs (with a few
restrictions) as far as the operating system is concerned.
In order to enable the operating system to treat the
batch jobs in a manner similar to timesharing users, TOPS-10
and TOPS-20 set up pseudo-terminals (PTYs) for them to use.
These are software simulations of terminals which the
operating system treats much like real terminals. By using
the pseudo-terminals, the commands in the control file can
be handled in the same way as those typed at a
real
terminal.
With a batch job, the complete text of the
session is maintained in a log file for future reference by
the programmer.

8I-9

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Software Int rod uction

..,
~

C)

0
..J

CI)

..,0 ..--

a
co

0

::E

~u.

CI)

u:

00
N
N

+I
I

I

...0

en
en
CI)

CJ

...
0

Q.

,~

-

.............

...... .,..

-

...

CI)
~

"'C

CI)

.I:

CJ

en

•
I
I

o

;;

CI)

oCu.

o

SI-10

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Software Introduction

REAL TIME
A real time system can be organized in a manner similar
to
a
timesharing system.
However, there is one big
difference -- the response time for the system cannot be
allowed to degrade.
Inputs to the system can be scanned in
a
round-robin-like
arrangement
as
with
timesharing;
however,
responses must be short. The processor cannot be
tied up by any particular job for so long that processing
needs of other jobs are not met.
When real time systems are combined with batch or
regular timesharing, the real time functions must always be
given priority. The operating system must maintain control
if it is to provide continued service to all users.
Necessarily then, the operating system must protect itself
from the users and all users from each other.
OPERATION MODES
A simple way to protect the operating system from users
is to have more than one operation mode. TOPS-l~ and
TOPS-20 have two modes:
EXECUTIVE mode and USER mode. Only
the operating system may run in executive mode and, as such,
it can issue any instruction which the machine is capable of
executing.
All users run
in user mode and must request
certain actions to be done for them by the operating system.
Only certain monitor calls and context switching require
executive mode.
Functions

MEMORY ALLOCATION
One of the problems with maintaining several
jobs at
once is managing the memory. Since jobs vary greatly in
size, there is a problem in fitting each into a fixed size
memory. In scheduling the job to be run, the scheduler must
determine if there is available space. One way of handling
the allocation of memory is to force jobs to use memory in
fixed size units called pages. Under this scheme, memory is
divided into pages (each with the same number of contiguous
words) and the allocation for each job is a number of pages.

SI-ll

«For Internal Use Only»

TOPS-20 MONITOR
Software Introduqtion

DIGITAL

On TOPS-20, for example, a page consists of 512.

words.

~CHEDULING

A portion of an operating system is its scheduler(s).
The use of all resources in the system must be scheduled and
these schedules are interrelated. On TOPS-20 a job may be
composed of several processes (forks) and it is these
processes which are scheduled.
PROCESS STATES
Processes can be placed
into
three
categories:
running, ready, and blocked. The running process is the one
currently executing on the processor;
for each processor
there is only one running process.
A ready process is one tha t can be run but is not
executing at the moment. Ready processes are those which
have all their currently required resources ready.
This
implies that memory is allocated to them and devices
assigned. There are usually a number of ready processes
from which the running process is chosen.
A blocked process is one that has some or all of its
resources but still requires something before it can be
considered ready.
The most frequent reason for being
blocked is an I/O WAIT (i.e., the process is waiting for
input or output to occur) •

SI-12

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Software Introduction

Running

Blocked

Ready

,,

/
/
/

,,

/

/

"

/

""

;'

"

./

"

M8 0233

- - - -"- - - --- --Suspended by

User

Figure SI-3. Process State Transitions

SI-13

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Software Introduction

TOPS-20 uses the term Balance Set to refer to a group
of processes
(initially selected from the group of ready
processes) which include the running process, some of the
ready processes, and possibly some blocked processes. The
group is called "balance" set because an attempt is made to
balance the usage of physical memory with the needs of all
the processes trying to use the processor.
The blocked
processes in the balance set are waiting for disk I/O and
are included because they will be blocked for only a short
time.
The TOPS-20 scheduler selects the process to be run
in the next time slice from among the processes in the
balance set.
STORAGE MANAGEMENT

We have already discussed some of the problems of
storage 'management connected with memory allocation and the
restriction of a user's addressing capabilities. One way to
solve or simplify many of these problems is to use virtual
memory.

Virtual Memory
To understand virtual memory, we must look at the
address space of a process. The address space is the size
of physical memory (number of locations)
which can be
addressed
uSlng the machine instructions. The size of the
address space is thus primarily dependent on the number of
bits
in
the address portion of an instruction.
On
DECsystem-10 and DECSYSTEM-20 the address portion of an
instruction, when used to access physical memory, is 18 bits
long.
Extended addressing adds 5 bits.
Thus, 2**23, or
8388608, locations can be addressed.
The usual size of
physical memory is 256K or 512K.
This virtual address capability is independent of
programs.
Thus, the virtual memory can be considerably
larger than the physical memory. Programs can be compiled
o r a s sem bl ed and 1 inked as tho ug h the en t ire vir t ua 1 mem 0 ry
were available to each program. However, the loading of an
entire program would be a problem because each program
currently scheduled to use memory would have addresses
ranging from zero to the size of the program (but there is
only one address zero in physical memory).

SI-14

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Software Introduction

One way to overcome this problem is
to
modify
(relocate)
each of the addresses according to its location
in physical memory. Another solution to the loading problem
is to use a mapping function to relate the virtual memory
addresses ,within the executable module to the physical
memory addresses.
Instructions can only be executed when
they are in physical memory. Consequently, the mapping must
be applied to each instruction as it is executed. This
mapping can be done with hardware assistance using process
tables so that all programs can appear to begin at address
zero.
There are several
advantages in employing virtual
memory address translation.
Fjrst, virtual memory does not
need to be mapped into contiguous sections of physical
memory.
If physical and virtual memory are both divided
into pages, the virtual memory pages of a program can be
mapped into pages scattered throughout physical memory.

«For Internal Use Only»

DIGITAL

TOP5-20 MONITOR

So f twa reI n t ro d uc t ion

'"

1

2

3

4

fo

fo

ft

fo

~

ft

fi

Mapping

Program in
Virtual Memory

Real Memory

(fi' represents an unused page.)

M8 0232

Figure 81-4. Virtual Memory Mapping

51-If)

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Software Introduction

Second, only those pages of the program that are
actually needed for execution have to be in physical memory.
When more pages are needed, they can be placed anywhere, and
when some pages are no longer needed, they can be removed.
lNhen a removed pag e needs to be in physical memory ag ain, it
can be placed anywhere. The address translation associated
with virtual memory results in the program being executed as
though the whole virtual memory were real, physical memory.
TOPS-10 and TOPS-20 both have virtual memory as an
integral part of their operating systems. Each process has
its own page table set up by the operating system and used
by the hardware to translate virtual memory references into
physical memory locations.
However,
the management of
memory at the logical level in the two systems is quite
different, TOPS-20 employs demand paging, whereas TOPS-l0
uses swapping.
PAGING

The use of virtual memory with paging
requires an
effort to keep track of where the various pages of a process
are. Some pages may be in physical memory, others on disk.
When the process references a page that is not in physical
memory, it must be fetched from the disk and placed into a
free page frame in physical memory. The referencing of a
non-resident page is referred
to as a page fault.
The
detection of a page fault and the retrieval of the page are
handled by the hardware
(using the page table)
and the
operating system wo rking together.

SI-17

«For Internal Use Only»

t1

H
G)
H
~

):II

t"'

Requested
Page
Load into

Cf)
H

l1li

.......

\

I

I-'

00

,

I

I

Page Map
A
A

'(J
'"'"

Real Memory

./

Change Pointer

Page map points to disk

~

OJ

(Blank page in real memory is free.)

en

CD

o

::1

I-'

'<
v

v

:e:OJ
~

t-3

CDO
."
HCf)

I-'

c

Cf)

o

rt'

::1

::1

M8 0234

H\

H

rt'
CD

Disk

,/

::1

Figure SI-5. Page Fault Action

I

rt'~
~Sl

o
~3:
c: 0
o Z
rt'H

I-'.~

00
::1 ::0

TOPS-20 MONITOR
Software Introduction

DIGITAL

Virtual memory lends itself easily to the sharing of
physical memory among processes. All that is necessary for
two processes to share physical memory is for their page
tables to map some virtual page to the same physical memory
page. Since the use of sharing takes place dynamically (as
the processes run), the operating system has to set up the
sharing. The operating system fills in the page table entry
and adjusts the physical memory usage statistics to show the
pag e is shared.
A full presentation of TOPS-20 paging appears later
thi s modul e.

in

File System
The operating system maintains a list of all users of
the system by directory name.
This list is kept in a system
directory which, on TOPS-20, is called ROOT-DIRECTORY.
For
each user in the system directory, there is a pointer to an
index block for the user's directory.
This index block
consists of pointers to the various pages of the user's
directory which are on disk.
In the directory there is a
fi~e
descriptor block for each file specifying owner,
protection, date of creation, etc.
The storage of files is similar to that of user
directories in that each file in the directory has a pointer
to an index block. This index block contains pointers to
the pages of the file, which may be scattered anywhere on
the disk.
It the file is so large that all the pointers to
the pages will not fit into one index block, two levels of
indexing can be used. With two levels of index blocks, the
directory entry points to a super index block which contains
pointers to index blocks.

81-19

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Software Introduction

Ln
M

Q)

-

N

LL.

a

0

co

(/)

:E:

Q)
c::J)

CO

a.

)(
Q)

"C

C

Q)

~
(J

0

0

~

m

CI)

Q,.-

....0

LL.

c

0

~

LA:

...

i

:::l

>
...
0

~

(J
Q)

...

c

co
U)

Q)
c::J)

ta

a.

9

en
en

§


...

!
,~

LL.

0

0

m

~

(J

Q)

...

)(
Q)

C

"C

C

>
...

o

~

(.)
Q)

...

C

...o

o
a:

SI-20

«For Internal Use Only»

TOPS-20 MONITOR
So f t wa reI n t ro d uc t ion

DIGITAL

Interrupt Handling

THE INTERRUPT SYSTEM
The operating system must control and provide service
to a wide variety of peripheral devices. Each of these
devices interrupts the processor whenever· it requires some
service or has completed some action. Thus, the operating
system can be bombarded with interrupts.
When several devices are competing for the processor's
attention, the physical arrangement of the devices and their
relative importance determines which device 'gets serviced
first.
Interrupt priorities are assigned to each device.
The occurrence of multiple service requests is not an
uncommon
event;
however,
the
different
priorities
immediately resolve these conflicts.
Figure 8I-7 shows how normal processing
can
be
suspended to service interrupts on several levels. Higher
priority interrupts disrupt service to lower priority ones
and lower priority interrupts must wait for the completion
of higher priority interrupts.

8I-21

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Software Introduction

r

-

~
'C

0
'i:

.--N

a.
.....
en

.--(¥)

j

CD

~

...

:r:

...
'8s

m
c

..
0..
..
!
-,~
.
0-

::::s

c

~N
~~

0

'C

a.
'"i"

en
!

~

u:
~(¥)

...>

'':::
0

'':::
Go

...

N

(¥)

~

CD

.....
e.G)

~

::::s

CJ

..... c
c 0

-ca ,c

..E
0

2

G)

..
0

Q.

8I-22

..

>

G)

Q;...J

-

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Software Introduction

For the most
part,
interrupt
service
is
the
acknowledgement of some event (an I/O completion, an error,
or a status change). An interrupt is usually a response to
some request by the operating system for a device operation.
THE DISK MANAGER
Service to the disk requires special recognition since
the operating system relies so heavily upon this device.
Access to files, spooling, unspooling, compiling,
loading,
paging, swapping -- all require access to the disk. Thus,
it is common for there to be several pending requests for
access to the disk.
In most operating systems, a disk
manager determines the order in which these requests are
processed.
The disk manager orders the requests in a queue
for
disk access so that average seek time (the time to find the
right cylinder) and average latency time (time for the disk
to rotate so that the desired sector is under the head) are
minimized. The work of the disk manager
is time critical
because new requests are coming in constantly and the disk
is always rotating.

SI-23

«For Internal Use Only»

DIGITAL

TOPS-2eJ MONITOR
Software Introduction

co
M
N

o

...N
~
o

CD
::l
CD
::l

a

c

Q.

=

a:

.::t.
en

t----t ....

C

CD
::l

0

en

t - - -...

~

1

N

i

...

u..

a:

(W)

............
en en en
CD

::l
C'

CD

CD

::l
C'

CD

CD

::l
C'

CD

a:: a:: a::

SI-24

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Software Introduction

Accounting
It is essential for the people who pay for the computer
system to know who is using it and for how long. Most
operating systems have accounting facilities built in to
keep track of the various ways that the computer is used.
These facilities keep account of such things as processor
time used, terminal connect time, amount of disk storage
used, number of pages of printed output, and number of cards
read. TOPS-10 and TOPS-20 accounting systems can keep track
of all these things and can produce reports that can be used
to charge the user.
Accounting systems charge different amounts for each
kind of usage.
Also,
the accounting systems have the
ability to treat each user separately so that individual
rates, discounts, etc. can be applied. Most systems also
have the ability to add charges for such things
as
consulting services and terminal rental, if appropriate.

SI-25

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Software Introduction
TOPS-20 HARDWARE/SOFTWARE INTERFACE

Virtual Address Translation - General

The IS-bit virtual address is considered as two parts:
the high-order nine bits are considered the page number, and
the low-order nine bits are used as an index into a page.
Remember that a page is 512. words long, and nine bits
addresses 512. entries (i.e., words~. through 511. in a
given page) •
~ virtual
address must be resolved to a physical
address in the machine, and each addtess in physical memory
is in one of the physical pages of memory.
The hardware
picks up the (9-bi t)
virtual pag e number, uses it as an
index into a page table to determine where the physical page
is, and then uses that physical page number (9-bits) along
with the index from the virtual address to get the address
in physical memory for the reference.

~--------------------NOTE--------------------~

Throughout this document the term "core"
refers to physical memory, whether it is
ferrite core or
MOS" semi-conductor
memory.

Some of the characteristics of virtual memory are:
1.

256K of available memory for every user
(even if
the machine has less than 256K of physical memory)

2.

Memory (virtual and physical) is divided into pages

3.

Each page is 512.

4•

Co r e (0 r MOS) i s pag ed

5.

The disk is paged

words long

SI-26

«For Internal Use Only»

TOPS-20 MONITOR
Software Introduction

DIGITAL

VIRTUAL ADDR.
(18 BITS)
USERfS VIRTUAL ADDRESS SPACE
~
ADDRESS OF INSTRUCTION
2
AND ANY ADDRESSES
REFERENCED BY THE
3 ADD AC, 4011
INSTRUCTION ARE CALLED
•
VIRTUAL ADDRESSES.
USER'S PAGE MAP PROVIDES
•
THE PHYSICAL PAGE
•
SUBSTITUTION FOR THE
HARDWARE WHEN IT IS
CALCULATING THE EFFECTIVE
PHYSICAL ADDRESS.
777777~

____________

(1 PAGE

USER'S VIRTUAL ADDRESS SPACE
PARTITIONED INTO PAGES.
VIRTUAL
PAGE #r-------------~--_

•

PAGE #

3~~
3~1
3~2
3~3

1~------------~

2~------------~
3~------------~
4~------------~
5~------------~

511~

•
•
•
•
__________

WORDS)

PHYSICAL CORE

~~------------~

•
•
•
•

= 512

•
•

304

3~5

3~6

307

•
•
•

--~

1023

•
•
•

8191

USER'S PAGE MAP
FOR ABOVE CASE
30'3
30'4
301
30'7

USER'S PAGE MAP (1 PAGE)
PAGE ~
PAGE 1
PAGE 2

•
•
•

•
•
•
•
D7 0092

Figure SI-9. Page Mapping

SI-27

«For Internal Use Only»

DIGITAL

TOPS-2 ~ MONITOR
Software Introduction

Since each virtual page maps to a physical page, the
hardware must have a means for determining where the
physical page is. The hardware initially finds the mapping
by using the User Page Map.

User Page Map

The User Page Map is a table 512.
words long.
Each
entry in the table gives the hardware (firmware, microcode,
etc.) the information it needs to determine where the
information physically resides. The user's page map is one
of the overhead pages which are guaranteed to be in core for
each fork in the balance set. (The balance set is the group
of processes which are eligible for running.) When the
hardware first needs to resolve a virtual address for a
user, the add ress is sol ved by getting the entry out 0 f the
user's page map.
Note that in this first case, an extra
reference to memo.ry is necessary. The first reference is
the only time this "extra" reference is necessary, since the
hardware, once it gets the mapping. the first time, puts that
information into a "cache" of addresses called the Hardware
Page Table.
~--------------------NOTE --------------------~

Actually, there are other times when the
Hardware Page Table entry is invalid for
some reason; these will be discussed
later.

Hardware Page Table - Addressing

When an address reference occurs, the microcode first
looks in the hardware page table to see if there is a valid
entry for the specified page. If there is a valid entry,
the memory reference is made to the physical page location
gotten from the hardware page table (this is the number of
the page in physical memory), and the index from the virtual
address requested (this is used as the low~order nine bits

51-28

«For Internal Use Only»

TOPS-20 MONITOR
Software Introduction

DIGITAL

for the address).
Otherwise, the microcode goes through the
user's page table
(in physical memory and
requiring a
physical memory reference) to get the physical page mapping.
The mapping information is then placed in the hardware page
table for future references.

__--------------------NOTE--------------------~
In the KL-Model B processor, extended
addressing
is
supported.
In these
machines, the page number information
from the Hardware Page Table is composed
of 13 bits of address data, the regular
9 bits, and the extra 4 for extended
addressing of physical memory up to
4096K words
(8192 pages). The use of
extended addressing will be discussed
1 ater.
In fact,
there are two address spaces using the
hardware page table simultaneously:
the user, as we have
just discussed, and the monitor. Since the hardware page
table
is only one page long, there is a high probability of
conflict. To help out here, each entry in the hardware page
table has a bit (user/exec bit) which tells the microcode
whether the mapping information is either for the user space
or monitor space.
A further help is the fact that the
monitor addresses are "hashed" so that, for example, page 0
of user space and page 0 of monitor space do not use the
same' hardware page table slot.
The entire hardware page table is cleared at context
switch time. That is, when a different process is chosen to
run, all of the mapping information in the hardware page
table must be re-created.
Earlier we mentioned that the mIcrocode first
checks
the Hardware Page Table to see if it contains a valid entry
for the specified page. Along with the user/exec bit, and
the fact
that the table is cleared at context switch time,
each page has an age stamp associated with it. Periodically
these age stamps get incremented, and when this happens, the
Hardware Page Table gets cleared.

8I-29

«For Internal Use Only»

TOPS-20 MONITOR
Software Introduction

DIGITAL

EFFECTIVE ADDRESS

r-~:--

9

9

118

L ____ ~_ _ _ _.--_ _--,-_ _ _....-_ _~I

BITS =

*23 BITS

= 32

[256K WORDS
512 PAGE S
256 K SECTIONS

"SIMPLIFIED" HDW. PG. TABLE
13

"

~E V

PHYSICAL
P W5 C

PAGE

"
13

9

]22 BITS

~----------~--------~

PHYSICAL ADDRESS

U/E
V
P
W
S
C

=

EXP/INSION
CAPABILITY OF
[ 4096K WORDS
81q2 PAGES

USER/EXEC MODE
VALID
PUBLIC/CONCEALED PG.
WRITEABLE PG.
SOFTWARE
CACHEABLE PG.

* EXTENDED ADDRESSING INCLUDES A 5-BIT SECTION NUMBER.

D7 0088

Figure 81-10. Addressing Hardware Page Table

8I-30

«For Internal Use Only»

TOPS-20 MONITOR
Software Introduction

DIGITAL

Poi nter Types

What does an entry in the page table look like?
access,

user/exec,

wr i tabl e,

1.

Each slot
has
cacheable bits.

2.

Each slot has either an immediate pointer or a
pointer to where to look next for the storage
address.

3.

There are three pointer types which
understands:

the

microcode

1.

Immediate pointer -- storage address is here.

2.

Shared pointer -- the storage address must be
gotten through the shared/special page table
(8PT) •

3.

Indirect pointer -- must look in the
page table for the next pointer.

SI-3l

specified

«For Internal Use Only»

DIGITAL

TOPS-2 ~ MONITOR
Software Introduction

~ ~-L_-O_-C_A~T~I-_O-N~ ~=I~-.------~----------------------------~.~I--------~

- "
PRIVATE
POINTER

PHYS I CAL
STORAGE

SPT

T
Y

~It

Y

-

--....

~

SHARED
POINTER

PHYSICAL
STORAGE

SPT

T
N

Y

t

-T

,.

PAGE MAP

N

Ll

INDIRECT
POINTER

~

PHYSICAL
STORAGE
D7 0057

Figure SI-11. Pointer Types

SI-32

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Software Introduction

• MEDIUM ON WHICH STORAGE EXISTS.
• LOCATION ON MEDIUM.
• CAN APPEAR IN APAGE TABLE OR THE SPT.
35

14 15 16 1718

I IIII
BIT 14 = 1
BITS 14-15 =

15 - 35

DISK ADDRESS

~

16 = 1

BITS 14 - 17

=

=

[)

0 [)

17 - 35 = DRUM ADDRESS
18 - 35 = CORE ADDRESS
D7 0042

Figure SI-12. Storage Addresses

SI~33

«For Internal Use Only»

DIGITAL

TOPS-2" MONITOR
Software Introduction

The pointer type is encoded in bits 0-2 of the page pointer
The access bits are in bits 3-6. They are:
Access Bits
Pointer Type
Public/Concealed
P
No Access
o
Writeable
W
1
Immediate or Private
C
Cacheable
2
Shared
S
For Software
Indirect
J
Not Used, Reserved for future use by DEC
4-7
The immediate pointer holds a 13 bit physical page number
in bits 23-35.
This ~s also called a private pointer since
it is private to the page table containing the pointer.
This
should not be confused with the public bit which describes
the type of access allowed.

I
o

2

3

4

5

6

12

17 18

MBZ IF

IN CORE

I

22 23

35

IMMEDIATE POINTER (CODE=l)
The shared 70inter contains an index which addresses into
the Special Shared Pages Table (SPT).
The SPT base register,
SBR, (reserved AC block) points to the beginning of the SPT.
The sum of the SBR and SPT index (SPTX) points to a word
containing the storage address of the desired page.
The line
number from the virtual address is used to complete the
reference.
SPT INDEX
(SPTX)
35

18

SHARED POINTER (CODE=2)
Regardless of the number of page tables holding a particular
shared pointer, the physical address is recorded only once
in the SPT.
Hence, the monitor may move the page with only
one address to update.
The indirect pointer identifies both another page table and
a new pointer within that page table.
This allows one page to
be exactly equivalent to another page in a separate address
space.
The Object page is located by using the SPT index.
PAGE
NUMBER
2

3

4

5

6

9

PAGE TABLE IDENTIFIER
(SPTX)
17 18

35

INDIRECT POINTER (CODE=3)
D7 0651

Figure 81-13. Page Pointers

SI-34

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Software Introduction

Storage Addresses

Once the microcod~ determines the storage address,
there is still work to do since the storage address may
indicate that the page is not currently in core. There are
three levels of storage for pages: core, drum, and disk.
The microcode deals only with core storage addresses;
if
the referenced page is not in core, a page fault occurs and
the monitor arranges for the desired page to be brought in.
Remember that the term "drum" refers to the swapping space,
which is, in fact, a reserved portion of the disk.
~ote
that we are still looking for a whole page; we have not yet
even considered the low-order nine bits of the requested
virtual aOdress.
The format of a storage address is what
the microcode uses to determine where a page is.

PAGE FAULTS

The term "page fault" indicates that, for some reason,
the microcode was not able to access a page and had to call
the monitor to make the page available. There are several
reasons why a page may not be available:
1.

The page is not in core.

2.

The page is in core but marked
r epl acemen t •

3.

Null pointer -- the page does not exist.

4.

Invalid age field.

5.

Invalid access requested
non-writable page.

to

e. g. ,

write

a

out

wr i te

for

to

a

STORAGE ADDRESS FORMAT

If bits 14-17 of a storage address are all 0, the page
is in core and bits 18-35 are the address. If bits 14-17
are not all 0, the page is on disk or drum. In the latter
case, bit 14 on indicates a disk address; otherwise, it is
a drum address. If the storage address indicates memory,

SI-35

«For Internal Use Only»

DIGITAL

TOPS-29 MONITOR
Software Introduction

the microcode
page table.

copies the storage address into the hardware

In summary:
1.

The User Page Table
virtual addresses.

2.

The entries in a User Page Table are either 9 (for
non-used pages) or one of three types of pointers:
1.

Immed ia te

2.

Share

3.

Indirect

has

slots

for

all

existent

3.

The translated address is copied into the Hardware
Page Table if the Storage Address is core.

4.

A page fault occurs if the
Storage
indicates a loc~tion other than core.

SI-36

Address

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR

Software Introduction

USER BASE REGISTER

~E55

PAGE TABLE

TABLE

PRIVATE PAGE

PRIVATE~----m.L-I

15HAREDt----~
.. I- - o. ~
USECTB~====~--~

INDIRECT~IN~II

SPT

SPT BASE REGISTER

I

___~.~~

~I_ _ _ _+-__~SH~AREDPAGESTABLE
I

SHARED PAGE

I

l--r---I......

...

...:-~I::-_-_-_-..::-_----'~
::LI- \

PAGE TABLE

UPT

PRIVATE PAGE
C+INDIRECT)

D7 0039

Figure SI-14.

Layout of KL Paging

SI-37

«For Internal Use Only»

DIGITAL

TOPS-2'=' MONITOR
Software Introduction

KL Paging
Two hardware registers are loaded for the microcodes'
use:
the ·Exec Base Register (EBR), which contains a pointer
to the Exec Page Table (EPT), and the User Base Register
(UBR), which po ints to the (UPT).

Process Overhead Pages
Each process needs several ov~rhead pages:
the UPT
(two pages)
and the User Page Map. The User Process Table
(UPT) contains the information which the system needs to run
a process.
Incl ud ed in the UPT is trap, contex t and
scheduler information. Also in the UPT is a 32. word block
(USECTB) which contains Page Map locations. There is one
space allocated the page map of each of the possible 32.
sections which may exist.

, . . . . . . - - - - - - - - - - NOTE - - - - - - - - - -....

At this time the TOPS-2'=' Monitor does
NOT
support extended addressing for
users.

When the microcode needs to find a page for the user,
the User Page Map is located from the section'=' (USECTB)
slot in the UPT.
(Remember that the physical address of the
UPT has been put into the UBR.) A similar path is taken by
the microcode for addressing in the monitor addressing
space, except that the EBR is used. The EBR points to the
EXEC Process Table which, in turn~ has the map pointers at
MSECTB.

SI-38

«For Internal Use Only»

TOPS-20 MONITOR
So ftwa re Int rod ucti on

DIGITAL
Name:

UPT

Description:

User Process Table. A one page User Process Table is
associated with the Scheduler and with each fork in the
system.
(Those associated with forks may be swapped
out with the fork.)
However, there is only one UPT
known to the hardware/firmware at anyone time.
The
UPT known is the one whose address is pointed to by
the hardware User Base Register (UBR), which is set-up
when a process is chosen to run.
The UPT contains the dispatch address for process
events (i.e., traps) and the user's section map table.

Defined In:

APRSRV

Referenced by:

APRSRV, SCHED
FORMAT
HWPTA*
=776000

Available to Software

\

\

I

I

\

\

377

400 1
\
4).7
420

1 UPTPPM*
\ =776400

Reserved
Address of LUUO Block

421 User Arith. Overflow Trap Instruction

UPTTPI*
=776420
UPTOV1*
=776421

422 User Stack Overflqw Trap Instruction
423
424

User Trap 3 Trap Instruction
MUUO OP-AC

Flags

Figure 51 .. 15.

FFL*=KIMUFL*
=776424

User Process Table

81-39

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR

Software Introduction
425

MUUO Old PC

426

E of MUUO

FPC*=KIMUPC*
=776424
KIMUEF*
=776426

427

MUUO Process Context

430

Kernel No Trap MUUO New PC (word)

UPTPCW*=KIMPCW"
=776427
UPTDSP*
=776430

i

431

Kernel Trap MUUO New PC (wo rd)

432 Supervisor No Trap'MUUO New PC (word)
433

Supervisor Trap MUUO New PC (word)

434 Concealed No Trap MUUO New PC (word)
435

Public Trap MUUO New PC (word)

436

Public No Trap MUUO New PC (word)

437

Public Trap MUUO New PC (word)

440

Reserved for software

\

\

477
500

Page Fail Word

UPTPFN* '
=776500

501

J;>age Fail Flags

TRAPFL*=UPTPFL*
=776501

502

Page Fail Old PC

TRAPPC*=UPTPFO*
=776502

503

Page Fail New PC

UPTPFN*
=776503

504
505

User Process Execution Time

506
507

User Memory Reference Count

510
537

\

\

I

540~-------------U-S-E-R-S-E-C-T--------------~ USECTB*
1

Figure SI-16.

User Process Table (cont.)

SI-40

«For Internal Use Only»

TOPS .... 20 MONITOR
So ftware Introduc tion

DIGITAL

I =776540

I

\

\

577

USERSECT37

600
Available to software

777
Note;

*

Approximately 1/4 of the UPT is used for hardware
cells, leaving the rest av~ilable to software.
The monitor currently uses this area to house the
first page of the PSB table.
(SeePSB table
description. )
These are monitor virtqal memory addresses and are
used when the monitor wishes to reference the
current fork's User Process Table.

Figure SI-17.

User Process Table (cont,)

81-41

«For Internal Use Only»

TOPS-2 e MONITOR

DiGITAL

Software Introduction

Name:

EPT

Desc r ip·t ion:

Executive Process Table. This memory resident
table pointed to by the Executive Base Register
(EBR), contains the vectored dispatch addresses
for system events. All device interrupts pass
control to a specific offset position in this
table.,
This table also includes the executive section map
tab~e, the time of day clock and arithmetic trap
instructions which are executed when arithmetic
conditions occur in executive mode.
Locations 444 to 457 are reserved for software and
used by DTESRV.

Defined In:

STG

Referenced by:

APRSRV, DTESRV, MEXEC,

PH~Hll,

PHYH2

FORMAT
Eight Channel LOgout Areas

KI EPT+0

Each:
\

!

o Initial Channel Command
1 Gets Channel Status Word
2 Gets Last Updated Command
3 Reserved for Channel's
Vectored Interrupt Location

\

I

\

37
40

41

Reserved

42

.57

\Standard Priority Interrupt Instruc. \

60

Four Channel Block Fill Words
63
64

Figure 81-18. Executive Process Table

81-42

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
So ftware Int roduc ti on

Reserved

\

\

77

SMTEPT=KI EPT+l 00

Pointer to SM10 Vector Table
(if 2020 System)

101
Reserved

\

\

137

Four 8-word DTE20 Control Blocks
Each: 0 To ~ll Byte Pointer
1 To -10 Byte Pointer
2 Interrupt Location
3 Reserved
4 Examine Protection Word
5 Examine Relocation Word
6 Deposit Protection Word
7 Deposit Relocation Word

DT~EBP=KIEPT+140

DTETBP=KIEPT+141
DTEINT=KIEPT+142
143
DTEEPW=KI EPT+144
DTEERW=KIEPT+145
DTEDPW=KI EPT+14 6
DTEDR\~=KI EPT+14 7

DTE1 Control Block

\

\

DTE2 Control Block

\

\

DTE3 Control Block

\

\

I
I

177

I
I

EpTMHI=KIEPT+200

Available to Software

417
EPTPTI=KIEPT+420
421

LUUO from Executive Mode
(. LUTRP) *
Executive Arithmetic Overflow Trap

Figure 81-19. Executive Process Table (cont.)

81-43

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Software Introduction

Instruction (JFCL)*
422

Executive Stack Overflow trap
Instruction (.PDOVT)*

423

Executive Trap 3 Trap Instruction
(JFCL) *

424
\

Reserved

\

Reserved for Software

\

---I1

437~_ _ _ _ _ _ _
440
443
DTEFLG=KI EPT+444

Operation Complete Flag

DTECFK=KIEPT+445

Clock Interrupt Flag

DTECKI=KIEPT+446

Clock Interrupt Instruction

DTETll=KIEPT+447

"To" 11 Argument

DTEF11=KIEPT+450

"From" 11 Argument

DTECMD=KI EPT+4 51

Command Word

DTESEQ=KI EPT+4 52

DTE20

Operati~n

\

Sequence Number

DTEOPR=KI EPT+4 53

Operation in Progress Flag

DTECHR=KIEPT+454

Last Typed Character

DTETMD=KI EPT+4 55

Moni tor TTY Output Complete Flag

DTEMTI=KIEPT+456

Monitor TTY Input Flag

DTESWR=KIEPT+457

Console Switch Register

460
\
Reserved for Software
\
477r________________________________~1
500
\
507

Reserved

\

------------il

~I

Figure 81-20. Executive Process Table (cont.)

SI-44

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR

So ftwa re Int roduc tion

510
Time Base
511
512
Per~ormance

Analysis Count

513
514

Internal Counter Interrupt Instruc.

MSECTB=KIEPT+540

EXEC SECTION 0

\
577

\
EXEC SECTION 37

EPTMLO=KI EPT+600

Available to Software

*

These values are placed into the table when the EPT is
initialized at system startup.

Figure SI ..21.

Executive Process Table (cont.)

SI-45

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
So ftware Introduction

Special/Shared Page Table (SPT)
The monitor keeps track of the UPT and User Page Map
pages in the SPT for each process on the system. The SPT is
a resident table (that is, it is never swapped out) which is
3000 to 5000 (octal) words long. The SPT keeps track of a
page·s location since the page may be in core or swapped
out.
The SPT is also used to keep track of file pages and
system overhead pages:.

SI-46

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Software Introduction

SPT
SPTH

IS

REFERENCED DIRECTLY BY PAGER.

PARALLEL TABLEJ

NOFN[

BUT REFERENCED ONLY BY SOFTWARE,

INDEX BLOCKS FOR OPEN FILES

PSB's) JSB's)

USER PAGE MAP TABLES
AND SHARED FILE PAGES

SPT

o

I

ENTRY

35

11 14
SHARE COUNT

STORAGE ADDRESS
D7 0058

Figure SI-22. Shared Pages Table

81-47

«For Internal Use Only»

DIGITAL

TOPS-2~ MONITOR
Software Introduction

Summary of Paging

The software sets up the page table locations
contents, the microcode does the address translation.
does the software tell the microcode where to look?
1.

AC block 6 is set up by the software with the
add resses 0 f;
1.

SPT Table

2.

CST Table (Core status table)

3.

Age stamp information (for removing
when necessary)

old

and
How
base

pages

NOTE

The other used
moni tor use, I
use.

AC

blocks are: ~ user, 7 - roic rocode

2.

EBR is set up by the software

3.

UBR is set up by the software

SI-48

«For Internal Use Only»

TOPS-20 MONITOR
Software Introduction

DIGITAL

Software Introduction
LAB EXERCISES
When answering the lab exercises, write down the names
of the tables where you found the answers. The labs will
help you understand the monitor data base structure;
so
remember, where to look is more important than what you find
there.
The exercises that are marked with a double star
(**)
are more difficult and are optional.
If you have the time
and motivation, do them.
TOOLS
FILDDT
FILDDT is a program that can be used to look at a crash
or at the running monitor. Use FILDDT as in the example
below to do this lab's exercises.
@ENABLE
$FILDDT
FILDDT>LOAD MONITR.EXE
FILDDT>PEEK

;need enabled wheel
;capability to look at the
;running monitor.
;start the program
;load the symbols
;peek at the running monitor

At this point, the usual DDT commands allow yo~ to look at
the running monitor. You cannot change any locations (i.e.,
you have no write privileges).
Also, your process will
always be running when you look because the mechanism to
look at the running monitor is like a JSYS whose function is
to let you use DDT from monitor context.

SI-49

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Software Introduction

Virtual Address Translation
The translation from virtual to physical addresses is
done by the microcode. However, the page maps and tables
the hardware uses are all set up by the monitor. Therefore,
the monitor's page map, the current process's page map and
the SPT table are all a part of the monitor's address space
(so the monitor can add and delete pages for itself or for a
process). Sections 0 and 1 of the monitor are both mapped
through the same page table which begins at offset MMAP.
The current process's page table is always mapped into the
monitor's address space beginning at location UPTA.
RESOURCES
1.

Read section 3.4 (TOPS-20 paging) of
Reference Manual.

2.

Use the UPTA table in your monitor tables.

3.

Refer to the Storage
Student Guide.

4.

Refer to the Page Pointers handout in your
Guide.

Addresses

the

handout

Hardware

in

your

Student

EXERCISES
1.

Using the page map at .UPTA (which is your process's
page map)
find a share pointer, an immediate
pointer, and in indirect pointer (if possible).

2.

What is the
pointers?

3.

What level of storage does
indicate that page is on?

4.

Look at MMAP;
why do you think that all the
pointers in the first portion of MMAP are private?

storage

address
the

for

each

storage

of

the

address

**

8I-50

«For Internal Use Only»

DIGI,TAL

TOPS-20 MONITOR
Software Introduction

Software Introduction
LAB SOLUTIONS
EXERCISES
1.

Using the page map at UPTA (which is your process's
page map)
find a share po inter, an immedia te
pointer, and in indirect pointer (if possible).
ANSWER:
Bits 0-2 of the pointer contain the
pointer type;
2 is a share pointer,
3 is an
indirect pointer, and 1 is an immediate pointer.

2.

What is the
pointers?

storage

address

for

each

of

the

ANSWER: A share pointer's storage address is in
the indicated 8PT slot;
an immediate pointer's
storage address is in bits 12-35 of the pointer
itself;
and the storage address of the indirect
pointer is determined by the object page map.
UPTA/124000,,517
UPTA+l/124000,,622
UPTA+2/206000,,2167

ST-51

;517 is the storage
; add ress
;622 is the storage
; add ress
;8PT slot 2167 contains
ithe storage address

«For Internal Use Only»

DIGITAL

3.

TOPS-2~ MONITOR
So ftware lnt roduc tion

What level of storage does
indicate each page is on?

the

storage

address

ANSWER:
If bits 12-17 are ~, the storage address
is a core address;
if bits 12-14 are ~ but bit
16=1, the remainder of the word is a drum storage
address;
if bit 14 is on, the remainder of the
word is a disk storage address.

4.

UPTA/1i4000,,622

;core address

UPTA+2/206000,,2167
SPT+2167/110,,5174

;SPT slot 2167 contains
;the storage address
;disk address

UPTA+10/124003,,7034

;drum address

Look at .MMAP;
why do you think that all the
pointers in the first portion of MMAP are private?

**
ANSWER:
This is the resident portion of the
monitor, most of it read in by BOOT. You will also
notice that the pages are always in core and that
their core addresses correspond with their virtual
add resses.
MMAP/124000,,0
MMAP+1/124000,,1
MMAP+2/ 124000,,2
MMAP+3/ 124000,,3
•
•
•
MMAP+32/124000,,32
•
•

MMAP+55/124000,,55

8I-52

«For Internal Use Only»

DIGITAL·

TOPS-20 MONITOR
Software Introduction

MODULE TEST
1.

What features of operating systems can be compared
to determine whether a given'system is large or
small?

2.

What are the basic aspects of batch,
and real time operating systems?

3.

What advantages does virtual memory's
translation give an operating system?

4.

What is a page fault and how is it handled?

5.

How are files

6.

What does the disk manager do?

organi~ed

51-53

timesharing,

address

on TOPS-20?

«For Internal Use Only»

DIGITAL

TOPS-2e MONITOR
Software Introduction

This page is for notes.

SI~54

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Software Introduction

TEST EVALUATION SHEET
1.

Such things as
scheduling
approach,
devices
handled, protection, file organization, accounting,
and network capabilities determine whether a system
is large or small.

2.

Batch works on long jobs, has sequential
job
submission,
few concurrently running
jobs, no
interaction,
and
is
often
card-oriented.
Timesharing
includes
many
interactive users,
round-robin
scheduling,
short
jobs
and
is
terminal-oriented.
Real-time is interaction with
fixed response time constraints.

3.

Virtual memory address
translation
eliminates
unusable pages by making all real memory usable by
any process. It makes partial
residency easy to
maintain dynamically.
It provides protection for
the operating system and users and,
finally,
it
reduces the work of the loader program.

4.

A page fault occurs when reference is made to a
process page that is not in real memory. When a
page fault occurs, the operating system requests
the page be load ed into real memory from the disk.
The process becomes blocked until it arrives.

5.

Files are accessed through directories. Each user
has a directory which has a pointer to an index
block for each file.
The index block contains a
pointer to each page of the file on disk. The
pages of the file may be scattered anywhere on the
disk.

~.

The disk manager maintains a queue
of
disk
requests.
The order of requests is such that
overall seek time and latency time are minimized.

o

SI-55

«For Internal Use Only»

DIGITAL

TOPS-2~ MONITOR
Software Introduction

This page is for notes.

51-56

«For Internal Use Only»

TOPS-20 MONITOR
Monitor Overview

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Monitor Overview

COURSE MAP

MR-2717

MO-i

«For Internal Use Only»

DIGITAL

TOPS-2~

MONITOR

Monitor Overview

This page is for notes.

MO-ii

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Monitor Overview

Monitor Overview
INTRODUCTION

The DECSYSTEM-20 consists of hardware
and software designed to allow users to run
a variety of programs
efficiently
and
conveniently.
It is specifically designed
as a paged timesharing system.
Normally,
several
active
programs
are
run
concurrently, with control switched from one
to another by the monitor. Programs not
using the CPU can still have active input
and output devices. This overlapping of I/O
with the processing of several programs
permits efficient use of both the CPU and
the I/O devices.
The DECSYSTEM-20 has several hardware
features
that
facilitate
multiprogram
ope rat ion. Th e two ba sic mod e s 0 f 0 pe rat ion
are:
executive and user. The monitor runs
in executive mode with no restrictions on
its operations. In user mode, a program can
access core memory
only
within
areas
assigned
to it by the monitor.
Also,
certain instructions are not permitted in
user
mode.
These
include
all
I/O
instructions and the instructions to control
memory access and mode of operation.

MO-I

«For Internal Use Only»

DIGITAL

TOPS-29 MONITOR
Monitor Overview

- - - - - - LEARNING OBJECTIVES - - - - - - .
Upon completion of
student will be able to:

this

functional

module,

the

sections

of

1.

Name the major
the moni to r.

2.

Describe the function of each
sections.

3.

Identify the
structures.

4.

Describe the use and function of TOPS-20
Monitor Calls (JSYSs).

major

data

and

of

those
monitor

-----------------RESOURCES--------------~

Appendices A and B of this course.

MO-2

«For Internal Use Only»

TOPS-20 MONITOR
Moni tor Ov erv iew

DIGITAL

MODULE OUTLINE

Monitor Overview
I•
II.
I I I.

IV.

Mo n i to r Ca 11 s
Storage Management
A. Block Diagram
Pag er
A. Hierarchical Storage Considerations
B. Implementation - Mapping
C. Inter-Level Data Flow
D. Updating Lower Levels
Sched ul er

V.

Fil e System
A• Data S t r uc tu r e

VI.

Job/Fork Structure

VII.

VIII.

IX.

Disk And Magtape Service
A. Hardware Principles
B. Monitor Modules
C. I/O Requests
Front End Service
A. TTY Input
B. TTY Line Buffers And Echoing
C. Line Printer Output
Append ices

MO-3

«For Internal Use Only»

DIGITAL

TOPS-2~ MONITOR
Monitor Overview

This page is for notes.

MO-4

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Monitor Overview

MONITOR CALLS
The monitor performs a number of services for user
programs,
including I/O operations. The instruction code,
104, provides the means for programs to request the monitor
to perform these services. Each monitor call, referred to
as a JSYS (Jump to SYStem), has a function code associated
with it which is stored along with the operation code, 104,
when the monitor call is assembled. The 104 operation code
has no hardware function except to give control to the
monitor. When a JSYS is executed, a routine in the monitor
decodes the request and calls a subroutine to perform th~
requested operation~
After the JSYS request has been
processed, control 1S returned to the calling program along
with indications of error conditions, if any.
Requests for service come from user programs in the
form of JSYSs.
A terminal request for system resources
simply takes the form of input data to the EXEC program
which translates the request into appropriate JSYSs. When a
request is made to start up a program, an inferior fork of
the EXEC
is created, and
the locations of the program's
pagps on disk are placed into the fork's page map table. No
initial core is assigned to the fork's pages. Rather, pages
in core are assigned on demand
(i.e., when a pag e faul t
occurs) when the process references them. The most frequent
requests for service from programs are the I/O JSYSs. These
JSYSs allow a process to access data by file name on a byte,
string, or page basis without being concerned about the
physical
location of the data.
The monitor computes
physical
addresses on disk, starts I/O transfers, and
handles the resulting I/O interrupts.
Control functions are performed as necessary by the
monitor, according to algorithms which attempt to give
optimal overall system performance.
One of the
most
important of these functions is dividing the available CPU
time among the active processes. A running process must be
stopped when a clock tick occurs, and its computational
state must be preserved so that it may be started at a later
time.
The monitor must decide which pages of user programs
to keep in physical core and which to swap out to the

·MO-5

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Monitor Overview

swapping device.
In addition, it must decide where to put
user pages in physical core when they are swapped back in,
replacing other user pages if necessary. The replaced pages
will be preserved first if needed
(i.e., modified pages
swapped out).

MO-6

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Monitor Overview

STORAGE MANAGEMENT
Block Diagram
The functions of scheduling and storage management are
handled
by
a number of interrelated modules of the
DECSYSTEM-20 monitor, each with a specific set of operations
to perform.
The following diagram gives the major modules
of the scheduler and
storage
management
and
their
communication paths with each other.

I
BALANCE SET
CONTROLLER

A"

I

I

--

SWAP PER
(Requests I/O)

-

....

CORE
MANAGER

-

DRUM
!·1ANAGER

--

I
I
I

"
PROCESS
CONTROLLER

~~

I
I

I
I
I

,if

I

STARTUP

I
I

&

DISMISS
INTERFACE

I

STORAGE MANAGEMENT

SCHEDULER

D7 0040

Figure MO-1. Block Diagram

MO-7

«For Internal Use Only»

DIGITAL

TOPS-2~ MONITOR
Monitor Overview

The Swapper handles communication between the secondary
storage devices
(drum or disk)
and core memory. Upon
receiving a request frQm the Scheduler or Core Manager to
move pages into and out of core, the swapper constructs an
I/O reques·t and calls the device-dependent module to start
the I/O.
The Drum Manager is responsible for both assigning
storage on the swappi~g drum and selecting pages to be moved
to the disk in the event the drun becomes full.
The Core Manager selects core pages to be used for swap
read s
from
the drum 0 r d 1sk, perfo rms some "ag ing n
operations, and handles the selection of core pages to be
swapped to the drum.
It has principal use and control of
the Core Status Table (CST) which reflects at all times the
current state of each page of core memory. The CST is also
mod ified by the pag ing hardware, recording information about
the activity of the running process.
The core manager is invoked when a page fault occurs.
If the working set of the faulted process can be increased
by one, the core manager will assign a page from the
replaceable queue
(linked list of free pages) and call the
swapper to swap in the faulted page.
If the working set
size cannot be increased, garbage collecting for the process
takes place. That is, the fork's working set will be
necreased
by
swapping
out the pages least recently
referenced. Whether the fork's working set size becomes too
large or not, the fork's working set is periodically
ex am ined fo r "old" pag es.
If a process page faults and can legally be granted
another page and none are available on the replacement
queue, the fork is put into a wait state and the scheduler
is called. The scheduler will detect the shortage of pages
and call the c~re manager to global garbage collect on forks
no longer in the balance set. The core manager will then
invoke the swapper to swap out the collected pages.

MO-8

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Monitor Overview
PAGER

The pager is placed logically between the processor and
the
core memories and translates each memory address
received from the processor into a physical core address
which is sent to the memories. Control signals allow the
pager to know what type of access the processor is making
(read, write, or execute), and allow the pager to signal the
processor when, for some reason, a
reference cannot be
completed (e.g., when the page is not in core). The virtual
addresses received from the processor are 18 bits, and
the
page
size is 512 words, so
the pager is,
in fact,
translating the high-order 9 bits of address, and passing
the low-order 9 bits throug h unchang ed.
The pager uses a 512-word hardware page table
(indexed
by virtual page number) to hold physical page information of
recently referenced virtual pages, but the source of this
information is always a "page table" in core memory. Page
tables contain (or point to) the physical storage address,
if any, of each page of a
virtual memory. Thus, each
process' virtual memory is represented by one page table.
Page table entries are of one word; hence, a page table for
a 25nK virtual memory is 512 words, or exactly one page
long.
The pager references the page table of the relevant
process, using the 9 high-order virtual address bits as an
index, whenever the hardware page table fails to contain the
physical information for the requested virtual address. The
pager is capable of interpreting three types of page table
entries.
The first
is called a "private" pointer and
contains a physical storage address.
If this is a core
address, the pager will load the ~ardware page table with
the information and complete the requested reference.
If it
is any other address, the pager will initiate a trap to the
monitor for appropriate action. The second type of page
table entry is called a "shared" pointer which contains an
index into a
system table at a
fixed
location.
This
"Shared/Special Pages Table"
(SPT)
contains the physical
storage address, and the details of its functions are
described below.
The third type of page table entry is the "indirect"
pointer which contains a page number and SPT index. The SPT
index is used to index into the SPT table to pick up an

MO-9

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Monitor Overview

address of a page table. This page table is indexed by the
page number given in the indirect pointer to obtain the
physical storage address. This pointer allows one page to
be exactly equivalent to another page in a separate space.
One other fixed table, called the Core Status Table 0
(CST0), is used by the pager. For each page of physical
core, this table
contains
information
about
recent
references and notes if the page has been modified.
Hierarchical Storage Considerat.ions

In any system using hierarchical (multi-level) storage,
one is concerned with the movement of data between the
various levels, the location of current "up-to-date" copy',
the updating of lower levels, etc. It is usually considered
essential that the address of the currently valid copy of an
item of storage resides in only one place. This tends to
conflict with the goal of sharing, ~hich requires that items
of
storage
be
made available to multiple processes
simultaneously. Replication of addresses would appear to
admit the possibility of unresolvable phase errors, and the
updating problem itself would unnecessarily complicate the
software.
DECSYSTEM-20's solution to the basic storage management
problem is the shared pages table scheme. In this scheme,
storage addresses (for shared elements) again reside in only
one place, a fixed table called the shared/special pages
table. Processes using an element of storage are given a
fixed index 'Y' which identifies the SPT entry holding the
current address, but an entry cannot be deleted from the SPT
as long as pointers to it exist. Therefore, a share count
is required for each entry to record the number of pointers
to it that have been created; this count is kept in the
SPT.

MO-10

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Monitor Overview

Implementation - Mapping

The following shows how the DECSYSTEM-20 implements the
file mapping operations discussed in the previous section,
and how data flows between the several levels of storage.
The DECSYSTEM-20 storage hierarchy consists of three levels:
core, swapping, and file.
As described previously, named memory consists of pages
within files. A sample file with two of its pages is shown
in Figure MO-2. The basic structure of the file is an index
block containing the storage addresses of all of the data
pages. In fact, this index block is a page table, initially
containing private pointers. Assume a starting point where
none of the file pages are mapped in any process, so the
only place for the storage address of each of these file
pages is logically and properly the index block of the file
that owns them.
PAGES ON DISK

FILE INDEX
BLOCK

DISK ADR

D7 0053
Figure MO-2.

File Structure

MO-II

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Monitor Overview

Next, a process requests that one of these file pages
be mapped into its address space. The monitor uses the JFN
portion of the identifier to 'locate the file inde~ block,
and the PN portion to select the appropriate entry within
it. Although our aim here is to have just one process using
the page, we see that, in fact, the page must become shared
at this point (that is, shared between the file and the
process).
Therefore, the monitor will assign a slot in the
SPT and place in it ~he disk address obtained from the
file's in-core copy of the index block. Simultaneously, it
creates a shared pointer which points to that SPT slot and
places a copy in both the file's in-core copy of the index
block and the process page table. The share count for the
SPT slot is set to reflect the fact that the page is in use
twice: once by the file, and once by the process.
PROCESS
PAGE
TABLE
SPT
PHYSICAL
DISK
PAGE

SHR PTR
SPTN

DISK ADR
~

IN CORE COpy OF
INDEX BLOCK

SHR PTR

-

D7 0602

Figure MO-3A. One Process Maps a File Page

MO-l2

«For Internal Use Only»

DIGITAL

TOP8-20 MONITOR
Monitor Overview

A second process wishing to use the same page proceeds
in the same manner, but now it is only necessary to create
another copy of the shared pointer and increment the share
count.
This situation is shown
in Figure MO-3B.
The
subsequent reduction of the share count to I
(when all
processes unmap the pag~ will indicate that the 8PT entry
may be reclaimed.

PROCESS
PAGE
TABLE
SPT
SHR PTR

PHYSICAL
DISK
PAGE

SPTN

,..,---

DISK ADR

SHR PTR

IN CORE COpy
OFINDEX BLOCK

SHR PTR

r---

D7 0055

Figure MO-3B. Two Processes Map a File Page

MO-13

«For Internal Use Only»

DIGITAL

TOPS-2" MONITOR
Monitor Overview

Some additional bookkeeping is necessary in order to
keep track of the owner of the page and to note the fact
that the file index block is in use.
This is shown in
Figure MO-4. The table labeled SPTH is parallel to and the
same length as the SPT. For our example file page which was
assigned to slot 'SPTN', the parallel entry in the SPTH
records the owning page table of the page. This is shown as
OFN and PN.
The OFN (OpenFi 1 e Number) is the monitor's
internal equivalent 9f the user's JFN, except that it
identifies open files over the domain of all jobs in the
system. The OFN is actually an index into a portion of the
SPT which is reserved for index blocks, and the PN is the
page number supplied by the user. The OFN portion of the
SPTH holds the home addresses of the index blocks currently
in use.
The monitor must always open files on the basis of the
storage address of the index block as obtained from the file
directory, and a search of this part of the SPTH is
necessary to determine if the file is alre~dy open.
SPTH
HOME ADR

--r
OFN
AREA

SPT
~

STG. ADR

i

OFN

I

PN

,

~~

SPTN

1

.....--

INDEX BLOCK

07 0059

Figure MO-4. Ownership Back Pointers

MO-14

«For Internal Use Only»

TOPS-20 MONITOR
Monitor Overview

DIGITAL

Inter-Level Data Flow
Next, we show what happens when one of the processes
references the file page which has been mapped. This is
shown in F·ig ur e MO-S.
The pag er in terpr ets the sha red
pointer found
in the process map, and references the SPT.
It finds, however, that the page is not in core, and so,
traps to the monitor.
The monitor in turn selects a page of
real core and initiates a read of the disk to bring
in the
page.
The SPT slot is then changed to indicate that the
page is in core.
Two tables record the state of physical core.
These
are the Core Status Tables (CSTI and CST2). For each page
of physical core, CSTI holds the physical address of the
next lower level of storage for the page.
In our example',
this is a disk address because the page is just being
read
from the disk.
CST2 records the name of the page table
holding the pointer to that core page, which in this case is
an S PT i n d ex.
PHYSICAL
DISK PAGES

PHYSICAL
CORE PAGE

SPT

T

SPTN

l~
CST2
CSTl
--------.
- - - - - -r-------......

CORE
PAGE
NUMBER

HOME
DISK ADR

SPTN

"-------~~

- -

- -

-------D7 0060

Figure MO-5. A Page is Referenced and Brought into Core

MO-IS

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Monitor Overview

Then, we consider what is necessary for the monitor to
swap the page onto the drum. It is important to note that
during the course of the drum write (including latency)
and
for a period of time thereafter, the core page still
contains a current copy of the data, and so we may properly
leave the SPT slot pointing to it. This will prove useful
in the event that a process makes another reference to the
page during this time (since the page will not have to be
read. into core again).. Thus, to beg in the swapout, the
monitor selects a free drun page, initiates the drum-write
operation, and updates CSTI to reflect the fact that the
next lower level of storage is now the drum.
However, we cannot discard the home address of the
page, so one other table is required. The DST (Drum Status
Table) serves a function for the swapping level of storag-e
equivalent to that of the CST for core. That is, for each
page in use on the drum, the DST holds the address of the
next lower level of storage. It also records whether the
copy on the drum has been modified with respect to the copy
on the disk so that the monitor will know whether a write is
necessary at some time to update the disk copy. The picture
of a file page with copies on all levels of storage is now
complete. (Figure MO-6).
PHYSICAL PAGES

CORE

-

DRUM

DISK

otO

..--

SPT

T
SPTN

~

'N'

TN

I

/
'-- CORE

CST2

t---

l

~-

CSTI
- - -t---.'M,---I

DST

PAGE NUMBER

T

DRUM PAGE
NUMBER
HOME DISK

ADR~

Figure MO-S. A Page is Swapped onto Drum

MO-If)

1
f---

D7 0061

«For Internal Use Only»

TOPS-20 MONITOR
Monitor Overview

DIGITAL

One final step is shown in Figure MO-7.
If the page
remains unreferenced for some period of time, the monitor
will want to use the core page for another purpose.
To do
this, the monitor will move the drum address from CSTI of
the page being reclaimed to the SPT slot, and succeeding
attempts to reference the page will reveal that it is no
long er in core.

PHYSICAL PAGES
DISK

DRUM

SPT

T
SPTN

~

DST

T

'M'

\

DRUM PAGE
NUMBER

M

~

~

D7 0062

Figure MO-7. A Core Page is Released

MO-17

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Monitor Overview

Updating Lower Levels
As long as the page remains mapped by one or more
processes, the share count will keep the SPT slot in use,
and the page will be moved between the drum and core as
needed.
This suggests that some procedure may be necessary
to periodically update the home (disk) copy of pages
a
necessity both to guard against loss due to system crash,
and because some files are mapped when the system starts up
and are never unm~pped
(e.g.,
the disk assignment bit
table) •
In the DECSYSTEM-20 a special system process
(DDUMP) takes this responsibility. DDUMP periodically scans
the open files, finding pages that have been changed since
being
read from the disk. File pages are backed up to the
disk by setting a request bit in the CST which causes the
swapper to move the page to the disk instead of the drum.
File index blocks must also be updated but require a
different
procedure.
For
these, the backup process
constructs an image of the index block as it would appear
with no pages shared. That is, it finds the home address of
each page and puts it in the index block in the form of a
private pointer. This copy is then written on the disk.

MO-IS

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Monitor Overview

SCHEDULER
There are two main goals of the TOPS-20 Scheduler:
1.

To prov id e rapid respo nse to inter acti ve us er sand
"fair share" service to compute-bound users of the
system.

2.

To make efficient use of
resources:
CPU and core.

the

machine's

principal

The actions of the Scheduler affect the utilization of
all of the resources in the system, primarily core and CPU
service. The scheduling algorithm includes procedures to
affect the scheduling as a result of I/O or other non-CPU
activity. The fact that TOPS-20 is a paging system greatly
increases the activity on the swapping channels, which
imposes an even greater demand on the scheduling procedures
to interrelate
the use of core with the allocation of the
CPU.
In trying to allocate equal CPU time to processes on
the system, the scheduler would like to know how much time a
process is going to use when it makes a
request
for CPU.
service.
The scheduler can only guess at the future
behavior of a process based on its past behavior
(but that
guess may be wrong).
The most significant piece of data
from the recent
history of a process is the amount of time it has used since
its last request for service.
Two observations
from
monitoring process activity that can be used to predict time
compl etion ar e:
1.

Within any short period of time,
the longer
process has run, the closer it is to completion.

2.

The number of processes completed during any fixed
period of time decreases as the total
runtime
increases; so, the longer a process has run,
the
less likely it is to finish.

MO-19

«For Internal Use Only»

a

DIGITAL

TOPS-20 MONITOR
Monitor Overview

Taking into account these observations, the runtime
broken up into separate reg.ions (queues) so that:

is

•

If ~wo processes are widely separated in accumulated
runtime (i.e., are in different queues), the one
with the lesser time is preferred.

•

If two processes are closely spaced
(i.e., are in
the same q~eue), the one with the greater time is
preferred.

MO-2eJ

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Monitor Overview

This scheduling philosophy has three parameters:
the
factor by which the time on each queue is greater than the
last, the amount of time allowed in the first queue, and the
number of queues.
The values chosen by TOPS-20 are graphically shown
below where a process runs from its queue for a given
quantum of time before being requeued to the end of the next
lowest priority run queue.
Processes completing their
quantum in MAXQ stay in MAXQ.

QUEUE

~

(HIGH-Q)

FOR INTERACTIVE (OR 1/0) PROCESSES

(ENTER HERE)

QUEUE 1
FOR "AVERAGE" PROCESSES

QUEUE 2
FOR "AVERAGE" PROCESSES

QUEUE 3 O''IAXQ)
COMPUTE BOUND
PROCESSES

D7 0048

Figure MO-S. Scheduler Queue Structure

MO-2l

«For Internal Use Only»

DIGIT.\L

TOPS-2g MONITOR
Moni tor Ov erv iew

While a process is active in the system, it will be
either on the go list (GOLST) or on one of the wait lists.*
The contents of the fork's entry in FKPT supply the list
name and the link to the next fork on the list. The table
FKPT holds the chain of fork pointers linked in a forward
direction for each list.
The chain pointed to by the
contents of GOLST is called the GOLST.

GOLS'J;'

I

FKPT

Fork #
BEST

0

.. 1

GOLST

2

3

GOLST

n

GOLST
D7 0649

Figure MO-9. GOLST Structure

*The wait lists
WT2LST, WTLST.

are:

TTLIST,

MO-22

FRZLST,

TRMLST,

CLKLST,

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Monitor Overview

Each fork is associated with one of the run queues, Q0
through 03.
One can think of the run queues as a linkage of
forks on the GOLST, where each fork's queue number is stored
in the table FKQ2. When a fork is removed from the GOLST
and put onto a wait list, its run queue number is still
remembered as well as the time it was placed on the run
queue. This time is kept in the table FKTIME.
When the fork's wait time is over, it must
back on the GOLST, its placement determined by:

be

placed

1.

The queue number of either the former queue or new
queue given to the fork as described in the previous
section.

2.

The fork's elapsed real time in the run queue before
being placed on the wait list.

MO-23

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Monitor Overview

FILE SYSTEM
Data Structure
File names and pointers to files are kept in a
directory.
Directories are also named, with their names
kept in a file called the ROOT-DIRECTORY.
Each entry in the
ROOT-DIRECTORY relates the name of the directory to its
location. Two home blocks (one used as a backup)
point to
the
ROOT-DIRECTORY.
Whenever
a
directory is being
referenced, the entire directory file is mapped into the
monitor's process address space. Pages are then faulted in
as needed. As far as disk page allocation is concerned, the
monitor keeps a disk bit table to keep track of which pages
are free and in use. This table is kept in a file on the
disk. Figure MO-l~ illustrates a structural overview of the
file system.

USER
DIRECTORIES
FILE

HOME BLOCK

ROOT
DIRECTORY

TEST 1

TEST 2

D7 0064

Figure MO-10. Extended File Structure

MO-24

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Monitor Overview

Each
file
on
the
disk
(ROOT-DIRECTORY,
user
directories, and user files) has at least one index block of
512 words which is essentially a page table where each entry
gives the location of one page of the file.
A file may be
logically ,as well as physically non-conti9uous. A file that
has page numbers <511 is called a short file.
Directory
files are always short files.
Files having page numbers
>511 are called long files. The location of index blocks
for a long file is given in a higher level
index block
called the Super Index Block. The Super Index Block, being
512 words long, allows a user file to have 512*512 pages.
See Figure MO-ll for a more detailed diagram of Figure
MO-10.

MO-25

«For Internal Use Only»

MASTER FILE
DIRECTORY

0

USER FILE
DIRECTORY

H
G)
H

USER FILES

1-3

)I'

HOME
BLOCK

INDEX
BLOCK

ROOT
DIR.

INDEX
BLOCK

INDEX
BLOCK

3:
I

----,
FILE

SMITH

o

USER
DIR.

USER
DIR.
TEST 11

L'

INDEX
BLOCK

~A

I

INDEX
BLOCK
I

SUPER::
INDEX BLK.

TEST2~

INDEX
BLOCK

N

~

INDEX

A

~

A
I"%j

o

PAGE 602

t'1
H

=='
rt
(1)

t'1
;:l

INDEX BLOCK
NEEDED WHEN USER FILE HAS
REFERENCED A FILE PAGE ~ 512
~SUPER

QJ

3:
01-3

10

;:l0
.... "'0

~

c::::

rt(J)

NOTE:

Ul

CD

o

INDEX BLOCKS AND
DATA BLOCKS ARE
A PAGE LONG.

I

t'1N

o

~

o

<3

=='
~

t'12

'<
v
v

(1)0

07 0067

Figure MO-11. Full File Structure

---

RPOLf./6

/
..... /1

~

IORB

i---

CDB

~

r-----...

/1
IORB

......
8 PTRS.

KDB::
UDB

••
•

/1

~

IORB
UDB
PWQ
TWQ

~

-

L-. /f
IORB

~KDB

~

-

(CONTROLLER DATA BLOCK) MAGTAPE ONLY
D7 0074

Figure MO-14.

PHYSIO Data Structure Linkages

MO-33

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Monitor Overview

FRONT END SERVICE
This section is designed to cover the functional
flow
of
information
between
the
two
processors of the
DECSYSTEM-20, the PDP-II, and the KLl~.
All unit record
equipment is attached directly to the PDP-II Front-End
Processor.
Input and output data is buffered by the
Front-End Processor. to remove some of the burden of I/O
handling from the KLI0. A program running on the KLI0 will
pass an entire block of line printer data to the Front-End
Processor, which will perform the necessary sequences to
cause it to be printed. The communication link between the
two processors is the UNIBUS device DTE20.
As a UNIBUS
device, it appears to the PDP-I! operating system, RSX20F,
as a standard UNIBUS peripheral and the microcode on the
KL10 side sees the DTE20 as a device on the EBUS.
TRANSFER BLOCKS
The primary
blocks:

protocol

builds

two

types

of

transfer

1.

Direct block - data is contained within the block

2.

Indirect block - data is stored as a seperate buffer

Both blocks contain a count, function,
device and a byte
pointer.
The device may be a pseudo-device similar to a
PTY. The count indicates directly the number of data items
to be transferred. The function field is used to indicate
to the receiver the method to be used in storing this data.
These blodks are l6-bit words to match the PDP-II format and
are referred to as a control packet. A control packet may
be passed in either direction and may occur simultaneously
to the transfer of a control packet in the opposite
direction. These two blocks are described in Figure MO-lS.

MO-34

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Monitor Overview

Direct

Indirect

COUNT

COUNT

FUNCTION
DEVICE

FUNCTION
DEVICE

SPARE

SPARE

·
·
Data
·

.Data

·

D7 0646
Figure MO-15. Transfer Blocks

MO-35

«For Internal Use Only»

DIGITAL

TOPS-2A MONITOR
Monitor Overview

TTY Input
Characters typed at the terminal are passed from the
Front-End Processor to the KLl0 processor where they are
stored in.a "Big Buffer". The monitor periodically sorts
these characters by line number into line buffers until a
wake-up character is recognized. This causes the requesting
process to empty the line buffer and reset the required
pointers to allow the: next line to be accepted.
The same
type of mechanism is used to build output line buffers to be
passed to the Front-End processor through its interface to
the terminal (except that they may be indirect packets).
The block built by the Front-End contains a count,
device, and function designator. The data received from the
terminals is appended to this header to form a Direct
Transfer Block. An example of this block is shown below.

18
LC
DLC
4
6
5
2

/
/
/
/

A
Q

COUNT
FUNCTION
DEVICE
LINE #/CHARACTER
LINE #/CHARACTER

L
E

D7 0647
Figure MO-16. Direct Transfer Block (Packet)

MO-36

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Monitor Overview

This block is built by the operating system on the 11
side (RSX20F) and is transferred to a fixed area in the KL10
memory under control of the micro-code. The DTE20 connects
the
two processors and holds the transfer parameters to be
used in requesting a transfer to the KL10.
A protocol
handler on the KL10 side takes the data from this fixed area
or region in KL10 memory and appends it to the circular
(ring)
buffer
known
as
"TTY Big Buff".
Every 20
milliseconds the monitor empties this buffer into the line
buffers.
If a line buffer becomes full, further typing on
the terminal will cause the character to be echoed as a
bell.
If a terminal (normally a buffered terminal) exceeds
the space allotted to it in the input buffer, an XOFF will
be sent to the terminal.
This eliminates buffer overrun and
allows the terminal to continue upon receipts of an XON from
the monitor. This sequence is further illustrated in Figure
MO-l 7.

RXS-20F

/~_D_T_E_2_0_...

TOPS-20

__

---'lIoo-----~

DIRECT TRANSFER BLOCK
COUNT

J.8
LC

FUNCTION
DEVICE
UNIT/DATA

••
••

DLC
4
5

A
C

7

B

PROCESS
A

PROCESS
B

D7 0072

Figure MO-17. TTY Input Overview

MO-37

«For Internal Use Only»

TOPS-20 MONITOR
Monitor Overvi~w

DIGITAL

An arbitrary limit of 100 characters has been set for a
transfer block.
Several direct transfer blocks may be
linked together
(appended to each other)
and may
be
terminated by an indirect block. These blocks are passed
between pr.ocessors as a single request by setting the byte
count in the DTE20 to be the sum of all blocks to be
transferred.
Interrupts from the DTE20 indicate completion of the
transfer into KL10 memory.
The module DTESRV recognizes
that a block is from a TTY by the device field. During the
next 20 milli-second scheduler cycle, TTYSRV is called to
sort the characters from "Big Buffer" into line buffers.
A
process blocked for input will remain in this state until a
wake-up character is received.
The
set
of
wake-up
characters consists of control characters, punctuation,
letters and/or numbers as indicated by the parameters of the
JSYS used.

Direct Transfer Block

Indirect Transfer Block

bits
COUNT
bi ts ~IU:r--I----t IND/FUNCTION
bits
DEVICE
bits
spare
8/ 8 bits
LINE #/DATUM
16
1/15
16
16

bitSEJCOUNT
bits
IN.D/FUNCTION
bits
DEVICE
bits
spare
8/ 8 bits
UNIT #/COUNT

16
1/15
16
16

data

D7 0650

Figure MO-18. Detailed Transfer Blocks

MO-38

«For Internal Use Only»

TOPS-20 MONITOR
Monitor Overview

DIGITAL

TTY Line Buffers and Echoing
Two character buffers are assigned to each line that
becomes active.
One buffer
is the
input buffer which
accumulates data as characters are moved from Big Buffer. A
copy of each input character will be placed into the other
buffer (the output buffer)
when the character is to be
echoed.
When
the
input buffer is full,
subsequent
characters will be echoed as the bell control character.
The output buffer consists of program characters to be
printed on the terminal and input characters to be echoed.
Echoing, if not disabled, is either performed at the
time the character is typed (immediate mode) or when it is
passed to the program (deferred). The deferred mode allows
immediate echoing if the process is in teletype input wait
when the character is typed. Deferred is the standard echo
mode and it produces a correctly ordered typescript (i.e.,
program input and output appear in the order they occur) •

Line Printer Output
Data to be passed to the printer is represented by a
header and an address.
These are used by the protocol
handler to deliver the data in the proper format to the
Front-End, eliminating the requirement to BLT the data to a
fixed area. The protocol between processors initiates two
transfers:
one to set up the Front-End to receive, and one
to initiate the data transfer.
Both are handled by the
DTE-20 operating in primary protocol using Indirect Transfer
Blocks and the doorbell mechanism.
Since line printer data and terminal output may consist
of blocks of information that can be passed as contiguous
data streams, the majority of KL10 to -11 transfers will use
the indirect mechanism.
(Device data for a specific device
is also implemented by the indirect mechanism.)
Transfers
from the -11 to the KL10 use the direct mechanism supplying
the line number and datum within the packet.
An overview of this process is shown in Figure MO-19.
The JSYS that initiates a line printer transfer invokes a
device driver. This device-dependent routine passes to the
protocol handler the parameters necessary to transfer the
block through the Front-End (to be handled and sequenced by

MO-39

«For Internal Use Only»

DIGITAL

TOPS-2~ MONITOR
Monitor Overview

RSX2~F)

to the printer. The block built contains a count,
function, and specific device. The KLl~ wakes up the -11 to
this transaction by ringing the II's doorbell. At the time
the doorbell is rung, the packet has already been set up and
stored in the DTE20. When the -11 acknowledges receipt, the
data packet can then be set up and sent.

MO-40

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR

Monitor Overview

RSX-20F

TOPS-20
DTE20

LINE
PRINTER

DATA

MR-2543

Figure MO-19.

Line Printer Overview

MO-4l

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Monitor Overview

This page is for notes.

MO-42

«For Internal Use Only»

DIGITAL,

TOPS-20 MONITOR
Monitor Overview

MODULE TEST
When' answer ing the lab exerc i ses, wr i te down the nam es
of the' tables where you found the answers. The labs will
help you understand the monitor data base structure;
so
remember, where to look is more important than what you find
there.
The exercises marked with a double star (**)
difficult and are optional.

are

more

Answering some of the exercises requires use of the
listings;
do not assume that the answer is in the tables.
After all, this is not a cookbopk course. '
TOOLS
FILDDT
FILDDT is a program that can be used to look at a crash
or at the running monitor. Use FILDDT as in the example
below to do this lab's exercises.
@ENABLE
$FILDDT
FILDDT>LOAD
FILDDT>PEEK

MONITR.EXE

;need enabled wheel
;capability to look at the
;running monitor.
;start the program
;load the symbols
;peek at the running monitor

At this point, the usual DDT commands allow you to look at
the running monitor. You cannot change any locations (i.e.,
you have no write privileges).
Also, your process will
always be running when you look because the mechanism to
look at the running monitor is I ike a JSYS whose function is
to let you use DDT from monitor context.

MO-43

«For Internal Use Only»

DIGITAL

TOPS-2ICJ MONITOR
Monitor Overview

EPT (Executi ve Process Tabl e)
Introduction
The EPT is the hardware/software interface for ,most
system-wide information.
Some EPT locations 'must contain
hardwa re-defined info rmation. These locations are set up by
the softwar,e and used! by the hardware. For example, devices
interrupt to location. In the EPT;
the monitor's s~ction
pointers are in the EPT; 'and the exec mode overflow trap
instructions are in the EPT. The software loads the base
address of , the EPT into a hardware register called the EBR
(exec base register) so the hardware knows where the EPT
beg ins.
The EPT is one page in len~th, but only a small
percentage of the locations have hardware-defined uses. The
remaining EPT locations are used solely by the software.
Note a1 so that the hardware uses of the table are different
for TOPS-2" and TOPS-10; that is, the microcode differs in
its use of the EPT.
The EPT is in the monitor's address space beginning
1 oca tionKI EPT.

at

RESOURCES
1.

12.
3.

Read and use as a reference section 3.4 of the
Hardware' Reference Manual; this section describes
TOPS-2e paging and ptocess tables.
The EPT is pictured in the Student Guide.
)

The EPT table is in the Monitor Tables.

EXERCISES
Vectored, Interrupt Locations
The devices on the sy~tem ,use vectored interrupts;
these 'interrupts all vector into the EPT (but/do not need
to). Vectored interrupts make polling all devices on the

MO-44

«For Internal Use Only»

DIGITAL

MONIT,OR

TOPS-2~

Monitor

Overvi~w

same priority level unnecessary since each device can vector
to i t sown ass i 9 ned 1 oc a t ion •
See section 3 • 1
(priority
Interru~ts)
of the Hardware Reference Manual for more
info'rmation.

, . . - - - - - - - - - - - NOTE - - - - - - - - - - . . . . ,

Each
interrupt
location
uses
the
instruction JRST 7,XXX (mnemonic XPCW).
See the section on the JRST instruction
(page 2-7~)
in the Hardware Reference
Manual for information on how
this
instruction works.

DTE-2~

1.

Where does each
control pass?

interrupt

2.

Where do RH2~s interrupt
pass for each RH2~?

3.

Where does the interval timer interrupt
does control pass?

and

and

where

where
does

does

control

and

where

Standard Interrupt Locations
Standard interrupts come in to the EPT at offset
2N where N is the priority interrupt level.
each

of

standard

+

interrupt

1.

What is in
locations?

?

Where does control pass for each standard interrupt
locati-on and what processin9 happens there?

3.

Which priority levels do you believe
interrupts?
.

MO-45

the

4~

use

standard

'«For Internal Use Only»

TOPS-2 frJ MONITOR
Monitor Overview

DIGIT~L

Exec Mode Trap Instruc tions
The Exec mode POL overflow anq ~rithmet~c o,,-erf~()wt~ap
instructions are in the EPT. This is where the processor,
traps wh~n one of these conditions occurs.
The trap
instruction in the appropriate location is executed.
"-

What is the Exec
instruc tion?,

2.

What 'will happen when this instruction is executed?

3.

What is the Exec mode stack lover flow instruction?

4.

What will happen when this instruc tion is executed?

5.

What is the trap 3 trap instruc tion?

mode

arithmetic

overflow

trap

I.

Exec Mode Section Pointers
The Exec mode section pointers are in the EPT beginning
at location MSECTB. The offset from MSECTB is the section
number. On a model A maohine, only section A can exist. On
a model B machine, sections 0-5 are used. Refer to the
section on extended addressing in your Student Guide for
information on the use of each section on a model B machine.
Note that the section pointers are "KL paging" format
po inter s.
1.

How many sections are .in use on
doing your lab with?

2.

What kind of pointer(s)
section?

MO-4~

is/are

th~

in

machine you are
use

for

each

«For Intern,l Use Only»

DIGITAL

TOPS-20 MONITOR
Moni tor Overv iew

DTE-20 Control Blocks

**

The EPT has spacefo r four DTE control blocks, one for
each possible DTE. Each block is eight words long. Refer
to the EPT table in your Monitor Tables for a detailed
layout of ' this area.

1.

What are the examine protection and relocation·
words used for?
What are they set up as in the
running monitor? **

2.

What are the deposit protection and relocation
words used for?'
What are they set up as in the
running monitor? **

3.

What are the To -11 and To

\

-l~

byte

pointers

for.?

**
Channel Logout Areas
There is a channel logout area for each possible RH20
on the system.
Refer to the EPT, table in your Monitor
Tables; do you know what each word is used for?

MO-47

«For Internal Use Only»

TOPS-2A MONITOR
Monitor Overview

DIGITAL

UPT
Overv iew
The UPT is the hardware/software interface for most
process-specific information. The UPT is one page in length
but only a few of the locations have hardware-defined uses.
The remainder of the, UPT page is used for software purposes
only. The UPT page is called the PSB by the software. This
page is called the UPT when referring to its hardware
functions and the PSB when referring to its software
functions.
Since
the
UPT/PSB
page
has
process-speci,fic
information, it is context switched. The current process's
UPT/PSB page is always mapped into the monitor's address
space beginning at location PSB.
RESOURCES
1.

Hardware Reference Man,ual.

2.

UPT picture in the Student Guide.

3.

PSB table in the Monitor Tables.

EXERCISES
Overflow Trapping
User push down overflow and
trap to locations in the UPT.

user

arithmetic

overflow

1.

What is the stack overflow trap instruction?

2.

What is the arithmetic overflow trap instruction?

3.

What will happen when the 'stack
instruction is executed?

MO-48"

overflow

trap

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Monitor Overview

4.

Using the information in the UPT, figure out what
routine
gets
executed
ona user-mode stack
overflow. And then, using the microfiche, trace
the routine; what does the routine do?

Pag e Faul t Wo rds
When a page f aul t occurs, the page fail wo rd and the PC
of the page fault are stored in-the EPT; the processor
picks up the new PC from the page fail new PC word (and
switches to Exec mode i~ not already in Exec mode). Read
the section entitled Page Fail ure on page 3-34 of the
Hardware Reference Manual for more information.
1.

What is in each of the page faul t wo rds?

2.

Where does page fault handling begin?

3.

Wha t routine handles a page faul t fo r the sched ul er
and what does this routine do when a page fault
occurs? **

~-------------------

NOTE

--------~----------~

When a page fault occurs, the processor
always traps to the UPT, regardless of
the
mode
the
processor
is
in.
Therefore, the scheduler has its own UPT
which is context switched
for
the
scheduler when it is running. A copy of
this UPT is always a part of
the
monitor's address space (even when it is
not being used as the current UPT);
thi s ·copy.' beg ins a t add ress SKHWPT.

MO-49

«For Internal Use Only»

DIGITAL

TOPS-29 MONITOR
Monitor Overv iew

User Section Pointers
The user section ~ointers begin at address USECTB.
Currently, only one user section is supported~ Note that
these pointers are standard KL paging pointers.
1.

What is the current pointer for user section 9?

2.

What is the storage address
map?

for

the

user's

page

Accounting Meters
For information on the accounting meters, read the
section entitled User Accounts, page 3~52 of the Hardwar~
Reference Manual. Note, however, tha t TOPS-29 does not
currently use the accounting meters.

MO-59

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Monitor Overview

TEST EVALUATION SHEET
EPT (Executive Process Table)
EXERCISES
Vectored Interrupt Locations
1.

Where does each DTE-20
control pass?

interrupt

and

where

does

ANSWER:
Each DTE interrupts into the third word of
lts DTE-20 control block in the EPT. For each DTE
on the system, the DTE-20 control block is set up
dynamically;
the interrupt location contains a
JRST 7,DTETRP+4n where n is the DTE-20 number. The
old PC is stored in the first two locations of
DTETRP+4n and the new PC is picked up from the
second two locations of DTETRP+4n; the new PC is
DTETRP+4n+5, which is always a JSR to SVDTRJ.
Location SVDTRJ does a JRST to SVDTAC, which is
where DTE interrupt processing begins.
KIEPT+142+4n/ JRST 7,DTETRP+4n
DTETRP+4n/ old PC flags
/ old PC
/ new PC flags
I new PC = .+1
I JSR SVDTRJ
SVDTRJ+l / JRST SVDTAC

MO-5l

«For Internal Use Only»

DIGITAL

2.

TOPS-20 MONITOR
Monitor Overvi~w
Where do RH20s interrupt
pass for each RH2~?

and

where

does

control

ANSWER: Each RH20 vectors into the fourth word of
its channel logout area in the EPT;
that location
contains a JRST 7,CDB-6
(i.e., six locations in
front of the channel's COB). Register PI is saved
in the COB and then control is passed to routine
PHYINT in PHYSIO.
KIEPT+3+4n/ JRST 7,CDB-6
CDB-6

3.

/
/
/
/
/
/

old PC flags
old PC
new PC flags
new PC = .+1
MOVEM PI,.+2+CDBSVQ
JS P P 1 , PRY INT

Where does the interval timer interrupt
does control pass?

and

where

ANSWER:
The interval timer does
a
vectored
interrupt to KIEPT+5l4;
this location contains a
JRST 7, TI MINT. The new PC is TIMIN0, which is in
APRSRV.
KIEPT+514/ JRST 7,TIMINT
TIMINT

/
/
I
/

old
old
new
new

PC flags
PC
PC flags
PC = TIMIN0

MO-52

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Monitor Overview

Standard Interrupt Locations
1.

What is in
I oca tions?

each

of

the

standard

interrupt

ANSWER:
KIEPT+40/
KIEPT+41/
KIEPT+42/
KIEPT+43/
KIEPT+44/
KIEPT+45/
KIEPT+46/
KIEPT+47/
KIEPT+50/
KIEPT+5l/
KIEPT+52/
KIEPT+53/
KIEPT+54/
KIEPT+55/
KIEPT+56/
2.

0
0
0
0
0
0
JRST
0
JRST
0
JRST
0
JRST

7,PIAPRX

; level 3

7,PI4R

;level 4

7,PI5R

;level 5

7,PI6R

;level 6

0

JRST 7,PISC7R

; level 7

Where does control pass for each standard interrupt
location and what processing happens there?
ANSWER:
Channel 3 - new PC at PIAPRX+3 = PIAPR+I in APRSRV;
this routine handles interrupts for the APR device.
Channel 4 - new PC at PI4R+3 = PISC4+l in STG;
this routine saves a few ACs, restores them and
dismisses the interrupt. However, note that there
is some code that is not assembled.
Channel 5 - new PC at PI5R+3 = PISC5+l in STG;
this routine saves a few ACs, restores them and
dismisses the interrupt. However, note that there
is some code that is not assembled;
if the machine
is 2020, SMFLG=l and the call to UNBCH5
is
assembled.
Channel 6 - new PC at PI6R+3 = PISC6+l in STG;
this routine saves a few ACs, restores them and
dismisses the interrupt. However, note that there

MO-53

«For Internal Use Only»

DIGITAL

TOPS-2~ MONITOR
Monitor Overview

is some code that is not assembled;
is a 2~2~, SMFLG=l and the call
assembled.

if the machine
to DZCTIN is

Channel 7 - new PC at PISC7R+3 = PISC7+1 in SCHED;
this routine 6andles the "software clock" that
drives the overhead cycle.
3.

Which priori ty levels do yo u bel ieve
interrupts? '

use

standard

ANSWER:
For standard 2050/20~0 monitors, only
levels 3 and 7 are used. Level 3 handles the APR
device (for memory parity errors, etc.) and level 7
is the "software clock" that drives the scheduler.
On a 2~20, since there is no front end, more
priority
interrupt levels are used to handle
devices that the front end handles on a 2050/2060
or that do not exist on a 2~50/2~60.
For a 2020,
the Unibus adapter is on channelS and uses routine
UNBCH5;
terminal
interrupts are on channel 6 and
are handled by routine DZCTIN.
Exec Mode Trap Instructions
1.

What is the Exec
instruction?

mode

arithmetic

overflow

trap

ANSWER:
Exec mode arithmetic overflow traps to
offset 421 in the EPT. This location contains a
JFCL.
2.

What will happen when this instruction is executed?
ANSWER:

3.

Nothing;

it is a no-oPe

What is the Exec mode stack overflow instruction?
ANSWER: Exec mode stack overflow traps to offset
422 in the EPT. This location contains: .PDOVT =
4200~, ,0

MO-54

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Monitor Overview

4.

What will happen when this instruction is executed?
ANSWER:
42 is an illegal op-code and is therefore
handled as a UUO.
However, since i t i s executed
from a trap instruction, the new PC is picked up
from the Kernel trap MUUO new PC word in the UPT
(offset 431).
Offset 431
in the
UPT
(PSB)
contains:
1"KITRPS. Therefore, when a push down
list overflow occurs in Exec mode,
routine KITRPS
is
executed.
This routine executes a MONPDL
BUGHLT.

5.

What is the trap 3 trap instruction?
ANSWER:
If the arithmetic overflow and stack
overflow PC flags are on at the same time, the
machine traps to the trap 3 trap instruction. This
never happens unless the PC flags are deliberately
set.

Exec Mode Section Pointers
1.

How many sections are in use on the machine you are
doing your lab with?
ANSWER:
Section pointers are set up for sections
0-3 whether the machine is a model A or a model B
machine. However, only section 0 is used on a
model A machine.
Sections 0 and 1 have the same
section pointer. Section 2 has an indirect pointer
through location DRMAP in the current PSB; DRMAP
contains a zero for model A machines.
Section 3
has an indirect po inter through location IDXMAP in
the current PSS;
IDXMAP contains ~ zero for model
A machines. Location DIRORA (the directory origin)
contains
[DRSECN,,0]
for Model B machines and
[MSECI, ,740000]
for Model A machines. Location
EXADDR is used as a flag to note whether this is a
model A or model B machine;
if EXADDR contains 0,
this is a model A machine.

MO-55

«For Internal Use Only»

TOPS-20 MONITOR
Monitor Overvi~w

DIGITAL

2.

What kind of pointer(s)
section?

is/are

in

use

for

each

ANSWER: Sections 0 and 1 have share pointers to
MMAP
(contents of MMSPTN). Sections 2 and 3 have
indirect pointers through locations in the PSB.
Section 4 is used to map the bit table; the bit
table is only mapped while it is being updated.
DTE-20 Control Blocks
1.

**

What are the examine protection and relocation
words used for?
What are they set up as in the
running monitor? **
ANSWER: The examine relocation word is the first
word of KL memory that a DTE-20 has read access to;
the examine protection word is the size of the
region
(beginning at the examine relocation word)
that this DTE-20 can read.
KIEPT 144/ 225
KIEPT 145/ COMBUF+3
KIEPT 144+10/ 226
KIEPT 145+10/ COMBUF+2

2.

What are the deposit protection and relocation
words used for?
Wh~t
are they set up as in the
running monitor? **
ANSWER: The deposit relocation word is the first
word of KL memory that a DTE-20 has write access
to;
the deposit protection word is the size of the
region
(beginning at the deposit relocation word)
that this DTE-2~ can write into.
KIEPT 146/ 30
KIEPT 147/ COMBAS+60
KIEPT 146+10/ 30
KIEPT 147+10/ COMBAS+110

MO-56

«For Internal Use Only»

TOPS-20 MONITOR
Monitor Overview

DIGITAL

3.

What are the To -11 and To -10 byte

pointers

for?

**
ANSWER:
The To -11 byte pointer
is used as the
byte pointer to the data for indirect transfers;
the To ~10 byte pointer is used as the byte pointer
for where to put the data transferred from the
PDP-II.
Channel Logout Areas
Th~re

on the
Tables;

is a channel logout area for each possible RH20
system.
Refer to the EPT table in your Monitor
do you know, what each word is used for?

ANSWER;
The first three words contain channel command list
lnformation for the last transfer on that channel. Word 4
is the vectored interrupt location for the channel.

MO-57

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Monitor Overview

UPT
EXERCISES
Overflow Trapping
1.

What is the stack overflow trap instruction?
ANSWER: Offset 422 in the UPT (PSS) is the stack
it contains • POOVT =
overflow trap location;
42000,,0

2.

What is the arithmetic overflow trap instruction?
ANSWER:
Offset 421 in the UPT (PSS) is the
arIthmetic overflow trap location;
it contains
JFCL (unless the user has enabled the PSI system to
handle arithmetic overflow).

3.

What will happen when the
instruction is executed?

stack

overflow

trap

ANSWER: Op-code 42 is an illegal instruction and
1s handled as a UUO except that it is being
executed as a trap instruction; therefore, the new
MUUO PC is picked up from the concealed trap MUUO
new PC wo rd whi ch is offset 435 in the UPT.
Thi s
address is KITRPU.
4.

Using the information in the UPT, figure out what
routine
gets
executed
on a user-mode stack
overflow. And then, using the microflche, trace
the routine; what does the routine do?
ANSWER;
KITRPU in APRSRV is
routine looks to see the if
channel is enabled for this fork
and initiates the interrupt.

MO-58

executed;
this
the POL overflow
or its superior

«For Internal Use Only»

TOPS-20 MONITOR
Monitor Overview

DIGITAL

Pag e Faul t Wo rds

1.

What is in each of the page fault words?
ANSWER:
The
following:

page

fault

words

conta in

the

UPTPFN= PSB+500 / page fail word --contains failure
type code and virtual address that page faulted.
UPTPFL= PSB+501 /

page fail flags (old PC)

UPTPFO= PSB+502 / old PC
UPTPFN= PSB+503 / new PC = PGRTRP
2.

Where does page fault handling begin?
ANSWER:

3.

PGRTRP in PAGEM

What routine handles a page fault for the scheduler
and wha t does thi s routin.e do when a page faul t
occurs? **
ANSWER: Offset 503 of the SKHWPT is the new PC for
page
fault
handling;
this location contains
address RIPFS.
!his routine executes a BUGHLT
because the scheduler is currently not expected to
pag e faul t.

User Section Pointers
1.

What is the current pointer for user section 0?
ANSWER:

USECT6+0 is the section pointer
for
it contains a share pointer to the page
map for section 0.
s~ction 0;

2.

What is the storage address
map?

for

the

user's

page

ANSWER:
The SPT slot indicated by the share
pointer contains the storage address for the user's
page map.

MO-59

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Monitor Overview

This page is for notes.

MO-60

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Monitor Overview

APPENDIX A
MONITOR MODULES
I.

MONITOR KERNEL

A.

Management
Allocation

II.
&

APRSRV
FORK
LDINIT
PAGEM
POSTLD
SCHED
SWPALC

III.

B.

Device Drivers
CDRSRV
DTESRV
IMPANX
LINEPR
PHYH2
PHYM2
PHYP4
PHYSIO
TTYSRV

IV.

UTILITY MODULES

FILE SYSTEM
DEVICE
DIRECT
DISC
DSKALC
FESRV
FILIN I
FILMSC
FREE
GTJFN
IMPDV
IO
LiSYSA
JSYSF
LOGNAM
LOOKUP
MAGTAP
MSTR
NETWRK
NSPSRV

DATA BASE
GLOBS
PARAMS
PHYPAR
PROLOG
SERCOD
STG

BOOT
COMND
DATIME
DIAG
EDDT
ENQ
FUTILI
IPCF
MDDT
MEXEC
MFLIN
MFLOUT
MR
SYSERR
TAPE
TIMER

A-I

«For Internal Use Only»

DIGITAL

TOPS-2 C?J MONITOR·
Monitor Overview

A-2

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Monitor Overview
MONITOR KERNEL

A.

Management & Allocation
APRSRV
This is the processor dependent service module which
contains the
initialization code for paging, MUUO
handlers, and the priority interrupt system as well
as for the clocks, APR, and DTE devices. Interrupt
handling for these devices, pager control routines,
and pre- and post- JSYS handling is also performed
here.
FORK
Fork controlling JSYSs and support code.
LDINIT
At load time, this module defines
the JSYS dispatch table JSTAB.

storage

PCs

for

PAGEM
TOP8-20 page management code;
core
management
routines, swapper routines, pager trap logic, OFN
control, and CST and 8PT initialization.
P08TLD
This code runs immediately following the loading of
the monitor and performs functions outside the
capabilities of LINK.
It will move the symbol table
to its runtime location, pruning it as necessary.
It will then build the MONITOR.EXE file, write a
BUG8TR text file and delete itself from core.
SCHED
This module contains the Channel 7 interrupt routine
(which performs context switching), the TOPS-20
scheduler,
the
job/fork
initialization/dismiss

A-3

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Monitor Overview

. routines, and the Program Software Interrupt (PSI)
analysis and resolution routines.
SWPALC
This is the swapping space allocator which handles a
device of some number (SWPSEC) of sectors, and some
number (DRMMXB) of tracks. It has a resident bit
table used to allocate swapping storage.
B.

Device Drivers
CDRSRV
Card Reader Service.
DTESRV
DTE Service Driver; protocol handler
to and from the Front-End.

for

requests

IMPANX
This module contains the device dependent code for
the
Interface-Message-Processor
(IMP)
device
connected to a-10/-20 on the ARPA--network.
LINEPR
Lineprinter service.
PHYH2
Channel-dependent code for RH20 controller at direct
I/O level.
PHYM2
Channel-dependent code for TM02/TM45 magtapes at
direct I/O level.

A-4

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Monitor Overview

PHYP4
Device-dependent code for RP04/6 disks at direct I/O
level.
PHYSIO
This module handles the channel and driver
routines.
It is responsible for queueing
requests into their proper queue, choosing
"best" request for seeking and/or transferring
starting I/O.

I/O
I/O
the
and

TTYSRV
This is the terminal service module containing the
TTY
I/O
drivers,
special
control
character
conversion routines, terminal JSYS routines and the
interface to the primary and secondary protocols in
DTESRV.
Its device dispatch table is contained in
FILMSC.
FILE SYSTEM
DEVICE
Device and initialization look-up code.
DIRECT
Disk file and directory management code.
DISC
This module contains the pre-PHYSIO disk-dependent
routines for I/O JSYSs and a dispatch table of
vectored addresses (DSKDTB) which points to them.
DSKALC
Drive-independent code for disk

A-S

block allocation.

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Monitor Overview

FESRV
Device code for FE devices., This code contains the
device-dependent routines for the FE pseudo-devices
F~0-FE3.

FILINI
This module contains code
system at system startup.

to

initialize

the

file

FILMSC
This module contains miscellaneous routines for the
PTY, TTY STRING and NULL I/O devices and also
includes a device dispatch table for each of these
devices.
FREE
Job storage free area management.
GTJFN
Contains the code for GTJFN,
and
supporting
look-up, recognition, and
file names.

the
JSYSs
creation of

IMPDV
This module contains the Interface-Message-Protcol
(IMP) 'device-independent code. It runs cyclically
as a separate fork (i.e., under JOB0)
and handles
the
interface to the ARPA network by monitoring
network activity and managing the message queues.
IO
Contains most of the device-independent sequential,
random,
and dump input/output routines for BIN,
BOUT, SIN, SOUT, DUMPI, and DUMPO.

A-6

«For Internal Use Only»

TOPS-20 MONITOR
Monitor Overview

DIGITAL

JSYSA
Random JSYSs for system and directory access, device
allocation,
job
parameter
settings,
system
accounting (EFACT) and file/fork mapping (PMAP).
JSYSF
Contains code that implements
JSYSs.

various

file

system

LOGNAM
Contains the logical name definition and recognition
JSYSs and routines.
LOOKUP
Device-independent file name look-up.
MAGTAP
This
module
contains
the
pre-PHYSIO
mag tape-dependent routines fo r I/O JSYSs and a
dispatch table of vectored addresses (MTADTB)
which
points to them.
MSTR
Contains the code to
structure JSys, MSTR.

implement

the

mountable

NETWRK
This module contains the interface for all standard
I/O JSYS5 that communicate with the ARPA-network.
It a'l so prov ides a fin i te sta te machine 0 f v ar i ous
events associated with a connection for the network
control program (NSP).

A-7

«For Internal Use Only»

TOPS-20 MONITOR
Monitor Overview

DIGITAL

NSPSRV
This module contains the control routines and JSYS
interfaces for the host-to-host protticol of DECnet
known as NSP, which allows communication between
processes on hosts by means of logical links.
UTI LITY MODULES
BOOT
BOOTSTRAP for the system.
COMND
Code for the COMND JSYS, which is used
programs for consistent command parsing.

by

user

DATI ME
Code for the date and time conversion JSYSs.
DIAG
This module contains code to support the DIAG JSYS
for the KL10.
EDDT
Exec mode DDT is loaded as part of the resident
monitor
and
used for debugging basic moni tor
func tions.

Thi s mod ul e impl ements the ENQ/DEQ faBility to
access to user specified
control
simul taneous
sharable resources.

A-8

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Monitor Overview

FUTILI
Contains routines to copy strings to/from
routines to get a yes/no answer from CTY.

JSBs

and

IPCF
Code for
facility;

the system interprocess
Code for [SYSTEM] IPCC.

communications

MOOT
This is a version of DDT which runs in the monitor
space for debugging processes on TOPS-20. This
version runs under timesharing.
MEXEC
This module contains the MINI-EXEC which is a
limited
command interpreter for certain system
loading/maintenance functions and swappable monitor
bootstrap procedures.
It is part of the swappable
monitor and also contains many JSYS routines.
MFLIN
Floating point input and conversion JSYSs.
MFLOUT
Floating point output and conversion JSYSs.
MR
Floating point double-precision arithmetic routines.

A-9

«For Internal Use Only»

DIGITAL

TOPS..,.20 MONITOR
Monitor Overview

SYSERR
Error reporting module for field service.
TAPE
This module contains the tape-table handler and
record proc~s~or.
TIMER
This module implements the TIMER JSYS and all of its
support.
This includes scheduler clock routines
(called from CLK2CL) and the code to kill the
pending clock belonging to a dying fork (KSELF).
DATA BASE MODULES
GLOBS
All globals are defined as external herewith QEXT
macro.
(Note, do not confuse thi s mod ul e wi th the
global cross-reference file, GLOB, produced
at
monitor assembly time.)
PARAMS
This module contains one of the parameter files,
PARBCH, PARSML, PARMIN, PARMED, PARBIG, depending on
the size
of
the
monitor
required
by
the
installation.
The parameters in these files affect
the 'space allocated for swapping
and
monitor
resident tables.
The assembled executable code is
not affected.
PHYPAR
Universal file for PHYSIO and associated modules.
It contains the definitions for the Channel Data
Block, Channel Dispatch Table, Unit Data Block, Unit
Dispatch Table, and the Input/Output Request Block.

A-10

«For Internal Use Only»

DIG I1'AL

TOPS-20 MONITOR
Monitor Overview

PROLOG
This is a file of parameters, storage assignments,
and macro deffnitions.
The major regions of the
.monitor address space are defined as well as macros
affecting PI bug strings, pseudo-interrupts, and
scheduling. All PSB and JSB storage defined by the
monitor at assembly time is specified here.
SEReOD
This module contains the error codes and fields for
SYSERR,
a
program
which
produces
hardware
performance reports for field service personnel.
STG
The bulk of the monitor storage, both resident
nonresident, is defined in this module.

A-Il

and

«For Internal Use Only»

DIGITAL

TOPS-2~ MONITOR
Monitor Overview

This page is for notes.

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Monitor Overview
APPENDIX 8
MONITOR'S VIRTUAL ADDRESS SPACE

Every user
job in TOPS-20 comprises one or more
processes.
Each process has two memory maps which describe
the virtual core assignment for the process when it is
executing in user or monitor mode.
The user page map
completely describes the user space for the currently
running process;
the executive page map describes the
mapping for the monitor's address space. The user space and
256K
PROCESS STORAGE

JOB STORAGE

200K

SWAPPABLE MONITOR.

102K
PER PROCESSOR PRIVATE PAGES
~

II

,,

}'
~~
..

RESIDENT VARIABLES

EDDT
SYMBOLS

23K

RESIDENT MONITOR

MR-3146

Figure 8-1. Monitor Virtual Memory Map

8-1

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Moni to r Overv iew

the moni tor space are each 256K. - New maps are loaded when a
new process is selected to run, with the user map reflecting
the current allocation of the user's virtual address space,
and the monitor map reflecting the per-process allocation of
the monitor's address space.
Notice, however, that the
major portion of the monitor's page map is used to map the
resident and non-resident parts of the- TOPS-20 monitor.
Figure 8-1 is a simplified diagram of the monitor's virtual
memory map.
The monitor consists of two logical sections: resident
and non-resident code. Resident code is non-swappable and
contains the scheduler, pager, basic interrupt and JSYS
dispatch handlers and tables. The non-resident portion on
TOPS-20 consists of swappable code and data which mayor may
not be in core at any given time (depending on system
utilization).' The RESCD macro causes code to be placed in
the resident portion of the monitor. The SWAPCD macro will
allow it in the swappable portion. The resident portion of
the monitor is the same for all processes and will be
disc us s ed fir st.

B-2

«For Internal Use Only»

TOPS-20 MONITOR
Monitor Overview

DIGlTI\L

RESIDENT MONITOR
Page 1 of the monitor is the JSYS dispatch table:
1000
long with one entry for each JSYS. The right half of
ea~h entry qontains the monitor PC describing where to start
executing.
Page 2 is the Executive Process Table. Page 3
is the scheduler page table which is used by the scheduler
when it is called to select a new process to (un.
wOfds

VIRTUAL PAGE NUMBER

275 8

141

I

RESIDENT VARIABLES
(CST'S, SPTO, SPT, ETC.)

74
MONITOR'S PAGE TABLE (MMAP)

73
SCHEDULER'S UPT (SKHWPT)

72
EPT
71

EDDT
MONITOR SYMBOLS

55
RESIOENT MONITOR CODE
(SCHED, PAGEM & DEVICE SERVICE ROUTINES)

JSYS DISPATCH TABLE

o
Figure B-2. Resident Monitor

B-3

MR-3168

«For Internal Use Only»

TOPS-20 MONITOR
Monitor Overview

DIGITAL

Pages 4-60 octal house the resident variables
(i.e.,
those defined by the RS macro).
Included here are the SPT,
S5PT, and CST tables used by the pag ing hardwar e. The size
of this area will vary depending on the size of the system.
Resident monitor code sits between pages .60 and 140 and
contains the paging and scheduling software and peripheral
device interrupt and error processingrout-ines. The symbol
MONCOR points to the highest location used by the resident
monitor code. Above this sits an optional area consisting
of EDDT and symbols. Since this area is 30-40 pages, it is
only in core when the system is being debugged.

B-4

«For Internal Use Only»

TOPS-20 MONITOR
Monitor Overview

DIGITAL

NON-RESIDENT MONITOR
The swappable code of the monitor really starts at page
270
(see
Figure B-3).
Pages 270-276 belong to the
per-processor private page area.
Since
the
current
implementation supports only one CPU, this area can be used
by the swapper for temporary pages. Pages 277-323 contain
swappable variables the monitor needs and are reserved by
the NR macro. A free space pool al so si ts here and incl udes
temporary storage for ENQ/DEQ and IPFC.
Pages 324-527
contain the swappable monitor containing the bulk of the
JSYS code, MDDT and symbols, and the MINI-EXEC. This area
is write-protected.
Pages 530-617 are swappable
page
storage reservable by the NP macro. Here lies a one-page
buffer for each line printer and any other device that needs
one.
Pages 620-717 are the Job Storage Block, an area that
is context-switched whenever a new job is run but is shared
among all forks in a job.
This area contains descriptor
blocks
(approximately 20 words in length) for every JFN
known to the user. These blocks reflect the current state
of the opening of a
file.
Pointers to filename, type,
version, directory and device names, and pointers to the OFN
and wildcard masks are stored. The GTJFN JSYS builds these
blocks;
the actual ASCII strings are stored in a free space
pool in the JSB.
Information is kept in the JFN for File
~/O as well (i.e., the file's page, byte
position, status,
length, etc.).
Pages 720-777 comprise the Per-Process Storage Area.
This virtual core is switched every time a new process is
run and is not the same for all forks in a
job.
Included
here from pages 740-770 is the directory currently being
scanned, which is PMAPed directly into this space for use by
GTJFN and other related JSYSs. Pages 720-737 are used for
special util ity fork and swapper functions and the IDXFIL
table. Page 777 is the Process Storage Block which contains
a per-process pushdown list and a monitor page table for
pages 720 and up. Also included here is space for saving
multiple sets of ACs needed in the situation of nested JSYS
calls, and tables for holding local fork handles.

B-5

«For Internal Use Only»

DIGITAL

TOPS-29 MONITOR
Monitor Overview

7778
PSB-

776

MAP FOR PAGES 707-777
PROCESS INFO, (I.E., PUSH DOWM LIST, AC SAVE AREA)

PER PROCESS STORAGE

707
PER JOB STORAGE
(I.E. FI LE STRINGS & FI LE I/O BUFFERS)

620

MAP FOR PAGES 6 2 0 - 7 0 6 ,
JSB- JOB INFO, (I.E., ACCOUNT, FORK STRUCTURES, JFN BLOCKS)
....
,

SWAPPABLE PAGE STORAGE
(LINEPRINTER BUFFERS, ETC.)

536

SWAPPABLE MONITOR
(MOST JSYS'S, MDDT, MINI-EXEC)

344
313

SWAPPABLE VARIABLES
(MONITOR TABLES, IPCF FREE'SPACE)
PER PROCESSOR PRIVATE PAGES

307
MR-3169

Figure 8-3.

Nonresident Monitor

8-6

«For Internal Use Only»

TOPS-20 MONITOR
Coding Conventions

«For Internal Use Only»

TOPS-20 MONITOR
Coding Conventions

DIGITAL

COURSE MAP

MR-2717

CC-i

«For Internal Use Only»

DIGITAL

TOPS-2~ MONITOR
. Coding Conventions

This page is for notes.

CC-ii

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Coding Conventions

Cod.ing Conventions
INTRODUCTION
There is a set of standard macro and
symbol definitions used in writing monitor
code
(and some support programs).
This
module will cover the use of the more common
of these macros and other TOPS-20 coding and
naming
conventions.
Knowledge of these
conventions will help greatly in the reading
of TOPS-20 monitor listings. A listinq of
MACSYM will be found at the end of this rrodule.

CC-l

«For Internal Use Only»

DIGITAL

TOPS-2~ MONITOR
Coding Conventions

....------LEARNING OBJECTIVES - - - - - - - - .
Upon completion· of
student will be able to:

this

module,

the

Determine the code generated and/or the
function a~plied by the various macros and
pseudo-ops used in the TOPS-2~ monitor.

CC-2

«For Internal Use Only»

TOPS-20 MONITOR
Cod ing Co nvent ions

DIGITAL

MODULE OUTLINE
CODING CONVENTIONS
I.

Using MACSYM
A.
Symbol Definitions
B. Macros To Manipulate Field Masks
C.
Instructions Using Field Masks
D. DEFSTR -- MSKSTR Data Structure Facilities
1.
LOAD
2. STOR
3.
Exa"mpl es
E.
F.
G•

II.

III.

Subroutine Conventions
Named Variable Facilities
Mi scell aneo us

TOPS-20 Coding Standards
A.
Subroutine Calling - JSYS
B. Subroutine Calling
C. AC Definitions
D. AC Saving and Restoration
E.
Subroutine Documentation
F. Multi-line Literals
G. Numbers
Appendices

CC-3

«For Internal Use Only»

DIGITAL

TOPS-20 MO,N ITOR

Coding Conventions

This page is for notes.

""""1':t __ ,._.L. ____ ,

"rvl.

J..U,""Cl.llQJ..

" __

Ui:)C

1"\,_'
.."-..'Vll.Ly""""

TOPS-2eJ MONITOR
Coding Conventions

DIGITAL

USING MACSYM
MACSYM is available on SYS:
in two forms:
MACSYM.UNV
and MACREL.REL.
The first of these is the universal file of
macro and symbol definitions;
the second is a file of small
support routines
used
by certain facilities (e.g., stack
variables).
The universal
file
is normally obtained at
assembly time by the source statement
SEARCH MACSYM
The object file, if necessary, may be obtained by the source
sta tement
.REQUIRE SYS:MACREL
which instructs LINK to load the object file along with the
main program.
The file
is loaded only once (even if the
.REQUIRE appears in several source modules) and no explicit
LINK command need be given.

Symbol Definitions
Conventions
symbol s are as
character) :

observed
regarding the construction of
follows
("x"
represents any alphanumeric

xxxxx.

an opdef or macro definition

.xxxxx

a constant value

xx%xxx

a mask,
field

i.e., a bit

or

bits

Symbols containing multiple periods
internally by some macros.

specifying
may

be

Symbols containing "$" are not used or defined
DEC and are reserved for customer use.
The following definitions are available in
are arranged into groups as shown.

CC-s

MACSYM

a

used
by
and

«For Internal Use Only»

DIGITAL

TOPS-29 MONITOR
Coding Conventions
MISCELLANEOUS CONSTANTS (SYMBOLS)
.INFIN

= 377777,,777777 ;plus infin i ty

.MINFI

= 49000O,,0 ;minus infinity

= 777777,,0 ; left hal f
• RHALF = 0,,,777777 ;right half
• LHALF

• FWORD

= 777777,,777777 ; full wo rd
CONTROL CHARACTERS (SYMBOLS)

Symbols are defined for all control character codes
0-37 and 175-177.
The following are the commonly used
characters; see source listing for others.
.CHBEL

= 07 ;be11

.CHBSP

= 10 ;backspace

.CHTAB

=

.CHLFD

= 12 ;linefeed

.CHFFD

= 14 ; formfeed

.CHCRT

= 15 ; carr iag e return

.CHESC

= 33 ;escape

.CHDEL

= 177 ;delete ( rubout)

11 ; tab

CC-6

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Coding Conventions
PC FLAGS

(MASK SYMBOLS)

PC%OVF = 1B0 ;overflow
PC%CYO

=

IBI ;carry 0

PC%CYI = lB2 ;carry 1
PC%FOV = 1B3 ;floating overflow
PC%BIS = 1B4 ;first part
suppress)

done

(byte

inc rement

PC%USR = 1B5 ;user mode
PC%UIO = 1B6 ;user 10 mode
PC%LIP = 1B7 ;last instruction public
PC%AFI = 1B9 ;ADDRESS FAILURE INHIBIT
PC%ATN = 1B10 ;apr trap number
PC%FUF = IBl1 ;floating underflow
PC%NDV = 1B12 ;no divide

Macros to Manipulate Field Masks
Many of the symbols in MACSYM and MONSYM define flag
bits and fields. A field mask is a full-word value with a
single contiguous group of lis in the field.
For example,
000000,,777000 defines a
field consisting of bits 18-26.
The following macros may be used in expressions to deal with
these masks.
WID (MASK)
Width - computes the width of the field defined by the mask,
i.e., ,the number of contiguous I-bits. The value is not
defined if the mask contains non-contiguous I-bits.
POS(MASK)
Position - computes the position of the field defined by the

CC-7

«For Internal Use Only»

DIGITAL

TOPS-2g MONITOR
Coding Conventions

mask.
The position of a field is always represented by the
bit-number of the bit furthest to the right of the field,
regardless of the field's width.
This is sufficient to
specify the entire field
in the case of flags
(I-bit
fields) .'
PO INTR (LOC, MASK)
Byte pointer - constructs a byte pointer to I oca tion LOC
For example,
which references the byte defined by MASK.
POINTR(I~~,,77) = POINT 6, 1~~,35 = ~~~6~9, ,l~~
FLD (VAL, MASK)
Field value - Places the value VAL into the field defined by
MASK.
For example, FLD(3,7~~) = ~,,0~~3~~
• RTJS T (VAL, MASK)
Right-justify - Shifts VAL right so that the field defined
by MASK is moved to the low-order bits of the word.
For
example, .RTJST(300, 7~~) = 3
MASKB (LB IT, RBIT)
Mask - constructs a mask word which defines a field from bit
LBIT to bit RBIT inclusive. E.g., MASKB(18,26) = ~,,777~~~.

Instru'ctions Using Field Masks
The following mnemonics are similar to certain machine
instructions used to move and test bits and fields. These
macros select the most efficient instruction for the mask
be ing used.
MOVX AC, MASK
Load AC with a constant. MASK may be any constant.
This
assembles one.of the following instructions: MOVEI, MOVSI,
HRROI"HRLOI, or MOVE literal.
TXmn AC,MASK
where m is:

N, Z, 0, C

CC-8

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Coding Conventions

n is:

E, N , A, null

There are 16 definitions of thi s form which incl ude all of
the modification and testing
combinations of the test
instructions (i.e., TXNN, TXNE, TXO, TXON, etc.). A TL, TR,
or TO literal is assembled as appropriate.
IORX AC,MASK
ANDX AC,MASK
XORX AC,MASK
These are equivalent to certain
provided for mnemonic value.

TX

functions

but

are

JXm AC,MASK,ADDRESS
This is a set of four d e fin i t ions which jump to ADDRESS if
the field speci fied by MASK meets a certain cond i tion.
The
condition (m) may be:
E -

jump if all masked bits are 0

N -

jump if not all masked bits are 0

o -

jump if all masked bits are I

F -

jump if not all masked bits are 1 (false)

These macros will assemble into one, two,
or
three
instructions as necessary to effect the specified result.
E.g., JXN TI,lB0,FOO = JUMPL TI,FOO
JXE TI,770,FOO

= TRNN

Tl,770 JRST FOO

DEFSTR - MSKSTR Data Structure Facilities
This set of macros provides a comprehensive faci Ii ty'
It is an
for the definition and use of data structures.
extension of some of the techniques represented by the field
mask
facilities
above.
Typically, a data structure
definition will include some information about the I oca tion

CC-9

«For Internal Use Only»

TOPS-2~ MONITOR
Coding Conventions

DIGITAL

of the data in memory as well as its position within a word.
These facilities are intended to provide the following
advantages:
1.

Data items may be referenced mnemonically.
For
example, two data items in the same word would be
given different names rather than merely being known
as the left half or right half of the word.

2.

Should the need arise, storage formats may be
changed without incurring the expense of a search of
the code to change each reference.

DEFSTR -- MSKSTR
These macros both define a data structure called NAME:
DEFSTR NAME,LOCATION,POSITION,SIZE
MSKSTR NAME, LOCATION, MASK
LOCATION specifies the memory location of the desired
word and consists of address, index, and indirect fields in
the usual form, i.e., @address(index). Any of the fields
may be omitted if not needed, and the entire location
argument may be null in some circumstances.
The remalnlng
arguments define the desired field.
DEFSTR specifies the
field in terms of its position (right-most bit number)
and
size (number of bits), while MSKSTR specifies the field by a
full-word mask as described earlier. Normally, the actual
storage to be used is declared separately, e.g., by a BLOCK
sta tement.
As a simple example, consider an array of full-word data
items.
We wish to use the name FOO for the data itself, so
we declare the actual storag e by some other name, e.g.,
FOOl:

BLOCK n

Then, we declare the structure by
DEFSTR FOO,FOOl(FOOX) ,35,36
This says that we declare a data item called FOO, that the
items are addressed by FOOI(FOOX) (assuming that the index

CC-10

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Coding Conventions

is kept in register FOOX), that the items are 36-bit
quantities with the right-most bit in bit 35 (i.e., full
words).
If instead, we wish to declare that each word of
FOOl consists of an item in the left half and two 9-bit
items in the right half, we could write:
DEFSTR FIRSTD,F001(FOOX) ,17,18

;LH item

DEFSTR SECOND,FOOI(FOOX) ,26,9

;one 9-bit item

DEFSTR THIRDD,FOOI(FOOX) ,35,9

;another 9-bit item

LOAD

Data items defined with DEFSTR or MSKSTR may .be
referenced in a general way. At each instance, additional
location information may be given if necessary.
A set of
reference functions
(macros)
is defined for most common
operations, some affecting AC and memory, others only
memory.
For example, the LOAD function loads a data item
into an AC and is written as
LOAD AC,NAME,LOCATION
where:

AC

is the AC to be loaded

NAME

is the structure name as defined with DEFSTR

LOC

is the location specification in addition to
that declared in the structure definition.
This field may be null in some cases.

Taking the sample definitions above, we may write
LOAD TI,FOO
which would assemble into
MOVE Tl,FOOI(FOOX)
or
LOAD TI,SECOND = LDB Tl,[POINT 9,FOOI(FOOX) ,26]
LOAD Tl,FIRSTD

=

HLRZ T1,FOOI(FOOX)

CC-11

«For Internal Use Only»

DIGITAL

TOPS-2 ~ MONITOR
Coding Conventions

Note that the macro compiles the most efficient
available to reference the specified field.

instruction

The optional third argument is provided to allow some
of
the, location information to be speci fied a teach
instance. For example, if the definition is
DEFSTR FOO,FOOI,35,36
i

The index may be speci fied a t each instance, for exampl e,
LOAD TI, FOO, (XX)
LOAD T2,FOO, (TI)
The specification given in the definition is concatentated
with the specification given in the reference.
STOR

The
defined:

following

reference

functions

are

presently

LOAD AC,NAME,LOC

load data item into AC

STOR AC,NAME,LOC

store data item from AC into memory

The data item is right-justified in the AC.
SETZRO NAME,LOC set the data item to zero
SETONE NAME,LOC set the data item to all ones
SETCMP NAME,LOC complement the data item
INCR 'NAME,LOC increment the data item
DECR NAME,LOC decrement the data item
For functions not specifically provided, the
may be used:'

following

OPSTR OP,NAME,LOC
OPSTRM OP,NAME,LOC

CC-12

«For Internal Use Only»

TOPS-20 MONITOR
Coding Conventions

DIGITAL

OP is any machine instruction written without an
address field.
It will be assembled so as to reference the
specified data structure. OPSTR is used if memory is not
modified;
OPSTRM is used if memory is modified.
For
exampl e"
OPSTRM ,FOO
to add the quantity in Tl to the data item FOO.
The following test
defined:

and

transfer

functions

are

presently

JE NAME,LOC,ADDR jump to ADDR if data is 0

IN NAME,LOC,ADDR jump to ADDR if data is not 0
The following test and transfer functions take a list
of structure names
(surrounded by angle-brackets)
or a
single structure name. They compile code to test each data
item in the order given, and will stop as soon as the result
of the functi on is known
(e.g. , ,AND encounter s a
fal se
term) •
JOR NAMLST,LOC,ADDR

jump to ADDR if
true (non-0)

JAND NAMLST,LOC,ADDR

jump to ADDR if all data
true (no n-0)

items

are

JNOR NAMLST,LOC,ADDR

jump to ADDR if all data
false (0)

items

are

JNAND NAMLST,LOC,ADDR jump to ADDR if
fal se (0)

any

any

data

data

item

item

is

is

These functions optim~ze multiple fields in the same word if
they are adjacent 1n the structure list.
If the final
location is an accumulator, further optimization is done.

CC-13

«For Internal Use Only»

DIGITAL

TOPS-29 MONITOR
Coding Conventions

EXAMPLES

As an example of the data structure facility, consider
the typical case of data organized into unit blocks with
pointers, to other blocks. Such a block may appear as:
Flag I Flag 2

Code

List pointer

+

+

+ ~
additional

node

data

••••••••
We assume that n-word blocks will be allocated from a free
pool at execution time.
The structure of the block is
declared as follows:
MSKSTR FLAGI,0,IB9
MSKSTR FLAG2,0,IBI
DEFSTR CODE,0,17,9
DEFSTR LINK,0,35,18
DEFSTR NODDAT,I,35,36
Note that the location field contains only the offset
address of the word within the block; the address of the
block will be specified in an index at each reference.
References would appear as follows:
LOAD'TI,LINK,(TI)

;step to next node in list

STOR T2,CODE,(TI)

;set new block code

JE FLAGI,(TI) ,FLOFF ;jurnp if flagl is off
JAND ,(TI) ,FLGSON

CC-14

;jump if flagl and
;flag2 are both on

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Coding Conventions

; Q-BLOCK FORMAT
ENQLJQ:
BACK POINTER TO
LAST Q-BLOCK FOR JOB

ENQNJQ:
FORWARD POINTER TO
NEXT Q-BLOCK FOR JOB

ENQLLQ:
BACK POINTER TO
LAST Q-BLOCK

ENQNLQ:
FORWARD POINTER TO
NEXT Q-BLOCK

ENQFLG:
FLAGS

ENQCHN:
ENQFRK:
PSI
FORK TO INTERRUPT
CHANNEL
WHEN REQUEST IS LOCKED

ENQNR:

ENQID:
REQUEST ID CODE

ENQLRQ:
BACK POINTER TO
LAST Q-BLOCK OF REQUEST

ENQFQ:
FORWARD POINTER TO
NEXT Q-BLOCK OF REQUEST

ENQLBP:

ENQGRP:
GROUP
FOR
SHARABLE REQUESTS

* OF RESOURCES
REQUESTED FROM POOL

POINTER TO
LOCK-BLOCK
ENQNST:
NEST COUNT

*

ENQJFN:
JFN OF REQUEST
OR -1, -2, OR -3
ENQMSK:
POINTER TO THE
MASK BLOCK

CC-lS

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Coding Conventions

;LOCK-BLOCK FORMAT
ENQLHC:
ENQNHC:
BACK POINTER TO LAST
POINTER TO NEXT
LOCK-BLOCK ON HASH CHAIN LOCK-BLOCK ON HASH CHAIN
ENQLLQ:
BACK POINTER TO
LAST Q-BLOCK ON QUEUE

ENQNLQ:
FORWARD POINTER TO
FIRST Q-BLOCK ON QUEUE

ENQFLG:
FLAGS

ENQLVL:

ENQTR:
TOTAL i OF RESOURCES
IN THIS POOL

ENQRR:
REMAINING NUMBER OF
RESOURCES IN THIS POOL

LEVEL NUMBER
OF THIS LOCK

ENQTS:
TIME STAMP
TIME OF LAST REQUEST LOCKED
ENQFBP:
FREE BLOCK POINTER
TO FREE Q-BLOCK

ENQLT:
LONG TERM LOCK LIST
FOR THIS JOB

ENQOFN:
OFN, OR -2, OR -3,
OR 400000 + JOB NUMBER

ENQLEN:
LENGTH OF THIS
LOCK-BLOCK

ENQNMS:
NUMBER OF WORDS IN
THE MASK BLOCK
ENQTXT:

ASCIZ STRING
OR
500000 + USER CODE

CC-l6

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Coding Conventions

DEFSTR(ENQLJQ,0,17,18)
DEFSTR(ENQNJQ,0,35,18)

iBACK POINTER TO LAST Q FOR JOB
iFORWARD POINTER TO NEXT Q FOR JOB
i ENQNJQ AND ENQLlJQ MUST BE IN '~ORD eJ
DEFSTR(ENQLLQ,I,17,18)
iBACK POINTER TO LAST Q IN LOCK QUEUF.
DEFSTR (ENQNLQ, 1, 35, 18)
iFORWARD POINTER TO NEXT Q OF LOCK
DEFSTR(ENQFLG,2,11,12)
iFLAGS OF BLOCK (EITHER LOCK OR Q)
DEFSTR(ENQCHN,2,17,6)
iPSI CHANNEL #, -1 MEANS JOB BLOCKED
DEFSTR(ENQFRK,2,35,18)
iFORK NUMBER OF CREATOR OF Q-BLOCK
DEFSTR(ENQNR,3,17,18)
i# OF RESOURCES REQUESTED
DEFSTR(ENQID,3,35,18)
iID OF ENQ REQUEST
DEFSTR(ENQLRQ,4,17,18)
iBACK POINTER TO REST OF REQUEST
DEFSTR(ENQFQ,4,35,18)
iFORWARD POINTER TO REST OF REQUEST
DEFSTR(ENQLBP,5,17,18)
iPOINTER TO LOCK-BLOCK OF THIS Q
DEFSTR(ENQGRP,5,35,18)
iGROUP NUMBER OF SHARABLE REQUEST
DEFSTR (ENQJFN,n,35,18) iJFN OF ENQ REQUEST
DF.FSTR (ENQNST,6,17,18) iNEST COUNT
DEFSTR (ENQMSK,7,35,18) iPOINTER TO MASK BLOCK
DEFSTR(ENQLHC,0,17,18)
DEFSTR(ENQNHC,0,35,18)

iBACK POINTER TO LAST LOCK IN HASH LIST
iFORWARD PNTR TO NEXT LOCK ON HASH LIST
iENQNHC AND ENQLHC MUST BE IN WORD eJ
DEFSTR(ENQLVL,2,35,18)
iLEVEL NUMBER OF LOCK
DEFSTR(ENQTR,3,17,18)
iTOTAL # OF RESOURCES IN POOL
DEFSTR(ENQRR,3,35,18)
i# OF RESOURCES REMAINING IN POOL
DEFSTR(ENQTS,4,35,36)
iTIME STAMP OF LAST REQUEST TO BE LOCKED
DEFSTR(ENQFBP,5,17,18)
iPOINTER TO FREE Q-BLOCK
DEFSTR(ENQLT,5,35,18)
iLONG TERM LOCK LIST FOR THIS JOB
.ENQLT==5
iOFFSET OF LOCK LIST ELEMENT
DEFSTR(ENQOFN,6,17,18)
iOFN, -2, -3, OR 40eJeJeJeJ+JOB NUMBER
DEFSTR(ENQLEN,6,35,18)
iLENGTH OF LOCK-BLOCK
DEFSTR(ENQNMS,7,17,18)
iNUMBER OF WORDS IN THE MASK BLOCK
DEFSTR(ENQTXT,leJ,35,36) iFIRST WORD OF TEXT OR USER CODE
.ENTXT==10
iINDEX INTO LOCK-BLOCK FOR TEXT BLOCK
DEFSTR(ENQOTA,ENQLST,8,9)
iENQ/DEQ QUOTA
DEFSTR(ENQCNT,ENQLST,17,9)
iCOUNT OF REQUESTS QUEUED UP

CC-17

«For Internal Use Only»

()
()

I

~

00

1\
1\

I'ZJ
0
1"'1

....

:J
rt
(1)

1"'1

:J
D.I

~

C

{Jl
(1)

0

::3

~

"<
V

....0c;)
....

MACRO %53(111142) 13:36 2111-0ct-78 Page 12
MAC
16-Nov-77 14:58

ENQ
ENQ
539
54111
541
542
543
544
545
546
547·
548
549
55111
551
552
553
554
555
556
557
558
559
56111
561
562
563
564
565
566
567
568
569
57QJ
571
572'
573
574
575
576
577
578
579
58111
581
582
583
584
585
586
587
588
589
59111
591
592
593

~

i DEQ FUNCTION 111

iACCF.PTS IN TIl
111111111274'1112
111111111275'1112
111111111276'1112
111111111277 '1112
1111111113111111'1112
11111111131111 '1112
11111111131112'1112
11111111131113 '1112
11111111131114 '1112
11111111131115'1112
111011131116'1112
11111111131117'1112
11111111131111'1112
111111111311'1112
111111111312'1112
111111111313'1112
11l11l11l314 '1112
0111111315'1112
11I1111B17 '1112
11111111132111'1112

2~5 1111
265 16
1111111111111112
41112 111111
322 1111
26111 17
263 17
26111 17
254 111111
26111 17
254 111111
26111 17
254 111111
135 1112
61113 1111
66111 1112
137 1112
2611l 17
254 111111
21112 1111
554 1112

I1IliHl321 '1112
111111111322'1112

327 1112 111 111111 1111112274'
554 1112 111 1111 1111111111111113

111111111323'1112
111111111324'1112

322 1112 111 111111 1111112277'
275 1112 111 12 111111111111111111

111111111325'1112

321 1112 111 111111 111111231114'

11111111132&;'1112
111111111327'1112
11111111133111'1112
111111111331'1112
111111111332'1112
111111111333'1112
111111111334'1112
111111111335'1112
111111111336'1112
11l11l11l337 '1112
11111111134111'1112
111111111341'1112
111111111342'1112
111111111343'1112
111111111344'1112
111111111345'1112

322
51116
554
55111
271
542
2111111
554
26111
254
21112
27111
327
337
254
263

11I~'HBI6'1112

1112
1112
1111
1112
1112
1112
1111
1111
17
111111
1111
1115
1115
1111
111111
17

111 111111 11111111111143'
111 111111 11111111111147*
1111111111111112
111 17 777776
111 111111 11111111131115'
111 111111 11111111171114'
111 111111 111111111111111111
111 111111 111111111734'
111 111111 11111111134111'
111 111111 111111211126'
111 111111 11111111134111'
111 111111 111111111133'
111 111111 11111111134111'
111 111111 1111112256'
111 111111 1114111111111111
111 111111 1111111111114111
I1l I1II1l 1111112256'
I1l 111111 111111111155'
111 111111 11111111134111'
111 17 777775
111 1111 111111111111~6

111
111
111
111
111
111
111
111
111
111
111
111
111
111
111
111

111111
1111
1111
1111
12
1111
17
1111
111111
111111
17
15
111111
17
111111
111111

111111231112'
1111111111111113
1111111111111115
1111111111111113
111111111111111111
1111111111111113
777775
1111111111111115
11111117111111'
111111111341'
777776
1111111111111113
11111111131113'
777776
111111111171*
111111111111111111

111
-1

= INTERNAL MONITOR
= JSYS CALL (READ

DEQFNI1I: JSP Tl,SETVAR
STKVAR (DQFNI1IT,DQFNI1IQ>

DQFNI1IA:
DQFNI1ID:

DQFNI1IE:

DQFNI1IB:
DQFNI1IC:

CALL
ARGUMENTS FROM USER SPACE)

iSET UP GLOBAL VARIABLES

iINITIALIZE ERROR COUNTER
SETZM DQFNI1IT
iIF MONITOR CALL, ARGS ARE SET UP
JUMPE Tl,DQFNI1ID
iVALIDATE THE ARGUMENT BLOCK
CALL VALARG
iILLEGAL ARGUMENT BLOCK
RET
,VALIDATE THIS LOCK SPECIFICATION
CALL VALREQ
JRST DQFNI1IB
i ERROR
iHASH THIS REQUEST
CALL HASH
JRST DQFNI1IB
iERROR DURING HASH
CALL FNDLOK
iFIND THE LOCK-BLOCK
iNO SUCH LOCK-BLOCK
JRST DQFNI1IB
LOAD T2,ENQFLG,(Tl)
iGET FLAGS OF THE LOCK BLOCK
iIS THIS A LONG TERM LOCK
TXNE PI, EN%LTL
TXO T2,EN.LTL
iYES, REMEMBER THIS IN THE LOCK BLOCK
STOR T2,ENQFLG,(Tl)
iFIND THE Q-BLOCK FOR THIS FORK
CALL FNDQ
:COULD NOT FIND THE Q-BLOCK
JRST DQFNI1IB
;SAVE THE Q-BLOCK ADDRESS
MOVEM Tl,DQFNI1IQ
;GET NEST COUNT
LOAD T2,ENQNST, (Tl)
JUMPG T2, [DECR ENQNST, (Tl)
iTHIS WAS A NESTED ENQ, DO NT DEQ IT
JRST DQFNI1IC]
LOAD T2,ENQNR, (Tl)
;GET NUMBER LOCKED IN ORIGINAL ENQ
JUMPE T2,[CALL DEQMSK
;IF 111, SEE IF DEQ'ING A MASK
JRST DQFNI1IE
iNOT COMPLETELY DEQUEUED
MOVE Tl,DQFNI1IQ ;OK TO DELETE THIS Q-BLOCK
CALL SQDEQ
iGO DELETE THIS Q-BLOCK
;STEP TO NEXT REQUEST
JRST DQFNI1ICl
SUBI T2,I1I(P3)
•.•.
;SEE IF DEQ'ING ALL RESOURCES
JUMPL T2,[MOVEI Tl,ENQXI2
JRST DQFNI1IB]
:DEQ'ING TOO MANY RESOURCES
JUMPE T2,[CALL SQDEQ
iDEQ'ING ALL OF THEM, DELETE Q-BLOCK
JRST DQFNI1IC]
STOR T2,ENQNR, (Tl)
iPUT BACK NEW t OF RESOURCES LOCKED
;GET ADDRESS OF LOCK BLOCK
LOAD Tl,ENQLBP, (Tl)
LOAD T2, ENQRR, (Tl)
;GET t OF REMAINING RESOURCES
;UPDATE THE COUNT
ADDI T2,11I (P3)
STOR T2,ENQRR, (Tl)
iSTORE NEW COUNT OF REMAINING RESOURCES
;GET Q-BLOCK ADDRESS
MOVE Tl,DQFNI1IQ
LOAD Tl,ENQLBP, (Tl)
;GET ADDRESS OF THE LOCK BLOCK
;GO SCHEDULE THIS LOCK
CALL LOKSKD
;DONT COUNT UP ERROR COUNTER
JRST DQFNI1IC
;SAVE THIS ERROR CODE
MOVEM Tl,DQFN0T
;STEP TO THE NEXT LOCK REQUEST
ADD Ql,EDSTP
;LOOP BACK FOR ALL LOCKS
JUMPG Ql, DQFNI1IA
;ANY ERRORS SEEN?
SKIPG Tl,DQFNI1IT
;NO, DEQUEUING COMPLETED
RETSKP
;YES, RETURN ERROR CODE IN Tl
RET

V

CC-1

Sample Listings

)I'
t""

()

0
0..

~.~

:J 0

I.Q "0

CJl

I
0 tv
:J 51
()

<:

(1) 3:
::3 0

rtZ

.........

0 ~
:J 0
en ::0

DIGITAL

TOPS-20 MONITOR
Coding Conventions

Subroutine Conventions

The following definitions are used to make subroutine
mechanics mnemonic. Reference is made to these conventions
e I s e wh e r. e in t his doc urn en t •
CALL address
Call subroutine at address;

equivalent to PUSHJ P,address

RET
Return from subroutine;

equivalent to POPJ P,

RETSKP
Return from subroutine and skip;

equivalent to

JRST [AOS 0{P) RET]
CALLRET address
Call the subroutine at address
thereafter; equivalent to

and

return

immediately

CALL address RET
RETSKP
CALLRET assembles as JRST but should be treated as if it
assembles into several instructions and cannot be skipped
over.

AC CONVENTIONS
The facilities described here assume
following AC conventions:

(in

some

cases)

the

pass

and

ACl-AC4

temporary, may be used to
return values

AC0,AC5-ACl5

preserved, i.e., saved and
if used by subroutine

CC-l9

restored

«For Internal Use Only»

DIGITAL

TOPS-2r2J MONITOR
Coding Conventions

ACl6

temporary, used as scratch
MACSYM facilities

by

some

ACl7 stack pointer

Named' Variable Facilities
A traditional deficiency of machine language coding
environments is a lack of facilities for named transient
storage ("automatic", etc.). Sometimes, permanent storage
is assigned (e.g., by BLOCK statements) when no recursion is
expected. More often, AC's are used for a small ntunber of
local variables. In such a case, the previous contents must
usually be saved, and a general mnemonic (e.g., TI, A, X) is
usually
used.
In some cases, data on the stack .is
referenced, for example,
MOVE TI,-2(P)
But this statement is non-mnemonic and likely to fail
if
additional storage is added to or removed from the stack.
The facilities described here provide' local named
variable storage. Two of these allocate the storage on the
stack;
the third allocates it in the ACs.
STKVAR NAMELIST
This statement allocates spac~ on the stack and assigns
local names.
The list consists of one or more symbols
separated by commas. Each symbol is assigned to one stack
word.
If more than one word is needed for a particular
variable, a size parameter may be given enclosed with the
symbol in angle-brackets.
For example,
STKVAR 
STKVAR 

;entry 2, clear flag
;common code, declare locals

CALL LSUBR

;call local subroutine

RET
;LOCAL SUBROUTINE
LSUBR:

STKVAR 

MOVEM Tl, CC

;local subroutine, declare
; locals
;reference outer routine
; variable
;reference local variable

RETSKP

;skip return

MOVE Tl, AA

ASUBR NAMELIST
This statement is used to declare formals for a subroutine.
The namelist consists of from one to four variable names.
The arguments are passed to the subroutine in ACs Tl to T4,
and values may be returned in these same ACs. ASUBR causes
these four ACs to be stored on the stack (regardless of how
many formals are declared), and defines the variable names
as their corresponding stack locations. The return does not
restore TI-T4.
The same frame pointer AC is used by both
ASUBR and TRVAR; hence, these declarations may not be used

CC-22

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Coding Conventions

within the same routine.
as fo r TRVAR.

The scope rules are the same here

ACVJ\R NAMELIST
This statement declares local storage which is allocated
from the set of preserved ACs. An optional size parameter
may be given for each variable. The previous contents of
the ACs are saved on the stack and automatically restored on
the next return.
Variables declared by ACVAR may be
referenced as ordinary AC operands.

Miscellaneous
TMSG string
Type literal string;
For example,

uses ACl, outputs to

primary

output.

TMSG 
JSERR
Handle unexpected JSYS error;
type "?JSYS ERROR: message".
This is a
single instruction subroutine call which always
returns +1.
JSHLT
Handle unexpected fatal JSYS error;
does a HALTF instead of returning.

same as JSERR except it

MOD. (DEND,DSOR)
Modulo
In assembly-time expression;
this gives the
remainder of DEND divided by DSOR; e.g., MOD.
10,3 = 1.

CC-23

«For Internal Use Only»

DIGITAL

TOPS-2~ MONITOR
Coding Conventions

TOPS-20 CODING STANDARDS
Subroutine Calling - JSYS
Monitor-call JSYSs may be used in user or monitor code.
All ACs are preserved over a JSYS call unless an explicit
statement to the contrary appears in the JSYS description.
ACs are changed over a JSYS call only when values are to be
returned to the calier.
The JSYS name appears as the opcode in the statement
perform ing
the call.
The JSYS mnemonic incl udes the
instruction field, so no other fields are supplied by the
user.
Unimplemented JSYSs will invoke the illegal instruction
sequence
(with error code ILINS2). Defined and implemented
JSYSs will return to caller +1 upon success, or will
invoke
the illegal instruction sequence upon failure. The illegal
instruction sequence recognizes an ERJMP or ERCAL following
the failing JSYS and causes the appropriate action.
If that
instruction is not an ERJMP or ERCAL, an illegal instruction
interrupt
is requested which will be handled by the
executing fork if enabled, or otherwise,
it forces fork
termination. See paragraph below on JSYS returns for proper
indication of JSYS failure.
All constant values, bits, and fields of JSYS arguments
will have mnemonics defined according to the rules in
MONSYM. The JSYS code itself uses these symbols for loading
arguments, testing bits, etc.
When writing code to implement a
conventions are observed:

JSYS,

the

following

1.

The 'entry point of the JSYS is defined by a global
tag consisting of a DOT concatenated with the
symbolic name of the JSYS; e.g~, .GTJFN::.

2.

The first statement of the JSYS code is MCENT
(Monitor Context ENTry).
This establishes the
normal JSYS context for a "slow" JSYS.
At this
writing, MCENT is a null macro and the JSYS entry
procedure is invoked automatically.
The use of

CC-24

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Cod ing Conventions
MCENT is required so that this implementation may
be changed in the future if necessary.

3.

All caller ACs are automatically preserved by the
entry
and
exit
procedures.
Therefore, JSYS
routines are specifically required NOT to save and
restore the ACs. The contents of the caller's ACs
1-4 are copied ipto the callee's ACs. However, no
callee ACs are copied back to the caller's AC block
on return;
one
0 f
the
"pr ev ious
c ontex til
instructions
. (i .e.,
UMOVE,
UMOVEM,
XCTU
[instruction], etc.) must be used
to return any
values to the caller. For example,
UMOVEM Tl,Tl

; store moni tor Tl into user- Tl

A "previous context" instruction may also be used
at any time to fetch the original contents of the
caller's ACs unless they have been explicitly
changed by a previous context store operation.
For
exampl e,
UMOVE T2,Tl
4.

;load .user Tl into monitor T2

Return from JSYS code should be effected by the
statement:
MRETNG

;Monitor RETurn Good

This transfers to the JSYS exit sequence (returning
caller
+1)
and
shouln be used to indicate
successful completion of the JSYS.
If the JSYS
could not be completed successfully, the following
statement should be used:
ITERR errcod

;causes an Instruction Trap
;ERRor, leaves
;the error code in LSTERR

CC-2S

«For Internal Use Only»

DIGITAL

TOPS-2~ MONITOR
Coding Conventions

Other statements are defined which effect
returns according to a previous convention.
are:

JSYS
They

RETERR errcod

;RETurn ERRor, return
;cal1er +1 with error code
;left in AC1 and LSTERR

EMRETN errcod

;Error Monitor RETurn, return
;cal1er +1 with error code left
;in LSTERR

These should not be used in new JSYS code
be needed if existing JSYSs are modified.

but

may

All error returns include an error code
(mnemonic)
that
will be defined
in MONSYM.MAC.
If the
appropriate error code has already been loaded into
ACI, the errcod field may be omitted from the above
with the contents of ACI taken as the error code.
No JSYS shall return other than +1 or instruction
trap; therefore, no occurrence of AOS 0(P)
should
ever be required in JSYS code.
When invoking a JSYS error return,
it is not
necessary to "pop"
temporary quanti ties from the
stack. The successful return, however, should be
given only when the stack is properly cleared.

CC-26

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Coding Conventions

Subroutine Calling
The allocation of ACs for all intersubroutine calls are:
ACs 1,2,3,4

and

intra-module

General temporary, may be destroyed by a
subroutine.

ACs 0, 5-15 -- Preserved, not changed by a subroutine (or
s a v ed and res tor ed, i f n e c e s sa r y) •
AC

In

AC 17

Temporary, used by the JSYS call/return
procedure and reserved for use by other
call/return procedures.
Global stack pointer

Call and return are effected by PUSHJ P,
and POPJ P,
respectively.
A set of assembler mnemonics has been defined
for subroutine mechanics as follows:
'CALL'
(=
PUSHJ
subroutines,
'RET'

(= POPJ P,)

P, )
is used
to
e.g., CALL SUBR.

call

is used to return +1 from

subroutines.
'RETSKP' is used to return +2 from
subroutines. RETSKP is equivalent to:
JRST [

AOS 0(P)
RET]

'RETBAD errcod' is used to return +1 with an
error code from a subroutine.
The error code
field is optional as with JSYS error returns
above.
RETRAD is equivalent to:
JRST

MOVEI A,ERRCOD
RET]

CC-27

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Coding Conventions

'CALLRET' may be used to call a subroutine and
return immediately thereafter.
It is an
abbreviation for
CALL SUBR
RET
or
CALL SUBR
RET
RETSKP
Note that CALLRET is not guaranteed to be a
single
instruction;
therefore, it may not be skipped over. The
other returns
above
are
guaranteed
to
be
single
instructions.
These mnemonics are used to emphasize the FUNCTION
being
performed
(calling, returning)
rather than the
mechanics of the function (pushing, jumping, etc.).
Also,
these mnemonics could still be used even if a more general
calling standard were adopted at some time in the future.
Return may also be effected by transferring control
global tag R or RSKP, for example,

to

JUMPE A,R

;equivalent to JUMPE A, [RET]

JUMPN A,RSKP

;equivalent to JUMPN A,[RETSKP]

the

The general temporaries are used for passing arguments
to subroutines and returning values.
ACI is used for a
single argument routine, ACs 1 and 2 for a two-argument
ro utine, etc.
A r 0 uti n"e de fin ed t o r e t ur n call e r + 2
( ski p)
u po n
success and caller +1 (noskip) upon failure is acceptable.
Returns greater than caller +2 are not permitted.

CC-28

«For Internal Use Only»

TOPS-20 MONITOR
Cod ing Conventions

DIGITAL

AC Definitions
The following mnemonics have been chosen
to
be
consistent with the AC use conventions above.
The preserved
ACs are divided into three groups:
F (1 AC)
intended
for
Flags,
and QI-Q3 and Pl-p6 for general use.
The ACs within
each group are consecutive.
0 -

1
2
3
4
5
6
7

-

-

10 - PI
P2
11
P3
12
13 - P4
14
P5
15 - Pf)
16 - CX
17 - P

F
Tl
T2
T3
T4
Ql
Q2
Q3

-

The programmer should assume that each group
(Tn,
Qn,
Pn,)
is
in ascending order (e.g., that T2=Tl+l) though the
specific assignment of numbers may change.
Explicit numeric
offsets from AC symbols (e.g., Tl+l) should NEVER be used.
Instructions using more than one AC (e.g., DIV,
JFFO)
must
be given an AC operand so that the other AC(s) implicitly
affected are in the same group.
For example, T3 (and T4) is
OK for IDIV because T3+1=T4, but Q3 is not because Q3+1=??

AC Saving and Restoration
Several
facilities
in
the
monitor
save
and
automatically restore ACs.
Each of these will save all of
the indicated ACs on the stack at the point of execution and
will place a dummy return on the stack which causes these
ACs to be restored automatically when the current routine
returns.
Use of these facilities eliminates the need for
matching PUSH/POP pairs at the entry at exits of routines
and
eliminates the bugs which often arise from an unmatched
PUSH or POP.
The available macros are:
,

SAVEQ -

saves ACs QI-Q3

SAVEP -

saves ACs Pi--P6

SAVEPQ SAVET -

saves ACs Ql-Q3 and PI-Po
saves ACs Tl-T4

CC-29

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Coding Conventions
?

Defining a different mnemonic for a preserved AC may be
of value when the AC is used for a specific function by a
large body of code.
However, this may cause confusion
because two d lfferent symbols may refer to the same AC
without the knowledge of the programmer.
In
smaller
programs, use of certain ACs can be restricted to specific
functions, and a global definition is appropriate. However,
a timesharing monitor is too large to accommodate all of the
possible dedicated ACs.
i

Therefore, when a
specific
function-oriented
AC
definition is made,
it shall be explicitly decided which
modules shall use the definition. Within these modules, the
usual name for the AC mus·t be purged so that there is no
possibility of using two different symbols for the same AC.
Only preserved ACs may be used for special definitions.
Parameters to subroutines may be passed in functionally
defined ACs in the following cases:

1.

On an intra-module call where the contents of
AC is appropriate to its function definition.

2.

On an inter-module call where the same definition
exists in both modules and the AC is being used for
its intended func tion.

the

A parameter may NOT be passed in a preserved AC unless
both caller and cal lee knQw it by the same name, and that
name must be a specific one related to the function the AC
i s pe r fo rm i ng •
The procedure for declaring a functionally

defined

AC

is:
DEFAC NEWAC,OLDAC

CC-3r2J

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Coding Conventions

This must be done at the beginning of an assembly;
it
defines NEWAC to be equal to OLDAC.
OLDAC must be the
mnemonic for one of the regul ar preserved ACs;
this
mnemonic will be purged and therefore unavailable for use in
the current assembly.
An AC with a special definition should not be used for
other purposes;
for example, "JFN" should not be used to
hold some quantity other than a JFN merely because it
happens to be available.

Subroutine Documentation
The following is a suggested format for documenting the
calling sequence of a JSYS or subroutine. A description of
this sort should appear at the
beginning
of
every
subroutine, no matter how short it may be.
;name of subroutine - function of subroutine, etc.
; Tl/ description of first argument
; T2/ description of second argument
;

CALL
; RETURN +1:
; Tl/ val ue
RETURN +2:

NAME or JSYSNAME
conditions giving this return,
(s) returned
conditions and values as above.

1.

The ar~uments, if any, should be documented as the
contents of registers and/or variables as shown.
MONSYM mnemonics should be used when available (for
example, at JSYS entry points) •

2.

The actual instruction to do the call should be
sho~n.
It will be "CALL subname" in the case of
internal subroutines, and the single-word JSYS name
in the case of a JSYS entry point.

CC-3l

«For Internal Use Only»

TOPS-2f2J MONITOR
Coding Conventions

DIGITAL

3.

The return (s)
or "NEVER"
appropriate;
does
not
described in

should be noted as shown;
II ALWAYS"
may be used as the condition where
the +2 return need not be shown if it
exist;
values returned should be
the same form as arguments.

Examples:
;SIN - COMPUTES SINE OF AN ANGLE
; TIl ANGLE IN RADIANS, FLOATING POINT
CALL SIN
;
; RETURN +1: FAILURE, UNNORMALIZED NUMBER OR OUT OF
RANGE
; RETURN +2: SUCCESS, TIl VALUE, FLOATING POINT
SIN: :

..

;GJINF - GET JOB INFORMATION JSYS
;
GJINF
; RETURN +1: ALWAYS,
; TIl LOGGED-IN DIRECTORY NUMBER
; T21 CONNECTED DIRECTORY NUMBER
; T31 JOB NUMBER
; T41 TERMINAL NUMBER OR -1 IF DETACHED
.GJINF:: ••

Multi-Line Literals
The use 0 f mul ti-l ine liter al s i s encourag ed as a
technique for making code more readable and easier to
follow. The following additional rules apply:
1.

The opening bracket for a multi-line literal should
occur in the position the first character of the
address field
would
have
occ~pied
if
the
instruction had an ordinary address. For example,
SKIPGE FOO
JRST [

CC-32

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Coding Conventions
/

2.

The first and all following instructions within the
literal
shall begin at the second tabstop.
For
exampl e,
JRST [

MOVE A,MUMBLE
JRST FIE]

iCOMMENT
iCOMMENT

The tab between the open bracket and
the first
opcode may be omitted
if the line position is
already at or beyond the second tab stop.
For
example,
JUMPGE A, [MOVE A,MUMBLE
3.

The closing bracket shall follow the last field of
the last instruction
(as above),
and shall- be
before the comment on the same line.

4.

Nesting of multi-line literals to a depth
than
one
is
discouraged
because of
formatting problems.

5.

Tags may not appear in multi-line literals.

6.

There are no hard and fast rules concerning when to
use or not use multi-line literals. However, a
literal longer than about 10 lines is suspect.

7.

Use of ".+1" is legal in a literal to return to the
main sequence.

greater
awkward

FLOW OF CONTROL - BRANCH CONVENTIONS
Jumps, where possible, should be used to
in the code
(except in the case of loops).
loop should be identified by a comment.

tags forward
The tops of a

The expressions ".+1" and ".-1" are the only legal uses
of "." (this location). All other potential uses should be
avoided in favor of an explicitly defined tag.
"~lobal"
jumps
should
be
avoided
altogether.
Higher-level
languages do not permit them, and with good
reason. The only exceptions are jumps to well-defined and
published
exit
sequences,
for example, R,
RSKP
(see
subroutine conventions, above).

CC-33

«For Internal Use Only»

DIGITAL

TOPS-2~ MONITOR
Cod ing Conventions

Numbers
In general, there should be no occasion to use a
literal. number in in-line code.
All parameters, bit
defini.tions, CONO/CONI codes, etc.
should be
defined
mnemonically at appropriate places. It is much easier to
err by not using mnemonics enough rather than in using them
too much; therefore, when in the slightest doubt, define a
mnemonic.

CC-34

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Coding Conventions

APPENDIX A
LIVING IN AN IMPERFECT WORLD
Much of the present TOPS-20 code does not conform to
this standard since it was written before the standard's
existence. Although a great deal of systematic editing has
already
been
done
to
improve
the
code,
obvious
irregularities exist.
In general, new code should conform
exactly to this standard even if it is being integrated with
old code. The following are some specific problems that may
arise, with recommended solutions:

1.

AC Mnemonics

Some code uses absolute numeric ACs.
If new code is
being
integrated
into a
sequence that uses numeric ACs,
editing the existing code to use the standard mnemonics is
desirable, particularly for the preserved ACs.
If the
programmer cannot take the time to do this, the mnemonics
TI-T4 should be used
for ACs 1-4;
other ACs should be
referenced in the same way as is done by the existing code.
Some code uses mnemonics A,B,C,D for the temporary ACs.
These mnemonics should be used for new code being integrated
into such code, or all references can he edited to use the
standard mnemonics.
You may write some code using the standard mnemonics
for preserved ACs and then discover that the module into
which you wish to put this code has redefined some of. these
ACs. The solution is one or a combination of the following:

1.

Move the new code to a module
redefine the preserved ACs.

2.

Use different preserved ACs -- ones which have not
been redefined.
(Note it is not acceptable to use
an AC with a special definition for other than its
spec ial purpo se.)

CC-35

which

does

not

«For Internal Use Only»

TOPS-2~ MONITOR
Coding Conventions

DIGITAL

Clearly, code needing some of the special definitions
must he placed in a module which has these ACs defined and
must therefore use only the other preserved ACs.
Not~ that a value which usually resides in a special AC
need not ALWAYS reside there. For example, if code in JSYSF
needs to call a routine in PAGEM and pass a JFN index as an
argument, the JFN should be loaded into TI-T4 for the call
since PAGEM does not have JFN defined and cannot accept an
argument in it.

2.

Stack Handling

Use of the several stack variable facilities defined in
MACSYM is recommended. However, some old code uses explicit
PUSH and POP and references of the form -n(P). When notable
modifications must be made to such code, edit it to use
STKVAR or TRVAR.

CC-36

«For Internal Use Only»

DIGITAL

TOPS-2~ MONITOR
Cod ing Conventions

MODULE TEST
For this lab, you are to use the coding conventions and
macros covered in the Coding Conventions module.
The exercises
optional.

marked

with

a

double

star

(**)

are

Using MACSYM
. Using any editor with which
you
are
familiar,
demop.strate', by wri ting as though for a program, the call
required to assure that the definitions in MACSYM are
available.
Data Structure Facilities
With the sample data structure given below, use the
data structure macros (e.g., DEFSTR - MSKSTR etc., and the
field mask definitions) to define names for each of the
specified fields.'
BACKP:
18 bits
COUNTl:
12 bits

FORPTR:
18 bits
FOOCNT:
10 bits

CHRCNT:
6 bits

TEXTl: -Tex t starts here
36 bits

CC-37

CHAR:
8 bits
I

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Coding Conventions

LOAD - STOR
Assuming the above macros, write the cod.,e necessary to:
1.

Get FOOCNT into ACI (using
ACl).

2.

Jump to location WEX if CHRCNT is not 0.

3.

Subtract 1 from CHRCNT.

the

name

standard

of

,

** Assume the location
contained in T2:
4.

of

the

above

table

was

What would the answers to the above three questions
be? **

Using The Coding Conventions
Using the . conventions and standard s of the Cod ing
Conventions module, write and compile a subroutine (assume \
it refers to the data structure given above and. that it is
called with CALL) with documentation, which will:
1.

Define TEMI and TEM2 as stack variables.

2.

Save the temporary .storage ACs.

3.

Put CHAR into TEMI.

4.

Add 167 (octal) to BACKP.

5.

,Jump to location PMW (il1 the subroutine)
is riot 0.

6.

If FORPTR is not 0 (at PMW) add 4 to
return 2.

7~

Otherwise, give return 1.

CC-38

it

if
and

FORPTR
give

«For Internal Use Only»

TOPS-20 MONITOR
Coding Conventions

DIGITAL

TEST EVALUATION SHEET

Results of the laboratory exercises will
in class.

CC-39

be

discussed

«For Internal Use Only»

DIGITAL

This page is for

TOPS-20 MONITOR
Coding Conventi"ons

notes~

CC-40

«For Internal Use Only»

MACSYM
MACSYM
1
2
3
4
5
6
7
8
9
10
11

12
13
14

(')
(')

1

~

~

/\
/\

'TJ

0

'"'"

H

;:J

r1"
CD
1"1
;:J

OJ

1-1

C

00
CD

0

;:J
~

~

V
V

15
16
17
18
19
20
21
22
23
24
25
20
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55

COMMON MACROS AND SYMBOLS
8-Nov-77 HI: 47
MAC

MACRO %53A(1072) 13:55 29-Dec-78 Page

0
H

G)

i<3-UTILITIES)MACSYM.MAC.6, 8-Nov-77 10:47:32, EDIT BY KIRSCHEN
iMORE COPYRIGHT UPDATING •••
i<3-UTILITIES)MACSYM.MAC.5, 26-0ct-77 11:06:30, EDIT BY KIRSCHEN
iUPDATE COPYRIGHT FOR RELEASE 3
i<3-UTILITIES)MACSYM.MAC.4, 21-Sep-77 15:49:41, EDIT BY OSMAN
iMOVE "PURGE" TO AFTER DEFINITION OF .RLEND
i<3-UTILITIES)MACSYM.MAC.3, 21-Sep-77 15:35:48, EDIT BY OSMAN
iADD .RLEND
i<3-UTILITIES)MACSYM.MAC.2, 22-Jun-77 15:40:57, EDIT BY MURPHY
;ADDED SETMI (XMOVEI) TO SAVEAC
i<2-UTILITIES)MACSYM.MAC.7, 27-Dec-76 17:06:19, EDIT BY HURLEY
i<2-UTILITIES)MACSYM.MAC.6, 11-0ct-76 13:01:04, EDIT BY MURPHY
i<2-UTILITIES)MACSYM.MAC.5, 6-0ct-76 11:45:47, EDIT BY MURPHY
i<2-UTILITIES)MACSYM.MAC.4, 6-0ct-76 10:41:20, EDIT BY MILLER
i<2-UTILITIES)MACSYM.MAC.3, 6-0ct-76 10:30:31, EDIT BY MILLER
iCHECK FOR ALREADY DEFINED STKVAR'S AND TRVAR'S
i<2-UTILITIES)MACSYM.MAC.2, 15-Sep-76 14:21:57, EDIT BY MURPHY
iADDED FMSG, PERSTR, SAVEAC
i<1A-UTILITIES)MACSYM.MAC.54, 10-MAY-76 14:01:20, EDIT BY HURLEY
; <1A-UTILITIES)MACSYM.MAC. 50, 8-APR-76 11:16:25, EDIT BY HURLEY
; <1A-UTILITIES)MACSYM.MAC.49, 8-APR-76 11:11:35, EDIT BY HURLEY
iTCO 1244 - ADD .DIRECT .XTABM FOR MACRO 50 ASSEMBLIES

H

8

;:1)1

tt

iTHIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY ONLY BE USED
OR COPIED IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE.
;COPYRIGHT (C) 1976, 1977, 1978 BY DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.
iVERSION 1
IFNDEF REL,

IFN REL,<
TITLE MACREL
SEARCH MONSYM
SALL
IFNDEF • PS ECT, <
.DIRECT .XTABM)

iUNIVERSAL UNLESS OTHERWISE DECLARED
COMMON MACROS AND SYMBOLS
SUPPORT CODE FOR MACSYM

)

(')

o

CL

..... P-3
;:JO

;THE STANDARD ·VERSION WORD CONSTRUCTION
VERS - PROGRAM VERSION NUMBER
VUPDAT - PROGRAM UPDATE NUMBER (1=A, 2=B ••• )
VEDIT - PROGRAM EDIT NUMBER
VCUST - CUSTOMER EDIT CODE (0=DEC DEVELOPMENT, 1=DEC SWS, 2-7 CUST)

1.0"0

DEFINE PGVER.
(VERS,VUPDAT,VEDIT,VCUST)<
•• PGV0==.
iiSAVE CURRECT LOCATION AND MODE
.JBVER=:137
iiWHERE TO PUT VERSION
LOC
.JBVER
iiPUT VER~ION IN STANDARD PLACE

;:JO

(J)

(')1

o

l\,)

;:J~

<:
CDJ:

r1"Z

....·H

OP-3
;:JO

00::0

MACSYM
MACSYM
56
57
58
59
6"
61
62
63
64
65
66

COMMON MACROS AND SYMBOLS
MAC
8-Nov-77 1":47

o

MACRO %53A(1"72) 13:55 29-Dec-78 Page 1-1
BYTE
.ORG

H
G)
H
~

(3)VCUST(9)VERS(6)VUPDAT(18)VEDIT
•• PGV"
;;RESTORE LOCATION AND MODE

)'
t'1

>
;"ASKS FOR THE ABOVE

7"""""

"777""
''''''1''''77

""""""
"""""111
.777777
""""""

VI%WHO==: 7B2
VUMAJ==:777Bll
VUMIN==: 77B17
VIlEDN==:777777B35
;ADDED VUXXX

Customer edit code
"ajor version number
Minor version/update
Ed it number

n
n
I

0l::Io
l\J

A
A
~

0

1"1
H

:J

rt

CD
1"1

::s

n

0
0.

~t-i

:J 0

OJ

\Q'tJ

c::
{J}

o

~

CD

0

::s

~

'<
V
V

en
nl
(I..)

::s~

<

CD3

::SO

rtZ
..... H
~

o

::s

{J}

0

::a

MACSYM
MACSYM
67
68
69
70
71
72
73
74
75

COMMON MACROS AND SYMBOLS
MAC
8-Nov-77 10: 47

MACRO %53A(1~72) 13:55
MISC CONSTANTS

29-Dec-7~

0

Page 2

H
G)
H
~

SUB TTL MISC CONSTANTS

)I'

:MISC CONSTANTS
377777
4000fIJfIJ
777777
777777

777777
000000
000000
777777
777777

.INFIN==
.MINFI==
.LHALF==
• RHALF==
.FWORD==

377777,,777777
1B0
777777B17
777777
-1

t"1

PLUS INFINITY
MINUS INFINITY
LEFT HALF
RIGHT HALF
FULL WORD

n
n

1

~

W

/\
/\
t'%j

0
t;
H

:J
rt
CD
t;

:J
D1
I-'

c::
Ul
CD

0

:J
I-'

~
V

n
0

Q,

.....

~

:J 0
\O'tJ
Ul

nl

ON
:JlSl

<:

CD 3:
:J 0

rtZ
....·H

o

~

:J 0
Ul!lj

MACSYM
MACSYM

()
()

I

~

~

1\
1\
t'Zj

0
t1
H

::s

rt
CD
t1

::s

III
~

C

en

76
77
78
79
80
81
82
83
84
85
81)
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
HJ2
HI3
104
105
106
107
108
109
110
III
112
113
1,14

COMMON MACROS AND SYMBOLS
MAC
8-Nov-77 10:47

o

MACRO %53A(1072) 13:55 29-Dec-78 Page 3
MISC CONSTANTS
SUBTTL

000000
000001
000002
000003
000004
000005
000000
. 000007
000010
000011
000012
000013
000014
000015
01110tH6
000017
I1HH'1020
000021
000022
000023
000024
000025
000026
000027
000030
000031
000032
000033
000034
000035
000036
000037

.CHNUL== 000
.CHCNA== 001
.CHCNB== 002
.CHCNC== 003
.CHCND== 004
.CHeNE== 2105
.CHCNF==:0216
.CHBEL==:007
.CHBSP==: 010
.CHTAB==: 011
.CHLFD==: 012
.CHVTB==: 013
.CHFFD==:014
.CHCRT==: 015
.CHCNN==: 011)
.CHCNO==: 017
.CHCNP==:020
.CHCNQ==: 021
.CHCNR==:022
.CHCNS==:023
.CHCNT==: 024
.CHCNU==: 025
.CHCNV==: 026
.CHCN\l1==: 027
.CHCNX==: 030
.CHCNY==: 031
.c HCNZ==: 032
.CHESC==: 033
.CHCBS==:034
• CHCRB==: 035
.CHCCF==: 036
.CHCUN==: 037

01110175
000176
000177

.CHALT== 175
.CHAL2== 176
.CHDEL== 177

H
(;)
H
~

SYMBOLS FOR THE CONTROL CHARACTERS

)I'
t'1

;NULL

BELL
BACKSPACE
TAB
LINE-FEED
VERTICAL TAB
FORM FEED
CARRIAGE RETURN

ESCAPE
CONTROL
CONTROL
CONTROL
CONTROL

BACK SLASH
RIGHT BRACKET
CIRCONFLEX
UNDERLINE

OLD ALTMODE
ALTERNATE OLD ALTMODE
DELETE

()

o

Q,

....
::SO
~

Ul~

en

()I
Ot\)

::StSl

CD

<
(1)3

a
::s

rtZ

~

~
v

::SO
...·H

0.-3
::sO

en::o

MACSYM
MACSYM
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131

COMMON MACROS AND SYMBOLS
MAC
8-Nov-77 10:47

tj

MACRO %53A(1072) 13:55.29-Dec-78 Page 4
SYMBOLS FOR THE CONTROL CHARACTERS
SUB TTL

H

G)
H
~

HARDWARE BITS OF INTEREST TO USERS

»I

Lot

;PC FLAGS
40~000
00000171
20e000 000~00
le00e0 000000
040000 000000
020000 000-".100
010000 . 000-".100
004000 000000
002000 000000
001000 0000""0
e"0600 000000
000100 000000
01110040 01110000

PC%OVF==~IB0

PC%CY0==:IBl
PC%CYl==:IB2
PC%FOV==:IB3
PC%BIS==:IB4
PC%USR==: IB 5
PC%UIO==;IB6
PC%LIP==:IB7
PC%AFI==:IB8
PC%ATN==: 3BHl
PC%FUF==: IB11
PC%NDV==:lB12

iOVERFLOW
iCARRY 0
iCARRY 1
iFLOATING OVERFLOW
iBYTE INCREMENT SUPPRESSION
iUSER MODE
iUSER lOT MODE
iLAST INSTRUCTION PUBLIC
iADDRESS FAILURE INHIBIT
iAPR TRAP NUMBER
iFLOATING UND~RFLOW
iNO DIVIDE

()

()

I

~

U1

/\
A
"'Zj

,.,0
H

::l
it
(J)

"'1
::l
Q.I
~

c:::
Ul

()

0
0..

..... ~

::l 0

~"'O

CJ)

()I

ON
::l~

(J)

<:

0

::l 0

(J)

::l
~

~

V
V

3:

rtZ

....·H

o

~

::lO
Ul

::0

MACSYM
MACSYM

(')
(')

1

~

0"1

A
A
~

o

1"1
H

::1
cT
CD
1"1

::1
OJ

......

c::

132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168

COMMON MACROS AND SYMBOLS
MAC
8-Nov-77 10:47

o

MACRO %53A(1072) 13:55 29-Dec-78 Page 5
HARDWARE BITS OF INTEREST TO USERS
SUB TTL

H

G)
H

t-3

MACROS FOR FIELD MASKS

~

t"'

;STANDARD MACROS
;MACROS TO HANDLE FIELD MASKS
;COMPUTE LENGTH OF MASK, I.E. LENGTH OF LEFTMOST STRING OF ONES
;REMEMBER THAT AL DOES 'JFFO', I.E. HAS VALUE OF FIRST ONE BIT IN WORD
;COMPUTE WIDTH OF MASK, I. E." LENGTH OF LEFTMOST STRING OF ONES
DEFINE WID(MASK)«AL<-«MASK> -1»>
;COMPUTE POSITION OF MASK, I.E. BIT POSITION OF RIGHTMOST ONE IN MASK
DEFINE POS(MASK)«AL«MASK>&<-
;CONSTRUCT BYTE POINTER TO MASK
DEFINE POINTR(LOC,MASK)«POINT WID(MASK),LOC,POS(MASK»>
;PUT RIGHT-JUSTIFIED VALUE INTO FIELD SPECIFIED BY MASK
DEFINE FLD(VAL,MSK) «VAL>B .
";MAKE VALUE BE RIGHT JUSTIFIED IN WORD.
DEFINE .RTJST(VAL,MSK)«VAL>B
;CONSTRUCT MASK FROM BIT AA TO BIT BB. I.E. MASKB 0,8

777B8

DEFINE MASKB (AA,BB)-l>-lB*DSOR»
(')

o

a,
..... t-3

::1 0
UlttJ
(Jl

(')1
o tv

til
CD

::1lSl

o

::1 0

......
'<
V

o

::1

V

<

CD 3

cTZ
..... H

t-3

::10

tIl::O

MACSYM
MACSYM

COMMON MACROS AND SYMBOLS
MAC
8-Nov-77 10:47

t1

MACRO %53A(1072) 13:55 29-Dec-78 Page 6
MACROS FOR FIELD MASKS

169
170

H
(;)
H
~

SUBTTL MOVX

>
Lt

171

()

n
I

~

....J

A
A
l'%j

o

~

H
~

rt
CD
~

~

OJ
I--'

C

en
CD

o
~

I--'

~
V

172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
21-6

217
218
219
220

;MOVX - LOAD AC WITH CONSTANT
DEFINE MOVX (AC,MSK)<
•• MX1==MSK
;;EVAL EXPRESSION IF ANY
IFDEF .PSECT,<
.IFN •• MX1,ABSOLUTE,<
MOVE AC, (MSK] >
.IF •• MX1,ABSOLUTE,<
•• MX2==0
;;FLAG SAYS HAVEN'T DONE IT YET
IFE < •• MX1>B53,<
•• MX2==1
MOVEI AC, •• MX1>
~;LH 0, DO AS RH
IFE •• MX2,<
;;IF HAVEN'T DONE IT YET,
IFE <~.MX1>B17,<
• .MX2==1
MOVSI AC,( •• MX1»>
;;RH 0, DO AS LH
IFE •• MX2,<
;;IF HAVEN'T DONE IT YE~,
IFE « •• MX1>B53-~0777777>,<
• .MX2==1
HRROI AC,< •• MX1»>
;;LH -1
IFE •• MX2, <
;; IF HAVEN'T DONE IT YET,
IFE « .. MXl>B17-~0777777B17>,<
• .MX2==1
HRLOI AC, ( •• MX1-~0777777)>> ; ;RH -1
IFE •• MX2,<
;;IF STILL HAVEN'T DONE IT,
MOVE AC,( •• MX1]>
;;GIVE UP AND USE LITERAL

»

IFNDEF .PSECT,<
•• MX2==0
;;FLAG SAYS HAVEN'T DONE IT YET
IFE < •• MX1>B53,<
•• MX2==1
MOVEI AC, •• MX1>
;;LH ~, DO AS RH
IFE •• MX2,<
;;IF HAVEN'T DONE IT YET,
IFE < •• MX1>B17,<
•• MX2==1
MOVSI AC,( •• MX1»>
;;RH 0, DO AS LH
IFE •• MX2,<
;;IF HAVEN'T DONE IT YET,
IFE « •• MX1>B53-~0777777>,<
•• MX2==1
HRROI AC,< •• MX1»>
;;LH -1
IFE •• MX2,<
;;IF HAVEN'T DONE IT YET,
IFE « •• MX1>B17-~0777777B17>,<
•• MX2==1
HRLOI AC,( •• MX1-~0777777»> ;;RH-1
IFE •• MX2,<
;;IF STILL HAVEN'T DONE IT,
MOVE AC,( •• MX1]>
;;GIVE UP AND USE LITERAL

>
PURGE •• MX1, •• MX2>

(l

o

a,

..... ~

~O

\0"0

CJ)

(ll

ON
~tS1

<:

CD
~

3:

0

rtZ

....·H

o

~

~O

en ::0

MACSYM
MACSYM
221
222
223
224
225
22fi
227
228
229
230

COMMON MACROS AND SYMBOLS
MAC
8-Nov-77 10:47

t:j

MACRO %53A(1072) 13:55 29-Dec-78 Page 7
MOVX

H
G')
H

;VARIENT MNEMONICS FOR TX DEFINITIONS

1-3

DEFINE IORX (AC,MSK)<
TXO AC,'
t'"

DEFINE ANDX (AC,MSK)<
TXZ AC,
DEFINE XORX (AC,MSK)<
TXC AC,
rt

;CREATE THE TX MACRO DEFINITIONS
;THIS DOUBLE IRP CAUSES ALL COMBINATIONS OF MODIFICATION AND TESTING
;TO BE DEFINED
DEFINE •• DOTX (M,T)<
IRP M, <
IRP T,<
DEFINE TX'~'T (AC,MSK)<
~.TX(M'~,AC,~<,E,N,A»A ;DO ALL DEFINITIONS
PURGE •• DOTX
; •• TX
;ALL TX MACRDS JUST CALL •• TX WHICH DOES ALL THE WORK

25~

()
()

I

~

1..0

A

A
I"1j

..,o
H

::s

rt

..,CD
::s
OJ

~

cUl

m

o

::s

......

"<
V

V

251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285

DEFINE •• TX(MT,AC,~SK)<
•• TXl==MSK
;;EVAL EXPRESSION IF ANY
IFDEF .PSECT,<
.IFN •• TX1,ABSOLUTE,<
TD'MT AC,(MSK]>
.IF •• TXl,ABSDLUTE~<
;;MASK MUST BE TESTABLE
•• TX2=="
;;FLAG SAYS HAVEN'T DONE IT YET
IFE < •• TXl&A~777777BI7>,<
•• TX2==1
::LH 0, DO AS RH
TR'MT AC, •• TXl>
IFE •• TX2,<
::IF HAVEN'T DONE IT YET,
IFE < •• TXl&A0777777>,<
•• TX2==1
::RH 0, DO AS LH
TL'MT AC,( •• TXl»>
IFE •• TX2,<
::IF HAVEN'T DONE IT YET,
IFE

« •• TXl>B53-

A

0777777>,< ;;IF LH ALL ONES,

•• TX3 (MT,AC»>
::TRY Z,O,C SPECIAL CASES
IFE •• TX2,<
::IF STILL HAVEN'T DONE IT,
TD'MT AC,( •• TXl]>
::MUST GIVE UP AND USE LITERAL
PURGE •• TXl, •• TX2»
IFNDEF .PSECT,<
•• TX2==0
::FLAG SAYS HAVEN'T DONE IT YET
IFE < •• TXl&A0777777BI7>,<
•• TX2==1
::LH 0, DO AS RH
TR'MT AC, •• TXl>
IFE •• TX2,<
::IF HAVEN'T DONE IT YET,
IFE < •• TXl&A 0 777777>,<
•• TX2==1
::RH 0, DO AS LH
TL'MT AC,( •• TXl»>
IFE •• TX2,<
::IF HAVEN'T DONE IT YET,
A
IFE « •• TXl>B53- 0777777>,< ::IF LH ALL ONES,
•• TX3 (MT,AC»>
TRY Z,O,C SPECIAL CASES
IFE •• TX2,<
IF STILL HAVEN'T DONE IT,
TD'MT AC,( •• TXl]>
MUST GIVE UP AND USE LITERAL
PURGE •• TXl, •• TX2»

()

o

0..

~o~

::s

0

~"'O

(J)
()I

ON
::s~

<:

3:
::SO
CD

rtZ

""oH
O~

::SO
Ul ::0

MACSYM
MACSYM

t::7

MACRO %53A(1972) 13:55 29-Dec-78 Page 9
TX -- TEST MASK

COMMON MACROS AND SYMBOLS
MAC
8-Nov-77 19:47

H
c;)
H

;SPECIAL CASE FOR LH ALL ONES

286
287
288
289
299
291
292
293
294
295
296
297

DEFINE •• TX3 (MT,AC)<
IFIDN ·,<
•• TX2==1
ANDI AC,A- •• TX1>.
IFIDN ,<
•• TX2==1
ORCMI AC,A- •• TX1>
IFIDN ,<
•• TX2==1
EQVI AC,A- •• TX1»

I-i

):It

;;IF ZEROING WANTED

t'"'i

;;CAN DO IT WITH ANDI
;;IF SET TO ONES WANTED
;;CAN DO IT WITH IORCM
;;IF COMPLEMENT WANTED
;;CAN DO IT WITH EQV

(")
()

I
01
~

1\
1\

tzJ

0

t;

H

::s

()

0

rt

....::Ja. 0

CD

~

t;

::s

\Q"tJ
CIl
()I

OJ

f-I

o (\.)
::s ~
<
CD 3:
::s 0

c::
en
CD

0

::s

f-I

~

V
V

"

rtZ
....·H

o
::s

I-i
0

en ::0

MACSYM
MACSYM
29-8
299
3vH'J
301
302
303
304
305
30fi
3{1)7
308
309
31.0

()
()

I
lTI
~

/\
/\

t-z:I

o

1"'1
H

::s

rt
CD

1"'1

::s
OJ

I-'

c:

00
CD

o

::s

I-'

"<
V
V

3n
312
313
314
315
31fi
317
31R
319
320
321
322
323
324
325
32fi
327
328
329
330
331
332
333
334
335
336

337
338
339
340
341
342
343
344
345
34fi
347
348

COMMON MACROS AND SYMBOLS
MAC
8-Nov-77 10:47

MACRO %53A(1072) 13:55 29-Dec-78 Page 10
TX -- TEST MASK

t1
H
G)
H
~

SUB TTL JX -- JUMP ON MASK
JXE
JXN
JXO
JXF

JUMP
JUMP
JUMP
JUMP

IF
IF
IF
IF

MASKED
MASKED
MASKED
MASKED

BITS
BITS
BITS
BITS

ARE
ARE
ARE
ARE

~

EQUAL TO 0
NOT EQUAL TO 0
ALL ONES
NOT ALL ONES (r'ALSE)

t'"1

DEFINE JXE lAC ,-=MSK, BA) <
•• .JX~==MSK
;; EVAL EXPRESSION IF ANY
IFDEF .PSEC'I',<
.IFN _•• JXl,ABSOL-UTE,
.IF •• JX1,ABSOLUTE,<
.IF0 «.~JXl>-IB0>,<
iiIF MASK IS JUST B0,
JUM-PG E A-C, SA> , <
.IF0 « •• JXl>+I>,<
iiIF MASK IF FULL WORD,
JUMPE AC,BA>,<
;;USE GIVEN CONDITION
TXNN (AC, •• JXl)
JRST BA>>>
PURGE •• JXl>
IFNDEF .PSECT,<
.IF0 « •• JXl>-IB0>,<
iiIF MASK IS JUST B0,
JUMPGE AC,BA>,<
.IF0 « •• JXl>+I>~<
i;IF MASK IF FULL WORD,
JUMPE AC,BA>,<
iiUSE GIVEN CONDITION
TXNN (AC, •• JXl)
JRST BA»>
PURGE •• JXl>
DEFINE JXN (AC,MSK,BA)<
•• JXl==MSK
;iEVAL EXPRESSION IF ANY
IFDEF .PSECT,<
.IFN •• JXl,ABSOLUTE,
.IF •• JXl,ABSOLUTE,<
.IF0 « •• JXl>-IB0>,<
iiIF MASK IS JUST B0,
JUMPL AC,BA>,<
.IF0 « •• JXl>+I>,<
iiIF MASK IF FULL WORD,
JUMPN AC,BA>,<
iiUSE GIVEN CONDITION
TXNE (AC, •• JXl)
JRST BA»>
PURGE •• JXl>
IFNDEF .PSECT,<
.IF0 « •• JXl>-IB0>,<
iiIF MASK IS JUST B0,
JUMPL AC,BA>,<
.IF0 « •• JXl>+I>,<
iiIF MASK IF FULL WORD,
JUMPN AC,BA>,<
iiUSE GIVEN CONDITION
TXNE (AC, •• JXl)
JRST BA»>
PURGE •• JXl>

()

o

0,
~.t-3

::SO

~"O
(J)

()I

ON

::sS1
<:

CD3

::sO
rtZ
~·H

01-3

::sO

00"

MACSYM
MACSYM

n

n

•
U"I
tv

I\.
I\.
t'Zj

o

1"1
H

:J
rt
CD
1"1

::s
OJ

~

c::
[I)
CD

o

::s

~

~

V
V

349
359
351
352
353
354
355
356
357
358
359
369
361
362
363
364
365
366
367
368
369
379
371
372
373
374
375
376
377
378
379
389
381
382
383
384
385
386
387
388
389
399
391
392
393
394
395
396
397
398
399
49(11

COMMON MACROS AND SYMBOLS
MAC
8-Nov-77 19:47

o

MACRO %53A(1(1172) 13:55 29-Dec-78 Page 11
JX -- JUMP ON MASK
DEFINE JXO (AC,MSK,BA)<
;;EVAL EXPRESSION
•• JX1==MSK
IFDEF .PSECT,<
.IFN •• JX1,ABSOLUTE,
.IF •• JX1,ABSOLUTE,<
.IF9 « •• JX1>-1B9>,<
JUMPL AC,BA>,<
•• ONEB ( •• BT,MSK)
;;TEST MASK FOR ONLY ONE BIT ON
.IF9 •• BT,<
SETCM • SAC ,AC
; ;GENERAL CASE, GET COMPLEMENTS
JXE (.SAC, •• JX1,BA»,< ;;JUMP IF BITS WERE ORIGINALLY
TXNE AC, •• JX1
: :TEST AND JUMP
JRST BA»>
PURGE •• JXl>
IFNDEF .PSECT,<
.IF9 « •• JX1>-1B(II>,<
JUMPL AC,BA>,<
•• ONEB ( •• BT,MSK)
;;TEST MASK FOR ONLY ONE BIT ON
.IF(II •• BT,<
SETCM .SAC,AC
; GENERAL CASE, GET COMPLEMENTS
JXE (.SAC, •• JX1,BA»,<
;JUMP IF BITS WERE ORIGINALLY
TXNE AC, •• JX1
TEST AND JUMP
JRST BA»>
PURGE •• JX1>

H
G)
H

t-3

>
t'1

OF BITS
ONES

OF BITS
ONES

DEFINE JXF (AC,MSK,BA)<
•• JX1==MSK
::EVAL EXPRESSION
IFDEF .PSECT,<
.IFN •• JX1,ABSOLUTE,-1B(II>,<
JUMPGE AC, BA>, <
•• ONEB ( •• BT,MSK)
;;TEST MASK FOR ONLY ONE BIT ON
• IF(II •• BT,<
SETCM .SAC,AC
;;GENERAL CASE, GET COMPLEMENT OF BITS
JXN (.SAC, •• JX1,BA»,< ;;JUMP IF SOME ZEROS ORIGINALLY
TXNN AC, •• JX1
;;TEST AND JUMP
JRST BA»>
PURGE •• JX1>
IFNDEF .PSECT,<
.IF(/J « •• JX1>-1B(/J>,<
JUMPGE AC, BA>, <
•• ONEB ( •• BT,MSK)
::TEST MASK FOR ONLY ONE BIT ON
.IF(/J •• BT,<
SETCM .SAC,AC
GENERAL CASE, GET COMPLEMENT OF BITS
JXN (.SAC, •• JX1,BA»,<
;JUMP IF SOME ZEROS ORIGINALLY
TXNN AC, •• JX1
TEST AND JUMP
JRST SA»>
PURGE •• JXl>

n

o
a.

..... t-3
::s 0
I.QtoO

n.CIl
tv

o

::StSl

<
CD
::s

3:

0

rtZ
....~H

o

::s
[I)

t-3
0
::0

MACSYM
MACSYM

COMMON MACROS AND SYMBOLS
MAC
R-Nov-77 HI: 47

MACRO %53A(1072) 13:55 29-Dec-7B Page 12
JX -- JUMP ON MASK

\:1
H

Q

401
402
403
404
405
4011
407
408
409
410

411
412
413
414
-415

410

(1
()

I
U'1
W

A
A
~

0

t;

H
;:]

cT

('I)
t;

;:]

OJ

t-'

C
00
C1>

0

='t-'

"<
V
V

417
41B
419
420
421
422
423
424
425
4211
427
428
429
430
431
432
433
434
435
431)

437
43B
439
440
441
442
443
444
445
4411
447
448
449
450
451
452

H

SUBTTL SUBFUNCTION MACROS
~.

1-3

DEFINE .IF.0 (COND,THEN,ELS"E)<
•• IFT==COND
IFE ~.IFT,<
THEN
•• IFT==0>
IFN •• IFT,<
ELSE»
~CASE

;~GET

t""I

LOCAL VALUE FOR CDNDITION

;;RESTORE IN CASE CHANGED BY NESTED .IF0

-(NUMBER,
~TEST

FOR FULL l'lORD, RH, LH, OR ARBITRARY BYTE

DEFINE •• TSIZ (SYM,MSK)<
SYM==)
~~ASSUME BYTE UNLESS •••
IFE +1,
~~FULL WORD IF MASK IS -1
IFE -~0777777, ~~RH IF MASK IS 777777
IFE -~0777777B17,
~~LOOK AT LOC
IFE •• TSA1&~0777777777760, ~;AC IF VALUE IS 0-17

>

IFDEF .PSECT,<
SYM=='"
~ ~ASSUME NOT AC UNLESS •••
•• TSA1==
~~LOOK AT LOC
.IF •• TSA1,ABSOLUTE,<
~~SEE IF WE CAN TEST VALUE
IFE •• TSA1&~0777777777760,
toot

.SAC=16

(')
(')

I
U1
~

/\
/\
~

,.,0
H

::l
rt
CD

,.,
::l
OJ

~

C

{J)

CD

0

:s

.......

~
v

(')

0

0.
.... 1-3

::SO

~"O

en

01
o tv

::s s
<
CD 3:

::l 0

rtZ
....·H

o 1-3
:s a

en :tJ

MACSYM
MACSYM
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
48'"

481
482
483
()

n
I

lJ1
lJ1

/\
/\
I'%j

COMMON MACROS AND SYMBOLS
MAC
8-Nov-77 1~:47

o

MACRO '53A(1072) 13:55 29-Dec-78 Page 13
SUB FUNCTION MACROS

H

G)
H

.-3
:J>I

SUBTTL DEFSTR -- DEFINE DATA STRUCTURE
DEFINE DATA STRUCTURE
NAM - NAME OF STRUCTURE AS USED IN CODE
LOCN - ADDRESS OF DATA
POS - POSITION OF DATA WITHIN WORD (RIGHTMOST BIT NUMBER)
SIZ - SIZE OF DATA (IN BITS) WITHIN WORD

t""I

DEFINE DEFSTR (NAM,LOCN,POS,SIZ)<
NAM==<-1B+1B,LOCN"Y,MSK»> iiDEFINE MACRO TO HOLD LOCATION
iALTERNATE

F~RM

OF DEFSTR -- TAKES MASK INSTEAD OF POS,SIZ

DEFINE MSKSTR (NAM~LOCN,MASK)<
NAM==MASK
i iASSIGN SYMBOL TO HOLD MASK
IF1,,LOCN"Y,MSK»> iiDEFINE MACRO TO HOLD LOCATION
i •• STR0

- PROCESS INSTANCE OF STRUCTURE USAGE, SINGLE STRUCTURE CASE.

484

485
486
487
48S
489
490
491
492

DEFINE •• STR0 (OP,AC,STR,Y)<
IFNDEF STR,,Y,.FWORD»
i;RESERVE A WORD, ASSUME WORD MASK
IFDEF STR,<
IFNDEF "STR,<
OP «AC>,Y,STR»
;;ASSUME NO OTHER LOCN
IFDEF "STR,<
.
"STR (OP,,Y,STR»» ;;DO IT

o..,
H

::s

n

it

o

::s

..... 1-3
::s 0

..,CD

OJ

......

c:::

Ul

CD

o
::s
......

~
V

Q,

Ul"'O
(J)

nl

Or-...>

::Stg

<
CDJ:

::SO
itZ

....·H

0.-3
::SO

en"

MACSYM
MACSYM

o
o
I

U1
0'\

493
494
495
491)
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
51n
517
518
519
520
521

COMMON MACROS AND SYMBOLS
MAC
8-Nov-77 10:47

t1

MACRO %53A(1072) 13:55 29-Dec-78 Page 14
DEFSTR -- DEFINE DATA STRUCTURE

H
(;)
H
~

; •• STRl, •• STR2, •• STR3, AND •• STR4 ARE INTERNAL MACROS FOR PROCESSING
;INSTANCES OF STRUCTURE USAGE.

»I

DEFINE •• STRI (OP,AC,STR,Y,CLL)<
•• NS==0
;;INIT COUNT OF STR'S
IRP STR,< •• NS= •• NS+l>
;;COUNT STR'S
IFE •• NS,,,Y»
IFG •• NS-l,<
;;MORE THAN ONE, DO GENERAL CASE
•• ICNS
;;INIT REMOTE MACRO
•• CNS «CLL (OP,
If'DEF STR,<
IFNDEF %'STR, <
•• CNS «,STR,Y»>
;;ASSUME NO OTHER LOCN
IFDEF %'STR,<
%'STR ( •• STR2"Y,STR»
;;STR MACRO WILL GIVE LOCN TO •• STR2
•• CNS «»)
; ;CLOSE ARG LIST
•• GCNS
iiDO THIS AND PREVIOUS NAME
•• ICNS
iiREINIT CONS
•• CNS «CLL (OP,
iiASSUME NO OTHER LOCN
IFDEF %'STR,<
%'STR ( •• STR2"Y,STR»»
iiPUT ON THIS ARG, END IRP
•• CNS «,,) »
; iCLOSE ARG LIST
•• GCNS»
i iDO LAST CALL

t'"1

1\
1\
t'Zj

o

t1
H

::s

rt

CD
t1

::s
QI

I-'

c:::

en
CD

o

o

Q,

.....

::s

\Q~

CIl

01

o ~
::s&
<:

CD 3:

o
::s

::s

~

o
::s

I-'

V

~

0

0

rtZ

....·H
~

0

en ::0

MACSYM
MACSYM
522
523
524
525
5215
527
528
529
53~

531
532
533
534
535
536
537
538
539
54~

()
()

I
U'I
'-ol

/\.
/\.
I-%J

o

t;

H

;:1

rt
CD

..,
;:1

OJ

......

c::
00
CD

o

541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556

557
558
559
56~

561
562

COMMON MACROS AND SYMBOLS
MAC
8-Nov-77 1~:47

o

MACRO %53A(1072) 13:55 29-Dec-78 Page 15
DEFSTR -- DEFINE DATA STRUCTURE

H
G)
H

; •• STR2 -- CALLED BY ABOVE TO APPEND STRUCTURE NAME AND LOC TO ARG LIST

.-3

DEFINE •• STR2 (AA,LOC,STR)<
•• CNS «,STR,LOC»>

t""f

)'

;;CONS ON NEXT ARG PAIR

; •• STR3 -- CHECK FOR ALL STRUCTURES IN SAME REGISTER
DEFINE •• STR3 (OP,AC,Sl,Ll,S2,L2)<
IFDIF ,<
IFNB ,<
OP «AC>,Ll, •• MSK)
;;DO ACCUMULATED STUFF
IFNB ,
;;INIT MASK
IFNB ,<
•• MSK= •• MSK!
; •• STR4 -- COMPARE SUCCESSIVE ITEMS, DO SEPARATE OPERATION IF
;DIFFERENT WORDS ENCOUNTERED
DEFINE •• STR4 (OP,AC,SI,Ll,S2,L2)<
IFDIF ,<
;;IF THIS DIFFERENT FROM PREVIOUS
IFNB ,<
OP {,Ll, •• MSK»
;;DO PREVIOUS
•• MSK==0>
;;REINIT MASK
IFNB ,<
•• MSK= •• MSK!
;;ACCUMULATE MASK
; •• STRS - SAME AS •• STR4 EXCEPT GIVES EXTRA ARG IF MORE STUFF TO
;FOLLOW.
DEFINE •• STR5 (OP,AC,SI,Ll,S2,L2)<
IFDIF ,<
;;IF THIS DIFFERENT FROM PREVIOUS,
IFNB ,<
IFNB ,<

;;IF MORE TO COME,

OP'1 (AC,Ll, •• MSK»
;;DO VERSION 1
IFB ,<
;;IF NO MORE,
OP'2 (AC,Ll, •• MSK»> ;;DO VERSION 2
•• MSK==~>
;;REINIT MASK
IFNB ,<
•• MSK= •• MSK!
;;ACCUMULATE MASK

()

o

0..

..... .-3

;:10
~~
(Jl

()I

Or-.>

::J:g

<

CD 3:
::JO

::J

rtZ

"<
V

0.-3

I-'

V

....·H

;:10

00::0

MACSYM
MACSYM

COMMON MACROS AND SYMBOLS
MAC
8-Nov-77 10:47

tj

MACRO %53A(1072) 13:55 29-Dec-78 Page 16
DEFSTR -- DEFINE DATA STRUCTURE

H

Cl
563
564
565
566
567
568
569
570
571
572
573
574
575
576

H

1-3

;'REMOTE' MACROS USED TO BUILD UP ARG LIST

):II

tot

;INITIALIZE CONS -- DEFINES CONS
DEFINE •• ICNS <
DEFINE •• CNS (ARG)<
•• CNS2 , >
DEFINE •• CNS2 (NEW,OLD)<
DEFINE •• CNS (ARG)<
•• CNS2 ,

>

577

;GET CONS -- EXECUTE STRING ACCUMULATED

578
579
580
581
582

DEFINE •• GCNS <
DEFINE •• CNS2 (NEW,OLD)<
OLD>
•• CNS () >

;;MAKE •• CNS2 DO THE STUFF
;;GET •• CNS2 CALLED WITH THE STUFF

n
n
I

U1

ex>

/\
/\
I'Zj

,.,o
H

rt

n
o

::s

::s

::s

,.,CD
OJ

1--'

Q,

..... 1-3
0

\.0"0

en
nl

en

o
::s

tSl

o
::s

::s

CD

3:

"<
V

o
::s

c::
CD

~

V

<:

tv

0

rtZ

....·H

Ul

1-3
0
::0

MACSYM
MACSYM
583
584
585
58fi
587
588
589
5ge
591
592
593
594
595
596
597
598
599
6~e

(")
(")

I
111
1.0

/\
/\
I'1:j

o

1"1
H

:J

rt

CD

1"1

:J

QI

......
c

en

CD

6e1
6e2
6e3
6e4
6e5
6e6
6e7
6e8
6e9
61e
611
612
613
614
615
616
617
618
619
62e
621
622
623
624
625
626
627
628

COMMON MACROS AND SYMBOLS
MAC
8-Nov-77 1e:47

MACRO %53A(le72) 13:55 29-Dec-78 Page 17
DEFSTR -- DEFINE DATA STRUCTURE

o

H
G)
H
~

iSPECIFIC CASES

):I'

LOAD, STORE
AC - AC OPERAND
STR - STRUCTURE NAME
Y - (OPTIONAL) ADDITIONAL SPECIFICATION OF DATA LOCATION

J:"1

DEFINE LOAD (AC,STR,Y)<
•• STR0 ( •• LDB ,AC, STR, Y»
DEFINE •• LDB (AC,LOC,MSK)<
•• TSIZ ( •• PST,MSK)
.CASE •• PST,«
MOVE AC,LOC>,<
HRRZ AC,LOC>.<
HLRZ AC, LOC>, <
LDB AC,[POINTR (LOC,MSK)]»>
DEFINE STOR (AC,STR,Y)<
•• STRe ( •• DPB,AC,STR,Y»
DEFINE •• DPB (AC,LOC,MSK)<
•• TSIZ ( •• PST, MSK)
.CASE •• PST,«
MOVEM AC,LOC>,<
HRRM AC, LOC>, <
HRLM AC, LOC>, <
DPB AC,[POINTR (LOC,MSK)]»>
iSET TO ZERO
DEFINE SETZRO (STR,Y)<
•• STR1 ( •• TQZ,,,Y, •• STR4»
DEFINE •• TQZ (AC,LOC,MSK)<
•• TSIZ ( •• PST,MSK)
;;SET •• PST TO CASE NUMBER
.CASE •• PST,«
SETZM LOC>,<
i iFULL WORD
HLLZS LOC>, <
RH
HRRZ S LOC>, <
LH
•• TSAC ( •• ACT, LOC)
SEE IF LOC IS AC
.IF~ •• ACT,<
MOVX .SAC,MSK
iiNOT AC
ANDCAM .SAC,LOC>,<
•• TX (Z,LOC,MSK»»>

(")

o

0,

.....

~

:JO
I.Q"'O
(/)

01
ON
:JS

<:

o

CD 3:
:JO

......
"<
V

O~

:J

V

rtZ

....·H

:JO

en::o

MACSYM
MACSYM

()
()

I

'"

!Sl

629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660

COMMON MACROS AND SYMBOLS
MAC
8-Nov-77 lA:47

MACRO %53A(1072) 13:55 29-Dec-78 Page 18
DEFSTR -- DEFINE DATA STRUCTURE

o

H
G)
H

;SET TO ONE

t-3

)I'

DEFINE SETONE (STR,Y)<
•• STRI ( •• TQO,,,Y, •• STR4»

t"'4

DEFINE •• TQO (AC,LOC,MSK)<
•• TSIZ ( •• PST,MSK)
.CASE •• PST,«
SETOM LOC>,<
HLLOS LOC>, <
HRROS LOC>,<
•• TSAC ( •• ACT,LOC)
.IF9 •• ACT,<
MOVX .SAC,MSK
IORM .SAC,LOC>,<
•• TX (O,LOC,MSK»»>
;SET TO COMPLEMENT
DEFINE SETCMP (STR,Y)<
•• STRI ( •• TQC,,,Y, •• STR4»
DEFINE •• TQC (AC,LOC,MSK)<
... TSIZ ( •• PST,MSK)
IF FULL WORD,
.IF0 •• PST,<
CAN USE SETCMM
SETCMM LOC>-, <
•• TSAC ( •• ACT,LOC)
OTHERWISE, CHECK FOR AC
• IF" •• ACT,<
MOVX • SAC, MSK
XORM .SAC,LOC>,<
•• TX(C,LOC,MSK»»

1\
1\
t'Ij

o

~

H

::J

rt
(I)

1'1

::J
OJ

......

()

o

Q,

.... t-3
::J 0
\.0'"0

en

()I

CD

o
::J
<

o

::J 0

......
'<
V

o

c

en
::J

V

CD

I\J

S1

3

rtZ
.... H

t-3
::J 0

en :::0

MACSYM
MACSYM
661
662
663
664
665
666
667
668
669
670
671

672
673
674
675
676
677

()
()

I
:J'\
.....,

A
A
I'Tj

o

1"'1
H

::s

rt"
CD

...,
::s

01
.....,

c:
rn

CD

COMMON MACROS AND SYMBOLS
MAC
8-Nov-77 10:47

MACRO %53A(111l72) 13:55 29-Dec-78 Page 19
DEFSTR -- DEFINE DATA STRUCTURE
;INCREMENT, DECREMENT FIELD

1-3

)I'

DEFINE INCR (STR,Y)<
•• STRIIl (.INCRIIl,,,Y»

t"1

DEFINE .INCRIIl (AC,LOC,MSK)<
• .PST==MSK&<-MSK>
; ;GET LOWEST BIT
• IFill •• PST-1,<
AOS LOC>,<
;;BIT 35, CAN USE AOS
MOVX .SAC, •• PST ;;LOAD A ONE IN THE APPROPRIATE POSITION
ADDM.SAC,LOC»
DEFINE DECR (STR,Y)<
•• STRIIl (.DECRIIl,,,Y»
DEFINE .DECRIIl (AC,LOC,MSK)<
•• PST==MSK&<-MSK>
• IFill •• PST-1, <
SOS LOC>,<
;;BIT 35, CAN USE SOS
MOVX .SAC,- •• PST ;;LOAD -1 IN APPROPRIATE POSITION
ADDM .SAC,LOC»

678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695

DEFINE OPSTR (OP,STR,Y)<
•• STRIIl (.OPST1,,,Y»

690

DEFINE OPSTRM (OP,STR,Y)<

697
698
699
700
701
702
703
711.14
71115

tj
H
G)
H

;GENERAL DEFAULT, TAKES OPCODE

DEFINE .OPST1 (OP,LOC,MSK)<
•• TSIZ ( •• PST,MSK)
.IFIIl •• PST,<
OP LOC>,<
;;FULL WORD, USE GIVEN OP DIRECTLY
•• LDB .SAC,LOC,MSK ;;OTHERWISE, GET SPECIFIED BYTE
OP .SAC»
•• STRIIl (.OPST2,,,Y»
DEFINE .OPST2 (OP,LOC,MSK)<
• • TS I Z ( •• PS T , MSK)
• IFill •• PST,<
OP LOC>,<
;;FULL WORD, USE OP DIRECTLY
•• LDB .SAC,LOC,MSK
OP • SAC
•• DPB .SAC,LOC,MSK»

()

o

a..

.... 1-3
::sO

\.Q~

en

()I

ON

::S5l

<:
CD3

o
::s
.....,

::SO
rt"Z

~

01-3
::sO
rn::t'

V

.... H

MACSYM
MACSYM

COMMON MACROS AND SYMBOLS
MAC
8-Nov-77 1~:47

o

MACRO %53A(1A72) 13:55 29-Dec-78 Page 20
DEFSTR -- DEFINE DATA STRUCTURE

H
G)
H

7~6

707
708
709
7U

711
712
713
714
715
716
717
718
719
729
721
722
723
724

725
726
727
()
()

I

~

r-...>

/'\
/'\
t'Zj

o
...,

"H

::s

rt
('1)

...,
::s
OJ

......

c::
en
CD

o

::s

......

~
V

728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
.744
745

;JUMP IF ALL FIELDS ARE 0 (ONE REGISTER AT MOST)

1-3

DEFINE JE (STR,Y,BA)<
•• STR1 ( •• JE,,,Y, •• STR3»

L'

)II

DEFINE •• JE (BA,LOC,MSK)<
•• TSAC ( •• ACT,LOC)
;;SEE IF AC
• IF0 •• ACT,<
•• TSIZ ( •• PST,MSK)
;;SEE WHICH CASE
.CASE •• PST,«
SKIPN LOC
; ;FULL WORD, TEST IN MEMORY
JRST BA>,<
HRRZ .SAC,LOC
;;RIGHT HALF, GET IT
JUMPE .SAC,BA>,<
HLRZ .SAC~LOC
;;LEFT HALF, GET IT
JUMPE .SAC,BA>,<
MOVE .SAC,LOC
;;NOTA, GET WORD
JXE (.SAC,MSK,,<
JXE (LOC,MSK,,,Y, •• STR3)>
•• IN (BA,LOC,MSK)<
•• TSAC ( •• ACT ,LOC)
;;SEE IF AC
.IF0 •• ACT,<
•• TSIZ ( •• PST,MSK)
.CASE •• PST,«
SKIPE LOC
;;FULL WORD, TEST IN MEMORY
JRST BA>,<
HRRZ .SAC,LOC
;;RIGHT HALF, GET IT
JUMPN • SAC, BA>, <
HLRZ .SAC,LOC
;;LEFT HALF, GET IT
JUMPN .SAC,BA>,<
MOVE .SAC,LOC
;;NOTA, GET WORD
JXN (.SAC,MSK,,<
JXN (LOC,MSK,,,Y, •• STR4)>

L'

)II

;JNAND - JUMP ON NOT 'AND' OF ALL FIELDS
DEFINE JNAND (STR,Y,BA)<
•• STR1 ( •• JNA3,,,Y, •• STR4»
DEFINE •• JNA3 (BA,LOC,MSK)<
•• TSAC ( •• ACT,LOC)
.IF0 •• ACT,<
SETCM .SAC,LOC
;;NOT AC, GET COMPLEMENT OF WORD
JXN (.SAC,MSK,,<
;;JUMP IF ANY BITS ORIGINALLY OFF
JXF (LOC,MSK,'

DEFINE JAND (STR,Y,BA,%TG)<
•• STR1 ( •• JAN,<%TG,,Y, •• STRS)
%TG:>

t"i

771

DEFINE •• JAN1 (BA1,BA2,LOC,MSK)<
•• JNA3 (BA1,LOC,MSK»
~~DO JUMP NAND TO LOCAL TAG

772
773
774
775

DEFINE •• JAN2 (BA1,BA2,LOC,MSK)<
•• TSAC ( •• ACT,LOC)
.IF0 •• ACT,<

776

SETCM .SAC,LOC

777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800

JXE (.SAC,MSK,,<
;;JUMP IF ALL BITS ORIGINALLY ONES
JXO (LOC,MSK,,Y, •• STR5)
%TG:>
DEFINE •• JN01 (BA1,BA2,LOC,MSK)<
•• IN (BA1,LOC,MSK»
~;DO JUMP OR TO LOCAL TAG
DEFINE •• JN02 (BAl,BA2,LOC,MSK)<
..JE «BA2>,LOC,MSK»
;;DO JUMP NOR TO GIVEN TAG
;TEST AND MODIFY GROUP USING DEFINED STRUCTURES.
;MODIFY-ONLY PROVIDED FOR COMPLETENESS.
DEFINE

819

TEST-ONLY AND

.~DOTY

(M,T)<
;;MACRO TO DEFINE ALL CASES
IRP M,<
IRP T,<
DEFINE TQ'M'T (STR,Y)<
•• STRI ( •• TY,M'T,,Y, •• STR3»»>
•• DOTY «N,O,Z,C>,<,E,N,A»~ ;DO 16 DEFINES
PURGE •• DOTY

Bin

802
803
804
805
806
807
808
889

;;NOT AC, GET COMPLEMENT OF WORD

~ALL

TY MACROS CALL •• TY AFTER INITIAL STRUCTURE PROCESSING

DEFINE •• TY (MT,LOC,MSK)<
•• TSAC ( •• ACT ,LOC)
i iSEE IF LOC IS AC
.IF0 •• ACT,<
PRINTX ?TQ'MT - LOC NOT IN AC>,<
TX'MT LOC,MSK»

()

o

Q,

.... Jooi

::SO

lQ."

(Jl

n.

o l\J
::s&

<
CD
::s

3:
0
rt'Z
..... 1-4

o t-i

::sO
(J)

::0

MACSYM
MACSYM

()
()

I

~

l.T1

1\
1\
I'%j

0
1'1
H

::s

~

(1)

1'1

::s

OJ

......
C
00
(1)

0

::s

......
'<
V
V

811
812
813
814
815
816
817
818
819
8UJ
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
84f1l
841
842
843
844
845
846

847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
8152
863
864
865

COMMON MACROS AND SYMBOLS
MAC
8-Nov-77 H'J: 47

o

MACRO %53A(1072) 13:55 29-Dec-78 Page 23
DEFSTR -- DEFINE DATA STRUCTURE

H
G)
H
~

SUBTTL CALL, RET, JSERR

)IJ

IFE REL,<
EXTERN JSERR0,JSHLT0,R,RSKP>

t"i

iCALL AND RETURN

2fi074f1l
2fi374f1l

.ACl==l
.AC2==2
.AC3==3
.A1fi==lfi
P=17

fIl0f1lfllfllfll
fIl0f1lfllfll0

OPDEF CALL [PUSHJ P,0]
OPDEF RET [POPJ P,0]
iABBREVIATION FOR

254000

iACS FOR JSYS ARGS

0IHHH'l2
000003
000016
000017

'HHHHH

000000

iTEMP FOR STKVAR AND TRVAR
iSTACK POINTER

CALL, RET, RETSKP

OPDEF CALLRET [JRST]
DEFINE RETSKP <
JRST RSKP>
iMACRO TO PRINT MESSAGE ON TERMINAL
DEFINE TMSG ($MSG)<
HRROI .ACl,[ASCIZ \$MSG\]
PSOUT>
iMACRO TO OUTPUT MESSAGE TO FILE
i ASSUMES JFN ALREADY IN .AC1
DEFINE FMSG ($MSG)<
HRROI .AC2, [ASCIZ \$MSG\]
MOVE I .AC3,"
SOUT>
iMACRO TO PRINT MESSAGE FOR LAST ERROR, RETURNS +1
DEFINE PERSTR ($MSG)<
IFNB <$MSG>,<
TM SG <$M SG> >
CALL JSMSG0>
iMACRO TO PRINT JSYS ERROR MESSAGE, RETURNS +1 AUWAYS
DEFINE JSERR<
CALL JSERR0>
;MACRO FOR FATAL JSYS ERROR, PRINTS MSG THEN HALTS
DEFINE JSHLT<
CALL JSHLT0>

()

o

Q,

..... ~

=,0

\.Q"tJ

m

(')1

ON

::sS
<
(1)3:
::SO

rt2!

..... H

Ot-i
::SO

00::0

MACSYM
MACSYM

866
867
868
869
87B
871
872

873
874
875
876
877

878
879

COMMON MACROS AND SYMBOLS
MAC
8-Nov-77 IB:47

t:j

MACRO %53A(1~72) 13:55 29-Dec-78 Page 23-1
CALL, RET, JSERR

H

;PRINT ERROR MESSAGE IF JSYS FAILS

H

G'l

I-i

)II

DEFINE ERMSG(TEXT),<
ERJMP
[TMSG 
JSHLT] .

t-t

>
. ;MAKE SYMBOLS EXTERN IF NOT ALREADY DEFINED
DEFINE EXT (SYM)<
IF2,<
IRP SYM,<
IFNDEF SYM,
JSMSGIIl::MOVEI A,.PRIOU
HRLOI B, .FHSLF
SETZ C,
ERSTR
JFCL
JFCL
TMSG <

iCLEAR TYPAHEAD
iWAIT FOR PREVIOUS OUTPUT TO FINISH

iSAY

THIS FORK "

LAST ERROR

>
RET
iFATAL JSYS ERROR - PRINT MESSAGE AND HALT
CALL JSHLTIIl
RETURNS: NEVER

913
914
915

916
917
918
919

JSHLT0::CALL JSERR0
iPRINT THE MSG
JSHLTl: HALTF
TMSG 

JRST JSHLTI

>

iHALT AGAIN IF CONTINUED
iEND OF IFN REL,

()

o

0,

..... ~

::lO

u:l""O
(J)

~

(ll

c:::
00

01\)

::s1Sl

(1)

<:

o
::s

::sO

~

08

~

V

(1)3

rrZ

....··H

::sO
00::0

MACSYM
MACSYM
929
921
922
923
924
925
926
927
928
929
939
931
932
933
934

()
()

I
V'\
00

A
A

tTJ

o

1"1
H

:;3

rt
CD
1'1

::s

OJ

I-'

c::
en

CD

935
936
937
938
939
949
941
942
943
944
945
946
947
948
949
959
951
952
953
954
955
956
957
958
959
969

961
962
963
964
965
966

967
968

969

COMMON MACROS AND SYMBOLS
MAC
8-Nov-77 19:47

MACRO %53A(1972) 13:55 29-Dec-78 Page 25
SUPPORT CODE FOR JSERR

tj
H

Q
H

SUBTTL STKVAR - STACK VARIABLE FACILITY

.-3

>'

1MACRO FOR ALLOCATING VARIABLES ON THE STACK. ITS ARGUMENT IS
;A LIST OF ITEMS. EACH ITEM MAY BE:
; 1. A SINGLE VARIABLE WHICH WILL BE ALLOCATED ONE WORD
; 2. A VARIABLE AND SIZE PARAMETER WRITTEN AS . THE
1
VARIABLE WILL BE ALLOCATED THE SPECIFIED NUMBER OF WORDS.
1RETURN FROM A SUBROUTINE USING THIS FACILITY MUST BE VIA
1RET OR RETSKP. A DUMMY RETURN WHICH FIXES UP THE STACK IS PUT ON
1THE STACK AT THE POINT THE STKVAR IS ENCOUNTERED.
;WITHIN THE RANGE OF A STKVAR, PUSH/POP CANNOT BE USED AS THEY WILL
;CAUSE THE VARIABLES (WHICH ARE DEFINED AS RELATIVE STACK LOCATIONS)
;TO REFERENCE THE WRONG PLACE.
1TYPICAL USE:
STKVAR ,ZZ>

r

IFE REL, <
EXTERN .STKST,.STKRT>
DEFINE STKVAR (ARGS)<
•• STKR==1 111
1 ;REMEMBER RADIX
RADIX 8
•• STKN==111
IRP ARGS,<
.STKVl (ARGS»
JSP .AI6, .STKST
•• STKN" •• STKN
RADIX •• STKR
PURGE •• STKN, •• STKR, •• STKQ

>

1INTERMEDIATE MACRO TO PEAL OFF ANGLEBRACKETS IF ANY
DEFINE .STKVl (ARG)<
.STKV2 (ARG»
;INTERMEDIATE MACRO TO CALCULATE OFFSET AND COUNT VARIABLES
DEFINE .STKV2 (VAR,SIZ)<
IFB ,< •• STKN== •• STKN+l>
IFNB ,< •• STKN== •• STKN+SIZ>
•• STKQ== •• STKN+l
.STKV3 (VAR,\ •• STKQ»

()

o

a,
..... .-3
:;3 0

1INNERMOST MACRO TO DEFINE VARIABLE

~."

DEFINE .STKV3 (VAR,LOC)<
IFDEF VAR,<.IF VAR,SYMBOL,
t-t

;COMMON ENTRY AND EXIT ROUTINE FOR STACK VARIABLE
.STKST::ADD P,~(.A16)
JUMPGE P, STKSOV
STKSEl: PUSH P,~(.Alfi)
PUSHJ P,1(.A16)
.STKRT::JRST STKRT~
POP P, .A16
SUB P, .Alfi
AOS ~ (P)
RET
STKRT~:

POP P,.Alfi
SUB P, .Alfi
RET

STKSOV: SUB P, ~ (.Alfi)
HLL .Alfi,0(.Alfi)
STKSOl: PUSH P,[~]
SUB • Al fi , [ 1 , , III 1
TLNE .Alo,777777
JRST STKSOI
JRST STKSEI

>

;BUMP STACK FOR VARIABLES USED
iTEST FOR STACK OVERFLOW
iSAVE BLOCK SIZE FOR RETURN
;CONTINUE ROUTINE, EXIT TO .+1
iNON-SKIP RETURN COMES HERE
iSKIP RETURN COMES HERE-RECOVER COUNT
iADJUST STACK TO REMOVE BLOCK
iNOW DO SKIP RETURN
RECOVER COUNT
ADJUST STACK TO REMOVE BLOCK
DO NON-SKIP RETURN
iSTACK OVERFLOW- UNDO ADD
iSETUP TO DO MULTIPLE PUSH, GET COUNT
;DO ONE PUSH AT A TIME, GET REGULAR
i ACTION ON OVERFLOW
iCOUNT DOWN TO ~?
iNO, KEEP PUSHING
; END OF I FN REL,

;J'\

\0

/\
/\

ITJ

o

I""C
H

::s

()

cT
CD

a,

I""C

::s

OJ

o

..... t-7J

::s

0

~."

I--'

til

c::

Of\.)

CD

<:

o
::s

::sO

"<
V

O"i

()I

en

I--'

V

::S~

CD3
cTZ

..... H

::SO

en::o

MACSYM
MACSYM

n
n
I

....,J
tg

/\

/\

"ZJ

,.,0
H

::s

rt

,.,
CD

::s
OJ
......
c:
til
CD

0

::s
......

~
V

997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
101118
1009
1010
19111
1012
1013
1014
BUS
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1926
1027
1028
1029
1030
1931
1032
111133
1934

COMMON MACROS AND SYMBOL~
MAC
8-Nov-77 10:47

tj

MACRO %53A(1072) 13:55 29-Dec-78 Page 27
STKVAR - STACK VARIABLE FACILITY

H
G)
H

~

SUBTTL TRVAR - TRANSIENT VARIABLE FACILITY

)I'

t"1

TRANSIENT (STACK) VARIABLE FACILITY - EQUIVALENT TO STKVAR
EXCEPT ALLOWS VARIABLES TO BE USED WITHIN LOWER LEVEL ROUTINES
AND AFTER OTHER THINGS HAVE BEEN PUSHED ON STACK.
N.B. USES .FP AS FRAME POINTER - MUST NOT BE CHANGED WHILE
VARIABLES IN USE.
90'H115

.FP==15

~DEFAULT

FRAME POINTER

IFE REL,<
EXTERN .TRSET,.TRRET,.ASSET,.ASRET>
DEFINE TRVAR (VARS)<
•• TRR==19
RADIX 8
•• NV==l
IRP VARS,<
.TRV1 (VARS»
JSP • A16, • TRSET
•• NV....:1" •• NV-1
RADIX •• TRR
PURGE •• TRR, •• NV>

~ ~ RESTORE RADI X
nCLEAN UP

DEFINE .TRV1 (VAR)<
• TRV2 (VAR»

~~PEEL

~~REMEMBER
~~INIT
~ ~

CURRENT RADIX

COUNT OF STACK WORDS

PROCESS LIST
STACK SPACE, SETUP .FP

~~ALLOCATE

OFF ANGLEBRACKETS IF ANY

DEFINE .TRV2 (NAM,SIZ)<
.TRV3 (NAM,\ •• NV)
~~DEFINE VARIABLE
IFB ,< •• NV= •• NV+1>
IFNB ,< •• NV= •• NV+SIZ»
DEFINE .TRV3 (NAM,LOC)<
IFDEF NAM,<.IF NAM,SYMBOL,
JSP .A16,.ASSET
~~SETUP STACK
RADIX •• TRR
;;RESTORE RADIX
PURGE •• TRR, •• NV>

n

o

Q,

..... t-i
::s 0

(,Q."

CIl

nl
o ~
::s s

<
CD
::s

3

0

rtZ

...·H

o

::s

t-i
0

til ::0

MACSYM
MACSYM

COMMON MACROS AND SYMBOLS
MAC
8-Nov-77 10:47

o

MACRO %53A(1072) 13:55 29-Dec-78 Page 28
TRVAR - TRANSIENT VARIABLE FACILITY

H

G)

n
n
I

~

J-I

/'\
/'\
~

o

~

H

::s
rt

CD

~

::s
OJ

J-I

c:::

Ul

CD

1048
HJ49
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
H'67
1068
HJ69
1070
HJ71
1072
1073
1074
1075
Hl76
1077
1078
1079
1080
1081
1082
10183
1084
1085
1086
1~B7

10BB
1089
1090
1091
1092
1093
1094

H

IFN REL,<
iSUPPORT ROUTINE FOR TRVAR
.TRSET::PUSH P,.FP
MOVE .FP,P
ADD P, 0 (.A16)
JUMPGE P,TRSOV
TRSET1: PUSHJ P,1{.A16)
.TRRET::JRST [ MOVEM .FP,P
POP P, .FP
POPJ P,]
MOVEM .FP, P
POP P,.FP
AOS 0{P)
POPJ P,
TRSOV:

SUB P,0{.A16)
HLL .A16,0{.A16)
TRSOV1: PUSH P,[0]
SUB .A16, [1,,0]
TLNE .A16,777777
JRST TRSOVl
JRST TRSET1

.-3

)II

Lt

iPRESERVE OLD .FP
iSETUP FRAME PTR
iALLOCATE SPACE
iCONTINUE ROUTINE, EXIT VIA .+1
iC LEAR STACK
iRESTORE OLD .FP
iHERE IF SKIP RETURN
iPASS SKIP RETURN
STACK OVERFLOW - UNDO ADD
GET COUNT
DO ONE PUSH AT A TIME, GET REGULAR
ACTION ON OVERFLOW
COUNT TO 0?
NO, KEEP PUSHING
CONTINUE SETUP

iSUPPORT ROUTINE FOR ASUBR
.ASSET::PUSH P,.FP
MOVE • FP, P
ADD P,[4,,4]
JUMPGE P,[SUB P, [4,,4]
PUSH P,A
PUSH P, B
PUSH P,C
PUSH P,D

SAVE .FP
SETUP FRAME POINTER
ADJUST STACK
PROBABLE OVERFLOW
DO WITH PUSH, GET INTERRUPT •••

JRST ASSET1]

DMOVEM A,l{.FP) iSAVE ARGS
DMOVEM C,3{.FP)
ASSET1: PUSHJ P,0{.A16)
iCONTINUE ROUTINE
.ASRET:: JRST [ MOVEM .FP,P
iNO-SKIP RETURN, CLEAR STACK
POP P, .FP
POPJ P,]
MOVEM .FP,P
iSKIP RETURN, CLEAR STZCK
POP P,.FP
AOS 0{P)
POPJ P,
iEND OF IFN REL,
>

n

o

0..

.... .-3
::SO

lQ"O

Ul

nl

ON

::S~

<:

CD3

a
::s

::sO

~

0.-3
::sO

......
v

rtZ

...·H

cn;:o

MACSYM
MACSYM

COMMON MACROS AND SYMBOLS
MAC
8-Nov-77 18:47

111195
111196
1897

lU8

()
()

I

~

r..J

1\
1\
I"Ij

o

1"'1
H

::J

it
CD
1"'1

::J

OJ

t-'

c::
en
CD

a

::J
t-'

~
V

lU9
111111
1111
1112
1113
1114
1115
1116
1117
1118
1119
112111
1121
1122
1123
1124
1125
1126
1127
1128
1129
113111
1131
1132
1133
1i34
1135
113fi
1137
1138
1139
1148
1141
1142
1143
1144
1145
1146
1147
1148
1149

o

H

G)
H

;AC VARIABLE FACILITY

8

~

IFE REL,<
EXTERN .SAV1,.SAV2,.SAV3,.SAV4,.SAV8>

B'98

1899
1188
1181
1182
1183
1U4
1U5
1186
1187

MACRO %53A(1872) 13:55 29-Dec-78 Page 29
TRVAR - TRANSIENT VARIABLE FACILITY

11181111111115
0111811118

• FPAC==5
.• NPAC==l~

Lt

;FIRST PRESERVED AC
;NUMBER OF PRESERVED ACS

DEFINE ACVAR (LIST)<
•• NAC==1iJ
IRP LIST,<
.ACV1 {LIST»
.ACV3 (\ •• NAC) >

; ; PROCESS ITEMS
; : SAVE ACS USED

DEFINE .ACV1 (ITEM)<
.ACV2 (ITEM) >

; ; PEEL OFF ANGLEBRACKETS IF_ANY

;;INIT NUMBER OF ACS USED

DEFINE .ACV2 (NAM,SIZ)<
NAM=.FPAC+ •• NAC
;;DEFINE VARIABLE
IFB ,< •• NAC= •• NAC+1>
IFNB ,< •• NAC= •• NAC+SIZ»
DEFINE .ACV3(N) <
IFG N-.NPAC,
IFLE N-4,<
JSP • A16, .SAV'N>
; ; SAVE ACTUAL NUMBER USED
IF-G N-4,<
JSP .A16, .SAV8»
; ; SAVE ALL
IFN REL,<
:SUPPORT ROUTINES FOR AC VARIABLE FACILITY
.SAV1:: PUSH P,.FPAC
PUSHJ P,I1I(.A16)
SKIPA
AOS -l(P)
POP P,.FPAC
POPJ P,
.SAV2:: PUSH P,.FPAC
PUSH P, • FPAC+1
PUS HJ P, 8 ( • Alfi )
SKIPA
AOS -2(P)
POP P, • FPAC+1
POP P, • FPAC
POPJ P,
.SAV3::
.SAV4:: PUSH P,.FPAC
PUSH P,.FPAC+l
PUSH P,.FPAC+2
PUSH P, • FPAC+3
PUSHJ P,8(.A16)

. :CONTINUE PROGRAM

()

o

Oa

...·8

::J

a

\.Q'tI

en
()I
o r..J
::Jtg
<
CD 3:

::J 0

itZ

...·H

o

~

::J 0
en ::0

MACSYM
MACSYM
1150
1151
1152
1153
1154
1155
1156
1157
115B
1159
1160
1161
1162
1163
1164
1165
1166
1167
116B
1169
1170
1171
1172
1173

COMMON MACROS AND SYMBOLS
MAC
B-Nov-77 10:47

o

MACRO %53A(1072) 13:55 29-Dec-7B Page 29-1
TRVAR - TRANSIENT VARIABLE FACILITY

H
G)
H

SKIPA
AOS -4(P)
pOP P,.FPAC+3
pOP P, • FPAC+2
POP P,. FPAC+l
pOP P, • FPAC
POPJ P,

8

;J:II

t""1

• SA VB:: ADD P, [1 0 , , 10 ]
JUMPGE P,[HALT .]
DMOVEM .FPAC,-7(P)
DMOVEM .FPAC+2,-5(P)
DMOVEM .FPAC+4,-3(P)
DMOVEM .FPAC+6,-I(P)
PUSHJ P,0(.Alfi)
SKIPA
AOS -10 (P)
DMOVE .FPAC+6,-I(P)
DMOVE .FPAC+4,-3(P)
DMOVE .FPAC+2,-5(P)
DMOVE .FPAC,-7(P)
SUB P, [H'l, ,HI]
POPJ P,

>

()

()

I

....J
W

/\
/\
"'%j

o
"""
H
::s

rt
CD

::s
"""

III
I-'

()

o

Q,

..... 1-3

::sO

\0'"0

(/l

()I

c:
00
CD

Of\.)

::s1Sl
<:

CD3

::sO

o
::s

rtZ

~

01-3
::SO

I-'

V

HoH

00::0

MACSYM
MACSYM

COMMON MACROS AND SYMBOLS
MAC
8-Nov-77 10:47

11 74
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
11811
1187

n

()

I

....,J
~

/\
/\

tj
H
G)
H

AC SAVE FACILITY - COMPILES OPEN PUSH'S
SAVEAC 
DUMMY ROUTINE PUT ON STACK TO CAUSE AUTOMATIC RESTORE. SUPPORTS
+1 OR +2 RETURNS.

toi

):I'
t"1

DEFINE SAVEAC (ACS)<
.NAC==0
IRP ACS, <
PUSH P,ACS
i iSAVE AN AC
.NAC=.NAC+l>
i i COUNT THEM
.Nl==.NAC
SETM I .AI6, (CAIA
iiSTACK DUMMY RETURN
AOS -.Nl(P)
i;HANDLE SKIP RETURN
IRP ACS,<
.Nl=.Nl-l
MOVE ACS~-.N1(P»
iiRESTORE AN AC
SUB P, (.NAC" .NAC]
i iCLEAR STACK
POPJ P,]
iiFINAL RETURN
PUSH P, .AI6>

1188

1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
121B
1204
1205
1206
1207

MACRO %53A(1072) 13:55 29-Dec-78 Page 30
TR~R - TRANSIENT VARIABLE FACILITY

IFN REL, <
iSTANDARD RETURNS
RSKP::
R::
>
000000'

AOS 0(P)
RET

LIT

iEND OF IFN REL,
;MAKE SURE LITERALS COME BEFORE END MARK

IFN REL, <
• RLEND==: .-1

>

IF2,
END

iMARK END OF CODE

~N

MACREL

;FLUSH REL FROM UNIV FILE

t'Zj

o

NO ERRORS DETECTED

t'1
H

PROGRAM BREAK IS 000000
CPU TIME USED 00:03.083

:::l
rt

CD
t'1

:::l
OJ
I-'

c:
en
CD

o

:::l

I-'

~
V

24P CORE USED

n

o

Q,
~.t-i

:::lO

\Q~

til

nl

o

I\)

:::lS

<

CD 3:
:::l 0

rtZ
~·H

o
:J
en

1-3
0
:::0

()
()

I

....J
U1

/\
/\

tTJ

..,0
H

::3

rt
CD

..,
::3
OJ

f-I

C

en
CD

0
::3
f-I
~

V
V

MACSYM
MACSYM

COMMON MACROS AND SYMBOLS
MAC
8-Nov-77 10: 47

CALL
CALLRE
JSERR0
JSHLT0
P
PC%AFI
PC%ATN
PC%BIS
PC%CY0
PC%CYI
PC%FOV
PC%FUF
PC%LI P
PC%NDV
PC%OVF
PC%UIO
PC%USR
R
RET
RSKP
VI %EDN
VI%MAJ
VI%MIN
VI%WHO
.All1
.AC1
.AC2
.AC3
.ASRET
.ASSET
• CHAL2
.CHALT
.CHBEL
.CHBSP
.CHCBS
• CHCCF
.CHCNA
.CHCNB
.CHCNC
.CHCND
.CHCNE
.CHCNF
• CHCNN
.CHCNO
.CHCNP
.C-HCNQ
.CHCNR
.CHCNS
.CHCNT
.CHCNU
• CHCNV
.CHCNW
.CHCNX
• CHCNY
.CHCNZ

2110740
254000

001000
0001)00
020000
20100001
100000
040000
000HJ0
002000
000040
400000
004000
010000
21)3740
077700
000077
700000

000000
000000
000000 ext
000000 ex t
000017
000000 sin
000000 sin
000000 sin
000000 sin
000000 sin
000000 . sin
000000 sin
000000 sin
000000 sin
000000 sin
000000 sin
000000 sin
000000 ext
000000
000000 ext
777777 sin
000000 sin
000000 sin
000000 sin
0000111 spd
000001 spd
000002 spd
000003 spd
000000 ext
1"00000 ext
0001711 sin
1"00175 sin
000007 sin
000010 sin
1"00034 sin
000031) sin
000001 sin
1"1"0002 sin
00001"3 sin
000004 sin
000005 sin
000001) sin
0000111 sin
000017 sin
000020 sin
1"00021 sin
000022 sin
000023 sin
000024 sin
000025 sin
000021) sin
000027 sin
000030 sin
000031 sin
000032 sin

.CHCRB
.CHCRT
.CHCUN
.CHDEL
.CHESC
.CHFFD
.CHLFD
.CHNUL
.CHTAB
.CHVTB
.FP
• FPAC
• FWORD
• INF IN
.LHALF
.MINFI
.NPAC
• RHALF
• SAC
.SAVI
.SAV2
.SAV3
• SAV4
.SAV8
• STKRT
.STKST
.TRRET
.TRSET

MACRO %53A(1072) 13:55 29-Dec-78 Page S-l
SYMBOL TABLE

777777
377777
777777
400000

000035
000015
000037
000177
000033
000014
000012
000000
000011
000013
000015
000005
777777
777777
000000
000000
000010
777777
000010
000000
000000
000000
000000
000000
000000
000000
000000
000000

0

H
G)
H

sin
sin
sin
sin
sin
sin
sin
sin
sin
sin
spd
spd
sin
sin
sin
sin
spd
sin

1-3

>
t-t

ext
ext
ext
ext
ext
ext
ext
ex t
ext

()

0

a,

..... 1-3
::30
Ul"'O
(J)

()

I

Ol\.)
::l~

<:

CD3

::30

rtZ

....·H

01-3
::30

en"

JSERR0
JSHLT0

()
()

1

....J

'"
1\
1\
t'Ij

..,o
H
~

rt

..,
CD
~

OJ

......

c::
en
CD

o
~

......

~
v

P
PC%AFI
PC%ATN
PC%BIS
PC%CY0
PC%CY1
PC%FOV
PC%FUF
PC%LIP
PC%NDV
PC%OVF
PC%UIO
PC%USR
R
REL
RSKP
VI%EDN
VI%MAJ
VI%MIN
V!%WHO
.A11;
.AC1
.AC2
.AC3
.ASRET
.ASSET
.CHAL2
.CHALT
.CHBEL
.CHBSP
.CHCBS
.CHCCF
.CHCNA
.CHCNB
.CHCNe
.CHCND
.CHCNE
.CHCNF
.CHCNN
.CHCNO
.CHCNP
.CHCNQ
.CHCNR
.CHCNS
.CHCNT
• CHCNU
.CHCNV
.CHCNW
.CHCNX
.CHCNY
.CHCNZ

B15#
H15#
823#
12B#
129#
124#

o

B25

H
G')
H

82fi

t-i

>
t"1

12H
122#
123#
130#
127#

13H
120#
126#
125#
B15#
34
815#
fi5#
fi3#

35

3B

814

883

936

971

1008

1049

1098

1125

1195

1203

1206

64#
fi2#
822#
B19#
820#

82H
1009#
1009#
113#
112#
81;#

87#
107#
109#
B0#

BU
82#
B3#

BH

85#
93#

941
95#
9fi#
97#
9B#
99#

11'11" •
10U
1I1J2#

lin #

104#
105#

n

o

0.
.... t-i

~O

\Q"O
til
01
01\)
::S~

<
(1)

3:
::SO

rtZ
~·H

o
::s

en

t-i
0

::t'

n
n

.CHCRB
.CHCRT
.CHCUN
.CHDEL
.CHESC
.C HFFD
.CHLFD
.CHNUL
.CHTAB
.CHVTB
.FP
.FPAC
• FWORD
.INFIN
.LHALF
.MINFI
.NPAC
• RHALF
.SAC
.SAV1
.SAV2
.SAV3
.SAV4
.SAV8
.STKRT
.STKST
.TRRET
.TRSET

o

Hl8#

H

92 #
110#
114#
106#

Cl
H

t-3

91#

)II

89#
79#

t"i

R8#
90#
1006#

1101#
75#
71#
73#

72#
1102#
74#
459#
111199#
1099#
1099#
1099#
1099#
937#
937#
1009#
1009#

I

....,J
....,J

1\
1\

t'%J

..,o
H

::l
rt
CD

..,
::l
OJ

J-.;I

c

Ul

CD

o

n

o

0,

..... 1-3
::l0
I.QPtJ
CJ)

nl

ON

::llSl

<:

CD 3:
::lO

::l

rt~

J--I

o

"<
v
v

....·H

1-3

::30

en::o

ACVAR
ANDX
ASUBR
CALL
CALLRE
DECR
DEFSTR
ERMSG
EXT
FLD
FMSG
INCR
IORX
JAND
JE
IN
JNAND
JNOR

()
()

I

....,J

00

1\
1\
I'Xj

0
t1
H

::3
rt
CD
t1

::3
D.J

......
C

en

CD

0
::3

......

"SV

JOR
JSERR
JSHLT
JXE
JXF
JXN
JXO
LOAD
MASKB
MOD.
MOVX
MSKSTR
OPSTR
OPSTRM
PERSTR
PGVER.
POINTR
POS
RET
RETSKP
SAVEAC
SETCMP
SETONE
SETZRO
STKVAR
STOR
TMSG
TQC
TQCA
TQCE
TQCN
T~

TQNA
TQNE
TQNN

110H
220#
HB8#
825#
830#
0741
409#
868#
875.
150#
8441
064t
223.
700#
709.
729#
754#

0

H
G)
H

I-i

):I-

t'1

782#

749'
85A.
803#
300#
370#
32A.
350#
591#
1041
108#
1741
477#
686#
6915#
85H
52#
152#
148#
826#
832#
1180#
649#
632#
615#
939.
602#
837#
802#
A02.
802#
A02#
802#
802#
A02#
802#

()

0
~

.... I-i

::s 0
lQ"O

CIl
()

I

o ~
::3 e:i:l
<
CD ::s::
::3 0

rtZ

....·H

o t-i
::SO
en ::n

()
()

1

'-ol

""
1\
1\

torJ

0

""'"

H

~

rt
CD

""'~"
OJ

I-'

c:::
en

CD

TQO
TQOA
TQOE
TQON
TQZ
TQZA
TQZE
TQZN
TRVAR
TXC
TXCA
TXCE
TXCN
TXN
TXNA
TXNE
TXNN
TXO
TXOA
TXOE
TXON
TXZ
TXZA
TXZ E
TXZN
WID
XORX
• .CASI
• .OOTX
• .OOTY
• .OPB
• .GCNS
•• lCNS
• .JANI
• .JAN2
•• JE
• .IN
• .JNA3
• .JNOI
• .JN02
•• LDB

•• ONEB
• .STR0
• .STRI
•• STR2
• .STR3
•• STR4
• .STR5
• .TQC
• .TQO
• .TQZ
• • TSAC
•• TSlZ

802#
802#
802#
802#
802#
802*
802#
802#
HHU
246#
246#
24fi*
24fi#
246#
24fi#
24fi#
246#
246#
246#
246#
246#
246#
246#
246#
24fi#
144#
229#
425#
239*
795#
605#
579*
568#
770#
773#
712#
732#
757#
786#
789*
594#
4541
485#
496#
525#
530#
542#
553#
1)52#
635#
618#
438#
430#

0

H
G)
H
~

)'

t'""

245
801

24fi
802

()

0
Q,

..... ~

~O

\0"0
til

(')1
Ot\.)

~&

<:

CD 3:

0

~O

I-'

....·H

:l

'<
V
V

rtZ
O~
~O

m:;rJ

• .TX
• .TX3
• .TY
.ACV1
.ACV2
.ACV3
.CASE
.DECR0
.IF0
.INCR0
.OPST1
.OPST2
• RTJST
.STKV1
.STKV2
.STKV3
.TRV1
.TRV2
.TRV3

tj

251#

H
G')
H

288*
801'i*
1110*
1113*
1118*

1-3
):II

t'"1

416*
677l1:
40fi#
fi67#
689#
699#
160#
953#
958*
91'ifi*
1022l1:
10125#
1030*

()
()

I

CX)
~

1\
1\
t'Zj

0
t1
H

::s

rt
(1)

t1

::s

OJ

I-'

c::
en

(1)

0

::s

I-'

'<
V
v

()

0
0.

.... 1-3
0

::s

~"'O

en

()I

o t\)
::S~
<
(1) 3

::s

0

rtZ
~'H

o

::s

1-3
0

en ::0

TOPS-20 MONITOR
SYSERR

«For Internal Use Only»

DIGITAL

TOPS-29 MONITOR
SYSERR

COURSE MAP

MR-2717

SER-i

«For Internal Use Only»

DIGITAL

TOPS-2~

MONITOR
SYSERR

This page is for notes.

SER-ii

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
SYSERR

SVSERR

--------------INTRODUCTION-------------SYSERR is the name of a
user error
reporting program and of a monitor module.
The SYSERR program takes a file,
ERROR.SYS,
and
produces
a
report of the errors
indicated by the entries in that file.
The
monitor SYSERR module contains the code
which puts those entries in the ERROR.SYS
file.
This module addresses both of these
aspects
of
SYSERR,
starting
with
a
discussion of the use of the SYSERR program,
and continuing with a view of the monitor's
internal SYSERR data base. The logic flow
of a SYSERR entry creation is presented, and
finally,
there is a presentation of the
tools which allow a privileged user to
create ERROR.SYS entries to be reported by
the SYSERR program.

SER-I

«For Internal Use Only»

DIGITAL

TOPS-2~

MONITOR
SYSERR

. - - - - - - LEARN ING OBJECTIVES-----Upo'n compl etion of
student will be able to:

thi s

modul e,

the

1.

Given typical SYSERR output,
the information contained.

describe

2.

Given ~ sample SYSERR message, tell
which data was used in the monitor to
generate the report.

3.

Use
SYSERR
to
gather
information
relevant to a specific problem.

, . . . . - - - - - - - - RESOURCES----------.
1.

TOPS-10 and
AA-D533A-TK

2.

DECSYSTEM-20 Monitor
Manual AA-4166C-TM

TOPS-20

SER-2

SYSERR
Calls

Manual
Reference

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
SYSERR

MODULE OUTLINE
SYSERR
I.

II.

The SYSERR Program
A.
Running the SYSERR Program
B.
Examples of SYSERR Output
SYSERR Module Internals
A.
SYSERR Block format
1. Head er
2. Da ta
B.
C.

D.

Creating a SYSERR Entry
The Job 0 SYSERR Task
The SYSERR JSYS

SER-3

«For Internal Use Only»

TOPS-20 MONITOR
SYSERR

DIGITAL'~

This page is for notes.

SER-4

«For Internal Use Only»

TOPS-20 MONITOR
SYSERR

DIGITAL

THE SVSERR PROGRAM
OVERVIEW OF SYSERR
SYSERR is a program which produces reports containing
system error information. TOPS-20 collects information such
as the time and reason for each monitor reload, error status
information
for
all
HARD
(non-recoverable)
and SOFT
(recoverable) errors on devices such as disk and magtape,
the
details
of each BUGINF, BUGCHK and BUGHLT, the
occurrence of memory parity errors and the memory locations
involved, and console front-end
reloads.
This data is
recorded on disk in file PS:ERROR.SYS.
If the TOPS-20 monitor cannot continue due to a BUGHLT,
it collects the error information and then halts. During
the reload, a dump is taken of the contents of main memory
and saved on disk in PS:~SYSTEM>DUMP.EXE.
Program SETSPD
looks in this crash dump file and extracts the error
information. As successive crashes occur, the DUMP.EXE file
is copied to successive generations of DUMP.CPY by SETSPD.
If the KL CPU (DECSYSTEM-2040/50/60 only) halts due to
some error, the console front-end task KLERR takes a
snapshot of the KL CPU.
This information is written in a
file called KLERRO.SNP in the console front-end files area
(usually on the dual-ported disk in the FILES-II area, but
written on floppy disk if it is the front-end device).
After
the system comes back up, SYSJOB appends
this
information
to
ERROR.SYS.
In these ways, ERROR.SYS
accumulates a history of system errors of various types.
Note that you should periodically determine the size of
ERROR.SYS.
If it 'is very large
(e.g., more than 1000
pages), save ERROR.SYS on magtape, delete and expunge, and
let it build up again.
The SYSERR program uses ERROR.SYS as an input file and
creates a large variety of reports, depending on the
commands you give.
Basically, you can select error reports
according to device, type of error, amount of detail, and
time frame.
This is done by specifying switches in commands
to SYSERR.
You can also obtain an error summary covering
all devices and error types for a selected time period.

SER-5

«For Internal Use Only»

TOPS-2(2J MONITOR
SYSERR

DIGITAL

Running the SYSERR Program

I

To run SYSERR, type
@SYSERR
FOR HELP, TYPE "/HELP"

*
When SYSERR is ready for a command,
asterisk. The command format is
*output-filespec

=

it

replies

with

an

input-filespec/switchl/switch2 ••••

where "output-filespec" is the report to be created and ,the
input file is usually SYSTEM:ERROR.SYS.
If you do not
specify an input file, SYSERR will use PS: (SYSTEM>ERROR. SYS
by default.
You may'need to enable privileges in order to
read ERROR.SYS. If you omit the output file specification,
the operating system will give the report a default name
(determined by the switches)
with file type .LST.
The
switches specify the device or type of error you wish to
report. The switches also specify the time frame.
Some of
the common switches are:
/ALL
/ALLSUM
/CPUALL
/MASALL

!List all errors.
!List the summary only.
!List all processor related errors.
!List all MASSBUS device errors (TU4S,
! RP (2J 6 , e tc .) •..
/DEV:name
!List errors for the specified device only.
!This allows you to select a particular
!magtape drive or disk drive.
!List errors for the specified type of
/DEV:type
!device, for example, TU4S, LP2(2J, the CPU,
! etc.
!List all information instead of a brief
/DETAIL
!listing.
!begin the listing on the
/BEGIN:mm-dd-yy:hh:mm:ss
!date specified. You may
! al so use the fo rmat
!/BEGIN:-nD to obtain all
lerrors for the past n days.
/END:mm-dd-yy:hh:mm:ss
lend the listing on the date
!specified. To obtain errors

SER-6

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
SYSERR
!up to n days ago, use the
! format lEND: -nO.

To obtain a summary of all errors, use the switch
IALLSUM.
This report can be obtained and printed each day.
It is useful for keeping track of such errors as HARD disk
errors, which can indicate a serious problem with a disk
pack. Whatever switches are used,
the error summary is
always a part of each report.

Examples of SYSERR Output
Figures SER-l, SER-2, and SER-3 at the end of this
section show examples of output produced by SYSERR.
Figure
SER-l shows two entries:
a MASSBUS device error and a
In the MASSBUS device error entry, the unit name is
BUGINF.
DP2f)0. This name indicates a drive on channel 2
(RH20
controller number 2)
with unit number 6.
The 0 has no
significance for disk. The unit type is RP0n, the name of
the structure SNARK:.
LBN stands for the Logical Block
Number on the pack being addressed when the error occurred,
and is translated to cylinder, surface and sector to provide
physical location. The last line indicates that the error
was recoverable
(SOFT error).
The line before the last
shows that the operation
was
retried
twice
before
succeeding.
The operation being tried is also indicated
following OPERATION AT ERROR:.
If an error
is
not
recoverable after a reasonable number of retries,
the
attempt to retry ceases and
the error is classified as
non-recoverable (HARD error) •
A hard error usually involves loss of data, or failure
for some user or system operation.
It is important to keep
statistics of the hard and soft errors which occur on each
disk pack.
In this way, you can detect a bad pack or one
about to go bad. The physical location of the errors (given
in terms of cyl inder, surface and sector) can also be used
to locate a bad spot (sc ratch, etc.) on the pack.
If errors
keep occurring in the same physical location, a bad spot is
indicated.
If many hard errors occur at once in a variety
of locations, the pack may have experienced a head crash.
The second example in Figure

SER-7

SER-l

is

for

a

BUGINF

«For Internal Use Only»

DIGITAL

TOPS-2~

MONITOR
SYSERR

whose name was DN20ST. The user and program name are useful
in determining the cause of the problem, especially in the
case' of BUGCHKs and BUGHLTs. If the same user and program
are specified each time a BUGHLT 'occurs, a good place to
start i,n investigating the cause of the crashes would be
with the user and user program.
Figure SER-2 shows an entry for a MASSBUS device error
caused by a tape operation. The device unit name is MT310.
This indicates a drIve on channel 3
(RH20 controller 3),
TM02 unit number 1, the drive being logical unit 0 on the
TM~2.
The position on the tape when the error occurred is
given in terms of the file and record numbers. The user and
program are also given. In this example, the error was
recoverable.
This type of entry can be used to track down
bad tapes or a malfunctioning drive.
Figure SER-3 shows two portions of an error summary.
Under FILE ENVIRONMENT are the input and output file names
and the switches used when running SYSERR. The input file
used to create this report was SYSTEM:ERROR.SYS. The total
number of errors in the categories BUGHLT-BUGCHK, MASSBUS
DEVICE and FRONT END DEVICE are given. There is also a
breakdown of the BUGHLT-BUGCHK types. The hardware detected
error summary for DP260 is another portion of the error
summary, showing the total number of such errors, both hard
and soft. Similar summaries are given for magtape drives.
For further information about SYSERR and the reports it
creates, refer to the DECSYSTEM-20 Operator's Guide and the
DECSYSTEM-2A20 Operator's Guide

SER-8

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
SYSERR

SYSTEM ERROR REOORl' CCMPILED

rn.

M:>rrlay, ~y 8, 1978 14:45:45

PAGE 1

***********************************************
MASSBUS lEVICE ERROR
LOGGED ON Mon 8 May 78 14:01:20
DETECI'ED ON SYSTEM # 2102.
RECCRD SEQUENCE NUMBER: 1438.

MONITOR UPTIME ~ 14:29:47

***********************************************
UNIT W\Pt1E:
DP 260
UNIT TYPE:
RP06
UNIT SERIAL #: 0597 •
VOLLME ID:
ENA.RK
LBN:
11157~4
=
794.
SURF:
17.
SECT:
8.
CYL:
OPERATION AT ERROR:
DEV.AVAIL., GO + RFAD DATA (70)
F~L ERROR STATUS:
200000,7
RETRIES PERFORMED:
2.
ERROR: ROCOVERABLE IRIVE EXCEPTION ,CRN ERROR, IN CCNI'ROLrER CONI
OCR, IN DE VI CE ERROR Rffi ISTER
=====REST CF INFCD1ATION AVAILABLE BY USN; /DETAIL SttITTCH====

SYSTEM ERROR REOORl' CCMPILED ON M:>rrlay, M3y 8, 1978 14: 46: 49

Pl\GE 4

***********************************************
TOPS20 BOOHLT-BUGCHK
LOGGED ON .MDn 8 May 78 12:48:01
DETECTED ON SYSTEM #: 2102.
ROCCRD SEQUENCE NUMBER: 1415.

MONITOR UPTIME ~ 13:16:28

***********************************************
ERROR INFrnMAT I ON :
DATE-TIME OF ERROR:
Mon 8 May 78 12:47:57
#: OF ERRORS SINCE RELClAD:
84.
FORK #: & JOB #::
117,0
USER'S LOGGED IN DIR:
OPERATOR
PROGRAM NAME:
SYSJOB
ERROR:
BUGINF
ADDRESS OF ERROR:
502633
~~E:
DN20ST
DESCRIPTION:
DTESRV- DN20 S'IDPPED
====REST CF INFrnMATION AVAIlABLE BY USI'f\[;· /DETAIL SWITCH====

Figure SER-1. Output from SYSERR

SER-9

«For

Internal Use Only»

DIGITAL

TOPS-20 MONITOR
SYSERR

SYSTEM .ERROR REPORT CCMPlIED ON M:>rXlay, M:ly 8, 1978 14: 41: 54

PAGE 1

***********************************************
MASS3lE DEVICE ERROR
Lro:;ED ON Sa t 6 May 78 14: 56 : 28
IETECTED ON SYS'lEM t 2l02.
RB:CRD SECUENCE NUMBm: 917.

MONITOR UPl'IME WAS

7: 44 : 04

***********************************************
UNIT N1\ME:
MT310
UNIT TYPE:
TU45
UNIT SERIAL #: 0148.
VOLUME ID:
LOCATION:
RECCRD # 12.
OF FILE # 0.
USER'S LOGGED IN DIR:
OPERATOR
USER'S roM:
EXEC
OPERATION AT ERROR:
DEV.AVAIL. GO + WRITE FWD. (60)
FINAL ERROR STATtS:
0,3
RETRIES PERFORMED:
0.
ERROR: RECOVERABLE DRIVE EXCEPI'ION, IN CCNl'ROLIER CONI
crn/CRC, IN IE VI CE ERROR R83ISTER
=====REST CF INFrnMATION AVAIlABLE BY USING /DETAIL &WITCH===

Figure SER-2. Output from SYSERR

SER-10

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
SYSERR

SYSn<.:M ERROR REPORT COMPILED ~ Monday May 8, 1978 14:46:50
- SYSn<.:M SUMMARY FOO SYSTEM it 2102.

PAGE 23

******************************************************************
FIrE ENVIRONMENT
SYSERR VERSION 10(546)
INrur FILES:
SYS:ERROR.SYS CREATED: Man 8 May 78 2:eJ6:40PM
ourPtJr FILE:
OOK:ERR.5
SNI'OCHES:
/CPUALL /BEGIN: 8-May-78 AT 12:4~: 39
DA'IE OF FIRST ENTRY PROCESSED: Tue 18 Apr 77 1: 33 : 36PM
DA'IE OF LAST ENTRY PROCESSED:
Mo n 8 Ma y 78 2: 06: 40PM
NUMBER OF ~IES PROCESSED:
1439.
it OF INCONSISTENCIES DETECTED IN ERROR FILE:
eJ •
ENTRY OCCURRENCE COONTS
TarAL TOPS20 BOOHLT-Bt.x:;CHK:
Tar.AL MASSBUS DEVICE ERROR:
TarAL FRONI' END mvrcE REPORT:

1.
~.

21.

TOPS20 BUGHLT-BUGCHK
BUGHLT /BUGCHK BREAKDOWN:
DN20ST 1.

SYSTEM ERROR REFORT CCJI1PILED ON M:>rrlay May 8, 1978 14: 46: 52
PAGE 24 - M&SSBUS SYSTEM ~LYSIS(RH20)

PAR
ERR
DP260 HARD
SOFT

EXC

6.

HARIJIlARE IETECTED
Sl"'C CRN RES
ERR ERR ERR

LWC
ERR

RAE

OVR
RUN

3.

Figure SER-3. Output from SYSERR

SER-11

«For Internal Use Only»

TOPS-29 MONITOR
SYSERR

DIGITAL

SVSERR MODULE INTERNALS
Error reporting, often
composed, of three steps:

called

SYSERR,

is

really

I'.

A request to generate a SYSERR block is created and
queued via the SYERR JSYS or, if generated by the
monitor, r~quested generally by calling the SYERR
routines directly.

2.

The SYSERR fork (part of Job 0) writes all
requests to the 'file PS:ERROR.SYS.

3.

The SYSERR user program reads the ERROR.SYS file
and generates the error reports and summaries.

queued

SVSERR Block Format
HEADER

Each entry in the ERROR.SYS file
is made up of two
parts:
the header, which has a fixed length and format (See
Figures SER-4 and SER-5), and a data portion, whose content
is dependant on the type of event being reported. See
Figure SER-6 for an example. Note that the diagram shown in
Figure SER-4 and SER-5, the first two words are part of the
internal header, but do NOT appear in the ERROR.SYS file.
The fixed information in the header includes the event
code
(the type given here tells the user SYSERR reporting
program the type and format of the data portion of the
message), and the block length (not including the two words
of monitor he'ader). The block lengths of the standard event
types are fixed on an ad hoc basis. The other standard
words are Universal format ~a~ and time of the blocks
creation, the uptime at that point, and APR serial number of
the system generating the report.

SER-12

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
SYSERR

SEBBFR: SYSERR BUFFER BLOCKS
SYSERR BLOCK FORMAT
SEBCOD
SEBSIZ
Code Blk Size with HDR

SEBCDR
Pointer to Next Block

17

SEBFN
JOB 0 Function to Call

SEBSOF
6
Offset to Free
String Space

1

2

SEHLEN
Block Length

SEHCOD
Event Code
SEHTAD
Date and Time

3

SEHUTM
Uptime

4

SEHSER
5

APR ID \"'0 rd
(Processor Serial Number)

SEBDAT=6
Body of Error Block
(Dependent on Event Type
See Below)

1
o

1

234 5 6

17 18

35

Word

o

SEBCOD
SEBSIZ
Code Blk Size with HDR

SEBCDR
Pointer to Next Block

Bits

Pointer

3-5

SEBCOD

State Code
SBCFRE=0 on Free List
SBCREL=l Released
SBCACT=2 Active

f)-17

SEBSIZ

Block Si ze Incl ud ing Header

18-35

SEBCDR

Pointer to Next in List

Meaning

Figure SER-4. SYSERR Block Format Header,

SER-13

«For Internal Use Only»

DIGITAL

Word
2

..

TOPS-29 MONITOR
SYSERR

I.

27

8

I

SEHCQD

35
SEHLEN

Block Length

Event Code

Bits

Po inter

Meaning

0-8

SEHCOD

Event Code (i.e., Block Type)
SEC%RL=10l System Reload
SEC%BG=102 BUGHLT/BUGCHK/BUGINF
SEC%FE=130 Front End Error
SEC%11=13l F.E. Reload Entry
(Gives -11 Reboot Info.)
SEC%PT=160 Processor Parity Trap
SEC%PI=16l Processor Parity Intrp.
SEC%MB=lll Massbus Device Error

27-35

SEHLEN

Block Length (Including Header)
RL%LEN - System Reload Block Length
BG%LEN - BUGHLT/CHK/INF Block Length
FE%LEN -F.E. Errors Blk Length
Rl%LEN -F.E. Reload Entry Blk Length
PT%LEN - Proc. Pa r i ty Tr ap Bl k Leng th
PI%LEN -Proc. parity Interrupt Blk Lgh
MB%LEN -Massbus Dev. Err Blk Length

Figure SER-5. Expansion of Word 2 of Header

DATA

The data portion of an entry is dependent on the event
being
reported.
When the monitor is generating a
SYSERR block, it takes specific information from specific
locations and puts that data
into the SYSERR block in a
pre-defined order. The user SYSERR reporting program is
coded to know what information the monitor has placed in
which word, and is thus able to format that data in a more
meaningful way. The example in figure SER-6 shows a typical
data po rtion.
typ~

SER-14

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
SYSERR
Event Type 101
System Reloaded Error Block Data

RL%SVN=eJ
RL%STD=l

ASCII Byte Pointer to System Name
Time of System Build

(Un i v. Format)

RL%VER=2

System Version Number

RL%SER=3

APR Serial Number

RL%OPR=4

ASCII Byte Pointer to "Why Reload"

RL%HLT=5

BUGHLT Address (if Auto-Reloaded)

RL%FLG=6

Flags
Monitor Name

(Tex t)

"Why Reload" Answer String

(Text)

RL%LEN=61

Figure SER·6. Sample SYSERR Block Data

Figures SER-4, SER-S and SER-6 were taken from the
TOPS-20 Monitor Tables, which has diagrams of the several
event types data formats. The TOPS-10 and TOPS-20 SYSERR
Manual also has descriptions of the ERROR.SYS entry formats.
INTERNAL QUEUE STRUCTURE
The monitor SYSERR blocks are taken from a queue of
free blocks reserved for them, and through the calling of
various monitor routines, these blocks are queued for the
SYSERR fork to write to ERROR.SYS. In referring to Figure
SER-4, note that the right half of the first word is
reserved for a pointer to the next block (if any).
Location

SER-IS

«For Internal Use Only»

TOPS-2f(J MONITOR
SYS,ERR

DIGITAL

24 of the machine contains a pointer to the first
block.
When the SYSERR fork is awakened, that task
to see if location 24 (SEBQOU) is non-zero. If there
address there, that SYSERR block and any other queued
blocks a~e appended to PS:ERROR.SYS.

queued
checks
is an
SYSERR

~------------------NOTE --------------------~

BUGHLT isi a
spec ial case where the
SYSERR block is created and queued but
the SYSERR fork is not started, and the
informatidn
is '
not
written
to
PS:ERROR.SYS until
the system
comes up after the crash.

, Creating a SVSERR Entry \
The following are the steps taken by the monitor in
creating a SYSERR block. The. calls described are generally
called individually by the monitor, but they are the same
ones as called by the SYERR JSYS (discussed below).
1.

2.

Generate SYSERR entry
1.

Put information in header

2•

Put data
in
data
following the he~der)

po rtion,

(imm ed iately

Call the internal monitor routines (or SYERR JSYS)
1.

ALSEB - allocate a SYSERR block

2.

SEBCPY - copy data to block

3.

QUESEB address
ex isting
f(J
SYSERR

queue the SYSERR block;
that is, put
into SEBQOU or on end of queue of
blocks •. Thi s c.all al so wakes the Job
task through an AOS @SECHKF~

SER-16

«For Internal Use Only»

DIGITAL

The Job

TOPS-20 MONITOR
SYSERR

g SVSERR Task

The Job 0 SYSERR task executes code in the module
SYSERR at SEBCHK, which checks the queue at SEBQOU (location
24). For each entry in the queue, SYSERR will:
1.

Unlink and remove the block from the queue

2.

Write the block to PS:ERROR.SYS

3.

Call RELSEB to release the block for reallocation

BUGHLT is a special case. The BUGHLT code generates
and queues a BUGHLT SYSERR block (event type 102), then
shuts the system down. This block is NOT written out to
ERROR.SYS at the time of the crash.
When the system
reloads, SETSPD, a Job 0 task, reads the dump and does a
SYERR JSYS for any queued SYSERR blocks.
(There will always
be a BUGHLT block, but there may also be others which had
not yet been written before the crash.) Refer to the Monitor
Tables descriptions or the SYSERR Manual for a breakdown of
the contents of the BUGHLT SYSERR error block format.

The SYERR JSVS
The SYERR JSYS is available to the privileged user who
wishes to make entries in ERROR.SYS for the SYSERR program
to report. WHEEL, OPERATOR, or MAINTENANCE capabilities
must be enabled to execute the SYERR JSYS. The monitor
makes no check of the event code (other than 0 is illegal).
When the SYSERR program detects an unknown event code, the
output contains a message to that effect and the contents of
the block a're reported in octal. However, event code 117
(17 on TOPS-10) is defined in the SYSERR program and
is
intended for this special use.
When event code 117 is
detected,
the SYSERR program labels it
as
"Software
Requested Data" and produces a report with the data as both
octal and SIXBIT. The data reported may be gathered by a
monitor patch, the PEEK JSYS, the SNOOP JSYS, etc. See the
SYSERR Manual
under "Software Requested Data", and the
Monltor Calls Manual for further information.

SER-17

«For Internal Use Only»

DIGITAL

TOPS-2~

MONITOR
SYSERR

This page is for notes.

SER-l8

«For Internal Use Only»

DIGITAL

TOPS-2Q1 MONITOR
SYSERR

EXERCISES

1.

2.

With the SYSERR Manual
. SYSERR report:

and

the

sheet

of

sample

1.

Tell the event type of the error report and the
type of error.

2.

Describe how the monitor
reported.

selected

the

values

Describe how you, as a user, might wish to use
SYERR JSYS.

SER-19

the

«For Internal Use Only»

TOPS-2S MONITOR
SYSERR

DIGITAL

This page is for notes.

SER-20

«For Internal Use Only»

TOPS-20 MONITOR
SYSERR

DIGITAL

EXERCISE SOLUTIONS
Check with your instructor and your classmates for answers.

SER-2l

«For Internal Use Only»

DIGITAL

TOPS-2~

MONITOR
SYSERR

Thi s page is for notes.

SER-22

«For Internal Use Only»

DIGITAL

TOPS-2eJ MONITOR
SYSERR
SVSERR
LAB EXERCISES

When'answering the lab exercises, write down the names
of the tables where you found the answers. The labs will
help you understand the monitor data base structure;
So
remember, where to look is more important than what you find
there.
The exercises marked with a double star (**)
are more
d i fficul t and are optional.
If you have the time and
motivation, do them.
Some of the exercises require use of the listings to
find
the answer;
do not assume that the answer is in the
tables.
TOOLS
FILDDT
To use FILDDT on a crash, use the GET command
instead
of the PEEK command.
For the following exercise, the crash
you
are
to
look
at
is
in
a
file
called
SYSERR.CRSH.
Use
FILDDT as in the
example below to do the following exercise.
~ENABLE

$FILDDT
FILDDT)LOAD R3-MONITOR.EXE
FILDDT>GET SYSERR.CRSH

;get symbols

At this point, the usual DDT commands allow you to
the crashed monitor. Note the following things:

look

at

time

of

1.

Only those pages that were in core at the
the crash are a part of the crash dump.

2.

BOOT has overwritten a part of the monitor-currently, it overwrites a part of APRSRV.

SER-23

«For Internal Use Only»

DIGITAL

TOPS-29 MONITOR
SYSERR

3.

You must tell FILDDT to use the monitor's page
table if you want to look at the monitor's address
space. By default, you are looking at physical
addresses when you look at a crash with FILDDT.
FILDDT knows how to simulate TOPS-29 paging;
the
command that causes FILDDT"to use TOPS-29 paging
and which specifies the page map to use is:
n$U
where n is the SPT slot belonging to the page table
FILDDT should use to do the address translation.
For most cases, you want FILDDT to use MMAP, which
is the monitor's page map for sections 9 and 1.
The SPT slot belong ing the the moni tor'"s pag e map
is in location MMSPTN. Location MMSPTN conta ins a
493 for standard monitors;
however, you should
check to be sure. If the limit on open files has
been changed for a monitor, the SPT slot belonging
to MMAP is also changed. To set monitor context
(i.e., to use MMAP ) do the following:
MMSPTN/ 493
403$U

iMMAP's SPT slot

Queued SYSERR Blocks
If there were any SYSERR blocks queued to be written at
the time of the crash, location SEBQOU= 24 will be the queue
header. The right half of the first word of each SYSERR
block will contain a pointer to the next block or 9 if there
are no more queued blocks. Normally, the BUGHLT block will
still be queued up and will be written to ERROR.SYS when the
SYSERR fork starts up again.
If the system gets
a
KEEP-ALIVE CEASED, there can be SYSERR blocks left in the
queue.
RESOURCES
1.

SYSERR related tables in the Monitor Tables.

SER-24

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
SYSERR

EXERCISES
1.

Beginning at SEBQOU,
trace the queue of SYSERR
blocks;
use the tables to determine if each block
.is active.

2.

What type of block is each queued block?

3.

Find a processor parity interrupt error block and
match
the
information stored there with the
information the tables say is stored in that block
type. **

SER-25

«For Internal Use Only»

DIGITAL

TOPS-2" MONITOR
SYSERR

This page is for notes.

SER-26

«For Internal Use Only»

TOPS-20 MONITOR
SYSERR

DIGITAL

SVSERR
LAB SOLUTIONS
EXERCISES
1.

Beginning at SEBQOU, trace the queue of SYSERR
blocks;
use the tables to determine if each block
is active.
ANSWER:
24/ SEBBFR+67
SEBBFR+~7/

20104"SEBBFR+173

SEBBFR+173/20104"SEBBFR+277
SEBBFR+277/20067"SEBBFR+366
SEBBFR+366/20104"SEBBFR+472
SEBBFR+472/20104,,0

; last queued
; block

Each queued block points to the next queued block;
the last queued block has a zero in the right half
indicating there are no more queued blocks.
Bits
3-5 contain the state code; a value of 2 means
active. Each of these blocks is active.
2.

What type of block is each que ued block?
ANSWER: 'Nord 2 of each block has the block type in
blts 0-8.
SEBBFR+67+2/102000,,0

; type= 102 = SEC%BG

SEBBFR+173+2/ 102000,,0

;type= 102 = SEC%BG

SEBBFR+277+2/ 161000,,0

;type= 161 = SEC%PI

SEBBFR+36fl+2/ 102000,,0

;type= 102 = SEC%BG

SEBBGR+472+2/ 102000,,0

;type= 102 = SEC%BG

SER-27

«For Internal Use Only»

DIGITAL

TOPS-29 MONITOR
SYSERR

Block
type
SEC%BG
labels
a
block
as
a
BUGHLT/BUGINF/BUGCHK type.
Block
type
SEC%PI
labels a block as a process parity interrupt type.

3.

Find a processor parity interrupt error block and
match
the
information stored there with the
information the tables say is stored in that block
type. **
ANSWER:

Use the SYSERR block tables to compare the

two.

SER-28

«For Internal Use Only»

TOPS-20 MONITOR
SYSERR

DIGITAL

MODULE TEST
The module test for this module is in two parts.
First, obtain a sample SYSERR report from your instructor,
and with it (using any available resources) determine where
in the monitor each of the reported data came from. You may
use either the micro-fiche, the running monitor with FILDDT,
or any of the class lab system crash files, (also using
FILDDT).
Second, locate and describe the unreported SYSERR
entries in a system crash file using FILDDT. See your
instructor for the name of the crash file to use.

SER-29

«For Internal Use Only»

DIGITAL

TOPS-2g MONITOR
SYSERR

This page is for notes.

SER-30

«For Internal Use

O~ly»

TOPS-20 MONITOR
SYSERR

DIGlTAL

TEST EVALUATION SHEET

The ,results of these problems
class after the laboratory session.

SER-31

will

be

discussed

in

«For Internal Use Only»

TOPS-2('J MONITOR
SYSERR

DIGITAL

This page is for notes.

SER-32

«For Internal Use Only»

TOPS-20 MONITOR
Troubleshooting

«For Internal Use Only»

DIGITAL

TOPS-2f2J MONITOR
Troubleshooting

COURSE MAP

MR-2717

TS-i

«For Internal Use Only»

DIGITAL

TOPS-2~ MONITOR
Troubleshooting

This page is for notes.

TS-ii

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Troubleshooting

Troubleshooting
. . - - - - - - - - I NTRODU eTION - - - - - - - - .

This module contains information on
debugging and crash analysis, with the final
section devoted to MDDT, EDDT, and FILDDT.
There is a great difference between
analyzing a crash and debugging one. While
analysis simply tells you what happened,
debugging gives you reasons why (and thus,
impl ies remed ies) •
Successful
crash
analysis
depends
heavily on how well you know the data base
and whether you can discover inconsistencies
that give you clues about what happened.
The information in this module shows you how
to use available tools in looking at a crash
and how to find basic information about the
state of the machine at the time of the
crash.
Further analysis of a crash requires
that you are able to propose a reason for
what happened that matches the state of the
data base.

TS-l

«For Internal Use Only»

DIGITAL

TOPS-2flJ MONITOR
Troubleshooting

r------ LEARNING OBJECTIVES - - - - - . . . ,
Upon completion of
will be able to:

this

module,

the

~tudent

1.

Identify the mode of the
operating
system a~ the time of a crash.

2.

Determine which, if
running at that time.

3.

Ded uce, from the stack, which of
save macros put what on the stack.

4.

El ic ita dump.

5.

Ex tract
cra$h.

6.

Designate the reI event portions
data base.

saved

SYSERR

any,

fork

blocks

from
of

was
the

a
the

r--------- RESOURCES - - - - - - - - - ,
DECsystem-lflJ/DECSYSTEM-2flJ Hardware Reference
Manual

TS-2

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Tro ubI eshoot i ng

MODULE OUTLINE
T r 0 ub I e s ho 0 t i ng
I.

II.

I I I.

IV.

V.

VI.

VII.

CTY Output
A.
Explanation of KLERR Output
B. Sample KLERR Output
Getting a DUMP
A. How To Get a Dump
B. Where BOOT Lands
SYSERR
A.
Overview of SYSERR Functions and
Da ta Base
B. Queued SYSERR Blocks In A Crash
C. Moving SYSERR Blocks From a Crash
To ERROR.SYS
BUGHLT
A.
BUG Macro
B. BUGHLT Contents
Push Down Lists And Related Data Bases
A. How To Look At a Stack
B. Push Down List / Machine State
C. Stack Usage For Local Storage
D.
Stack Adjustment
Machine States and Relevant Data Bases
A.
PC Storage
B~
AC Storage
C.
Fork Scheduled, Or Not
D.
Fork NOSKED
E.
Extended vs. Non-extended Addressing
F. Sizes (Resident, Non-resident, Total)
G.
MDDT Page
H.
Relevant Data Base for Each Machine
State
DDT's
A.
FILDDT
B.
Relevant DDT/FILDDT Commands
C. MDDT
D.
EDDT

TS-3

«For Internal Use Only»

DIGITAL

TOPS-2~ MONITOR
Troubleshooti ng

This page is for notes.

TS-4

«For Internal Use Only»

DIGITAL

TOPS-2eJ MONITOR
Troubleshooting

CTY OUTPUT
Collect any CTY output that is relevant to the crash.
This should include the KLERR printout and the BUGHLT (as
well as recent BUGCHKs and BUGINFs, if any).
If the machine
got a KEEP-ALIVE CEASED,
the KLERR output is the only
r,el iable information you get.
(See the section 0 n the
BUGHLT location for an explanation.)

Explanation of KLE R R Output
KLERR includes the PC,
the last memory fetch and
information on the PI system. The PI information includes
the following:
PI STATE: ON or OFF

indicates whether the PI
system is on or not.

PION: n

n indicates which of
the 7 channels are
enabled.

PI HLD: n

n indicates which of
the 7 channels have
an interrupt in progress.

PI GEN: n

n indicates which of
the 7 channels have
a pending interrupt.

Sample KLERR Output
Here is an example of the KLERR output on a
CEASED error:

KEEP-ALIVE

%DECSYSTEM-20 NOT RUNNING

KEEP ALIVE CEASED
KLERR -- VERSION VeJ2-02 RUNNING

TS-5

«For Internal Use Only»

TOPS-20 MONITOR
Troubleshooting

DIGITAL

KLERR
KLERR
KLERR
KLERR
KLERR

KL NOT IN HALT LOOP
KL ERROR OTHER THAN CLOCK ERROR STOP
KL VMA: 000000 035717
pc: 000000 035717
PI STATE: ON, PION: 177, PI HLD: 004, PI GEN: 001
EXIT FROM KLERR
GETTING A DUMP

DUMP.EXE is a pre-allocated file into which BOOT writes
the dump. When the system comes up, SETSPD copies DUMP.EXE
to DUMP.CPY.
How to Get a Dump
If the system does an auto-reload, the console front
end will give BOOT the commands to get a dump.
If the
auto-reload does not work for some reason, you can force a
dump by typing /d to the BOOT> Prompt.
KLI
VERSION V806-07 RUNNING
KLI
ALL CACHES ENABLED
KLI
BOOTSTRAP LOADED AND STARTED
?DUPL STR UNI?DUPL STR UNI
iproblem because two PS:
istructures on line.
irequest a dump (after the
BOOT> /d
iproblem is corrected) •
BOOT>

itype CR for default monitor

Where BOOT Lands
The console front end l-oads BOOT into KL memory.
Of
course, this overwrites whatever used to be in that part of
memory. Therefore, BOOT is always loaded into a part of the
monitor that contains pure code
(i.e., so no data is
destroyed). Currently, BOOT is brought in on top of a part
of APRSRV.
If you need to look at code that is loaded where
BOOT lands, you must go to the 1 istings.
BOOT al so uses
some of high core to build the EXE directory for the file
DUMP. EXEi for example, on a machine with 256K, no page
above 761 is dumped.

TS-6

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Troubleshooting

SYSERR
Overview of SYSERR Functions and Data Base
SYSERR is a program that reads PS:ERROR.SYS and
generates reports on hardware errors, system crashes, front
end reloads, etc. Entries in the file ERROR.SYS are written
via the SYERR JSYS.
For a description of each of the types
of entries, see the monitor tables.
When an ERROR.SYS entry is desired, the caller
(which
is one of the system programs such as QUASAR or the monitor
itself) builds a SYSERR block as described ln the monitor
tables and does the SYERR JSYS. The SYERR JSYS adds the
block to a queue in the monitor's address space; the queue
header is SEBQOU (location 24). It then wakes up the Job 0
task which processes the queue and writes the queued entries
to ERROR.SYS.

Queued SYSERR Blocks In a Crash
A BUGHLT entry is generated when the system BUGHLTs;
this entry is queued but not written to ERROR.SYS. The
system is considered to be in an unsafe state at the time of
the crash. When the system comes back up, code in SETSPD is
called to move any queued SYSERR blocks in the dump to
ERROR.SYS.
The queue header is location 24 (called SEBQOU);
each
SYSERR block consists of the standard SYSERR header followed
by the information in the specific block type.
Sometimes it is useful to look at the queued SYSERR
blocks in a crash, particularly the BUGHLT block. The
BUGHLT block contains certain status information at the time
of the crash. The status words are described below:
1.

CONI APR,
Read the status of the processor error and
sweep flags. This information is stored in offset
BG%APS of the BUGHLT block. The flags and status
information returned by a CONI APR are described in
the Hardware Reference Manual.

TS-7

«For Internal Use Only»

DIGITAL

2.

TOPS-20 MONITOR
Troubleshooting
CONI PAG,
This information is stored in offset BG%PGS of
the BUGHLT block.
A CONI PAG reads the system
,status of the pager.
If TOPS-20 paging is on,
there is a 1 in bit 21. Bits 23-35 contain the
contents of the EBR (the address of the EPT).
For
a description of all the fields, see the Hardware
Reference Manual.
t

3.

DATAl PAG,
This information is stored in offset BG%PGD of
the BUGHLT block. A DATAl PAG returns the process
status of the pager.
DATAl PAG,
returns the
current and previous contex AC blocks, and the
address of the UPT.
For a complete description of
the fields returned by a DATAl PAG, see the
Hardware Reference Manual.

4.

CONI PI,
This information is stored in offset BG%PIS of
the BUGHLT block. A CONI PI returns the status of
the priority interrupt system;
it indicates which
levels are on, whether the PI system is on, and on
which levels interrupts are currently being held.
For
a complete description, see the Hardware
Reference Manual.

Moving SYSERR Blocks From a Crash to ERROR.SYS
As stated before, SETSPD moves
from the crash to ERROR.SYS. A Job 0
program at START3;
this code copies
and then issues a SYERR JSYS for each
the crash.

TS-8

queued SYSERR blocks
task starts the SETSPD
DUMP.EXE to DUMP.CPY
queued SYSERR block in

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Tro ubleshooting

BUGHLT
Location BUGHLT contains the location the BUGHLT came
from.
The latter contains an XCT BUGHLT-name. All BUGHLT
code is generated by the BUG macro defined in PROLOG.

BUG Macro
DEFINE BUG(TYP,TAG,STR,REGS,%NAM,%STR)<
XCT [TAG::
JSR BUG'TYP
IRP REGS,<
Z REGS> .
SIXBIT /TAG/]
.PSECT BGSTR
ASCIZ \STR\
%STR:
.ENDPS BGSTR
• PSECT BGPTR
XWD TAG,%STR
• ENDPS -BGPTR

>
This is an example of a call to the BUG macro:
BUG(HLT,J0NRUN,B39-1=37677i
if ACBAS contains anything else, there are pushed
AC blocks saved in UACB.

TS-1S

«For Internal Use Only»

DIGITAL

2.

TOPS-20 MONITOR
Troubleshooting
Process is contex t switched while running
mode.

in

The current ACs (i.e., the user mode ACs)
.saved in block UAC.

3.

Process is context swi tched while running
mode.

in

user
are
exec

The current ACs are saved in block PAC.
The
previous context ACs are saved in block UAC. The
ACs saved in UAC are the user mode ACs unless a
nested JSYS is in progress;
in this case, the ACs
saved in UAC are the ACs the nested JSYS was called
with. The user mode ACs for this case are saved on
the AC stack called UACB;
the user mode ACs are
the first saved ACs on UACB.
4.

Software interrupt processing.
The exec mode ACs are saved in block
while a software interrupt is in progress.

PIAC

AC STORAGE AT THE TIME OF THE CRASH

1.

BUGACS
Exec mode ACs at the time of the crash, copied
to current ACs when using FILDDT.

2.

BUGACU
Previous context ACs at the time of the crash.
These are the user mode ACs unless a nested JSYS
was in progress, i~e., if a JSYS called from a
JSYS~
If a nested JSYS was in progress at the time
of the crash, BUGACU contains the ACs the current
JSYS was called with.
In such a case, the user
mode ACs are saved in the AC stack called UACB.

TS-19

«For Internal Use Only»

DIGITAL

TOPS-2~ MONITOR
Troubleshooting

SUMMARY OF AC STORAGE
1.

UAC
Previous context ACs are saved here when the
user
is context switched.
For the currently
scheduled process, UAC contains the ACs from the
last time the process was dismissed. Once again,
if a nested: JSYS was in progress, the UACs contain
the ACs the JSYS was called with. In such a case,
the user mode ACs are saved in the AC stack called
UACB.

2.

UACB and ACBAS
Pushed AC blocks when
prog ress.

3.

a

nested

JSYS

it

here

when

a

software

BUGACS
Ex ec mode ACs a t time

6.

when

PIAC
Exec mode ACs saved
inter,r upt is in prog ress.

5.

in

PAC
Exec mode ACs saved here for process
is dismissed.

4.

is

0

f crash.

BUGACU
Previous context ACs at time of crash.

Fork Scheduled, or Not
If a fork is scheduled, location FORKX contains the
fork's system fork number.
The scheduled fork's PSB and
per-process pages, JSB and per-job storage, and the page
table are all mapped into the monitor's address space. If
no fork is currently scheduled, location FORKX contains a
-1.

TS-2~

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Troubleshooting

Fork NOSKEO
If a fork is NOSKED,
its fork number is stored
SSKED;
if there is no NOSKED fork, SSKED contains -1.

in

Extended vs. Non-Extended Addressing
f1 ag
If the machine supports extended add ressi ng ,
does
not
support
EXADDR contains a
1;
if the machine
extended addressing, EXADDR contains 0.

Sizes (Resident, Non-Resident, Total)
MONCOR/ ntmlber

0

f pag es in resident moni tor

TOTRC/ total number of swappable core pages
NHIPG/ highest physical core page ntmlber

MOOT Page
When MDOT is in use for a process, DOTPPG
(currently
page 774) exists. If the running process's page 774 exists,
that process has been using MDDT.
(You might suspect the
crash was caused by an accidental deposit in MOOT, for
examp1 e.)

Relevant Data Base for Each Machine State .
JSYS
1.

Stack
UPDL

2.

Initial stack setup
Initial UPOL setup for JSYS if from user mode:
/ PC at time of JSYS
/ PC f1 ag sat time 0 f JSYS

TS-21

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Tro ubI eshoo ti ng
/ PC at time 'of JSYS
/ PC fl ags at time 0 f JSYS
Initial UPDL setup for JSYS if from exec
(nested) :
/
/
/
/

3.

INTDF
(for higher level JSYS)
PC at time of JSYS (return PC)
PC flags at time of JSYS
M~P

Previous PC
The return PC is pushed on to the stack;
is the stack pointer for the return PC.

4.

mode

MPP

Saved ACs
ACs saved in UACB if the JSYS is nested.
See
section on AC STORAGE for a description of UACB.

5.

Saved stack po inter
If the JSYS was from user mode, this is not
relevant.
If the JSYS is nested, the previous JSYS
also used this stack and the MPP pointer can, be
used to determine where the stack pointer was when
thi s JSYS beg an:
Previous
stack ptr-> /
/
/
/
MPP - > /

6.

INTDF
MPP (for higher level JSYS)
MONPC
PC at time of JSYS (return PC)

AC usage
There is no standard for AC usage to which all
JSYSs conform.

TS-22

«For Internal Use Only»

DIGITAL

7.

TOPS-20 MONITOR
Troubl eshooting
Related storage
1.

MPP -- points to:
--return PC for JSYS
--last location of initial setup for this
JSYS

2.

FPC = KIMUPC -- dispatch address for JSYS

3.

KIMUUl -- last UUO from user in format:
KIMUUl/ fl ag s, ,opcod e
/ JSYS number

4.

INTDF
Indicates if the process is NDINT, and to
how many levels. Set to -1 if the process is
not NOINT, greater than or equal to zero if the
process is NOINT.

PAGE FAULT
1.

Stack
TRAPSK

2.

Initial stack setup
The initial stack setup differs
three cases:

for

each

of

--pag e faul t from user mode
--page fault from exec mode
--recursive page fault

TS-23

«For Internal Use Only»

TOPS-2~ MONITOR
Troubleshooting

DIGITAL

1.

Stack setup upon page fault from user mode:
/runtime
Ireturn PC
/return PC f1 ag s

2.

Stack setup upon page fault from exec mode:
/
/
/
/
/
/
/
/
/
/

3.

AC1
AC2
AC3
AC4
AC7
AC16
TRAPSW
runtime
PC
PC flags

Stack setup upon recursive page fault:
/ AC1
/

AC2

/ AC3

3.

/

AC4

/
/
/
/
/

AC7
AClfi
TRAPSW
PC
PC flags

Previous PC
. Saved on stack;
location.

4.

see initial stack

setup

for

Saved ACs
The ACs that are saved are kept on the stack.
See the initial stack setup to learn where each AC
is saved.

TS-24

«For Internal Use Only»

DIGITAL

5•

TOPS-20 MONITOR
T r 0 ub Ie sho 0 t i ng
S a v ed s t a c k po in t e r
TRAPAP

6.

,AC usag e
Differs for each type of page fault.

7.

ReI ated storag e
1.

TRPID --identity of the page causing
in the form PTN"PN or PTN

the

trap

This is the identity of the page the page
fault handler
is working on. TRPID contains
the page's page table identity while the page's
page table is brought into core (if the page
table was not in core) •
2.

TRPPTR
Storage address of the page the page fault
handl er is wo rki ng on.

3.

TRAPSW (copy of TRAPS0)

4.

TRAPC

o if the first
greater than 0,
it
recursion.
5.

TRAPFL/TRAPPC

=

level page fault;
if
indicates the level of

UPTPFL/UPTPFO

FI ag s and. PC a t time
6.

0

f pag e faul t.

TRAPS0 = UPTPFW
Page fail word;
pag e faul ted.

TS-2S

contains the ADDRESS that

«For Internal Use Only»

DIGITAL

TOPS-29 MONITOR
Troubleshooting

SCHEDULER
1.

Stack
SKDPDL

2.

Initial stack setup
None. ,

3.

Prev ious PC
S av ed in PS B fo r a pr oc e s s
upo n a con t ex t
switch to the scheduler;
the PC is saved in
PFL/PPC of the process's PSB.
If FORKX contains a
fork number, it is the number of the fork running
when the scheduler was invoked.
If FORKX is not
set up, you cannot determine which fork was running
1 ast.

4.

Saved ACs
The process's ACs are saved in block PAC (exec
mode ACs)
and block UAC (previous context ACs) of
the PSB for the process. If FORKX is not setup,
you cannot determine which process was running
1 ast.

5.

Saved stack pointer
In the saved ACs.

6.

AC usage
FX/ -1 if no ,fork was chosen, or the system
fork number of the chosen fork

7.

Related storage
1.

FORKX
FORKX contains a -1 if no fork is
chosen, or the fork number of the chosen fork.

2.

Temporary storage while entering scheduler.

TS-26

«Fo r Internal Use Onl y»

TOPS-2~ MONITOR
Troubleshooting

DIGITAL

PHYSIO QUEUEING LEVEL
1.

Stack
PHYPDL

2.

Initial stack setup
The P and Q ACs are saved on the stack by the
macro SAVEPQi
the ACs are saved in order of Ql
through Q3 followed by PI through P6.
See the
section on Stack Usage for Local Storage for the
fo rmat.

3.

Previous PC
Since PHYSIO
is called with a
PUSHJ,
previous PC is the top of the saved stack.

4.

the

Saved ACs
ACs QI-Q3 and PI through P6 are saved on the
stack.
See the section in Stack Usage for Local
Storage entitled SAVEPQ.

5•

S a v ed s t a c k po i n t e r
The previous stack pointer is saved in PHYSVP.

6.

AC usage
P4/ address of IORS being queued
Pl/ address of CDB
P3/ address of UDB
P2/ address of KDB or

7.

~

if no KOB

Related storage
None.

TS-27

«For Internal Use Only»

DIGITAL

TOPS-2g MONITOR
Troubleshooting

PHYSIO INTERRUPT LEVEL
1.

Stack
PHYIPD

2.

Initial stack setup
None .,
i

3.

Previous PC
The previous PC is saved
by
the
XPCW
instruction in a two word block, beginning at the
CDB-n.

4.

Saved ACs
PHYACS -- block where ACs saved

5 • . Saved stack pointer
The saved stack pointer is in PHYACS+17.

6.

AC usage
Pl/ address of CDB
P2/ add ress of KDB or g if none
P3/ address of UDB
P4/ IORS address or argument indicating
ac tion code:
P4<0
P4=g
P4>0

7.

schedule a channel cycle (P4) = -1
dismiss interrupt
housekeep current request
(contains IORB address)

Related storage
Home block check funtion.
CHSUDB.

TS-28

In STG,

starts

at

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Troubleshooting

APR INTERRUPT LEVEL
1.

Stack
MEMPP

2.

Initial stack setup
/UPTPFO= TRAPPC
/UPTPFL= TRAPFL
/UPTPFN
/UPTPFW~ TRAPS0

3.

Pr ev io us PC
Saved as a double-word PC by XPCW in locations
PIAPRX and PIAPRXI.

4.

Saved, ACs
MEMPA

block where ACs 0-10 are saved.
NOTE - - - - - - - - - -....

Release 3A uses a different AC block
while at APR interrupt level; therefore,
no ACs are saved.
5.

Saved stack pointer
MEMAP -- previous stack pointer saved there.

6.

AC usag e
None.

7.

Related storage
1.

Sets

II

local II pag e fail routine to MEMPTP.

TS-29

«For Internal Use Only»

TOPS-2~ MONITOR
Troubleshooting

DIGITAL

DTE INTERRUPT LEVEL
1.

Stack
DTESTK

2.

Initial stack setup
None. i
!

3.

Previous PC
Saved in DTETRA.

4.

Saved ACs
DTEACB -- block where ACs are saved.

5.

Saved stack pointer
Previous stack pointer is saved in DTEACB+17.

6.

AC usage
Fir e s u1 t

AI

0

f CON I DTEn,

DTE number of DTE that caused interrupt

31 count (if

41
7.

RSX2~F

Byte pointer (if

protocol)
RSX2~F

protocol)

Related storage
None.

TS-3~

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Troubleshooting

PSI HANDLING
1.

Stack
PIPDB

2.

Initial stack setup
None.

3'.

Previous PC
PIDL/PIPC

4.

Saved ACs
PIAC -- block where ACs are saved.

5.

Saved stack pointer
Previous stack pointer is saved in PIAC+17.

6.

AC usage
FX/ interrupt flags from FKINT

7.

Related storage
None.

JOB 0 EXEC MODE TASKS
1.

Stack
UPDL

2.

Initial stack setup
None.

TS-3l

«For Internal Use Only»

DIGITAL

3.

TOPS-20 MONITOR
Troubleshooting
Previous PC
Since these are scheduled processes,
not relevant.

4.

this

is

this

is

Saved stack pointer
Since these are scheduled processes,
not re1 evant.

6.

is

Saved ACs
Since these are scheduled processes,
not relevant •.

5.

this

AC usage
None.

7.

Related storage
1.

How can you tell this use of UPDL from a JSYS?
If the FKJOB entry for the running fork is
Job 0, the current process is probably a Job 0
task as opposed to a JSYS in progress. If the
PC is in a Job 0 routine, this also indicates a
Job 0 task.

USER MODE
The system never BUGHLTs in user mode, but it could
KEEP-ALIVE CEASE.
The ,PC is from user mode if the flag
UMODF is set in the pc.

TS-32

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
T r 0 ub Ie sho 0 t i ng

DDT's
FILDDT
The latest version of DUMP.CPY is the last crash.
program FILDDT is used to analyze a crash.

The

HOW TO USE FILDDT ON A CRASH
To look at a crash with FILDDT you need
the monitor file it came from (for symbols).
@ENABLE
$FILDDT
FILDDT>LOAD MONITR.EXE
FILDDT>GET DUMP.CPY

the dump and
For example:

; load symbol s
; load dump

The ACs contain their contents at the time of the dump.
default you look at physical (not virtual) addresses.

By

$U COMMAND
FILDDT can simulate KL paging.
If you want to look at
a particular address space, use the n$U (altmode U) command.
The n is the address space's page table's 8PT slot.
Usually, you wish to look at the monitor's address space.
MMAP's SPT slot is in location MMSPTN (usually it is 403,
but you should check the contents of MMSPTN if you are
looking at an unfamiliar monitor) ~
In the part of the
monitor
that
BOOT
loads,
there
is
a
one-to-one
correspondence between physical and virtual
addresses;
MMSPTN is in this part of the monitor's address space.
If you wish to look at some fork's address space, find
its page table's SPT slot in the left half of FKPGS, indexed
by fork number.
If you wish to return td physical addressing
KL paging simulation), type $U (no n argument) •

TS-33

(i.e.,

no

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Troubleshooting

Relevant DDT/FILDDT Commands
These are standard DDT commands; however, you may not
be familiar with them. They are included here along with
example$ of their use.
QUESTION MARK (?)
If you type a symbol followed by a question mark, DDT
tells you which module(s)
that symbol appears in; the
module name is followed by a G if the symbol is global.
A
local symbol may be defined in more than one module.
This facility can be used to locate symbols, like GLOB,
but faster.
BUGSTO?
APRSRV ;symbol is local and defined in
SPT?
STG G

APRSRV

;symbol is global and defined in STG

UNDERSCORE
A value followed by an underscore is a request
to find a symbol with that value.
This facility can
address of a value.

be

used

to

locate

the

to

DDT

symbolic

14156 L8CHED+5
101400 8PT
EFFECTIVE ADDRESS SEARCH ($E)
The $E command is used to search for all locations
where the effective address, following all indirect and
index-register chains to a maximum length of 64
(base 10)
equals the address being searched for.

TS-34

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Troubleshooting

The format of the command is ac$E;
a
is the
range and is optional.
If no range is specified, the whole
address space is assumed.
The c argument is the address to
search for.
MMSPTN$E
PGRI10+3/ MOVEM Tl,MMSPTN
FPTA4/ SKIPA Tl,MMSPTN
MLKPGM+2/ CAMN T2,MMSPTN
SWPER3+2/ CAMN T2,MMSPTN
GSMLER+ll/ HRL Tl,MMSPTN
BSMGPl+2/ HRL Tl,MMSPTN
212777/ HRL Tl,MMSPTN
SNPF0A+15/ HRL Tl,MMSPTN
SNPF5B+l~/ HRL Tl,MMSPTN
UTlLL+l/ HRL Tl,MMSPTN
JSB0$E
JOBMAP+2/ 0
JOBMAP+3/ 0
JOBMAP+5/ ~
WORD SEARCH ($W)
Word search compares each storage word with the word
being searched for
in those bit positions where the mask,
located at $M, has ones. The mask word contains all ones
unless set by the user.
If the comparison shows equality,
the word search types out the address and the contents of
the location;
if the comparison results in inequality, the
word search types out nothing.
The format of the command is ac$W.
a
is the
range and c is the quantity searched for.
To set the mask,
type n$M where n is the quantity to be placed in the mask
word.
Suppose we wish to find all share pointers in the
current user's page map between pages 0 and 10.
In this
case, store a 7 (for pointer type) in bits 0-2 of the mask.
The
command
is UPTA200000,,0$W and works as
follows:

TS-35

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Troubleshooting

7999909,,9$M

UPTA200000,,0$W
,UPTA+2/206000,,1244
UPTA+4/ 206~00,,1242
NOT WORD SEARCH ($N:)
Not word search works like word search, the only
difference is that it types out the contents of the register
when the comparison is an inequality, and types nothing when
an equality is found.
Not word search is commonly used to type out all
non-zero locations in some range. Suppose you wish to find
all existent (non-zero) entries in the JSB map;
you would
type:
-l$M
JOBMAP0$N
JOBMAP/224000,,635
JOBMAP+l/124003,,7044
JOBMAP+4/124003,,2764
JOBMAP+6/124003,,7050

MOOT
,MQDT is a part of the monitor that allows you to look
at the running monitor with the standard DDT commands; your
process is always the running process when you use MDDT.
You can also call monitor routines to map pages, etc.;
however, extreme caution spould be taken when using MDDT.
I~
you change any locations, you can crash the monitor. It
is ~ good practice to type carriage return immediately after
yo~
open any location to prevent accidental deposits into
memory.
You can enter MDDT in either of two ways. In the first
example, the running fork will be the top fork of your job,
i.e., the EXEC. In the second example, the running fork
will be the fork running user level DDT.
@EN}\BLE

TS-36

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Troubleshooting
$AEQUIT
MX>/
MOOT

@ENABLE
$SOOT
JSYS 777$X.
MOOT
You can use either method to enter MOOT~
Return
MOOT by calling the routine MRETN. 00 this by typing:

from

MRETN$G

EDDT
While you are in EOOT, timesharing ceases.
Loading the Monitor With EOOT
Switch registers: 0,1,2,7
BOOT>/L
BOOT>/G141
EOOTF/ 1
OBUGSW/ 2
143$G

TS-37

«For Internal Use Only»

TOPS-29 MONITOR

DIGITAL

Troubleshooting

This page is for notes.

TS-38

«For Internal Use Only»

DIGITAL

TOPS-2" MONTTOR
Troubleshooting

MODULE TEST
When answering the 1 ab exerc i ses, wr i te down the names
of the tables where you found the answers. The labs will
help you understand the monitor data base structure.
So
remember, where to:look is more important than what you find
there.
'
The exercises marked with a double star (**) are more
difficult and are optional. As the course progresses, you
may feel more comfortable about these portions;
feel free
to come back to them later.
ILLUUO Crash
TOOLS
This set of exercises uses a crash named ILLUUO.EXE.
your symbol sis named I LLUUO-MONITR. EXE.
Do not forget to set monitor context!

TS-39

«For Internal Use Only»

DIGITAL

TO PS-20 MON.IT"oR
Troubleshooting

EXERCISES
You should attempt to. analyze why the ILLUUO crash
occurred.
The following questions should/help ybu look in
the rig~t directions. Good luck!
1.

What is the BUGHLT?
BUGHLT type?

What does it mean to get

2.

What was the PC that caused the BUGHLT?

3.

What was the instruction that
UUO?

4.

What stack was in use?

5.

What mode was the processor in when the illegal UUO
occurred?

6.

How did it get to that instruction?

~rapped

this

as an illegal

**

!

TS-4g

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Troubleshooting

TEST EVALUATION SHEET
EXERCISES
1.

What is the BUGHLT?
BUGHLT type?

What does it mean to get

this

ANSWER: The BUGHLT is an ILLUUO. This means the
monitor executed an illegal instruction, which, in
turn, generally means that either the monitor
somehow started executing data or its ACs or that
some code was garbaged.
2.

What was the PC that caused the SUGHLT?
ANSWER:
Since it is a UUO, the PC is stored in the
MUUO old PC word;
address KIMUPC (this is offset
424 in the UPT/PSS page). Remember that this is
the updated PC, so it is usually 1 greater than the
UUO.
KIMUPC/304000,,1

3.

What was the instruction that trapped as an illegal
UUO?
ANSWER: The updated PC was Ii
1S in AC0.

0/ 0
4.

so the illegal

UUO

icertainly looks illegal

Wha"t stack was in use?
ANSWER:
The stack
generally going on.

in

us~

P/ UPDL+125"UPDL+30

TS-4l

tells

us

what

was

iJSYS in progress

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Troubleshooting

5.

What mode was the processor in when the illegal UUO
occurred?
ANSWER: The PC flags have bit UMODF on if it was
user mode;
but a ILLUUO cannot happen anyway
unless it was monitor mode.
KIMUPC/304000,,1
UMODF= 10000,,0

6.

;not user mode

How did it get to that instruction?

**

ANSWER: The best way to figure this out is to look
at the stack.
There are these basic facts that
help to make sense of the stack:
1.

P contains the current stack pointer.

2.

MPP contains the stack pointer at the time the
last JSYS began. If MPP does not point to the
start of the stack plus 1 (UPDL+1), there is a
JSYS that called a JSYS.

3.

If an entry was made on the stack by a PUSHJ,
it will look like a PC. This is not a hard and
fast rule, but it can help.
A user mode PC
usually has bits 1,2, and 3 on and a monitor PC
has bits 1 and 2 on.

4.

When a JSYS begins, it pushes the old PC on the
stack twice.

5.

If a return address is still on the stack
(i.e., has an address less than the stack
pointer), then you have not returned from the
routine.

6.

The monitor uses the stack for
temporary
storage. The macros STKVAR, TRVAR, etc. leave
recognizable things on the stack.
Knowing
these conventions helps you recognize which
stack locations are being used as temporary
storage.

TS-42

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Troubleshooting
Using these points, try to fit the pieces together.
Here is the stack and deductions from it:

PI

UPDL+125"UPDL+30

;current stack pointer

MPPI UPDL+76"UPDL+1

ion1y one JSYS

UPDL/310000,,442531
I 310000,,442531

iPC at time of JSYS
i 2nd copy of PC

I 0
'
I 1,,1
I MMAP".STKRT
I CAIA SOUT1+1

I MMAP+400"SWP~LK+3
I JSTAB+161
UPDL+101 CAIA SOUTB+6
I CAIA BYTOUA+l3
I CAIA NOPGT0+15
I -1
I 1,,160000

I -1
I JSTAB+161
I 4,,4
UPDL+201 CAIA .STKRT
I CAIA NEWWNA+6

I
I
I
I
I
I

i looks 1 ike tempo rary
istorage macro (STKVAR)
i looks 1 ike a PC
i and the add ress
iimplies this
iis a SOUT jsys.

i

1 00 k s like a PC

;4 temporary
istorage locations
; ano ther STKVAR
ilooks like a PC

-1

JSTAB+160
CAIA JFNOF5+20
UPDL+77"UPDL+2
Tl
CAIA .ASRET
UPDL+301 JSTAB+563,,10

I -1
I CAIA .TRRET
I CAIA GTFDB2+14
I CAIA USTDIR+l

TS-43

i

looks like a PC

ilooks like a PC
ithis is our top
iof stack
isince this is the
i last location
iPopped off the stack;
iroutine for return
iwi th TRVAR

«For Internal Use Only»

DIGITAL

MONITOR
Troubleshooting

TOPS-2~

P and the stack indicate there is a SOUT going on;
'MPP indicate it is not a nested JSYS. The PC at
the time of the JSYS (in UPDL) is a user mode PC
because UMODF is on.
Loca tions UPDL+2 t.hrough UPDL+4 are STKVAR
locations;
.STKRT is the return routine STKVAR
sets up and the location before it (containing
1, ,1)
is the count of temporary storage locations,
that is, l~
It looks as if the SOUT called NEWWNA to
change the file window page.
That code'called
JFNOF5, which made a call to NEWLFP;
this is
indicated by the entry in UPDL+24, which is the
return address from NEWLFP. Looking at the code,
and what gets called, it seems that NEWLFP went to
NEWFLL and called NEWLFS, which failed.
In the
literal at NEWFLL+3,
it calls and returns from
USTDIR, and then it adjusts the stack. This causes
it to POPJ to -1, the next higher entry on the
stack.
So it adjusted the stack by 1, which in this
case,
it should not have.
The code apparently
expected one more thing to be on the stack.

TS-44

«For Internal Use Only»

TOPS-20 MONITOR
PHYSIO - Disk/Tape

«For Internal Use Only»

DIGITAL

TOPS-2~ MONITOR
PHYSIO - Disk/Tape

COURSE MAP

MR-2717

DT-i

«For Internal Use Only»

DIGITAL

TOPS-2f(J MONITOR
PHYSIO - Disk/Tape

This page is for notes.

DT-ii

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
PHYSIO - Disk/Tape

PHYSIO - Disk/Tape

r--------

I NTRODUCTION ------~

This module covers, in depth, the flow
of the physical I/O for Magnetic Tape and
Disk transfers. The flow starts with the
generation
of
disk/magtape I/O Request
Blocks (IORBs), through their queueing to
the calling of the device-dependent, unit
specific code. The channel and unit data
bases
are
discussed,
along
with
a
description of the algorithms used for the
selection of the appropriate transfer to be
executed.
Interrupt and error processing
are also addressed.

DT-l

«For Internal Use Only»

DIGITAL

TOPS-2~ MONITOR
PHYSIO - Disk/Tape

, . . - - - - - - ,LEARNING OBJECTIVES - - - - -....

Upon completion of
student will be able to:
1.

this

module,

Describe the overall structure
I/O data base.

of

the
the

Physic~l
I

2.

Identify the data contained in each of
the structures relating to the Physical
I/O data base.

3.

List the various error
counts
specify the location of each.

4.

Describe the disk allocation algorithms
and the relevant portions of the data
base.

and

--------------, RESOURCES
1.

Monitor Tables

2.

Micro-fiche of the Monitor

DT-2

«For Internal Use Only»

TOPS-2g MONITOR
PHYSIO - Disk/Tape

DIGITAL

MODULE OUTLINE
PHYSIO-Disk/Tape
I.

II.

III.

IV.

PHYSIO
A. Data Structure
B. Queueing an IORB
C. Scheduling an IORB
D. Starting I/O
E. Interrupt Handling
Disk Allocation
A. Data Structure (DSKBTTBL)
B. Space allocation
C. Space Deallocation
D. Drum Allocation
E. BAT Blocks
DISK Dependent I/O
A. Data Structure
B. Disk-Dependent Code
C. Disk Interrupts
D. Disk Errors and Abnormal Conditions
MAGTAPE Dependent I/O
A. Magtape Data Base
B. Magtape IORB
C. CDB, KDB, and UDB
D. Interface to PHYSIO
E. Magtape I/O wait
F. CLOSF Device-Dependent Functions
G. Magtape Interrupts
H. Error and Abnormal Conditions

DT-3

«For Internal Use Only»

DIG ITAL

TOPS-20 MONITOR
PHYSIO - Disk/Tape

This page is for notes.

DT-4

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
PHYSIO - Disk/Tape

PHYSIO
Data Structure

IORB (I/O REQUEST BLOCK)
An IORB is built by the disk or magtape dependent code.
Short IORBs are built for most disk I/O requests; magtape
I/O always uses long IORBs.
CHANNEL DATA BLOCK
The
channel
data
block,
or
COB,
contains
channel-dependent status information.
All interrupts for
the channel begin processing in the COB and are dismissed by
code in the CDB; 'interrupts come in at offset CDBINT=-6 and
are dismissed at offset CDBJEN.
Offset CDBDSP has the
address of the channel dispatch table (RH2DSP). The KDB
addresses for magtape, or the UDB addresses for disk, begin
at offset CDBUDB. The channel number is in offset CDBADR.
Each COB has a device-dependent portion beginning at
CDBDDP.
For RH20s, this portion is a 4-word block with the
CONI, CONO, DATAl, and DATAO instructions in it. For RHlls,
the portion contains the device registers, the UNIBUS status
register address, and the UNIBUS bus address base address.
CONTROLLER DATA BLOCK
The controller data block, or KDB, exists for magtape
controllers.
Disk units each have their own controller
built in; there is no KDB for disk.
The KDB has the
addresses of the unit data blocks for each magtape unit on
the controll'er; one controller can handle a maximum of
eight units.
Offset KDBDSP has the address of the RDB function
dispatch table.
Offset KDBUDB is the first of eight
possible UDB addresses, and each KDB has a device-dependent
portion beginning at offset KDBDDP.
I/O instructions and
current unit status information is kept in this portion.

DT-5

./

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
PHYSIO - Disk/Tape

UNIT DATA BLOCK
Each magtape and disk unit has a unit data block, or
UDB. Each UDB has unit-dependent status information for the
unit. Offset UDBPWQ is the header for the unit's position
wait queue, and offset UDBTWQ is the header for the unit's
transfer wait queue.
Each UDB has a, device-dependent portion beginning at
offset UDBDDP. RP~4 and RP06 devices have the hardware I/O
instructions here, plus the twenty drive registers. Magtape
devices have the slave address on the slave bus, error
information for the drive, and the tape cleaner flag stored
here also.
FINDING EACH DATA STRUCTURE
The CHNTAB table, indexed by channel number, contains
the address of the channel data block, or COB. For disk,
offset CDBUDB of the COB is the first of eight pointers for
the eight possible unit data blocks, or UDBsi
if the unit
exists, the pointer has the address of the unit's UDB.
For
magtape units, offset ~DBUDB contains the address of the
KDB, or controller data block. The KDB has the pointers to
the
magtape
UDBS, beginning at offset KDBUDBi
each
controller can support a maximum of eight units.
For magtape units, MTCUTB,
indexed by unit number,
contains the CDB address for the unit in the left half and
the UDB address for the unit in the right half.
RH20 CHANNEL DISPATCH TABLE
Table PHYCHT contains the addresses of the channel
dispatch tables for each channel supported. Currently, this
table has one entry and all systems have the address RH2DSP.
However, the RH2DSP table is in PHYH2 or PHYHII, and only
one of these modules will exist in a monitor; PHYHII is the
2020 channel-dependent module and PHYH2 is in all other
TOPS-20 monitors.
The channel dispatch table offsets are described in the
CDS table in the Monitor Table Descriptions section. Each
offset serves a different function.
For example, offset

DT-6

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
PHYSIO - Disk/Tape

CDSINI initializes the channel and builds the COB.
UNIT DISPATCH TABLE
Table PHYUNT has the dispatch table addresses for all
supported unit types. The possible dispatch tables are:
1.

RS4DSP

RS04 dispatch table

2.

RP4DSP

RP04/RP06 dispatch table

3.

TM2DSP

TM02 dispatch table

The KDB, at offset KDBDSP, contains the KDB dispatch table
TM2DSP,
the same table referred to above as the unit
d ispa tch tabl e.
Many channel-depend ent
functions
(i .e. ,
ro uti nes
dispatched to through the channel dispatch table) will also
dispatch through the unit dispatch table.
For example,
RH2DSP
plus
CDSSIO
(start
I/O
offset)
does some
channel-dependent functions and then dispatches through
offset UDSSIO of the TM2DSP table, or the RP4DSP table,
depending on the unit type.
Queueing an IORB
The IORB is added to either the transfer or position
wait queue for the relevant unit.
If the unit's channel is
inactive, the request is serviced;
that is, positioning or
transfer is started, depending on the request type.
QUEUING A MAGTAPE IORB
For magtape, routine MTAIRQ is called to set up the
IORB transfer list and fill in other IORB fields. MTAIRQ
then calls QUEIRB (in PHYSIO) which calls routine PHYSIO (in
PHYSIO) to add the IORS to the unit's transfer wait queue or
position wait queue.
Magtape requests must be serviced in the order they are
requested.
To insure this happens, requests are handled as
follows:

DT-7

«For Internal Use Only»

DIGITAL

TOPS-29 MONITOR
PHYSIO - Disk/Tape

1.

In a transfer request with the position wait queue
(PWQ)
empty, add the request to the transfer wait
queue (TWQ).

2.

In a posi tion request, add the request to the PlflQ.

3.

In a transfer request with the position wait
not empty, add the request to the PWQ.

For an explanation of how this affects scheduling,
the section on how IORB's are scheduled for magtape.

queue

see

QUEUING A DISK IORB
For disk, read operations are triggered via the page
fault mechanism.
Write operations are triggered by UFPGS
JSYS, un-mapping a file page, DDMP action, or by one of the
garbage collectors (XGC or GCCOR).
Read requests call SWPIN; write requests call SWPOUT.
These routines do any necessary overhead operations (such as
mapping the index block, getting a page from RPLQ, setting
up the core manag ement data base, putting the page on RPLQ,
assigning drum space, etc.) and then call DSKIO to set up a
short IORB.
(Index block read sand wr i tes go through
UDSKIO).
For disk requests, routine PHYSIO will add the IORB to
either the unit's position wait queue or transfer wait
queue. If the unit is positioned at the same cylinder as
the requested cylinder and the fairness count for the unit
has not expired, the request is added to the unit's transfer
wait queue;
otherwise, the request is added to the unit's
position wait queue.
If the channel is not active, positioning or data
transfer
(depending on whether the request was added to the
PWQ or to the TWQ) is started. If the channel is busy, the
request is scheduled at interrupt level;
if the request is
added to the TWQ for disk, it may be stuffed into the backup
register. A request is added to the backup register if:

DT-8

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
PHYSIO - Disk/Tape

1.

The primary command is active.

2.

It is for the
positioned.

3.

Full latency optimization is enabled.

4.

Its sector address is within minimum latency time.

cylinder

at

which

the

unit

is

Scheduling an IORS
Most sched ul ing of IORBs is done at interrupt level.
When a
transfer done interrupt occurs for a unit, another
transfer is started for the channel.
Each unit has a
transfer wait queue; however, the chpnnel can handle only
one data transfer at a time. When a disk unit's transfer
wait queue is empty, a new cylinder is selected via the scan
algorithm, and positioning is started for that unit.
Note
that positioning can be started for a unit (or units) with
data transfer started on another unit;
that is, positioning
and data transfer can go on simultaneously for units on the
same channel. However, the positioning requests must be
started before any data transfer is requested because once a
data transfer begins, the channel is busy until the transfer
done interrupt occurs.
The algorithms used to choose a
disk and magtape are as follows.

transfer

request

for

Fo r mag tape:
Requests must be serviced in the order they are given.
Choose the next request on the ~WQ.
If the TWQ is empty,
look at the first request on the PWQ.
If it is a
positioning
request, start positioning. An empty TWQ, with
the first request on the PWQ being a
transfer request,
implies that the last serviced request for this unit was a
position request; move all transfer requests
(up to the
next positioning request) from the PWQ to the TWQ. Service
the first request on the TWQ.
The unit is chosen in
round-robin fashion.

DT-9

«Fo r Internal Use Only»

TOPS-2~ MONITOR
PHYSIO - Disk/Tape

DIGITAL

For disk:
1.

Choose the best latency request from TWQ fo reach
unit and, then, the best latency for all units on
the channel.

2.

If the fairness count for best latency across units
has expired, step one unit from where marker CDBCUN
(in the COB) points.
l

3.

If a unit's TWQ is empty, start positioning the
unit using the SCAN algorithm with read preference
(next higher numbered cylinder read request;
if
none, take next higher numbered wr i te request;
if
none, start algorithm over at lowest cylinder).
IORBs in the PWQ for the cylinder positioned to are
moved to the TWQ.
Note:
the
channel
can
simultaneously transfer data and postion units.

When a request has been chosen, start I/O.
If the primary command is active when the interrupt
comes in,
it is likely that there was a backup register
request which became the primary command when the request
(whose
interrupt
is
being
serviced)
was
finished
transferring. Moving the backup register command to the
primary command is done by the hardware if the backup
register has a command in it when the primary command
finishes.
When the routine that schedules transfers at
interrupt level sees that the primary command is active, it
looks for a transfer request in the TWQ whose sector address
is less than minimum latency;
if there is such a request,
it is stuffed in the backup register.

Starti ng I/O
The routine in offset CDSSIO of the channel
table is called to start I/O for the channel.

DT-l~

dispatch

«For Internal Use Only»

DIGITAL

TOPS-2 A MONITOR
PHYSIO - Disk/Tape

Interrupt Handling

All disk and magtape interrupts vector to the fourth
word of the channel's data logout area in the EPT;
this is
the vec~ored interrupt location, which always contains:
JRST 7,CDB -6

(where COB is that channel's COB).

This instruction stores the old PC and flags in the first
two locations and picks up the new PC from the next two
locations.
The PC picked up is COB-I;
the instruction in
this location saves AC 10 and then does a JSP l0,PHYINT.
Routine PHYINT does the standard pre-processing for disk and
magtape.
PHYINT calls channel-dependent code through offset
CDSINT of the channel dispatch table to analyze the cause of
the interrupt. The channel-dependent routine for RH20s is
RH~INT.
Lower level routines called by RH2INT (i.e., unit
dependent routines) return an argument in accumulater P4;
this argument is passed to PHYINT to indicate whether to
dismiss the interrupt (argument is zero), schedule another
channel cycle right away (argument less than zero) , or
housekeep the current request (argument greater than zero).
For example, the argument returned can have the following
meaning s:
1.

Request to dismiss (P4=0) -- the done
and the channel is not occupied.

2.

Request for immediate channel cycle
(P4 < 0)
positioning done interrupt has occurred and there
is no transfer in progress.

3.

Housekeep current request (P4 > 0) -- Transfer done
interrupt
occurred and transfer done requires
housekeeping before
another
request
can
be
schedul ed.

DT-ll

flag

is

on

«For Internal Use Only»

TOPS-2g MONITOR
PHYSIO - Disk/Tape

DIGITAL

DISK ALLOCATION

Data Structure (DSKBTTBL)
Each structure on the system has a
file, called
STR:DSKBTTBL,
containing
the
current
structure allocation information. This file is divided into
two parts.
The ,first portion holds a word containing a
count of free page~ for each cylinder on the structure. The
second portion has one bit for each page on the structure;
if the bit for a page is on, the page is free.
This file must be mapped into the monitor's address
space in order to allocate space on a structure. For Model
B processors using extended addressing, it is mapped into
section BTSEC (BTSEC = 4, currently) beginning at address 0.
For systems not using extended addressing, the bit table is
mapped into section 0 beginning at location BTB. The bit
table is mapped only when space is being allocated or
deallocated.

Space Allocation
The routine DSKASN in DSKALI allocates space on the
disk.
The caller can request a specific cylinder; when a
new page is allocated for an existing file, the caller
requests a page from the same cylinder that the last file
page was allocated from.
If a cylinder is requested, and no page is free on that
cylinder, this algorithm is used to select a page:

1.

Look for the next higher cylinder
unit.with any free page.

2.

If no page is found on this unit,
units in the current structure.

DT-12

on

the

step

current
to

other

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
PHYSIO - Disk/Tape

If no cylinder is requested, the search for a page to assign
begins at the cylinder number stored in location SDBLCA of
the SDB; this location contains the cylinder from which a
page was last allocated. The algorithm works as follows:
1.

Start with the last cylinder a
from (contents of SDBLCA).

page

was

assigned

2.

Look at it;s cylinder number (across all units)
for
at I east SDBMFP pag es.
(SDBMFP is in the SDB and
contains the minimum free pages below which DSKASN
changes
its
assignment algorithm.
SDBMFP is
initialized to the value stored in table MINFPG for
this structure's unit type.)

3.

If there are less than SDBMFP pages free on this
cylinder, increment the cylinder number and look at
that cylinder for SDBMFP pages across all units.

4.

If no cylinder has at least SDBMFP pages, choose
the cylinder with the most pages and set SDBMFP to
this value.

Once a cylinder is chosen, the count of free pages on
the cylinder is decremented in the first part of DSKBTTBL
and the bit for the chosen page is turned off.
DSKBTTBL
will always be updated before the index block of a file is
updated.

Space Deallocation
Routine DSKDEA is called to release a disk page.
The
bit is set to 1 for the page and its cylinder's free page
count is incremented.

DT-13

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
PHYSIO - Disk/Tape

Drum Allocation
Table DRMCNT has a one word entry for each cylinder in
the swapping space; table DRMBBT has one bit for each page
in the $wapping space. Location DRMFRE is the total number
of fre& pages on the swapping space. Routine DRMASN assigns
swapping space while DASDRM, de-assigns it.
Routine DRMASN, is called to assign a page anywhere on
the drum and DRMASA is called to assign a specific address.
DRMASN looks for the first free page of swap space,
beginning where a page was last assigned. The cylinder a
page was last assigned from is remembered in location
DRMBN0.
Routine DRMASA tries to assign the requested page;
if the page is not free, it gives an error return. For most
cases, DRMASN is the routine called to assign a page.
DRMASA is called:
for swappable monitor space when the
system is initialized, by GCCOR when it writes a group of
pages, and to mark bad spots in the swapping space (to keep
them from being allocated).

BAT Blocks
Any page in a bad spot on the disk is marked in the BAT
blocks and is also marked as assigned in the bit table for
disk or drum. When the disk is formatted,
the BAT blocks
are allocated and any bad spots on the disk at thi s time are
marked in the BAT blocks. If, at any later time, a page
gets a hard read or a hard write error, the file's FDB is
marked. When the page is released from the file, the page
is marked in the BAT blocks.
The channel-dependent routine also
records
error
information so that PHYINT can see if error recovery is in
progress or should be started.
If the 'interrupt is a positioning complete or transfer
done interrupt, the IORB is removed from the PWQ or TWQ and
the IORB is posted as done. If the interrupt is from a disk
unit and the backup register had a request, the backup
register request is serviced while the interrupt handling is
in prog ress.

OT-14

..• ~.J ~:.

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
PHYSIO - Disk/Tape
DISK DEPENDENT I/O

Data Structure

FILE WINDOW PAGE
All disk I/O is done by mapping a file page to or from
a virtual address space. The PMAP JSYS is the way a user
maps a file page. The sequential and dump mode JSYSs al so
use page mapping for disk I/O. However, this mapping is
invisible to the user. The page will be mapped through a
page called the file window page. There can be one file
window page per JFN.
File window pages are allocated in the JSB space, and
the address of a file window page is stored in offset FILWND
of the JFN block.
When the user executes an I/O JSYS
(sequential or dump mode) to a disk file, the data is moved
from the user's address space to the file window page (if
writing) or from the file window page to the user's address
space (if reading). When the window page is either full or
empty, it is unmapped and the next page of the file is
mapped.
If the file is being written, unmapping the page
insures that the updated information is on disk.
JFN BLOCK ENTRIES
FILBYT is the current byte pointer into the file window
page. FILCNT is the number of bytes left in the file window
page. FILCNT is decremented for each byte removed from the
file window page
(if reading) or added to the file window
page (if writing). When FILCNT goes to zero, the next page
of the file is mapped to the file window page. FILBYN is
the byte number of the last byte read or written. FILLEN is
the total length of the file in bytes. If the file is being
written and FILBYN becomes greater than FILLEN, .FILLEN is
set to FILBYN. The OFN of the current index block is stored
in the left half of FILOFN.
A long file is one with a data page whose page number
is greater than 777.
When a file is long it has a super
index block (also called a page table table).
This is
required because with only one index block, there are slots

DT-IS

«For Internal Use Only»

TOPS-20 MONITOR
PHYSIO - Disk/Tape

DIGITAL

for only pages 0-777. Note that a file can be long but have
only one page whose page number is greater than 777. When 'a
long file is open, the OFN of the super index block is
stored in ~he right half of FILOFN. FILeOD has the OFN of
index b~ock 0;
this is the unique identity ENQ/DEQ uses for
a file. When a short file goes long, index block 0 is used
because it is the only overhead page that is constant.
Index block 0 always exists for a file, even if there are no
pages in the file ~ith page numbers between 0 and 777.
The left half of FILLFW contains the count of pages
mapped.
The file cannot be closed until there are no pages
mapped. FILFDB has the address of the file's FDB, the
offset from the beginning of the directory.
DISK IORBS
Disk file data I/O requests use short IORBs.
A short
IORB is an entry in table eSTS. The offset into eSTS is the
physical core page that is to be read into or written out.
An entry in eSTS that is a queued IORB has the link to the
next IORB in the right half and status bits in the left
hal f •
( I n o t he r
wo r d s, ash 0 rt lOR B i s 0 ne wo r d long an d
has the same format as the first word of a long IORB.)
Status bit IS.SHT is on if the IORB is short. The parallel
entry in eST3 is the disk address to be read from or written
to.
Routine DSKIO creates short IORBs.
Index blocks and other disk pages that are not data
pages of a TOPS-20 file (such as front end file pages, and
home blocks) use long IORBs. Routine UDSKIO creates long
IORBs for disk pages. The DSKOP JSYS al so creates a long
disk IORB when necessary. See the tables descriptions for
the 1 ayout of along disk IORB.
Disk requests (IORBs) will always be for one page at

a

time.

Disk- Dependent Code
The disk-dependent code for sequential and dump mode
JSYSs is called through offsets in table DSKDTB. Each time
the file window page is full or empty (when FILCNT goes to
zero), the disk-dependent code is called to map a new page

DT-16

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
PHYSIO - Disk/Tape

into the file window page.
MAPPING A NEW PAGE INTO THE FILE WINDOW PAGE
A c'ombination of the following factors determines
happens when a new page needs to be mapped:
1.

The new page does or does not exist

2.

The user is reading or writing

3.

The file is long

4.

The file is going long

what

If the new page exists and is in the same index block
as the previous page, the new page is mapped and control
returns to the caller.
If the new page exists but is in a different index
block than the previous page, an OFN is needed for that
index block. The previous OFN is released and the new OFN
is stored in the left half of FILOFN.
If the new page does not exist, and the user is
reading, a private core page of zeroes is set up in the file
window page. The user will see data as zeroes when reading
from non-existent pages before the EOF mark.
If the new page does not exist, and the user is
writing, the directory's quota must be checked.
If the page
to be mapped is not in the same index block, an OFN is
needed for the index block. The OFN is stored in FILOFN and
the OFN previously in use is released.
If the file is going long,
a super index block is
created, an OFN assigned for the super index block and
stored in the right half of FILOFN, and the super index
block is mapped to a page of the JSB space with its mapped
address stored in the right half of FILLFW.

DT-17

«For Internal Use Only»

DIGITAL

TOPS-2eJ MONITOR
PHYSIO - Disk/Tape

Disk Interrupts
All disk and magtape interrupts vector to the fourth
word of the channel's data logout area in the EPTi however,
all dis~ and magtape interrupt handling begins at PHYINT (in
PHYSIO) •
See the PHYSIO section for a description of what
happens in the CDB before dispatching to location PHYINT in
PHYSIO.
After standard pre-processing, long disk IORBs
dispatch to UDIINT" the interrupt address set up in the
right half of offset IRBIVA in the IORB.
If flag IS.SHT
(short IORB) is set, go directly to SWPDON.
Since the
interrupt location cannot be specified for short IORBs, it
is defaulted to SWPDON.

Disk Errors and Abnormal Conditions
Before each transfer for a long disk IORB is started,
routine UDISIE is called to see if the unit is offline.
If
so, the transfer is aborted. This check is not made for
short IORBs.

DT-IS

«For Internal Use Only»

TOPS-20 MONITOR
PHYSIO - Disk/Tape

DIGITAL

MAGTAPE DEPENDENT I/O
The magtape device-dependent code is called through
offsets in table MTADTB;
each function has an offset in
MTADTB. ,

'Magtape Data Base
Of the several levels of magtape data base,
the
principle ones are for the MAGTAP and PHYSIO modules. The
MAGTAP data base looks at the world from a magtape drive
point of view and has tables with per-drive entries. The
PHYSIO data base works with disk and magtape I/O requests;
PHYSIO maintains the position and transfer wait queues and
schedules requests from them.
I/O requests for disk and
magtape have formats defined by PHYSIO; a request is called
an I/O request block, or IORB. A magtape IORB is built by
MAGTAP and passed to PHYSIO to be queued and scheduled.
There is also a small amount of data that must be maintained
for the channels, controller, and units.
MAGTAPE BUFFERS AND RELATED DATA BASE
For sequential I/O, buffers are built in the JSB space
of the job.
The buffer size is determined by the record
size the user has set at the time of the first read or
write.
For
record
sizes
larger
than
a
page, a
non-contiguous set of pages makes up the buffer.
Each
magtape unit has a list of buffer page pointers. The
maximum size of a record is 20 (octal) pages and there are
two buffers; therefore, the buffer page pointer list needs
40 (octal) entries. The buffers are built when the first
sequential I/O request is made.
Table MTANR2, indexed by uni t number,' has the address
of the list of buffer page pointers for that ,drive.
Table
MTANR3, indexed by drive number, has fields MTCUB
(current
user buffer)
and MTCSB
(current service routine buffer) •
Table MTANR4, indexed by drive number, has a
field MTCUP
(current user page) for storing the offset into the buffer
page pointer area.

DT-19

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
- Di sk/Tape

~PHYSIO

USE OF JFN BLOCK LOCATIONS
FILLEN is set to the number of bytes in a record
(the
record size).
FILCNT is set to the number of bytes in the
current ,page of the buffer (this will be less than a
full
page of bytes if the record size is less than a page or if
this is the last page of-the buffer and it is only partially
used) •
When FILCNT goes to zero, it is time to step to the
next buffer page or" if this was the last page of the
buffer,
read
~r
write
the
next
record.
The
magtape-dependent code i~ called whenever FILCNT goes to
zero;
it determines if it should set up the JFN block to
point to the next buffer page or, if this was the last page
of the buffer, step to the next record. FILLEN is the
number of bytes in" the whole record, so if FILBYN has
reached FILLEN, it is "time to step to the next record.
When the magtape-dependent code
returns
to
the
device-independent code:
FILCNT contains the number of
bytes in this buffer page, FILBYT is a byte pointer to the
beginning of this buffer page, and FILBYN is set to zero.
FILLEN is the number of bytes in the whole record.

Magtape IORB
Magtapes use long IORBs. These have a 7-word header,
followed by the number of hardware bytes in the record,
followed by the channel command list.

COB, KOB, and UDB
The Channel Data Block (COB) contains channel-dependent
information.
There is one COB for each channel. The six
locations immediately preceeding the COB for each channel
contain ~he' interrupt storage and vectors for the specific
channel.
(This is the space pointed to by the interrupt
locations in the channel logout area of the EPT.) The COB
contains status information, channel timers, error counts,
etc. See the table descriptions for a full breakdown of the
COB Table.
The Kontroller Data Block (KDB) exists only for TM02
tapes. The KDB contains MASSBUS addresses and the una table
for these units.

DT-20

«For Internal Use Only»

TOPS-20 MONITOR
PHYSIO - Disk/Tape

DIGITAL

The Unit Data Slock (UDS)
contains unit specific
information.
Among the data in the UDS are the error
counts, timers, and pointers to the units'
queued IORBs.
See the table descriptions for the specific contents of the
UDB.

Interface to PHYSIO
When a record needs to be read in or written out,
MAGTAP uses the IORB pointed to by field MTCIRB in table
MTANR4, indexed by drive number. The pages of the buffer
are locked in core and the physical page numbers of the
buffer pages are written into the left half of the MTBUF
entries.
MAGTAP then builds an I/O list in the IORS,
beginning at offset MTIRSL+l.
This I/O list is composed of
channel command words, or CCWs. MAGTAP then calls PHYSIO to
queue the request.

Magtape I/O Wait
If the other buffer is al so
queued
(that
is,
unavailable to the user to fill or empty), the process must
block. The process is put into balance set wait for a
maximum of 50 ms. A standard wait list test is also set up;
the blocking reason is the IORB number and the test routine
is MTARWT.
If 50 ms. expires before the record is ready,
the process is moved to WTLST.

CLOSF Device-Dependent Functions
When a CLOSF is issued for a
magtape,
several
device-dependent functions must be performed.
If the tape
is open for read, the tape is left positioned after the tape
mark.
If the tape is open for write, any partial buffers
are forced out, two tape marks are written,
the tape is
positioned between the tape marks, and any remaining IORBs
are fl ushed •

DT-21

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
PHYSIO - Disk/Tape

Magtape Interrupts
All disk and magtape interrupts vector to the channel's
data logout area in the EPTi however, interrupt handling
fo r bot.h disk and mag tape beg ins a t
location PHYINT
(in
PHYSIO).
See the PHYSIO description for an explanation of
how control passes from the EPT to PHYINT.
After standard
pre-processing, magtape interrupts dispatch to MTAINT, the
interrupt address ~et up in the right half of offset IRSIVA
of the lORS.
Routine MTAINT unlocks the buffer pages associated with
the IORS
(they are locked when the IORS is queued because
they must be in core for the data transfer).
It also checks
for errors and aborts any other queued IORSs for this drive
if there are errors.

Error and Abnormal Conditions
Before each magtape transfer is started, routine MTCHKA
is called to check if the abort flag has been turned on for
the IORB.
If the abort flag is on, the transfer is aborted.
MTCHKA is the address set up in the right half of offset
IRBIVA of all magtape IORBs.

DT-22

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
PHYSIO - Disk/Tape

MODULE TEST
When answering the lab exercises, write down the names
of the tables where you found the answers. The labs will
help you understand the monitor data base structure.
So
remember, where to look is more important than what you find
there.
The exercises marked with a double star (**)
are more
difficult and are optional.
If yo~ .have the time and/or
motivation, do them.
I/O - Magtape Dependent Data Base
Since there are not enough magtape drives to go around
for the whole class, this part of the lab uses a "set up
crash";
that is, while using a magtape and while the
monitor was in a desired state, the system was deliberately
crashed.
Tools
For the following exercises, use FILDDT on the crash
named TAPE.CPY.
For symbols, use the
monitor named BADBTB.CPY. For symbols, use the monitor
in the file R3-MONITOR.EXE.
Do
not
forget to set monitor context!

DT-24

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
PHYSIO - Disk/Tape

EXERCISES
1.

Find the location of each channel data block.

2.

Find the location of each unit data block.

3.

Which channel is each UDS associated with?

4.

How many units
are on channel 0?
l

5.

Which channels have disk units on them?

6.

Which UOSs are for
structure ps:? **

7.

Find the TWQ for unit 0 of the public structure.

8.

Find the UDS for MTA0:

9.

Were any magtape units in use at the
crash?

units

that

are

**

part

time

of

of

the

the

10.

Trace the TWQ for each disk unit.

11.

Trace the PWQ fO,r each unit of PS:

12.

Are there any long IORBs in the PWQ for
of PS:? **

13.

What routine is called to start I/O for a disk'
unit?
For a magtape unit? What module is each
routine in? **

DT-25

the

units

«For Internal Use Only»

TOPS-2eJ MONITOR
PHYSIO - Disk/Tape

DIGITAL

This page is for notes.

DT-26

«For Internal Use Only»

DIGITAL

TOPS-2~ MONITOR
PHYSIO - Disk/Tape

TEST EVALUATION SHEET
I/O Magtape Dependent Data Base
EXERCISES
1.

Which magtape drives are in use?
ANSWER: Table MTASTS, indexed by drive number,
contains a drive's status. When a drive is not in
use, its status is~.
Location MTINDX contains the
highest real unit number in the right h~lf.
MTINDX/ -7,,1
MTASTS/ 0
MTASTS+l/410000,,400000

2.

Are there any magtape buffers set up?
buffer si ze?

What is

the

ANSWER: Table MTANR2,
indexed by drive number,
contains the pointer to the buffer pages list.
If
the buffer is set up, the buffer pages list
contains the JSB space virtual address for the
ass i g ned pag es in the rig h t hal f 0 f e a c hen try 0 n
the list. The buffer size is in the right half of
MTANRl, indexed by drive nLUnber.
MTANR2+1/ 444400,,127325
127325/

674,,627~00

ipag e
ipage
ipage
i page
ipage
ipage
ipage
i page

/ 677,,630000
/ 700,,031000
/ 701,,632000

627 is a buffer
630 is a buffer
631 is a buffer
632 is a buffer

/ 0
MTANR1+1/ 10041,,1006

DT-27

i si ze is 1006

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
PHYSIO - Disk/Tape

Since the size is 1006, and since there are always
2 buffers assigned, pages 627 and 630 are for
buffer 1 and pages 631 and 632 are for buffer 2.
3.

Which pages of the JSB space are in use as
buffers?

magtape

ANSWER: As stated above, pages 627, 630, 631,
632 are iri use as magtape buffers.

4.

Are the pages locked in core?

and

**

ANSWER:
First find
the page's current storage
address;
if the page is in core, table CST1,
indexed by page number, contains the lock count.
MMAP+627/324007,,400
MMAP+630/324010,,400
MMAP+n31/324011,,400
MMAP+632/324012,,400

; mapped ind ir ec t
; thro ugh slot 7
;of the JSB map
; mapped ind irec t
; t h r 0 ug h s lot 10
;of the JSB map
;mapped indirect
; through slot 11
;of the JSB map
; mapped ind irec t
; thro ugh slot 12
; of the JSB map

JSB+7/124003,,1474

;page on drum

JSB+10/124003,,1510

; page on drum

JSB+l1/124000,,566

;page in core (so
;might be locked)

JSB+12/124003,,1520

; pag eon d r urn

CST1+5~6/

; lock count = 0

3,,1514

No page is locked in core;
core.

DT-28

only

one

page

is

in

«For Internal Use Only»

DIGITAL

5.

TOPS-20M ONITOR
PHYSIO - Disk/Tape
Which buffer and which page of the buffer
sequential I/O code currently using?

is

the

.

ANSWER: Table MTANR4,
indexed by drive number,
contaIns the IORB, if any, that the service routine
is using in the left half and the current user page
in the right half. The current user page is the
buffer page that the JFN block is currently moving
bytes to ,or from;
that is, the pag e of the buffer
the sequential I/O code is currently using.
MTANR4+1/ 127330

;this is the offset
;in the buffer pages
;list which contains
;the address of the
;current buffer page.

127330/ 701,,632000

;currently on page
; 632

Note that it is
buffer.
6.

the

second

page

Is there a queued magtape IORB?
transfer list for the IORB? **

of

the

second

If so, what is the

ANSWER: We need to look at the TWQ and PWQ for the
unIt;
table MTCUTB, indexed by drive number,
contains the unit's UDS address. The TWQ and PWQ
headers are in the UDS.
MTCUTB+l/555253,,555435

;555435 is
; the UDS for
;unit 1

555435+UDSPWQ/555463,,0

;this is an
;empty queue.
;When the
; queue is
;empty, the
;tail pointer
;points to
;the header
;itself.

555435+UDBPWQ=5554fi3

DT-29

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
PHYSIO - Disk/Tape

555435+UDBTWQ/555464,,0

; t his i sal so
; an empty
;queue.

555435+UDBTWQ= 555404
7.

What is the status of each magtape drive?
ANSWER: Table MTASTS,
contains the status.

indexed

MTASTS/ 0

; not in use

by

unit

number,

MTASTS+l/4l0000,,400000
OPN= 400000,,0
BUFA=100000,,0
MT%ILW=400000
Drive 1 is open, has buffers assigned, and is write
locked.

I/O - PHYSIO Dependent Data Base
EXERCISES
1.

Find the location of each channel data block.
Each channel data block is pointed to by
an entry in CHNTAB;
the offset from CHNTAB is the
channel number.
ANS~1ER:

CHNTAB/ 555007

/ 555253

DT-30

;address of CDB for
, ; channel QJ
;address of CDB for
;channel 1

«For Internal Use Only»

DIGITAL

2.

TOPS-20 MONITOR
PHYSIO - Disk/Tape
Find the location of each unit data block.
ANSWER: Beginning at offset CDBUDB in each COB,
there
is space reserved for pointers to the
channel's UDBsi there can be as many as eight
entries and if a channel has less than eight units,
those entries are 0.
If the channel has magtape
units, the pointer is to the KDB and the KDB points
to the ma9tape unit's UDBs.
555007+CDBUDB/ 555065
/ 555155

3.

555253+CDBUDB/ 555331

i
i

555331+KDBUDB/ 555365
/ 555435

iunB for MTA unit 0
iUDB for MTA unit 1

po inter to ROB
(channell)
iused for magtapes.

Which channel is each unB associated with?
ANSWER: Offset unBCDB of
unit's COB address.

each

555l55+UDBCDB/ 555007

UDB

->

555065+UDBCDB/ 555007

->

555365+UDBCDB/ 555253

->

555435+UDBCDB/ 555253

4.

iUDB for unit 0
UDB fo r un it 1

i

contains

the

share same COB

share same COB

->

How many units are on channel 0?
ANSWER: Two units because there
pointed to by channel 0's COB.

DT-31

are

two

UDBs

«For Internal Use Only»

TOPS-20 MONITOR
PHYSIO - Disk/Tape

DIGITAL

5.

**

Which channels have disk units on them?

ANSWER: Channel 0 has two disk units.
Each UDB
has a status word at offset UDBSTS with the unit
type in bits 31-35.
itype =

555065+UDBSTS/44004,,146

i

555365+UDBSTS/400002,,143

itype = 3

555435+UDBSTS/400102,,143

itype = 3

.UTT16= 3

iTlJ45

.UTRP6:;: 6

i RP06

We have two RP06s and two TU45s.
historical
reasons
the
TU45s
mnemonics!
6.

n

555155+UDBSTS/4004,,146

Which UDBs are for
structure PS:? **

units

that

type = h

Note
have

are

part

that for
TU1n-like
of

the

ANSWER: The structure data block has a list of
pointers to the structure's UDBs (for its upits)
beginning at SDBUDB.
STRTAB/ SDDBL0

iPS'S SDB

SDDBL0+SDBUDB/300000,,555065
/

7.

til

Find the TWQ for unit 0 of the public structure.
ANSWER: The previous question located the UDB for
unit 0 of PS: The TWQ for unit 0 begins at offset
UDB'IWQ.
555065+UDBTWQ/ CST5+647"CST5+647

DT-32

itai1"
ihead of
i un it's
iTWQ

«For Internal Use Only»

DIGITAL

8.

TOPS-20 MONITOR
PHYSIO - Disk/T~pe

Find the UDB for MTA0:
ANSWER: Table MTCUTB,
indexed by magtape unit
number, contains that unit's CDB address in the
left half and the unit's UDB address in the right
hal f.
MTCUTB/555253,,555305

9.

;CDB"UDB for unit 0

Were any magtape units in use at the
crash?

time

of

the

ANSWER: Table MTASTS, indexed by unit number, has
that unit's status. There are status bits to say
the drive is ·open, do ing a JSYS, etc.
; not in use
; not in use

MTASTS/ 0

/
10.

"

Trace the TWQ for each disk unit.
ANSWER: Each unit's TWQ header is at offset UDBTWQ
of the unit's UDB.
The queue is a linked list.
From previous exercises, we know that the disk unit
UDBs begin at 555155 and 555065.
555l55+UDBTWQ/ CST5+307"CST5+307

;onlyone
; pag e on queue
; it is pag e 307

CST5+307/400003,,0

; no nex t IORB

5550fi5+UDBTWQ/ CST5+647"CST5+647

;a1so
; page
;it is
;page

only one
on queue
core
647

CST5+647/400001,,0

DT-33

«For Internal Use Only»

DIGITAL

11.

TOPS-20 MONITOR
PHYSIO - Disk/Tape
Trace the PWQ for each unit of PS:
ANSWER: From previous exercises, we know PS:
has
only one unit whose UDB begins at 555065. A P"'TQ's
head er is at 0 ffset UDBPWQ.
555065+UDBPWQ/ CST5+670"CST5+513
CST5+513/400001"CST5+737
CST5+737/400001"CST5+717
CST5+717/ 400001"CST5+616
CST5+616/ 400001"CST5+622
CST5+622/ 400001"CST5+321
CST5+321/ 400001"CST5+551
CST5+551/ 400001"CST5+670
CST5+670/ 400001,,0

12.

;end of queue

Are there any long IORBs in the PWQ for
of PS:? **

the

units

ANSWER: No, there are no long IORBs.
If there
were a long IORB, it would be allocated from the
IORB pool and all the IORBs on the queue would be
in CST5.

DT-34

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
PHYSIO - Disk/Tape

13.

What routine is called to start I/O for a disk
unit?
For a magtape unit? What module is each
routine in? **
ANSWER:
To start I/O,
PHYSIO first calls the
channel-dependent level code in PHYH2i
this code
is dispatched to through offset CDSSIO in the
channel's
CDS
table.
This routine does the
channel-dependent functions and then dispatches to
unit-dependent code through the unit's UDS table at
offset UDSSIOi the UDS table for magtape is in
module PHYM2 and for disk, in module PHYP4. Table
PHYCHT contains the addresses of the
channel
dispatch
tables
for
each channel supportedi
currently, this is only RH2DSP for RH20s.
Table
PHYUNT has the dispatch addresses for all supported
unit typesi
in this monitor, RP4DSP
(for RP06s)
and TM 2DS P ( fo r mag tape) are 0 fin t ere st.
PHYCHT/l"RH2DSP

i
i

RH20 dependent
dispatch table

RH2DSP+CDSSIO/ JRST RH2SIO idispatch here
ito start I/O
i for a c ha nne 1 •
PHYUNT/ l"RP4DSP

iRP04/6 dependent
d ispa tch tabl e
iTM02 dependent
i dispatch table
i

4, ,TM2DSP

RP4DSP+UDSSIO/ JRST RP4SIO

idispatch here
ito start I/O
i fo r an RP04/6

TM2DSP+UDSSIO/ JRST TM2SIO idispatch here to
istart I/O
i fo r a TM02

DT-35

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
PHYSIO - Disk/Tape

This page is for notes.

DT-36

«For Internal Use Only»

TOPS-20 MONITOR
Front End/Terminals

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Front End/Terminals

COURSE MAP

MR-2717

FE-i

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Front End/Terminals

This page is for notes.

FE-ii

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Front End/Terminals

Front End/Terminals
INTRODUCTION - - - - - - - - - .
This module covers data flow between
the host processor and the front end in
terms of the DTE formats for the I/O.
Al~o
addressed 1's the terminal handling data base
and flow both within the host processor and
the DTE. This module covers the -10 side of
these transactions in depth. The processing
within the -11 is not addressed here.

FE-l

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Front End/Terminals

- - - - - LEARNING OBJECTIVES - - - - - - Upon completion of
,student will be able to:

this

module,

three

the

1.

Describe the format of the
of DTE transfer packets.

types

2.

Identify the portions of the terminal
data base in terms of the tables and the
routines effecting terminal I/O.

3.

List the modules used to configure the
monitor for terminal I/O with a given
system.

- - - - - - - - RESOURCES - - - - - - - - .

1.

Monitor Tables

2.

Micro-fiche of the Monitor

FE-2

«For Internal Use Only»

TOPS~2~ MONITOR
Front End/Terminals

DIGITAL

MODULE OUTLINE

Front End/Terminals
I.

II.

TTY/PTY Device-Dependent Code
A. TTY Data Base
B. TTYIN - TTY-Dependent Input
C. TTYOUT - TTY-Dependent Output
D. TTCH7 - 2~ ms. Overhead Task
DTE
A.
B.
C.

Device-Dependent TTY Code
DTE Data Base
DTE Terminal Output
DTE Interrupts

FE-3

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR

Front End/Terminals

This page is for notes.

FE-4

«For Internal Use Only»

DIGITAL

TOPS-2~ MONITOR
Front End/Terminals

TTY/PTY DEVICE-DEPENDENT CODE
The ter~inal device-dependent code is called for each
character for TTYs and PTYs from the JSYS level code. The
device-dependent code exists on several levels;
the first
level
1S dispatched to via the dispatch tables TTYDTB for
TTYs and PTYDTB for PTYs. Calls to subsequent levels come
from the current level.
This code is fnitially dispatched to through offsets in
TTYDTB for input and output.
The TTCH7 code is called
cyclically from the scheduler overhead cycle;
the TTCH7
routine moves characters from BIGBUF to their respective
line buffers.

TTY Data Base
DEVICE TABLES AND DEVICE DISPATCH TABLES
Table TTLINV contains
the
addresses
of
the
device-dependent dispatch tables for each type of line that
can be supported by a TOPS-2~ monitor.
TTLINV: TTFEVT
TTMCVT
TTPTVT
TTDCVT
TTNTVT
TTDZVT

--console front end lines
--MCB lines (not used -- future table for
command terminal support on DECnet nodes)
--PTY lines
--DC10 lines (not used -- historical)
--network virtual lines
--DZll lines

A subset of the dispatch tables will exist for a particular
hardware
configuration.
Here is a list of standard
configurations and the dispatch tables that would exist for
such configurations:
2040 or 2050 -- TTFEVT and TTPTVT
2020 -- TTDZVT and TTPTVT
ARPA net system -- TTFEVT, TTPTVT and TTNTVT
Each entry of a dispatch table is the transfer vector of a
particular line-type-dependent function. Each function has
the same offset into each dispatch table.
Each line type
that does not exist in a monitor will dispatch through a

FE-5

«For Internal Use Only»

TOPS-20 MONITOR
Front End/Terminals

DIGITAL

dummy vector table called TTDMVT, with its table name set
equal to TTDMVT. Entries in that table return immediately,
give an error, or bughal t, depend ing on the function.
DATA BASE FOR EACH LINE
Tables indexed by line number (resident tables):
TTSTAT - fl~gs and line type (offset into TTLINV
table)
TTCSAD - address of special request routine
TTCSTM - time to call special request routine
Tables indexed by line number (non-resident tables):
TTSPWD - input and output line speed
TTACTL - address of dynamic data for line
Dynamic data block for each line:
The dynamic area is created for a line when it becomes
fully active. The dynamic area length (TTDDL2 = 26 (octal»
contains items such as:
number of input and output buffers for the line
number of characters in input and output buffers for
the line
terminal data mode
byte pointer for removing/adding a character from/
to an input or output buffer
terminal characteristics
Sometimes, output needs to be sent to an inactive line,
as in one of these cases: a send-all message, "Logging in
on local terminals is not allowed", or sending a "ding" when
any character but CTRL/C is typed on an inactive line.
There are two shortened forms of the dynamic data block that
are built for these cases:
send-all block and message
block. The send-all block is the smallest block; it is not
used on KL systems because the front end does the send-all.
This block is used on the 2020.

FE-6

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Front End/Terminals

Line buffer allocation:
TTFREB TTFREC TTSIZ

head of free list for TTY buffers
free buffer count; initialized to NTTBF =
214 (oc tal)
- 20 (octal) buffer size

Input and output buffers for each line:
When buffers aCre needed, they are assigned
from the
free list TTFREB. Each of these buffers is 20 (octal) words
long.
Routine TTGTBF assigns the requested number of
buffers and links them circularly, (that is, the last buffer
points to the first).
The dynamic data block for
the line
points to the first buffer and also has a byte pointer for
the current character.
The
output
buffer
contains
characters to be echoed as well as output characters.
Currently, two input buffers and two output buffers are
assigned for each active line;
that is, a line's output
buffer consists of two buffers assigned from TTFREB and a
line's output buffer consists of two buffers assigned from
TTFREB.
Each character is stored in a
9-bit
byte;
therefore, four characters are stored in each word.
Several fields in the dynamic data block for a line are
used
for byte pointers into the line buffers and as
character counts in those buffers. The dynamic data block
fields relevant to line buffers are:
TTNIN /
TTNOU /
TTOCT /
TTOOUT

/

TTOIN /
TTICT /
TTIOUT /
TTIIN /

count of input buffers
count of output buffers
number of characters in output buffer
byte pointer for removing characters
buffer
byte pointer for adding characters to
number of characters in input buffer
byte pointer for removing characters
buffer
byte pointer for adding characters to

from output
output buffer
from input
input buffer

TTYIN - TTY-Dependent Input
This is the routine for handling BIN, SIN,
an~
SINR
JSYSs.
TTYIN is the dispatch address in TTYDTB + BIND.

FE-7

«For Internal Use Only»

TOPS-20 MONITOR
Front End/Terminal s

DIGITAL

The code first translates the JFN, TTY device number,
or -1 (implies the controlling job's terminal), to an actual
line number and checks if it is legal for this process to
read from the line. If not, an error is returned.
At this point, one of three choices is made:
1.

If the user just issued a BKJFN,
char acter.,

2.

If the terminal is set for
for binary input at TCIB.

binary

3.

If the terminal
dis pa tc h to TC I •

set

is

not

repeat

for

mode,

the

last

dispatch

binary

mode,

Routines Tel and TCIB both pick up the next character
from the input buffer if there is one.
If there is no
character in the input buffer, the process is blocked with
an MDISMS.
The MDISMS code adds the fork to TTILST with
test data equal to the line number and test routine set to
TCITST.
If the process goes into TTY input wait, when it wakes
up will be determined by its wake up class. The decision to
wake up the process is made when characters are being moved
from BIGBUF to their individual line buffers. See the
section on TTCH7 for more detail s.
If deferred echoing is in effect, the character
is
echoed now
(that is, as it is removed from the line buffer
and read by the pr 0 c e s s) if i t ha s no t a l read y been ec ho ed •
Each character in the input buffer has a flag indicating
whether or not it has been echoed;
this flag is TTXECO and
is on if the character has been echoed. The character will
already have·been echoed if immediate echoing is on, or,
in
the case of deferred echoing, if the line was in TTY input
wait when the character was moved from BIGBUF to its line
buffer.
Binary
mode does not echo.
Therefore, the
character is echoed at the time the character is read from
its input buffer only if echoing is on and if the TTXECO
fl ag fo r the character is not 0 n.

FE-8

«For Internal Use Only»

TOPS-20 MONITOR
Front End/Terminals

DIGITAL

If an echo is needed, the character is sent by placing
it in the line's output buffer, as with any other character
to be output to the line. Deferred echoing assures a clean
typescript, that is, characters are not added to the output
buffers.unless the line is in input wait or the process is
reading characters from the line buffer. Therefore, echoed
characters will not be scrambled with output.
Some characters are treated specially. For example, if
the character being read is a carriage return, it is echoed
as a carriage return and a line feed. The TTYIN code also
handles such things as raising the case of the character
before echoing it if terminal-raise is set.
If the character picked up from the input buffer is an
enabled interrupt character, the character is flushed and
the code tries again for the next character.
An enabled
interrupt character is one of the class of characters (such
as control characters) that a process can enable a software
interrupt on; when an enabled interrupt character is typed,
the process gets a software interrupt.
In the case of
interrupt characters, the interrupt is initiated at the time
the character is moved from BIGBUF to its line buffer.
An XOFF or XON will be sent to the line if necessary.
The XOFF is sent a few characters before the input buffer is
full.
It is an undefined condition to have more than one fork
of a
job in TTY input. wait at any given time.
It is
impossible to determine which process will receive the
character.
If this situation occurs, however, the conflict
is resolved as follows:
all forks in TTY input wait that
are inferior to the fork receiving the character are halted;
all forks in TTY input wait that are not inferior to the
fork receiving the character are put in fork wait.

TTYOUT - TTY-Dependent Output
This is the dispatch address in offset BOUTD of
for SOUT, BOUT, and SOUTR JSYSs.

TTYDTB

First, determine if the terminal is in binary mode. If
it is, transfer to TCOB;
if it is not, transfer to TeO.
Routine TCOB does not use the eeoc (control character output

FE-9

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Front End/Terminals

control) words for control character translation.
Each terminal has two control character output control
words. Each word consists of 2-bit bytes, one byte for each
of the control characters (ASCII codes 0-37). The bytes are
interpreted as follows:
00:
01:
10:
11:

ignore (send nothing) for the character
ind icate by X (where X is the character)
send actual code to terminal
simulate format action for character

The terminal data mode may be set so that the CCOC words are
used:
1.

For both echoing and output (the normal mode)

2.

For neither echoing nor output (binary mode)

3.

For echo translation only

The CCOC words themselves can be set for the translation
each character for ASCII codes 0-37.

of

Routine TCO must first check the data mode of the
terminal.
If
the
data mode is set for no output
translation, routine TCOY is called to output the actual
character code.
If the character code is not between 0 and 37, TCOY
called to output the character directly.

is

If the character is between 0 and 37, several more
checks must be made to determine what to do. If the
character is an escape, it is handled as a special case:
if
the corresponding CCOC byte is equal to 01, send A[;
if the
CCOC byte is' equal to 11, send a $;
if the eeoc byte equals
00, flush the character, and if 10, send the character.
If the ccoe byte for the
character is flushed;
that
terminal.

character is a zero, the
is, nothing is sent to the

If the CCOC byte for the character is 01, the character
is converted to its printing equivalent (i.e., AX) and TCOY
is called to print the
first and then the X.
A

FE-10

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Front End/Terminals

If the CCOC bits for the character are set to 10
(send
actual character)
or to 11 ( simulate format action), call
TCOY to output the character. In simul ating format action,
device-dependent code for the terminal type will be called
(according to the hardware terminal characteristics).
For
example, a form feed is handled differently on a VT50 than
on an LA36.
The code beginning at TCOE is also called for echoing a
character.
TCOE 'will be called from Tel or TTCH7 (the
overhead cycle task to move characters from BIGBUF to their
individual line buffers), depending on when the character is
echoed.
TCOY
Routine TCOY is the second level TTY device-dependent
routine.
It handles a device's idiosyncracies and spacing
(e.g., adding a CRLF sequence if at right margin).
Here,
also, lower case is converted to upper case for terminals
that do not support lower case and
is placed in front of
the
character
if
the
character is upper case and
terminal-indicate is turned on.
A

Special characters such as form feed or tab are handled
based on the terminal characteristics by dispatching through
table CHITAB. Also, any necessary padding is done here.
TCOUT
TCOY calls
TCOUT,
which
is
the
third
level
TTY-dependent output routine. TCOUT handles the parity bit
by dispatching through offset TTVT12 of the TTXXVT table for
terminal type XX.
If the line is currently linked to another terminal,
routine TTLNK3 is called to output the character to the
other terminal as well.
If output is currently
output is to be discarded.

control

FE-II

Oed,

return

because

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Front End/Terminals

If there is no room in the output line buffer for this
character, set up a scheduler test of line-number" TCOTST
and give an error return. The calling code will MDISMS and
put the fork on WTLST. The fork will become runnable again
when the characters currently in the output buffer have been
sent to the terminal. WTLST is checked for processes that
have become runnable in one of the long cycle tasks.
If there are no output buffers for the line, routine
TTGTBF is called to assign two output buffers for the line.
, The character is then stored in the output buffer using
the byte pointer-in offset TTOOUT of the line's dynamic data
area and the count of characters in the output buffer
is
inc remented.
If output is not active on the line, routine STRTOU is
called to start output. This routine dispatches through the
TTVT13 offset of the TTXXVT table where XX is the terminal
type.
Terminal type:

Dispatch address in TTXXVT+TTVT13:

TTFEVT

STRT01 -- calls DTESRV to send the
character out to the
line. See section on
TTFEVT functions.
STRT02 -- converts internal line
number to PTY number.

TTPTVT

TTCH7 - 20 ms. Overhead Task
TTCH7 moves characters from BIGBUF to their respective
line buffers.
Characters are added to BIGBUF at interrupt
level by either the DTE
interrupt code for systems with
front end lines, or,
for the 2020, by the DZ11 interrupt
code. For systems using RSX20F front end lines, the DTE
transfers packets of characters to BIGBUF from the front
end.
For 2020 systems, the characters are added to BIGBUF
one at a
time when the interrupt from the character is
handled.

FE-12

«For Internal Use Only»

DIGITAL

TOPS-2 A MONITOR
Front End/Terminals

~n entry in BIGBUF is one word with the line number
in
the left half and the character in the right half. Cell
TTBIGC contains the count of characters currently in BIr,BUF.
TTRIr,O has the address of the next character to be removed
from BIGBUF.

Routine TTCH7 is called cyclically from the scheduler
overhead cycle, currently during the short clock cycle.
If TTBIGC, the count of characters in BIGBUF, is
non-zero, pick up the next entry from SIGBUF using pointer
TTBIGO. This will be an entry in the form line number"
character.
Decrement
TTBIGC, which is the count of
characters in AIGBUF.
Dispatch
through
offset
TTVT2n
of
TTXXVT
line-type-dependent table, where XX is the line type. These
routines return immediately for all supported line types and
it exists for historical reasons only.
Some entries in BIGBUF may not be characters destined
for input line buffers.
Such entries will have the line
number in the left half and either flag TTOIRQ, DLSRCF, or
DLSCXF in the right half.
These entries are placed in
BIGBUF to flag conditions that are noted at DTE interrupt
level but cannot be handled due to interrupt routine time
constraints. If flag TTOIRQ is on in an entry, the line's
output buffer was emptied and the process has asked for an
interrupt when the output buffer became empty.
When this
type of entry is picked up from BIGBUF, a software interrupt
for terminal code .TICTO is generated for the process. Flag
DLSXCF indicates carrier transition was noted; flag DLSRCF
is ignored. After handling anyone of these conditions,
loop back to TTCH7 for more characters.
If the entry picked up from BIGBUF is an input
character, call routine TTCHI to place the character in the
appropriate line buffer. TTCHI will initiate an interrupt
if the character is an enabled interrupt character, echo the
character if appropriate, and wake up the process if it was
in TTY input wait and the character is in the wake up class
set for the terminal. After returning from TTCHI, loop to
TTCH7 for the next character.
If there are no more
characters, control will transfer to TTCH7X to handle any
special line requests.

FE-13

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Front End/Terminals

When BIGBUF is empty, cqntrol is transferred to TTCH7X
and if there are any special requests queued, they are
handled here.
If there are any requests, cell TTQCNT will
contain the count of requests. Special requests are set up
for front end lines, primarily when the buffer space for TTY
packets is full.
For the 2020, the queued requests will be
checking for data set line conditions, such as carrier on.
Requests are handled for a maximum of eight lines
beginning with the line number in TTCQLN. Routine DOLINE is
called to handle each line's request.
The
requested
function's routine address is in field TROUT of offset
TTCSAD in the line's dynamic data block. The function may
have a designated time at which it is to be performed;
the
time is stored in the parallel table TTCSTM.

FE-14

«For Internal Use Only»

DIGITAL

TOPS-2~ MONITOR
Front End/Terminals

,DTEQS IS A TABLE CONTAINING THE QUEUE HEADER FOR
EACH DTE. DTEQS·+ DTE NUMBER IS THE QUEUE HEADER
FOR A PARTICULAR DTE.
DTEQS + DTE NUMBER:

TAIL POI~TER"HEAD

LINKED LIST OF
PACKETS QUEUED TO
SEND OVER THE DTE-2~.
IF THE PACKET'WAS BUILT
BY DTEQ, IT MUST BE
RE-FORMATTED BEFORE
SENDING.
DTSNGL PACKETS
CONFORM TO
RSX2~F PROTOCOL.
M8 0263

Figure FE-1. DTE Packet Queue

FE-IS

«For Internal Use Only»

~~

JllREil.~MJ.!I.TI-C!iI\BSI) PACKET

SNGPK 1 II ND 2:

15 16

I

FUNCTION

CNT

HDCNT

t-3

HDFNC

PACKET BYTE
CNT

HDDEV
SPARE

DEVICE

H
G)
H

16
PKTADR:

PACKET BYTE

tj

[PTR TO DATA GIVEN
SEPARATELY TO DTE]

(UP TO 6)

J:=o'

FUNCTION

~

HDSRR
DEVICE

SPARE

HDLlN

#

DATUM

LINE

#

DATUM

LINE

#

DATIJM

LI NE

#

DATUM

LINE

#

DATUM

LINE

#

DATUM

LINE

LINE

I'%j
t%j

I
~

~

~

DIRECT (SINGlE CHAR )* PACKET

~

/\
/\

d
1"'1

PKTADR:

15 16

IHDCNT

35

DATA

1 HDFNC

PACKET BYTE
CNT

FUNCTION

I HDSRR

HDDEV

SPME

DEVICE

H

31 32

TTY'S
OUTPUT BUFFER

::s

rt

CD
1"'1

::s

M8 0303
HDLlN
LINE

HDDAT

#

DATUM
(CHAR, )

I-'

en
CD

*SINGLE CHARACTER PACKETS WILL ONLY BE SENT WHEN
THE TWO PACKETS, SNGPKI AND SNGPK2 ARE FULL OR
UNAVAILABLE OR WHEN THE TTY'S OUTPUT BUFFER HAS
ONL Y 1 CHARACTER,

o

'<
V
V

o

0,'
,N
t-3~

CD

1"'13:

30

::s

I-'

o

::J
rtt-3
t:tl'"O
::SCJl

OJ

c:::

..,

I'%j

-

....·z

Figure FE-2. Packet Types Sent Over DTE (RSX20F Protocol)

::JH

OJt-3

1-'0
cn::O

-DIGITAL

TOPS-29 MONITOR
Front End/Terminals
DTSNGL QUEUED PACKET

a
SNGPK1/2: [ _ _

,

DOES NOT NEED
REFORMATTING.
QUEUED OVER
DTE FROM HERE

-.:~~

n~

~

L!:E~:!~~~J]NOT

___

o~--'------r=:.--------15 16
31 32 35
f....
PACKE~2:~TE CNT

.

* FLAGS

I NO I CATE WHETHER
THE PACKET IS FULL,
AVA ILABLE, OR ALREADY
LINKED ON QUEUE.

FUNC.=.DFHLC

'DEVICE

SPARE

l'

LINE

# I

BYTE

LINE

# I

BYTE

LINE

# I

BYTE

LINE

# I

BYTE

LINE

# !

BYTE

LINE

# I

BYTE

TRANSFER ED OVER THE DTE

;,

"
THE LINK WORD AND THE REMAINDER CF THE PACKET ARE CONTIGlXlUS.
f'f6

FORMAT OF PACKET
LINKED ON DTE
QUEUE IN COMQ
AREA.
NEEDS REFORMATTING
TO RSX2,iJF PROTOCOL

DTEQ QUEUED PACKET
1718
QINT
QLlNK
POSTING ROUTINE
LIN~ TO
NEXT PACKET
ADDRESS
QFNC
FUNCTION

QDEV
DEVICE CODE

QLlN

QMO]QCNT
IJ/1
BYTE/IJ/
BYTE CNT.

LINE

~

#

35

IQPNTR BYTE PTR FOR INDIRECT PTR.

- OR - LO-CAL- CHAR :-ii QC~T--HoLDs- ;-- ~

TH I S CASE I S NOT USED FOR TTY I S

QCOD
UNIQUE CODE RETURNED
TO INTERRUPT ROUTI NE

"
CASE 1
DIRECT PACKET FORMAT
QINT
QLINK
TTYINT
LINK
QFNC

QDEV
• FEDLS/. FECTY

.DFHLC
QLlN
LINE

#

IJI

TRANSFORMED
TO RSX2f6F
PROTOCOL

12 8
HODEV
.FEDLS/
.FECTY

f6

,

.DFHLC
HDSRR
SPARE

HDL~4HDOAT

8 BIT CHARACTER
QCO!)

HDFNC

HDCNT

LINE

UNIQUE CODE RETURNED
TO INTERRUPT ROUTINE.

CHAR

CASE 2
INDIRECT PACKET FORMAT
QINT
QLINK
TTYINT
LINK
QDEV
• FEOLS/. FECTY

QFNC
.DFHSD
QLlN
LINE

#

1

IQCNT
BYTE CNT

QPNTR

TRANSFORMED
TO RSX2J/JF
PROTOCOL

c:t>

9-BIT BYTE PTR TO CHARS

UT,( OCOO

TTOUT/OUTP
BUF PTR

.

f6

f6

B

A

R

HDFNt.
.DFHSD

HODEV
• FEDLS/
.FECTY

HDSRR
SPARE

1fl.1~I~T

LINEdirYT.fo
# BE SENT

UNIQUE CODE RETURNED
TO INTERRUPT ROUTINE.

F

HDCNT
12 8

···

M8 0295

Figure FE-3. DTE Packets

FE-17

«For Internal Use Only»

DIGITAL

TOPS-2" .MONITOR
Fro nt End/Term inal s

DTE DEVICE-DEPENDENT TTY CODE
For front end lines, characters are assembled as
packets and tranferred over the DTE.
For output, packets
consist.of characters from output line buffers to be sent by
the front end to the terminal lines. For input, the front
end gathers characters from the terminals, sends them over
the DTE, and the DTE interrupt code places them in BIGBUF.
TTCH7, one of the 20 ms.
scheduler tasks, moves the
characters from BIGBUF to their line buffers, as described
in the section above.

DTE Data Base
Data is sent across the DTE in packets composed of
header or overhead
information, and the characters to be
transferred. Packets may be either direct or indirect.
If
the header block is followed immediately by the characters,
the packet is a direct packet.
If the header block and
characters are not contiguous, the packet is an indirect
packet.
.
When a packet is sent to the front end, its header will
always have the following format:
HDCNT - count in bytes
HDDEV - device
HDLINIHDDAT

or

HDFNC HDSPR

function

-

spare

HODTl

Some packet headers need to be reformatted to conform to
RSX20F protocol before they are sent. All packets queued by
the routine DTEQ need reformatting, but packets queued by
DTSNG L do not.
Each DTE has a transfer wait queue.
The header for
each queue is in table DTEQS and the header for a particular
DTE is in DTEQS, indexed by DTE number.
Each DTE queue
header word has this format:
tail pointer"head pointer

FE-18

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Front End/Terminals

The queue is a linked list and the first word of each packet
contains the link to the next packet (or a 0 if the packet
i s 1 as ton t he que ue) •
NoW, we will look at how TOPS-20 initiates
OTE
transfers for TTY output, and later, at the interrupt code
that fills BIGBUF.

DTE Terminal Output
Three different data structures, or packets, are built
to transfer characters from an output line buffer over the
DTE to the front end. The type of packet used depends on
whether the line has output that is currently actlve (i.e,
output queued or being transferred to the front end by the
DTE) and whether there, are any packets available for use.
If the line currently has no active output, routine
STRTOI will call OTSNGL. DTSNGL has two standard packets
that it fills and queues;
their purpose is to start I/O for
lines which are inactive. These standard packets have the
format shown above.
(See DTSNGL Queued Packet.)
If there is no room in either of DTSNGL's standard
packets,
routine DTEQ is called to build a packet for that
single character. This packet has the format shown above.
(0 i rect Packe t Fo rma t)
If DTEQ is unable to get space for a packet, and cannot
block to wait for the space, a request to have the packet
built later is set up. Blocking is not possible for one of
the following reasons:
1.

The process is NOSKED

2.

The'request to queue the packet
task)
sched ul er (TTCH7 20 ms.

was

made

by

the

3.

The request to queue the packet
interrupt level

was

made

at

DTE

When the TTCH7 task has finished emptying BIGBUF,
it
services special requests for terminal lines; a maximum of
eight requests will be serviced in one call to TTCH7.
A
special line request is made by storing the address of the

FE-19

«For Internal Use Only»

TOPS-20 MONITOR
Front End/Terminals

DIGITAL

routine to be called in table TTCSAD (indexed by line
number) the time to call the routine in TTCSTM (also indexed
by line number) and incrementing TTQCNT, which is the count
of special line requests.
When a packet for a front end line cannot be queued
because there is no packet space, a special line request is
set up for that line. TTSN10 is the routine address stored
when the request is to queue the packet;
this is the only
type of special request made for a front end line.
TTCH7
calls the routine TTSN10, which tries to get packet space to
queue the packet. DZ11 lines
(on 2020 systems)
use the
special request mechanism for carrier off line and other
related conditions handled by the front end on systems with
a front end.
Once a line has been activated by one of the methods
above
(i.e., the first character has been output), the
TTYINT routine, which is called when a DTE transfer done
interrupt occurs for a TTY packet, will queue the next
packet for the line if there are any characters in the
line's output buffer.
If the packet whose transfer was
completed was a DTSNGL packet, TTYINT will be called for
each line that had a character in the packet. If there are
at least two characters in a line's output buffer, TTYINT
will call DTEQ to build a string data packet. String data
packets are indirect packets and have the indirect packet
format.
String data packets hold a maximum of 40 (decimal)
characters;
this limit is imposed by RSX20F buffer space.
Note that the packet built is an indirect packet. The
characters will be in the line's output buffer and the
packet header byte pointer will point there.
The normal sequence of events for a line that is
output is:

doing

1.

The' line buffers are assigned only while they have
characters in them;
therefore, the first two
output line buffers must be assigned.

2.

The FIRST character is queued via DTSNGL.
This
will add the character to one of DTSNGL's standard
packets. TTOTP in the line's dynamic data block is
set to indicate the line is active.

FE-20

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Front End/Terminals

3.

When t;he transfer done interrupt occurs, TTYINT
will pick up any characters in the line's output
buffer and call DTEQ to build a string data packet
for the characters.
NOTE ----------------------~

TTYINT is ~alled for each line that has a
9haracter
in
the
DTSNGL
packet;
therefore, a packet is built and queued
for each line (if it has characters to
output) •
4.

Each time a transfer done interrupt occurs, TTYINT
will build an indirect (string data) packet for the
line if there are at least two characters in the
line's output buffer.

5.

If there is only one character in the line's output
buffer, DTSNGL will be called to add that character
to one of its standard packets. This is done to
keep to a minimum the number of single character
packets that are sent.

6.

If the line has no characters, its state is changed
to inactive. Flag TTOTP indicates whether or not a
I ine is active.

7.

The line is now inactive and the output buffers are
released.
When there is a character for the line,
the output buffers must be allocated and the line
must be reactivated as described before.

A TTOTP' flag indicating that a line is active means
that at the time a character is added to the line buffer,
there is no need to worry about getting the character out
because the TTYINT routine will queue another packet when
the currently active packet for the line gets a
transfer
done interrupt.
Note that DTEQ called to send a single character
(because the DTSNGL standard packets are full) is really a
special case of the usual call to DTEQ by TTYINT; that is,

FE-21

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Front End/Terminals

all calls to DTEQ will construct a packet with characters in
it for a single line.
If only one character is being sent,
DTEQ will use a direct packet;
if multiple characters are
being sent, an indirect packet is built.
If a character is being echoed from TTCH7, and the line
must be activated, and if there is no room for the character
in one of the DTSNGL standard packets, DTEQ is not called.
Instead,
a special
request is added to the queue that is
examined when TTCH7 has finished emptying BIGBUF.
When TTYINT sets up a string data packet for DTEQ,
it
will
never send beyond an escape character. An escape
character is a a 9-bit byte with its high order bit on. The
only defined escape character right now is stop output,
which is used for terminal page (so it will not output more
than one screen at a time). Routine FNDEND is called to
scan the output buffer, and if an escape character is found,
only the characters up to the escape character are sent in
this packet.
If the next character in the output buffer
is
the
stop
output
escape character, output cannot be
reactivated until a CTRL/Q is typed by the user.
TTYINT will be called for all TTY output transfer done
interrupts.
It is set up in the packet as the posting
routine to calIon transfer done.
If the packet was queued
by DTEQ,
there will always be a posting routine address in
the left half of the first word of the packet;
the posting
address is passed to DTEQ by the caller. DTSNGL character
packets also call TTYINT, although TTYINT is not set up in
their packet header as the routine to call.
If the two
high-order bits in the first word of the packet are on, the
packet is a DTSNGL,
and TTYINT is called as the posting
routine.
TTYINT will call DTEQ to send the characters, if there
are at least two.
If there is only one character, TTSND is
called which, in turn, calls DTSNGL to add the character to
one of its standard packets.
All packets, whether TTY output or line printer output,
are put on queue DTEQS.
Each DTE has its own offset into
the queue. Routine DTESKD is called to start the transfer
on the top packet in the queue, which is the active packet.

FE-Z2

«For Internal Use Only»

DIGITAL

TOPS-2~ MONITOR
Front End/Terminals

DTSNGL packet headers and DTEQ packet headers do not
have the same form~t. DTSNGL builds packets that conform to
queued protocol, while the packets built by DTEQ must have
their headers re~formatted to conform to queued protocol.
Routine,DTESKD takes the top packet from DTEQS, re-formats
it if it was built by DTEQ, and sends it to the DTE. DTESKD
knows the packet is a DTSNGL packet if bits ~ and 1 of the
first word of the packet are on; a DTSNGL packet is sent as
it is.

DTE Interrupts
All DTE interrupts come to INTDTE. This routine checks
the reason-for the interrupt and dispatches on type:
1.

TOl~DN

2.

'DINGME

3.

TOllDN

TO-l~
l~

transfer done (input)

doorbell

TO-II transfer done (output)

10 TO 11 TRANSFER DONE INTERRUPT (OUTPUT)
TOllDN will be called when a transfer over the DTE to
the 11 is complete;
that is, when an output request
finishes. There are two basic tasks to be completed in this
case:
1.

Schedule the next DTE transfer

2.

Post the packet

Routine'DTESKD schedules 10 to 11 DTE transfers.
The
first entry in a DTE's queue will be sent.
(This will be
the entry pointed to by the right half of DTEQS, indexed by
DTE
number.
Remember
that
the
DTE
can transfer
simultaneously in both directions, so it will not be busy in
the to 11 direction when DTESKD is called.)
The packet header will have the name of the posting
routine to call
(in offset QINT)
unless the packet was
queued by DTSNGL. For TTY output, this will always be set

FE-23

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Front End/Terminals

up to TTYINT.
The posting of TTY packets includes some
housekeeping and queuing of other packets that need to be
sent for the line (or lines) in the packet whose transfer
was just completed.
Housekeeping
means
updating
the
relevant
data
structures to say the data has been successfully sent. In
the case of TTY transfers, this means updating the count of
characters in the line's output buffer (field TTOCT in the
line's dynamic data block) , updating the byte pointer to
take characters from the output buffer (field TTOOUT in the
line's dynamic data block), and,
if there are no more
characters in the output buffer, setting the line to
inactive (field TTOTP set to zero).
If the output buffers
are empty, they are released at this time.
If there is only one character in the output line
buffer, send the single character by calling TTSND (which
will call DTSNGL). To activate a line, see the mechanism
described in the section above on DTE Terminal output.
If there is more than one character, set TTYINT as
interrupt handler and call DTEQ to send the characters.
the description of DTEQ in the DTE output section.

the
See

11 TO 10 TRANSFER DONE INTERRUPT (INPUT)
T010DN will be called when a transfer over the DTE from
the 11 to the 10 is finished.
The major task of this code
is to put the packet in its proper buffer. For TTYs, this
will mean putting the characters into BIGBUF.
The T010DN code dispatches, depending on the function
code in the packet through table FNCTBL in DTESRV.
TTY
character input dispatches to TAKLC, which calls routine
DTESTO for each character. DTESTO calls BIGSTO to store the
character into BIGBUF,
using pointer TTBIGI to
place
characters.
Each entry in BIGBUF is one word containing a
line number in the left half, and the character in the right
half.
Since BIGBUF is a circular buffer, if TTBIGI reaches
TTBIGO, BIGBUF is full and the monitor BUGCHK's.
When all
characters in the packet have been moved to BIGBUF, the
interrupt can be dismissed.

FE-24

«For Internal Use Only»

DIGITAL

TOPS-2ftJ MONITOR
Front, End/Terminals

MODULE TEIT
When answering the lab exercises, write down the names
of the tables where you found the answers. The labs will
help you understand the monitor data base structure.
So
remember,where to .look is more important than what you find
there.
The exercises marked with a double star (**) are more
d ifficul t and are optional.
If you have the time and/or
motivation, do them.
I/O - TTY Dependent Data /Sase
TOOLS
Use the PEEK command of FILDDT;
i.e.,
running monitor to answer these exercises.

look

at

the

EXERCISES
1.

What TTY line types exist in this monitor?

2.

What is the address of your terminal line's dynamic
data block?

3.

Is anyone linked to your line?

4.

What is your line speed set to?

5.

What line-type is your line?

6.

How many line buffers are
list? **

7.

What device-dependent routine is called to
character for your line's line-type? **

FE-25

**

currently

on

the

free

send

«For Internal Use Only»

a

DIGITAL

TOPS-20 MONITOR
Front End/Terminals

DTE - DTE Dependent Data Base
This set of exercises also uses a deliberate crash.
TOOLS
Use the crash DTEQS.CPY for this set
of
exercises.
For
symbols,
use
the
monitor
< MONITOR-INTERNALS>R3-MONITOR. EXE. Do not forget to set
moni to r contex t!
EXERCISES
1.

Are there any packets queued to be
DTE?

sent

2.

How many characters
packets?

of

3.

Which routine (DTEQ or DTSNGL) buil t
queued packets?

are

FE;""26

in

each

over
the

each

the

DTSNGL
of

the

«For Internal Use'Only»

DIGITAL

TOPS-20 MONITOR
Front End/Terminals

TEST EVALUATION SHEET
I/O - TTY Dependent Data Base
EXERCISES
1.

What TTY line types exist in this monitor?
ANSWER:
If a line type exists, it
llne-type-dependent dispatch table
the appropriate entry in TTLINV.
If
not exist, the offset in TTLINV for
will point to the dummy table TTDMVT.

will have a
pointed to by
a line does
that line-type

TTDMVT=43300
TTLINV/400000"TTFEVT = 400000, , 43 3 54
/ 400000"TTNTVT = 400000,,43300 i does not
iexist
/ 400000"TTPTVT = 400000,,44235
/ 4 00000, ,TTNTVT = 400000,,43300 idoes not
i ex ist
/ 400000"TTNTVT = 400000,,43300 idoes not
i ex ist
/ 40000Ci1"TTNTVT = 400000,,43300 idoes not
i ex ist
The table TTLINV says that offset 0 is for front
end lines and offset 2 is for PTYsi
therefore,
these two types of lines exist for this monitor.
2.

What is the address of your terminal line's dynamic
data block?
ANSWER: Given your job number, you can get your
I ine number from JOBPT, indexed by job riumber, (in
the left half).
Table TTACTL,
indexed by line
number, contains the address of the line's dynamic
data bloc k.
$INFORMATION JOB
Job 26, User DONALEEN, CD:,

FE-27

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Front End/Terminals
Account LSCD, TTY32
$CONT
JO~PT+26./

32,,56

TTACTL+32/ 556235

3.

iline's dynamic data
i block

**

Is anyone linked to your line?

ANSWER:
If there are any lines linked to this one,
the line numbers are stored in the line's dynamic
data block at offset TTLINKi there are four 9-bit
fields in this word to store a maximum of four
1 inks.
55~235+TTLINK/

4.

-1

ino links

What is your line speed set to?
ANSWER: The line speed for a terminal is stored in
table TTSPWD, indexed by line number.
TTSPWD+32/

5.

150,,9~00

i

(decimal)

What line-type is your line?
ANSWER: A terminal's line-type is stored
in bits
12-17 of table TTSTAT, indexed by line number.
TTSTAT+32/ 24000

ithis line's type is
i.e., this is
ia front end line.

i0 -

6.

How many line buffers are
list? **

currently

on

the

free

ANSWER:
Location TTFREC contains the count of free
buffers.
TTFREC/ 154

FE-2B

«For Internal Use Only»

TOPS-2~ MONITOR
Front End/Terminals

DIGITAL

7.

What device-dependent routine is called to
character for your line's line-type? **

send

a

ANSWER:
Table TTLINV,
indexed by line
type,
contains the address of the 1ine-type-dependent
function table for a line type;
that table, at
offset TTVT32 contains the dispatch address to send
a character to a line.
4~~000

TTFEVT

TTFEVT+TTVT23/

4~000~

TTLINV/'

;vector table for
;thi~ line type
TTSND1

;TTSND1 is the
;routine to send
; a character to
;this line type.

DTE - DTE Dependent Data Base
EXERCISES
1.

Are there any packets queued to be
DTE?

sent

over

the

ANSWER: Table DTEQS, indexed by DTE, contains the
queue header for packets queued to be sent over the
DTE.
DTEQS/126040,,126033

; ta i1 , ,head
;of queue

/ 0
2.

How many characters
packets?

are

in

each

of

the

DTSNGL

ANSWER: The DTSNGL packets are called SNGPK1 and
SNGPK2;
SNGPK1
is
queued to be sent
(and
therefore, can be expected to have valId unsent
data in it). The byte count for a packet includes
the header portion, but not the first word because
this is only for queueing and is not sent over the
DTE. An empty packet (i.e, header portion only)
contains 10 bytes.
There is room in a DTSNGL
packet for six characters total;
each character

FE-29

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Front End/Terminals
takes two bytes -- one byte for the character and
one byte for its line number.
Therefore, a
full
packet
can
contain 10 header bytes plus 14
character bytes equals 24 bytes.
Flag SNGAVL in
the header word indicates there is room in the
packet.
SNGPKI/700001,,126052
/

0,12,O,4

/ O,4,O,O
/ 17,215,5,317
/

;line number and
; character

0,0,0,0

SNGPK2/ 0

3.

iSNGAVL= bit 1;
; SNGACT= bi t 2
; (type out set to
is-bit bytes)
;there are 12 bytes
; in thi s packe t.
;Therefore, there is
; 0 n e c ha r act e r •

; pa c ke t i s no t
; queued

Which routine (DTEQ or DTSNGL) built
que ued packe ts?

each

of

the

ANSWER: Only packets SNGPK1 and SNGPK2 are used by
DTSNGL;
therefore, only SNGPKl of the queued
packets was built by DTSNGL.

FE-30

«For Internal Use Only»

TOPS-20 MONITOR
Storage Management

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Storage Management

COURSE MAP

MR-2717

SM-i

«For Internal Use Only»

TOPS-20 MONITOR
Storage Management

DIGITAL

This page is for notes.

SM-ii

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Storage Management

Storage Management
- - - - - - - - INTRODUCTION - - - - - - - - - .
This module covers the portion
of
TOPS-20 which is responsible for storage
management. The areas addressed by storage
management include:
the physical location
of each page, the movement of pages between
the
several
levels
of
storage,
the
manangement of reserved
space,
garbage
collection, working set control and balance
set adjustment. The emphasis in this module
is on data base tables associated with the
tasks mentioned above, and
refers to the
table descriptions section of the course
materials, along with the micro-fiche.

SM-l

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Storage Management

- - - - . . . . - - - LEARNING OBJECTIVES-----....,
Upon completion of
student will be able to:

this

module,

the

1.

Describe the uses of the data contained
in
the
various
storage management
related tables, specifically, the CST
tables, the SPT and parallel tables, and
the JSB/PSB space.

2.

List the uses
of
the
allocated monitor space.

3.

Describe the uses of the JSB and the PSB
in context switching.

dynamically

, . . . . - - - - - - - - RESOU RCES - - - - - - - - - - .
1.

The Monitor Table Descriptions

2.

The TOPS-20 Micro-fiche

SM-2

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Storage Management

MODULE OUTLINE
Storage Management
I.

II.

Storage Management
A.
Introd uc tion
B. Data Structures
C. CST Tables
D. SPT and Parallel Tables
E. Working Set Management
F. System-Wide Page Management
G. Pag e Faul ting
H. Adjustment Of the Balance Set
I.
SWPIN and SWPOUT
JSB/PSB Space
A.
Context Switching the JSB and PSB
B. JSB and PSB Maps
C. Use of JSB Space
D. Use of PSB Space

SM-3

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Storag e Management

This page is for notes.

SM-4

«For Internal Use Only»

TOPS-20 MONITOR
Storage Manag ement

DIGITAL

STORAGE MANAGEMENT
Introduction
Storage management is responsible for each page's
location, changing
a page's level of storage, garbage
fo rks.
These
collection, and
reserving storage
for
responsibilities are implemented in:
1.

Working set management

2.

System wide page management

3•

P ag e fa u 1 t i ng

4.

Adjustment of the balance set

Data Structures
PAGE TABLES
Both forks and files have page tables.
(A file's page
table
is also called its index block). While a file (or a
section of a long file) is in use, its index block is copied
into core;
this copy cannot be written to disk (but can be
swapped to "drum") and is called the in-core copy of the
index block. Each page of the file that is currently mapped
has a share pointer or an immediate pointer in the
in-core
copy of the index block.
STORAGE ADDRESSES
The page table entry for a page tells you where to find
the page's storage address.
If the pointer for the page is
an immediate pointer, the storage address is in hits 14-35
of the page table entry.
If the pointer for the page is a
share pointer, the storage address is in bits 14-35 of the
SPT slot that belongs to the page.

SM-5

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Sto rag e Manag ement

CST Tables
The CST tables are parallel tables;
there is one word
entry per page of physical core in each table. The amount
of physical core determines the size of these tables.
The
CST tables are all resident.
CST0
CST0 is the only CST table that both the microcode and
the software use. The microcode writes into the CST0 table
and the software uses the information. A CST0 table entry
is divided into three fields:
the age, the PUR (process use
register), and the modify bit. See the CST0 table in the
Monitor Tables for a diagram.
The age field
is in bits 0-8;
when a page is
referenced, the running fork's current age is stamped in the
age field of the page's CST0 entry (if the fork has not
referenced the page since its last age increment -- or since
it was context switched).
The Hardware Reference Manual incorrectly states that
the age is in bits 0-5.
The age field is actually in bits
0-8, but if the value stored in this field is not at least
10, the microcode traps to the software. Note that a number
smaller than 10 in this field would be only in bits 6-8.
The PUR (process use register) is in bits 9-32.
The
PUR is used to indicate if a page has been referenced by
more than one process;
that is, whether or not the page is
shared.
Each process in the balance set is assigned a bit
(called its core number) in the range of bits 9-32. When a
process references a page, its core number is inclusively
ORed into the page's PUR in its CST0 entry;
this happens
only if the process has not referenced the page since its
last age stamp increment (or since it was context switched) •
The modify bit indicates if a page has been modified.
CSTI
The lock count and next level of storage for a page are
stored in its CSTI entry.
A page cannot be swapped out
while its lock count is non-zero. The overhead pages for a
fork are locked when the fork enters the balance set, and

SM-6

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Storage Management

pages being read or written are locked when the page is
queued.
The lock count can be greater than one;
for
example, if two forks from the same job are in the balance
set, the job's JSB is locked twice.

The CST2 entry for a page indicates its "home"
either its owning SPT slot, or its owning page table's SPT
slot and its offset in that page table.
The CST2 entry for
a page is the internal identity on that page;
it uniquely
identifies any page on the system.
If a core page is not
assigned, its CST2 entry is zero.
CST3
The CST3 table is used for multiple purposes, depending
on the state of the page.
If the page is on the RPLQ, its
CST3 entry contains the list pointers for the RPLQ.
If the
page is on the deletion queue or special memory queue, its
CST3 entry is the list pointer for that queue. When a core
page is queued to be read from disk or written to disk, its
CST3 entry contains the local disk address.
CST5
The CST5 table is used for short IORBs.
If a page is
linked on a disk unit's transfer wait queue or position wait
queue, the entry in CSTS for the core page being read to or
from contains status flags and the pointer to the next item
in the queue.
SPT and Parallel Tables

The SPT and SPTH are parallel tables.
to the OFN portion.

SPTO is parallel

SPT
The SPT contains the storage addresses for all
fork
page tables, JSBs, PSBs, in-core copies of index blocks, and
file pages with share pointers in bits 14-35.
The OFN
portion of the SPT also contains the ALOCX index for the OFN
in bits 0-11;
the remainder of the SPT table keeps the
share count on the SPT slot in bits 0-11.
For a shared file

SM-7

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Storage Management

page, this is the number of pointers to the SPT slot.
SPTH
The SPTH table contains flags and the disk address of
the
index block iri the OFN portion. The remainder of the
SPTH table slots are used to identify the page's origin.
If
the page is a file page, its SPTH slot contains the owning
OFN and the offset (page number) into that index block.
If
the page is not a file page, its SPTH slot is the owning
fo rk number.
SPTO
The SPTO table contains the OFN's share count
structure number the file is from.

and

the

DISK BIT TABLE
Each structure has a
file
in its 
called DSKBTTBL.BIN.
This file contains one bit for each
page in the structure. The file is mapped whenever a page
is allocated or deallocated on that structure.
If the bit
for a page is 0, the page is allocated;
if it is a one, the
page is free.
See the write-up on disk allocation for more
info rmation.
FORK AGING
A fork always has an age associated with it based on
the amount of time it has run. When a fork is created, it
is assigned an age of 100; each time it has accumulated
AGTICK
ms.
(currently
40 ms.), the fork's age is
incremented.
The fork's current age is stored in the FKNR
table, indexed by the system fo rk number.
RPLQ
RPLQ, which is linked through the CST3 table,
is the
header for the linked list of available core pages. NRPLQ
is the count of pages on this free list. A page is added to
the head of the RPLQ if it is not expected to be referenced
again;
for example, del~ted pages are added to the front of

SM-8

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Storage Management

the RPLQ.
A page is added to the end of the RPLQ if there
is a high probability the page will be referenced again;
for example, index blocks are added to the end of the RPLQ.
When the system needs a core page, it takes one from
the RPLQ.
For example, when a process page faults (for
not-in-core), the system takes a page from the RPLQ to swap
the page into. When NRPLQ (the number of pages on the RPLQ)
gets low (currently NRPMIN), the overhead cycle does a
global garbage collect (GCCOR).
WORKING SETS
Each fork has both a reserve working set size and a
current working set size. The current working set size is
the count of pages currently in core. It is stored in table
FKPGS and indexed by the system fork number. The reserve
working set size is the count of pages reserved for the fork
when it is in the balance set;
the reserve working set size
is stored in table FKNR, indexed by the system fork number.
The reserve working set is always at least as large as the
current working set.
Working Set Management

Pages are removed from a fork's working set by the
local garbage collector
(called XGC). The local garbage
collector is invoked when a process page faults and the fork
has run at least 2000. ms. since its last local garbage
collection.
The CST tables are scanned for pages to
collect. A page is removed if:
1.

The last reference to the
seconds ago.

2.

It is private. The PUR must have only this
core number stored.

3.

It is not locked.

4.

It does not have write in progress.

SM-9

page

was

more

than

3

fork's

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Storage Management

System-Wide Page Management
GCCOR
The' overhead cycle checks if the RPLQ has at least
NRPMIN pages;
if the free list is low or if a fork is being
deleted, the global garbage collector (GCCOR) is called to
collect pages for the free list. GCCOR scans the CST tables
and take s pag es :
1.

If
Whose owning fork is outside the balance set.
the PUR i nd ica tes the page is shared and the owner
is not
is on the GOLST, it is left. If the owner
on GOLST and
there are sharers, the page is
colI ected anyway.

2.

That are not locked.

3.

That are not being written.

GCCOR collects a maximum of 1/2 of swappable core.
Note that even if a page is added to the free list, its
owner can still
reclaim the page.
See the diagram on
re-claiming a page from the RPLQ.
DDMP
DDMP is a Job 0 fork that runs in exec mode;
its task
is to move file pages from the swapping space back to disk.
This both cleans up the swapping space and updates the disk
copy of the page. DDMP is invoked both cyclically (every
minute) and when the swapping space gets low.

Page Faulting
Although page faulting often refers to a page' that is
not in core, there are actually several types of page
faults. A page fault occurs when the microcode traps to the
monitor because it cannot complete a reference for one of
several reasons. Page faults are divided into hard and soft
types;
if flag
'lWHPFF is on in TRAPSW, it is a hard page
fault.
The soft page fault types are:

SM-10

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Storage Management

1.

NIC - not in core.
When the microcode did the
address translation,
it found the storage address
was not in core.

2.

TRP0 - illegal age. The age field contains zeroes
'in bits 0-5.
This means the page is in a special
state.
(For example, a read may be in progress.)
See the CST0 table for an explanation of each of
the special states.

3.

NPG - null pointer. The page table entry is
The page must be created.

4.

WCpy - copy on write.
There has been a write
reference to a page with copy-on-write access set.

5.

ILWR - illegal write. A write-protected
had a write reference.

6.

ILRD - illegal read. A reference was made to a
read-protected page or to a page from a file on a
structure that has been dismounted.

zero.

page

has

Adjustment of the Balance Set
The balance set defines which processes have reserved
core. The balance set is adjusted when one of the following
is true:
1.

8UMNR is greater than MAXNR. The number of pages
needed by balance set processes exceeds available
core.

2.

It is time for
b a1 ance set.

the

periodic

adjustment

These factors determine whether a process is
b a1 ance set:

1.

GOL8T priority

2.

If it will fit in its partition.

8M-II

added

of

the

to

the

«For Internal Use Only»

TOPS-20 MONITOR
Storage Management

DIGITAL

SWPIN and SWPOUT,
The routines SWPIN and SWPOUT are called for all
storage management functions that require a page to be read
or written. These routines call DSKIO or DRMIO to set up
the request that is passed to PHYSIO to queue the page. The
SWPOUT routine may not need to write the page if the page
has not been modified. Also, the SWPOUT routine can decide
to swap a file page to its disk home if the swapping space
is low. The following system routines and JSYSs call SWPIN
and/ or SWPOUT:
1.

Page fault not-in-core calls SWPIN.

2.

Page fault null pointer calls SWPIN to assign
zero a core page if a private page is created.

3.

Page fault copy-on-write calls SWPIN to assign a
core page and copy the source page to the new page.

4.

GCCOR calls SWPOUT for collected pages.

5.

XGC calls SWPOUT for collected pages.

6.

DDMP calls SWPIN to read pages in from the "drum"
and then calls SWPOUT to write them to their homes
on disk.

7.

AJBALS calls SWPIN to read
in a fork's overhead
pages when it is added to the balance set.

8.

UFPGS JSYS calls SWPOUT to update file pages on the
disk.

9.

CLOSF JSYS can call SWPOUT to
file pages to the disk.

10.

PMAP JSYS can call SWPIN or
the requested function.

SM-12

write
SWPOUT,

any

and

modified

depending

on

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Storage Manag ement

JSB/PSB SPACE
Each job has a JSB (Job Storage Block) and each process
has a PSB
(Process storage Block).
The JSB and PSB
associated with a fork are context switched with that fork.
Also, all virtual pages between 620 and 777 of the monitor's
address space are context switched with the process.
And,
for Model B machines, sections 2 and 3 are context switched
with the process. How these parts of the monitor are used
and context switched is explained below.
Pages 620-706 are called the JSB space and contain job
specific information.
Pages 707-777 are called the PSB
space and contain process specific information. On model B
machines, sections 2 and 3 also contain process specific
information;
namely, the
process's
currently
mapped
directory and the IDXFIL for the structure the process
accessed last.

Context Switching the JSB and PSB
Each JSB and PSB has its own SPT slot. When a process
is running,
its JSB is currently mapped to pag e 620 of the
monitor's map and its PSB is currently mapped to pages 776
and 777 of the monitor's map. Therefore, to context switch,
all that is necessary is to set up share pointers in MMAP
slots 620,
776,
and 777 for the fork's JSB and PSB pages.
By changing the map slots, the virtual address space of the
monitor is changed to include the current fork's PSB and JSB
pages. The fork tables FKJOB, FKPGS, and FKeNO (all indexed
by fork number) contain the SPT offsets for a fork's JSB and
PSB pages.
However, as discussed above, many more pages than just
the JSB and PSB proper are context switched with the
process.
It is possible to change both the MMAP entries for
each of the pages that is context switched and th~ section
pointers for sections 2 and 3;
but the cost in time would
be exo rb i tant.

SM-13

«For Internal Use Only»

TOPS-20 MONITOR
Storage Management

DIGITAL

JSB and PSB Maps
as a
used
for
PSB,

To simplify context switching, part of the JSB is used
page map for the JSB space pages and part of the PSB is
as a page map for the PSB space pages. The MMAP slots
these pages are indirect pointers through the JSB and
respec ti ve1y.

To avoid having to set up SPT offsets for the JSB and
PSB, the monitor reserves SPT slot 400 for the current JSB,
and SPT slot 401 for the current PSB page containing the PSB
space map. When a process is context switched, the monitor
gets its JSB and PSB SPT offsets from the FKJOB and FKPGS
tables, picks up the current storage addresses from the
relevant SPT slots, and copies the JSB's storage address to
SPT slot 400 and the PSB's storage address to SPT slot 401.
Suppose fork 71 needs to be context switched, and the
FKPGS and FKJOB entries for the fork contain the following:
FKJOB+71/ xx,,503

i503 is the SPT offset for
ithe JSB belonging to this
ifork's job

FKPGS+71/ xx,,451

i451 is the SPT offset for
the PSB page

i

The storage addresses for these pages are in their SPT
offsets. Suppose the SPT offsets contain the following:
SPT+503/300,,213

ithe page is currently in
icore page 213

SPT+451/100,,451

ithis page is currently in
i core page 451

To context switch, copy the current storage addresses above
to SPT slots 400 and 401, respectively.
What must MMAP look 1 ike to make thi s wo rk? . MMAP+620
contains a share pointer for SPT slot 400.
MMAP+621 through
MMAP+706 contain indirect pointers through the JSB map in
the JSB
(that is, indirect pointers through SPT slot 400).
The JSB map begins at 620000,
the start of the JSB.
Therefore, the JSB space is represented in MMAP as:

SM-14

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Storage Management
MMAP+621/3xxxxl,,400
MMAP+622/3xxxx2,,400
MMAP+623/3xxxx3,,400

MMAP+706/3xxx66,,400

;indirect through
;offset 66 in the
;JSB.

For the PSB, things are a little more
complex.
Remember that the PSB is also the UPT;
therefore, several
locations in the PSB have hardware-defined uses.
For this
reason, the PSB map cannot begin at the start of the PSB
page. The PSB map begins at offset 666 of the PSB.
Therefore, the PSB space is represented in MMAP as:
MMAP+707/3xx666,,401
MMAP+710/3xx667,,401

MMAP+775/3xx754,,401
MMAP+776/ 2xxxxx,,401

;share pointer to
;PSB page itself

MMAP+777/3xx756,,401

Use of JSB Space
The JSB space is divided into reserved and
allocated areas.

dynamically

RESERVED JSB SPACE
Beginning at location FILSTS, space for 140 JFN blocks
is reserved.
Each JFN block has a size of MLJFN.' The JSB
see the
page itself has defined uses for each location;
Monitor Tables for a description of the JSB.

SM-15

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Sto rag e Manag ement

DYNAMICALLY ALLOCATED SPACE
The JSB space is allocated both a page at a time and an
n-word block at a time.
JBCOR -

is an allocation table with one bit for each
page in the JSB space. If the bit is on, the
pag e is free. I f the bit is 0 ff, the pag e is
in use. Pages 620-706 are represented here.

JSBFRE -

is the head of the blocks of free storage.

Routine ASGPAG is called to allocate
Pages of JSB space are allocated for:

a

page

of

storage.

1.

Magtape buffers.

2.

File window pages.

3.

To add more space to the free list, JSBFRE.

4.

Mapping the super index block of a file.

5.

Mapping the EXE file directory page and other
uses when a temporary page is needed.

such

Routine ASGJFR is called to allocate a free block;
the
caller passes the desired block size. If there is no block
of the desired size, ASGJFR calls ASGPAG to assign another
page.
Blocks are used to store name strings for the JFN
block. Name strings have this format:
-1, ,n

in is size of block including this word
in-l words containing name in ASCIZ.

Use of PSB Space
The PSB space is used differently for Model A and Model
B machines.

SM-16

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Sto rag e Manag ement

MODEL A VERSUS MODEL B MACHINES
On Model B machines, directories are mapped to section
2;
on Model A machines, directories are mapped to page
740000 of section 0
(the only section).
On Model B
machines~
IDXFIL is mapped to section 3;
on Model A
machines, IDXFIL is mapped to pag e 720000 of section 0.
Pages 720000 through 770000 of sections 0 (and 1) are unused
on Model B machines.
PSB SPACE LAYOUT
1.

CXBPG- page 707;
blocks.

used

to

temporarily

2.

CPTPG- pag e 710;
tables.

used to tempo rar ily map fork pag e

3.

CPYPG - pag e 711;
used
to map the source pag e
while a copy-on-write page fault is in progress.

4•

F PG 0, FPG 1 , F PG 2 , FPG 3 pa g e s 71 2 t h r 0 ug h 715 ;
called temporary fork pages;
currentlY,unused.

5.

PSIPG - pages 716 and 717; meant for temporary PSI
storage;
currently unused.

6.

IDXFIL - pages 720 through 737;
IDXFIL mapped here
on Model A machines;
unused on Model' B machines.

7.

Directory pages - pages 740 through 770;
directory
mapped here on Model A machines;
unused on Model B
machines.

8.

DDTPG - page 774;
in use.

MDDT page;

used while

map

index

MDDT

is

DRMAP
For
section
DRMAP of
for the
exampl e:

Model B machines, MSECTB+2 (the section pointer for
2)
contains an
indirect pointer through location
the current PSB. DRMAP contains a
share pointer
index block of the currently mapped directory.
For

SM-17

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Storage Management

M8ECTB+2/324643,,401
DRMAP=P8B+643/ 224000"OFN of mapped directory
Therefore, when the PSB is context switched, the currently
mapped directory is also context switched.
I DXMAP
For Model B machines, MSECTB+3 (the section pointer for
section 3)
contains an indirect pointer through location
IDXMAP contains a share pointer
IDXMAP of the current PSB.
relevant
structure's IDXFIL.
For
for the index block of the
example:
MSECTB+3/324643,,401
IDXMAP=P8B+644/ 224000"OFN of IDXFIL

8M-18

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Storage Management

MODULE TEST
When answering the lab exercises, write down the names
of the tables where you found the answers. The labs will
help you understand the monitor data base structure;
so
remember, where to look is more important than what you find
there.
The exercises marked with a double star (**)
are more
d ifficul t and are optional.
I f you have the time and/or
motivation, do them.
Storage Management Data Structures
Tools
Use the
exercises.

crash

SM.CPY

for

these

EXERCISES
1.

Find an in-core page in the running fork's' page
table:
Is it locked in core? If so, what is the
lock count for the page?

2.

Is the fork's page table locked in core?

3.

Does the fork have an in-core page with
add ress on the drum?

4.

Find' an in-core page with its own SPT slot.

5.

Is there an in-core page with
With read in progress?

6.

What page is at the head of the RPLQ?

7.

How many pages are on the RPLQ?

SM-19

write

in

**
no

backup

progress?

«For Internal Use Only»

OIGITAL

TOPS-20 MONITOR
Storage .Management

8.

Find a mapped file page in the running fork's page
map.
What is the owning OFNs backup level of
storag e? **

9.

Using CST2, find a core page that is not ,currently
'assig ned. **

10.

What is the running fork's current age?

11.

What is
size?

12.

What is the
size?

13.

How many pages are on the swapping space free list?
**

14.

Does the running fork have any
with an indirect pointer?**

15.

How many of the pages of the
space actually exist? **

running

16 •

Wh a tar e the S PT 0 f f set s for
JSB, PSB and user page table?

the

17.

Verify that the storage addresses for the running
fork's JSB and PSB match the storage address in
slots 400 and 401.

the~

running

fork's

current

working

set

running

fork's

reserve

working

set

mapped

file

page

fork's

JSB

r un n i ng

for k ' s

Internal Mapping Using MOOT **
MOOT is a part of the monitor that allows you to look
at the running monitor with the standard OOT commands; your
process is always the running process when you use MODT.
You can also call monitor routines to map pages; however,
extreme caution should be taken when using MOOT.
If you
change ,any locations, yqu can crash the monitor.' It, is a
good practice to type carriage return immediately after you
open any location to prevent accidental deposits into
memory. This part of the lab uses MOOT to map directories
and/or other pages using their internal identities.

SM-20

«For Internal Use Only»

TOPS-20 MONITOR
Storage Management

DIGITAL

Tools
You can enter MOOT in either of two ways. In the first
example, the running fork will be the to~ fork of your job
(i.e., the EXEC). In the second example" the rUnning fork
will be the fork running user level ODT.
@ENABLE
$AEQUIT
MX>/
MODT

;go to the mini-exec
;enter MOOT

@ENABLE
$SDOT
Jgys--777$X

MOOT

;you can use SOOT or UOOT
;jsys 777 causes you to enter MOOT

You can use either method to enter MDOT.
You can return
from MOOT by calling the routine MRETN. You do this by
typing: .
MRETN$G
You will also need the writeup in the OEBUGGING section
called Mapping Page 677 and from your Student Guide.
EXERCISES
Map the pages in the following exerc i ses to pag e 677.
This is a page out of your
job's JSB space and is the
traditional page to use.
1.

Map some other page table.
It can be the page
table of one of your .friend's forks or, any page
table you choose.

SM-2l

«For Internal Use Only»

"D~GITAL

TOPS-20 MONITOR
Storag e Management,

~--------------------NOTE --------------------~

Hint:
If you know the fork number of
the fork whose page table you want to
. map, where would yo u find the pag e
table's internal identity?
2.

Map some other JSB. For example, ask your neighbor
what his/he'r fork number is and then find out what
the corresponding JSB's intern~l identity is.

3.

Map an OFN.

~-------------------

NOTE

--------------------~

Suggestion: You may wish to map the OFN
of the program running in your fork and
verify that the in-core-copy of the
index block has share pointers that
match the share pointe~s' for your fork's
mapped pages from the file.

**

4.

Map a page of some other process.

5.

Map a JSB space page from some other JSB.

6.

Un-map the last page.

**

~---------------------NOTE--------------------~

If you do not un-map the page, the job
will hang when you try to LOGOUT because
the JBCOR table does not have the page
allocated.

SM;...22

«For Internal Use Only»

DIGITAL

TOPS-2(?J MONITOR
Storag e Management

. Page Fault Crash

**

The crash for this exercise fs BADBTB.CPY.
Try and
figure out why the system crashed. The questions below
should help point you in the right direction.
To look at
the crash, do the following:
@ENABLE
$FILDDT
FILDDT>LOAD R3-MONITOR.EXE
FILDDT>GET BADBTB.CPY
1.

Why does a BADBTB crash happen?

2.

What push down list is in use
(i.e., what
generally going on when the system crashed)?

3.

What instruction made the reference that caused the
BADBTB?

SM-23

was

«For Internal Use Only»

TOPS-2f2J MONITOR
Storage Management

DIGlTAL

This page is for notes.

SM-24

«For Internal

Us~

Only»

DIGITAL

TOPS-20 MONITOR
Storage Management

TEST EVALUATION SHEET
Storage Management Data Structures
EXERCISES
1.

Find an in-core page in the running fork's page
table.
Is it locked in core? If so, what is the
lock count for the page?
ANSWER: The running fork's page table is mapped to
the monitor's address space beginning at UPTA.
Look for a page whose storage address indicates it
is in core;
that is, bits 12-17 of the storage
address are 0.
The CSTI entry for that page
contains the lock count in bits 0-11.

2.

UPTA/124000,,742

;this is an immediate
;pointer, therefore,
;the storage address
;is in bits 12-35.
;Bits 12-17 are 0,
;indicating the page
; is in core.

CSTl+742/3,,12704

;page is not locked
;in core lock count
;is zero.

Is the fork's page table locked in core?

**

ANSWER: The fork's page table is mapped at UPTA.
Currently UPTA=775.
Therefore, we want to trace
down MMAP+775;
see if the page is in core, and if
so, is it locked.
UPTA= 775000
MMAP+775/324754,,401

SM-25

;mapped indirect
;through offset 754
;of SPT slot 401

«For Internal Use Only»

TOPS-20 MONITOR
Storage Management

DIGITAL

; (which is the first
; pa g e 0 f the PS B) •

3.

PSB+754/224000,,1131

;share pointer so
; sto rag e add ress in
; SPT slot 1131

SPT+1131/100,,250

;storage address is
; core page 250

CST1+250/503,,12524

;lock count = 5

Does the fork have an in-core page with
address on the drum?

no

backup

ANSWER: The next level of storage back up address
for a core page is in its CST1 entry;
if the page
has a copy on the drum, the CST1 entry has a drum
address.
So, you want to look for a CST1 entry
with no drum address.
UPTA+4/124000,,210
;not a drum address.
;Therefore, this page
;has no drum copy.

CST1+210/ 1,,0

4.

Find an in-core page with its own SPT slot.
ANSWER:
If an in-core page has its own SPT slot,
tne ~eft half of its CST2 entry is zero and the
right'half is the SPT slot.
CST2+56/ 536
CST2+57/403,,45

;has own SPT slot =536
;does not have own SPT
;slot
;has SPT slot =520

CST2+60/ 520
5.

Is there an in-core page with
With read in progress?

write

in

progress?

ANSWER:
If a page has read or write in progress,
its age field in its CST0 entry is equal to PSRIP

SM-26

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Storage Management
or PSWIP, respectively. See the CST0 table
description of the age field states.
CST0+615/4010,,0

for

a

ithis page has write
iin progress.

There is no page with read in progress.
6.

What page is at the head of the RPLQ?
ANSWER: RPLQ is the queue header for the linked
lIst of free pages.
The replaceable queue is a
linked list through CST3. The page number is its
offset from CST3.
RPLQ/77403,,77611

itai1"head of free
i1ist

CST3=77000
77611-77000~611

7.

ipage 611 is the head
iof the free list.

How many pages are on the RPLQ?
ANSWER:
pages.

Location NRPLQ contains the count of
NRPLQ/ 30

8.

free

ithere are 30 free
ipages

Find a mapped file page in the running fork's page
map.
What is the owning OFN's backup level of
storage?
ANSWER:
pointer
entry.

A mapped file page
has the owning OFN

that has a share
stored in its SPTH

UPTA+5/204000,,517
SPTH+517/17,,2

iOFN in left half

SPT+17/403,,15770

iOFNs currently on

SM-27

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Storage Management
; drum.
SPTH+17/10,,577554

9.

;therefore next level
; 0 f s tor ag e i s dis k •
;SPTH entry for an
;OFN always contains
;the disk address.

Using CST2, find a core page that is not
assigned.
**

currently

ANSWER:
If a core page
entry is 0.

its

is

CST2+71/ 0
10.

unassigned,

CST2

;unassigned page

What is the running fork's current age?
ANSWER: A fork's current age is stored in it
entry in bits 9-17.

FKNR

FORKX/ 40
FKNR+40/100127,,166
11.

What is the
size?

running

fork's

;current age is 127
current

ANSWER: A fork's current working set
its FKWSP entry.
FKWSP+40/ 166
12.

What is the
size?

running

working
size

is

set
in

; current si ze
fork's

reserve

ANSWER: A fork's reserve working set
its FKNR entry, right half.
FKNR+40/100127,,160

SM-28

working
size

is

set
in

;reserve size = 1n6

«For Internal Use Only»

TOPS-29 MONITOR
Storage Management

DIGITAL

13.

How many pages are on the swapping space free list?

**
ANSWER:
Location DRMFRE contains
.free
swapping
pages.
Routine
swapping space and uses DRMFRE.

the number of
DRMASN assigns

DRMFRE/ 3325
14.

Does the running fork have any
with an indirect pointer?**

mapped

file

page

ANSWER:
If the running fork has any indirect file
page pointers, the page map entry has an indirect
pointer through an OFN;
that is, the SPT slot is
less than NOFN. Search the page table (i.e., UPTA)
for indirect pointers whose right half is less than
NOFN.
In this case, there are none.
15.

How many of the pages of the
space actually exist? **

running

fork's

JSB

mapped
ANSWER:
The JSB space pages are all
indirectly through the JSB map;
if a page actually
exists, its JSB space map slot contains a pointer
and if the page does not exist its JSB map slot
contains a zero.
JSB9$N
JSB/224909,,1132
JOBMAP+4/ 124903,,12574
JOBMAP+6/ 124009,,241
16.

What are the SPT offsets for
JSB, PSB and user page table?

the

running

fork's

ANSWER:
Table FKJOB indexed by
fork
number
contains the JSB's SPT offset in the right half.
Table FKPGS, indexed by fork number, contains the
user page table SPT offset in the left half and the
first page of the PSB's SPT offset in the right
half.
Table
FKeNO,
indexed by fork number,

SM-29

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Storage Management
conta ins the second pag e
the left half.

0

f the PSB' s SPT

0

ffset in

FORKX/ 40

17.

FKJOB+40/13,,1132

iJSB's SPT offset=1132

FKPGS+40/1131,,454

iuser page table SPT
ioffset"PSB first
i SPT 0 ffset

FKCNO+40/1130,,15

iPsa second page SPT
ioffset=1130

Verify that the storage addresses for the running
fork's JSB and PSS match the storage address in
slots 400 and 401.
ANSWER:
SPT+1132/100,,200
SPT+400/200,,200

iJSB storage address
imatches SPT slot 400

SPT+454/100,,464
SPT+401/200,,464

iPSB storage address
;matches SPT slot 401

Internal Mapping Using MOOT

**

EXERCISES
1.

Map some other page table.
It can be the page
table of one of your friend's forks or any page
table you choose.
ANSWER:
Every page table has its own SPT slot;
t fie r e for e , its i n t ern a l i den tit Y i s t hat ,S PT s lot.
If you know the fork number, its SPT slot is stored
in the left half of FKPGS, indexed by fork number.
Therefore, you should call SETMPG with that SPT
slot as the argument in ACI.

S.M-30

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Storage Management

2.

Map some other JSB. For example, ask your neighbor
what his/her fork number is and then find out what
the corresponding JSB's internal identity is •
. ANSWER:
Every JSB also has its own SPT slot;
its
8PT slot is stored in FKJOB indexed by fork number
(for every fork in t~e job). This SPT slot is a
JSB's internal
identity and is the argument you
give in AC~ fO'r SETMPG.

3.

Map an OFN.
ANSWER: The OFN
(i.e.,
its SPT slot)
is its
internal
identity;
the OFN is the argument in ACl
when you call SETMPG.

4.

Map a page of some other process.

**

ANSWER:
To map a page of another process, you need
the process page table's SPT slot in the left half
and the page number in the right half.
5.

Map a JSB space page from some other JSB.

**

ANSWER: A JSB page's internal
identity is the
JSB's SPT slot in the left half and the page's
offset in the JSB map in the right half.
6.

Un-map the last page.
ANSWER: To unmap a page, call SETMPG with AC2
up as usual and a 0 in AC1.

Page Fault Crash

set

**

EXERCISES
1.

Wh Y does a BADBTB c rash happen?
ANSWER: A BADBTB happens when a page where the bit
table is mapped is referenced when the bit table is
not currently mapped.

SM-3l

«For Internal Use Only»

DIGITAL

2.

TOPS-20 MONITOR
Storage Management
What push down list is in use
(i.e., what
generally going on when the system crashed)?

was

ANSWER: The push down list that is in use tells
·you what type of thing the monitor was doing at the
time of the crash.
;a page fault was in
; prog ress.

p/ -36"TRAPSK+23

3.

What instruction made the rieference that caused the
BADBTB?
ANSWER: We want the instruction that page faulted.
The address of the instruction that page faulted
and the page fault address are stored in the page
fault old PC
(UPTPFO)
and the page fault word
(TRAPS0), respectively.
TRAPS0/1000,,551100
UPTPFL/ JUMP 0
UPTPFO/ 26255

;address that page
; faul ted
; fl ag s
;address of
; instruction that
; pag e faul ted
;i.e., the effective
; add r ess 0 fits
;contents is 551100.

BTB=540000

;base address where
;bit table mapped

BTB LEN=150 00

;size in words of
;bit table reserved
iarea.

Therefore, we see the reference is definitely in
the area. Now, why was the reference made?
Was
the code actually trying to reference the bit table
and did not map it first, or was it a garbaged
reference?
26255/ LDB TI, 25643

SM-32

;this is the

«For Internal Use Only»

TOPS-20 MONITOR
Storage Management

DIGITAL

i
i

256431 3002,,101400

inst ruc tion tha t
caused the faul t

ithis is the byte
pointer. Note
it is indexed by AC2

i
i

SPT= 101400

ithis is the SPT base
add ress

i

551100-101400= 447500

ithis must have been
ithe contents of AC2.

Using listingsl microfiche and FILDDT, find where
the instruction is.
SECG37+221 JRST GETTPI
1 HRRZ T2,Tl

1 MOVEM T2,TRPID
1 LOB T1,25643

0, ,-I$M

;looks like
;the start
; 0 f a l i ter al
; here is 0 ur
; instruction

;set the mask for the right
;half

SECG37+23$W
GETTPl+271 JRST SECG37+23

;here is
;where we
;came from
;i.e, how we
;got to the
; 1 iter al

So, this page fault came from the routine GETTPD,
which is page fault code itself. We have a page
fault within a page fault.
Look on the stack for
evidence of what the old page fault was and what
was happening to cause this page fault.
Also,
remembering what our byte pointer looks like, that
is, SPT table base address indexed by an AC,
implies that the LDB was trying to pick up some
information from an SPT slot; however,
447500 is

SM-33

«Fo r Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Storage Management
not a legal SPT slot. Also, location TRAPC is zero
if this is not a recursive page fault and if TRAPC
is positive, the number indicates the level of
recursion.
TRAPCI 1

PI

;one level of recursion

-36"TRAPSK+23

TRAPSK+231 JUMP 0

; top

TRAPSKI 10
I 447500
I 224000,,447500

0

f stack now.

;looks like our index
;share pointer with
; 0 ur index!

I
I
I
I
I

2000,,0
221120,,531
300000"CHKDM0+1 ;looks like a PC
401000, ,6070
32, ,541636
TRAPSK+101 MRP4+12
I 300000,,0
I 300000"TRPRST+1 ;looks like a PC
I 447500
lour index again
I 224000,,447500
I 1000,,707010
I MOVE Tl,PIPGA(T1)
I 75
TRAPSK+201 300000"CHKDM0+1 ;looks like a PC
I 1000,,707010
I 26255
I 320000,,0

SM-34

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Storage Management
Using your crash wr i teup, look at wha t gets pushed
on the stack when a page fault begins. In order of
appearance, we get ACl, AC2, AC3, AC4, AC7, AC16,
TRAPSW, the ,runtime (if not recursive fault), the
,return PC, and the flags. So, stack locations 0-11
are these locations at the time of the first page
fault. Note that the first page fault came from
MRP4+l2.
Then, we have something on the stack that
looks like a return address. It is the return from
the call to GETTPD in the routine TRPRST. Then, we
have the set up from the second page fault.
Note
that AC2 contained a 447500 in the right half, as
we suspected. And note that it looks very much
like
a
share pointer, also as we expected.
Location TRAPSW is the previous saved TRAPS0, that
is, the page faul t wo rd.
So the pr ev ious pag e
fault was on address 707010. See why it faulted.
MMAP+707/324600,,401
PSB+666/224000,,447500

;here is the
;share pointer
;we saw on
;the stack.

It is not a legal share pointer because 447500 is
not a legal offset into the SPT. So, somehow, the
PSB page map got a bad share pointer.
what
why.

The original page fault was from MRP4+12.
See
that routine was doing, how it got called and

MRP4+12/ MOVE T3,CXBPGA(Tl) ;here is the
i reference to
ipage 707 that
ithat originally
ipage faulted.
When a page fault
location TRAPAP.

starts, the old P is saved in

TRAPAP/ UPDL+26"UPDL+25
So, there was a JSYS going on and the JSYS code
called MRP4. See what JSYS it was.

SM-35

«For Internal Use Only»

DIGITAL

TOPS-20 MONITOR
Storage Management

MPP/ UPDL+10"UPDL+7

UPDL/
/
/
/
/

;this indicates that
ia JSYS has called a
iJSYS.

5623
CAM 104000
5623
CAM 104000
-1

/ UPDL+4"UPDL+3
/ FFFFPL+l
/ MEMPSl+3,,104000
UPDL+10/ UPDL+5"UPDL+4
/ 137
/ .TRRET
/ CAl RPACSl+10
/

1

/

1

/ IMULI T2,@53l
/ 0
UPDL+20/ 137
/ DSKDTB
/ HRR DSKDTB
/ 0
If we look at the stack, it seems that an FFFFP
JSYS called an RPACS.
RPACl+7/ CALL MRPACS
The routine MRPACS calls MRP4, which is where the
orig inal page fault came from.
Inspection 0 f the
code seems to indicate that all traces of who
messed up the map entry for page 707 are gone. The'
code' in MRP4 call s SETXBl to map the index block
and it looks as though the routine set up a bad
share pointer somehow.

SM-36

«For Internal Use Only»

Monitor Tables

DECsystem-2~

Monitor Tables

Table Of Contents
(ALOC1) Allocation 1 Table. • • • • • • • • • • • • • • • • • • • • • • 1
(ALOC2) Allocation 2 Table. • • • • • • • • • • • • • • • • • • • • • • 2
;

(BALSET) Balance Set Table.

• • • • • • • • • • • • • • • • • • • • •3

(BAT) Bad Allocation Table. • • • • • • • • • • • • • • • • • • • • • • 4
(BSPT) Balance Set Process Table ••••••••••••••••• 6
(BSQ) Balance Set Quantum Table •••••••••••••••••• 7
(BTB) Bit Table for Disk ••••••••••••••••••••••••• 8
(BUG-HLT/CHK/INF-STORAGE-AREA)
BUGHLT, BUGCHK, and BUGINF Storage Area ••••••••• 10
(CDB) Channel Data

Block~

•••••••••••••••••••••••• 11

(CDR-Storage-Area) •
Card Reader (Physical) Storage Area ••••••••••••• 15
(CDS) Channel Dispatch Service Routine Table ••••• 18
(CHNTAB) Channel Table ••••••••••••••••••••••••••• 19
(CST0) Core Status Table

~

••••••••••••••••••••••• 20

(CSTl) Core Status Table 1 ••••••••••••••••••••••• 22
(CST2) Core Status Table 2 ••••••••••••••••••••••• 23
(CST3) Core Status Table 3 ••••••••••••••••••••••• 25
(CST5) Core Status Table 5 ••••••••••••••••••••••• 27
(DEVCHR) Device Characteristics Table •••••••••••• 28
(DEVCHl) Device Characteristics Table 1 •••••••••• 29
(DEVCH2) Device Characteristics Table 2 •••••••••• 30

i

(DEV'DTB) Device Dispatch Table •••••••••••••••••• 31
(DEVDSP) Device Dispatch Table Addresses ••••••••• 33
·(DEVNAM) Device Name Table ••••••••••••••••••••••• 34
(DEVUNT) Device Unit Table ••••••••••••••••••••••• 35
(DIRECTORY)

Directo~y

Format ••••••••••••••••••••• 36

(DRMBBT) Drum Bit Table •••••••••••••••••••••••••• 44
(DRMCNT) Drum Count Table •••••••••••••••••••••••• 45
(DSKSIZ) Disk Size Pointer Table ••••••••••••••••• 40
(DSKSZ'n) Disk Size Table •••••••••••••••••••••••• 47
(DSKUTP) Disk Unit Type •••••••••••••••••••••••••• 48
(DST) Drum Status Table •••••••••••••••••••••••••• 49
(DTE-STORAGE-AREA) DTE Storage Area •••••••••••••• 50
(DTEDTV) DTE Protocol Device Dispatch Table •••••• 61
(END/DEQ - STORAGE AREA).
Enqueue/Dequeue Storage Area •••••••••••••••••••• 62
(ENQ-LOCK-BLOCK) Enqueue Lock Block

~

••••••••••••• 63

(EPT) Executive Process Table •••••••••••••••••••• 65
(EXEC-PG-MAP-TBL) Executive Page Map Table ••••••• 69
(FDB) File-Description Block ••••••••••••••••••••• 71
(FE-STORAGE-AREA) Front End Storage Area ••••••••• 74
(FKCNO) Fork Core Number Table ••••••••••••••••••• 76
(FKINT) Fork Interrupt Table ••••••••••••••••••••• 77
(FKINTB) Fork

Interrup~

Buffer Table ••••••••••••• 79

(FKJOB) Fork Job Table ••••••••••••••••••••••••••• 80

ii

(FKJTQ) Fork JSYS Trap

Queue~

•••••••••••••••••••• 81

(FKNR) Fork Number of Reserve Pages Table •••••••• 82
(FKPGS) Fork Page and Process Storage Table •••••• 83
( FKPGST)
Fork BALSET Wait Satisfied Test Table ••••••••

0• • •

84

(FKPT) Fork List Pointer Table ••••••••••••••••••• 85
(FKQl) Fork Run Queue Table 1 •••••••••••••••••••• 86
(FKQ2) Fork Run Queue Table 2 •••••••••••••••••••• 87
(FKSTAT) Fork Status Table ••••••••••••••••••••••• 88
(FKTIME) Fork Time Table ••••••••••••••••••••••••• 89
(FKWSP)
Fork Working Set (In-Memory Size) Table ••••••••• 90
(HOM) Home Block ••••••••••••••••••••••••••••••••• 91
(HOME) Home Table •••••••••••••••••••••••••••••••• 93
(HOMTAB)
Logical Unit's Channel and Unit Table ••••••••••• 94
(IDXFIL) Index Table File •••••••••••••••••••••••• 95
(INDEX) Index Block Table •••••••••••••••••••••••• 97
(INIDEV) Initialization Device Routines •••••••••• 98
(INIDV1 )
Front End Initialization Device Routines •••••••• 99
(INIDVT) Device Initialization Table ••••••••••••• 100
(IORB) I/O Request Block ••••••••••••••••••••••••• 103
(IPCF-MESSAGE-HEADER). IPCF Message Header ••••••• 107
(IPCF-PID-HEADER). IPCF Process ID Header •••••••• 108

iii

(IPCF-STORAGE-AREA) Inter-Process Communication
Facility Storage Area ••••••••••••••••••••••••••• 109
(JOBDIR) Job Directory Table ••••••••••••••••••••• 110
(JOBNAM) Job Name Table •••••••••••••••••••••••••• 111
(JOBPNM) Job Program Name •••••••••••••••••••••••• 112
(JOBPT) Job Process Table •••••••••••••••••••••••• 113
(JOBRT) Job Runtime Table •••••••••••••••••••••••• 114
(JOBRTL) Job Runtime Limit ••••••••••••••••••••••• 115
(JSB) Job Storage Block •••••••••••••••••••••••••• 116
(RDB) Kontroller Data Block (TM02 only) •••••••••• 125
(LOGICAL-NAME-DEFINITION). Logical Name Definition
Block ••••••••••••••••••••••••••••••••••••••••••• 126
(LOGICAL-NAMES-LIST) Logical Names List ••••••••• ,127
(LPT-STORAGE-AREA) Line Printer Storage Area ••••• 128
(MTA-STORAGE-AREA) Magtape Storage Area •••••••••• 134
(NAMUTP) Name Unit Type Pointers ••••••••••••••••• 138
(NBQ) Negative Balance Set Hold Quantum •••••••••• 139
(NBW) Balance Set Wait Time •••••••••••••••••••••• 140
(OFNLEN) Open File Length Table •••••••••••••••••• 141
(PHYCHT) PHYSIO Channel Dispatch Tables •••••••••• 142
(PHYUNT) PHYSIO Unit Dispatch Tables ••••••••••••• 143
(PIDCNT) Process ID Count Table •••••••••••••••••• 144
(PIDTBL) Process ID Table •••••••••••••••••••••••• 145
(PSB) Process Storage Block •••••••••••••••••••••• 146
(PTYSTS) Pseudo Terminal Status Table •••••••••••• 153

iv

(QBLOCK) Queue Block ••••••••••••••••••••••••••••• 154
(RES-FREE-SPACE) Resident Free Space Storage ••••• 156
(SCDRQB) Scheduler Request Table ••••••••••••••••• 158
(SDS) Structure Data Block ••••••••••••••••••••••• 159
(SNAMES) Subsyste, Names ••••••••••••••••••••••••• 162
(SNBLKS) Sybsystem Blocks •••••••••••••••••••••••• 163
(SPFLTS) Subsystem Page Faults ••••••••••••••••••• 1~4
(SPT) Special Pages Table •••••••••••••••••••••••• 165
(SPTH) Special Pages Table Home Information •••••• 168
(SPTO) Special Pages Table O••••••••••••••••••••• 170
(SSIZE) Subsystem Working Set Size ••••••••••••••• 171
(STIMES) Subsystem Runtimes •••••••••••••••••••••• 172
(STRTAB) Sturcture Data Block Table •••••••••••••• 173
(SWAP-FREE-SPACE)
Swappable Free Space Pool Format •••••••••••••••• 174
(SYNMTB) System Logical Name Table ••••••••••••••• 175
(SYS-STARTUP~VECTORS)

System Startup Transfer Vectors ••••••••••••••••• 176
(SYSERR-STORAGE-AREA)
Syserr Storage Area ••••••••••••••••••••••••••••• 177
(TT-LINE-DYN-DATA-BLK)
Teletype Line Dynamic Data Block •••••••••••••••• 188
(TTACTL) Teletype Active Line Table •••••••••••••• 191
(TTBUFS) Teletype Buffers •••••••••••••••••••••••• 192
(TTCSAD)
Terminal Call Special Request Address Table ••••• 193

v

(TTCSTM)
Terminal Call Special Request Time Table •••••••• 194
(TTLINV) Terminal Type Line Vector Table ••••••••• 195
(TTSPWD) Terminal Speed Word Table ••••••••••••••• 196
(TTSTAT) Teletype Status Table ••••••••••••••••••• 197
(TTXXVT)
Teletype Device Specific Vector Table .•••••••••• 198
(TTY-STORAGE-AREA)
Teletype Storage Area ••••••••••••••••••••••••••• 200
(UDB) Unit Data Block •••••••••••••••••••••••••••• 202
(UDIORB) UDSKIO rORB Pool •••••••••••••••••••••••• 205
(UDS) Unit Dispatch Service Routine Table •••••••• 206
(UPT) User Process Table ••••••••••••••••••••••••• 207
(USER-PG-MAP-TBL)
User Page Map Table ••••••••••••••••••••••••••••• 210

vi

ALOCl

Description:

Allocation 1 Table. This table of lenqth
NOPN (aize of orN area in SPT) is used to
help enforce disk quotas for each active
directory.

Oefined in:

STG

Reference by:

PJ(GEM

/
ADIRN
ALOCl

CDIRe
OPN Directory Count

Directory No.

···
···

·
Note:

Each SPr entry in the crN area contains an index into this
table.

-1-

Name:

ALOC2

Cescription:

Allocation 2 Table. This table of length
NOFN (size of OFN area is SPT) is used in
disk quota enforcement for each active
directory.

Defined In:

STG

Referenced by:

DISC, PAGEM
F..ormat

PGLFT
ALOC2

Count of Pages Left for This Directory
(may be negative)

Note:

Each SPT entry in the OFN area contains an'index
into this table.

-2-

Description:

Balance Set Table. This table contains the set
of .o.t eligible forks for CPU servIce whose
coabined working set size. are balanced with the
aaaunt of physical core available. -Only fork.
In this table can be chosen to run. Posi tion In
this table is arbitrary and has no effect on run
priority (Position on GOLST deteraine. this).

Defined in:

SCREn

Referenced by:

PAGDI
Po mat

BALSET

Bsrx

Pork Status

Pork Index

···
··
···
·
17 18

fIJ 1 2 3 4 5 6

BALS!T

IIIIII

35

Pork Index

Syllbol

Ilta

Iswm

I

ISNSK

I

BSNUL

2

BSHLD

4

COntent
If 1, fork waiting for I/O
(disk or drua)
If 1, fork Is MOSIED (no
scheduling of other forks
allowed) or NOSWAP
If 1, free BALS!T slot (Deleted
entry)
If 1, fork being held in Balance
Set

-3-

Na.e:

BAT

Description:

BAd Allocation Table. The
In len9th (128 words). It
header, followed by data,
imUeat.s ttl. bad spot3 on

Defined in:

PROLOG

Referenced by:

DSKALC,

BAT Block is one sector
conslsts of 4 words of
e.ch 2 word data entry
the disk.

DISC, DEVICE, PRYB2
Po mat

SIXBIT/BAT/

/ \

BA'!'PR
!Te. Block. Left
9

B'l'MC'r

•

BTHer
17
of Pairs
Added By
Mapper

Seader

• of Pairs Added

by

Monitor

\ /
\

Bad Block Infor.ation

\
~ata

9

ADD 27
Addre •• of Starting Sector

/ Pair

35

/

.

··
··
···
··
··

\
\
:.Data
/ Pair

BATCOD-176

Unlikely Code 68686.
Sector NWIlber of the BAT Block

/

Data Pair
word 1

fI

18

BA'l'NI
Bad Blk. cnt

2.

InNM
Controller.

21
Type

22 23
APRNM
Apr Serial

Bit.

Pointer

Content

"-8

BATMB

Couat of a.td Blt. 1n Pair
M•••bua Controller •
Type field in BAT Pair
APR Seri.l t

la-2_
21
23-35
word 2

8

BTlNa
BACT

APRINt

Bits
18-35

ADD1!

9-35

AD!) 27

Old .tyle disk addre •• of
starting sector
New style address of
starting sector

-5-

35

•

O.scription:

Balance Set Proc.ss Table. This table is a
doubly link.d list of all forks in the balanc.
s.t and i. parallel to the BALS!T table. Th.
point.rs to the be9inninq and'end of the list
are k.pt 1n the r •• id.nt storage addr •• s, BALLST.
The Schedul.r .cans this ordered list from the
top for the next eligible fork to run. When a
fork ha • •xhaust.d it's balanc. set quantum (Se.
BSQ table), it vill be requ.u.d to the bette. of
the SSP! lat. allowing the Scheduler to Clive
round-robin CPU •• rvice to the balance ••t
proc ••••••
Co_put_bound proc..... (Q3 forks ) ar. placed
at the end of the BSP'!' 1 ist when th.y .nter the
balance s.t. Int.ractiv. process •• (0', Ql, Q2
fork.) ar. initially favored in th.ir plac•••nt
on the BSPI' list a. th.y are placed above Q3
forks and above any forks that have run 80re
than th.ir balanc. s.t quantua. (1 ••• , have been
r.queued one.).
onc. 1nteractive proc ••••• have exhau.t.d th.ir
balanc. set quantu.., howev.r, th.y are requ.u~d
to the botta. and co.pete equally vith other
fork. for CPU servic••

Def~ned

in:

Ref.r.n~.d

STG

by:

SCREC

FORMAT
BSP!'

S.ckward List Ptr.

··
··
·
Note:

Forvard List Ptr.

··
··
·

Th. end of the list vill be aarked by the
addre•• , BALLST.

Na.e:

aSQ

Description:

Balance Set Quantum Table. This table Is parallel
to the BSP? table and holds the balance set quantua
for a fork in the Balance Set. When the balance •• t
quantua has .. pi red for a fork, the fork i. requeued
to • lower run priority In the BSPT table and its
quantu. reinitialized.

Defined in:

STG

Referenced by:

SCHED
18

35

BSQTM
Balance Set Quantum*

* The initialization value 1s currently

-7~

21. ms.

..,

~

Bft·

Description:

Bit Table for Disk. ~is table haa mapped
into it pointers to the file STRNAM:(ROOT
-DIRECTORY) DSKBTTBL, when pacJe. are allocated or d•• llocated fro. the di.k unites)
belonging to structure, STRNAM. The bit
table file a. shown below indicate. which
p.; •• are a •• igned (bits off)
and ~ich
are available (bits on).
It c:oa.a!.U of ttllO parts, ~ top __ ~lf_ ~ ._.
tain.
tile n. .ber of fr_ paq •• for uch

cylinder. in the ,structure and the bottaa
balf contain. a bit ..p ( 1 bit Per peg e)
for all p.ge. of each cylinder 1ft the
structure.
At initialization ti.e, all of this structure'. pege. belonging to the 8o.e block.,
swpping space and pointed to by the BAT
block. are ••• igned in the Bi t Table file.
Defined in:

STG

Referenc::ed by:

DSItALC

Pree Page. on Cylinder

/I

Pree P8ge. on Cylinder 1

··
···
··

··
·

Pree Page. on Cylinder n
~

8

, \

\

\

l
\

l

\
\

\
\

~

\

Cylinder
I

e

\

Cylinder 1
I

\
Cylinder n
I

Note:
In the bit map each cylinder starts on a word boundary
and contains as many full words as are needed for all
of its pages.
*For Systeas which have sectioning, the BTa table doe.
not hold the map. for the disk bit table file. Rather,
the monitor will aap the disk bit table file for a
structure into section four of the monitor's address
space.when it ne.ds.to allocate or deallocate disk pages.
That .i., the index block of thi. file vill be the page
table pointed to by the aonitor's section pointer for
.ection four.

Name:

BUG-BLT/CBK/INF-STORAGE-AREA

Description:

Def ined in:

BUGHLT, BUGCRK, and BOGINF Storaqe Area. This re.ident
storaqe ia used to hold such information as the pu.h
down list, PC, ACe and dispatch address wben a aUCBLT/
IUGCBK/BUGINP occurs. BUGS!B holds the pointer to the
l.st queued up SYSERR block. (Se. SYSERR-6TORAGE-AREA)
STG

Refer"enced by: APRSRV, DIVICE, DIAG, DIREa, DISC, DSKALe, D'rESRV,
DO, nSRV, nLIMI,PIUlSC, rORK, FREI, rtnILI, G'l'J1'N,
IMPPBY, IMPDV, 10, IPCr, JSYSA, JSYSP, LINPR, LOGNAM,
LOOKUP, MAGTAP, MIXEC, MSft, !lITWRK, !lSPSRV, PAGIM,
PHYBll, PRYB2, PIIYM2, PHn .. , PHYSIO, SCBID, S!'G,
SWPALe, SYSIRR, TAPE, TTYSRV
PORftAT

•

BUGHLT

(PC

Stored here on BUGHLT)

JRST BUGHO the BUGBLT vas issued
Save Va11d Ix_lne 1n BUGTYO

SVVEXM

Lock on BUGxxx

BUGLCK

Ro utine.

• (PC Stored here on BUGeR!)
JRST BooeO
• Stored here on BUCINP)

BUGCBK

BooIH!'

(PC

JRST BUGIO
BUGACS·

,

\

AC'. Saved on • IUGRLT
(Contents of AC' • • t time of

BUGHL~)

BOOPDL

Push Down List ('''0 12 words)

BUGOft'

Count of BUG Block. in SYSERR Queue
(Maxi.ua of BUGMAX-S)
!luaber of BUGHLT/CRK/INrs since STARTUP

BUGsn

Ptr to last queued up SYSERR Block
due to • BUGHLT/CB!/IHr

BooP

Place to Store P OUr1nq BUG BLT/CHIt/INP

BUGPl

Te.p Storage for BUGSTO Routine

BUGP2

Te.p Storaqe for BUGSTO Routine

BUGP3

Temp Storaqe for BUGSTe Routine

-1.0-

,
,
,

H••e:

CDB

De.cription:

ChanDel Data Block. Thia table, one per ebannel,
contain. channel dependent instruction. and data,
pointers to the units (I.e. ODBs) belonging to
the channel end information aboat the currently
active unit. When the channel interrupts,
control passe. (via a JSP instruction) to COBINT.
The COB addre•• is stored in AC, Pl, and the
principal analysis routine, PHYINT; 1s called.

Defined in:

PB1PAR

~fft.need~:

PltYSIO, PllTB2, PRYM2,

PRYP4

Pormat
COBIN,.

I (2-word PC stored on interrupt)

-s
(nags)

-4

-3

•
•
I"

.+1

MOVBM P1, • +2-+CDBSVQ

-2

JSP Pl, PBYIliT

-1

Status and Configuration Intoraation

CDBSTS-'

Me.ory Bandwidth Scheduling Intoraation
CDBODT

OVerdue Tl.er wben Data Transter Active

COBICP

EXEC Virtual Adrs (!P! Adrs) of
Data Logout Are." Interrupt Vector

COBIUli

Initi.l AOBJII Pointer to

CoaCUN

current A08J11 Pointer to

COBDSP

Unit Utilities Dispatch

tms Table
tJD8

Table

Main Entry Dispatch
(Channel Dispatch Table)

coarCT

Pairness Count for Latency

COB PAR

Ctannel Me.ory Parity Errors

CDBNXM

Channel

MXMs

Currently Transferring OD8

COBUR
COBCCL

r-

Channel Command List (3 words)

,
\

COSUDS

\
\

UDS Table (8 word.)

\

\

-11-

CDBSVQ

P1 Saved llel"e on VeetOl" Interrupt Entry

BL'!' 11, 1T

CDB.JEM

(Interrupt 01_1 •• )

DA'!'AI RB, CDBRST
XJD COB INT (P 1 )

CDBRS't

Location U.ed by CDBJEM

CWCRI

Channel CONI at Start of Interrupt

CDBOHR

'ork

_0 saa

Olannel In Mai.,t. Mode

CDBADR

Humber of Thi. Channel (CBln'AB index)

CDB~SI

Channel Statu. I at Error

CDBCSl

Channel Status 1

CD8CS2

Channel Statu. 2

CDBCCl

First CCW

COBCC2

Second CCW

CD80VR

Number of Overruns

CDBICR
CDBCL2

Initial STCR When Device Started
\

I'

Alternat&

cow

List (3 words)

CD8 Device De p endent Block

CPBDDP
\

\

1

1

-12-

8 1 2 3 4 S 6
COBSTS

2S 26 28 9 8 31

I

I , 11 I 1
SYlibol
CS.OPL
CS.AC1
CS.AC2
CS.MAI
CS.JIfRQ
CS.ERC
CS.STK
CS.ACL

Sits
8
1

2
3
4
S

6

7
26-28

31-35

PIA

35

TYP!

Content
Offilne
Pri.ary coa.and aetiy.
Secondary co. .and active
a.anne1 is In .atnt. aode
".lnt • •ode requested for a unit
Error recovery in pro9re••
Channel Support Command Stackin9
Alternate COW List is CUrrent
PIA fi.1d
Channel type field

COBDSP
Se. Table., UDS and CDS

coaoop
COB Device Oependent Block for the RB21 Controller

COBODPaRR2CNI

CONI RR2, TI
CONO RH2, T2
DATAl RR2, Tl
DATAO RR2,

-13-

T2

COB Device Dependent Block for the IBll Controller
CI)8PDP-RClCSl
RClDS

Control Status 1
Drive Status Register

RClDl

JrrorRe91st~rl

RClMR

Maintenance Register

RClA!

Attention Su. .ary Register

RClDA

De.ired Address Register

RClD'l'

Driver Type Register

RClLA

Look Ahead Register

RClSH

Serial Number Register

RClor

Offset Register

RClOC

Desired Cylinder Register

RClCA

Current Cylinder Register

RC1ER2

Error Register 2

RClERJ

Error Register 3

RC1!Cl

ICC Register 1

RelBC2

ICC Register 2

RClWC

Word Count Register

RC1BA

Current Addre•• Register

RClCS2

Control and Statu. Register 2

U8ACSW

Unibus Statu. Register Addre••

UBBASA

Unibus Bus Addr. Base Addr.

-14-

Deecription:

Storage Are. for card Beaders
Each entry (except for CORLex
i. CORN word. 10n9 where CORN
nUliber of card reader. on the

Defined in:

STG

Referenced by:

CDRSRV

CORCTl

~

CDRCKT

CDRSTS ,
CDRSTl
CDRST2

Cphysical).
and CDRCNT)
equals the
ayst_.

Buffer Count

,

Word for Scheduler Test

,

Statu. Word

,

~

~

~

Second Status Word
Third Status Word

~

CARDCT

Count of cards Read

CARDER

Number of -Hardware- Errors

CDRLCK

CDR Lock Wo rd

CDRCNT

Count of CDRa Opened

,
~
\

,
~

The Non-resident area cantaina:

CDRBUP

i__________

f

C_4_r_d__R.e.a.d_e_r_B.u_f_f.e_r__C.l__p_a_9_e_)___________

-15-

•

17 8 9 21

35

emR$TSI_.~-.~~_OWn
__ .~_r_k__-.~. .~I_I__I___

CCl
__BB_L_._s_t__E_r_r_o_r.c.o.n_4_1_t_l_o.-nl

.l_ft9
__

8lts
1-17

18

19
21-35
• 1 234 5

CIlRSTll

I'IILI

Polnt!ll"

Content

enoL

OVDlnq fork
If on., carda In r.ad.r
Waitint for a card

CDBLK
ClZRR

~.t

error

11 2 3 4 5 6 17 18

eond~tion

35

IIII 111C:~ant I~tarnal StmqaWord I
i

Point.~

Content

e

COAII

1

CDATN

2

CtMSG
COOPN
CrER

COR open.d in ASCII
CPR needs attention
Suppress $yste. messages
COR is pp.n
Error In this CDR
Count of byte. now In bu~fer
EOP button was pushed
Buffer for process level
Proc,ss needs interrUPt
Suffer for PI l.vel
If one, doing a buffer by proc.ss

~its

3
4

12

CDCNT
CDEO,

13
14

coaUF

17

COPIR
COBPI
CODON

lS
l6

-16-

17 8 9 21

• 1 2 3 • 5 6 7 8 9 • 1 12

CDRST21111
JUts

35

CDPSI
Pointer

Content

CDSHA

·Status ha. arrived· flag
MTOPR is waltin9 for statu. to
arrive
Front end ha. reloaded
PSI chan. no. for on-line
·tran.itlon.

CtMWS

CatLD

CDPSI
ctBST

SoftllJere .tatu..-wrd

Syabol

Bits

.DVPP!

28

.OVl'LG

29

.DVP!F

31
31
32
33
34
3S

.DVFIP
• DWSE
.OVFH£

.DVFOL
.DVPNX

-17-

Oevice ha. a
fatal, unrecoverable error
Error 1099in9
in~o. follows
!OF
I/O in pro9re ••
Software cond •
Hardware error
Offline
Nonexistent device

Oescription:

Channel Dispatch Service Routine Table.
This table contains vectored addre.... to
channel dependent functions. and is given in lta
generalized fora. ~he specific channel dispatch
table for the RB21 beqins at RB2DSP In PBYB2.
See PRYPAR for definition. of arguaents given
and returned on calls to these channel routines.

Dee i ned. 1n:

PBYPAR

Referancad Jly:

PRYB2, P1ITJI'2, PBYP4, PRYSIO, S'fG

ronaat
Initialize and Build Data Structure
Stack Second Channel Co. .and, Skip it OK
Start I/O on IORB (skip if started O.K.)
COSPOS-3

Do POSitioning to Idle Unit (skips if O.K.)
Return Latency and aest Reque.t (I.e. best IORS)

CDSI~'1'-5

Interrupt Entry
Generate Single CCW Entry

CDSBNG.7

Rung Re.et

<::DSRST-li

On Restart, Reset Channel and All Device.

CDSCHK-ll

Periodic Check Entry, PIA, etc.

-18-

Description:

Channel Table, indexed by channel number,
contains channel data block (COB) pointers.

De(1ned in:

STG

Referenced by:

DSKALC, PBYR2, PHYSIO

Pormat

CBN'l'At

CDS

Pointer

/1'
Chan. t

,L

-1.9-

Name:

CST~

Description:

Core Status Table 9 (sometimes referred to as
CST). Each entry in this table, indexed by
physical page I, 1s principally defined by the
pager. If the page is in us., the entry contains
the age stamp for the page, which process.s
have referenced it and whether the page has b•• n
modified. The ag. stamp field is used to show
the page's stat. if it is not assigned to a
proc••••

Oefined 1n:

STG

Referenced by:

APRSRV, DSKALC, PAGEM
Format

CST0

CST AGE
Age

Process Use Register

/ \
M

or
CST AGE
Page State

CFXRO

Fork •

··
··
···
···
···
··
··

-20-

Physical
Page t

\ /

Symbol

Bits

A-8

Pointer
CST1l.GE

PUFLD

COflMB

Content
If page in use, contents of
pager age register ( >- 100
at last age register reload
Process use register if age
field indicates page is in use
( i.e., age >-10~). Bit n is
1 if process with core number n
has referenced it. (Core number
is stacked in the FRCNO table)

35

This is the -modified- bit which
1s set by the pager on any write
reference. This bit will be 1 if
the page has been written since
the last operation.
If page not in use, this field
indicates (right-justified) the
page state as follows:

AGP:MSK

PSRPQ .. ~
PSDEL - 1
PSRDN
PSWIP
PSRIP
PSSPQ

-

PSASN -

PSTPLD

On replaceable queue
To be put on replace
able queue
2 Read completed
4 Write in progress
6 Read in progress
7 Page on special memory
queue
10 Page assign to process
if age field >PSASN.
(The age field should
always be strictly
greater than lS as
it is initialized
to l0a and increases
in value as process
runs. )

15...a2

CFXTtD

Number of fork which initiated
read if page not in use
(i.e. age field < 10).

3314

CSTPST

Special page state
PSTAVL-.MCPSA-0
PSTSPM-.MCPSS-l
PSTOFL-.MCPSO-2
PSTERR- •.MCPSE-3

-21-

Available for
RPLQ when freed
Place on SPMQ
when freed
Offline-ection
as PSTSPM
Offline due to
error action as
PSTSPM

Name:

CST1

Description:

Core Status Table 1. This table, indexed by physical
core paqe number, is referenced only by the software
and ls parallel to CST9. It contains the lock count
which indicates the number of system events requiring
the page be locked in core (l.e., page table contains
other core addresses) and the backup address (next
level of storage) for each page 1n core (1999999
if unassiqned).

Defined in:

STG

Referenced by:

PAGEM, PHYSIO, SCHED

0 PLK

CSTl

11

Lock Count

14

35

BaCkUp Address

/ \

··
··
··
···
·

··
··
··

Note:

If· the lock count is non-zero, the page will not be
considered for swapping.

-22-

Physical
Page

•

\ /

~ame:

CST2

Description:

Core Status Table 2 (Home Map Location). This
table, indexed by physical page number, is referenced only by the software and is parallel to
CST0. It contains the home map location for the
page (i.e., the page table which contains the
core address pointing ·to the page).
If the left half is 0, the home map is the SPT
and the right half contains the 5PT index.

If the left half is not I, the home mwp i~ a
page table or index block, where PTN is the
SPT index of that map and PN is the page number
within that map.
(See the SPT and SPTH table descriptions.)

Oefined in:

STG

Referenced in:

PAGEM
Format

CST2

P~

I

PN

/ \

or
0

I
··
··
···
···
···
··

-23-

SPTN

Physical
Page

t

\ /

Note;

The SPTN/PTN value (both SPT indexes) is used to specify
the kind of page represented in the CST2 table. For
example, if the SPTN in the second format above is
greater than or equal to NOFN (length of the OFN area) ,
the process' page is a file page pointed to by a shared
pointer or fork overhead page. Otherwise (i.e.,
SPTN(NOFN), it's an index block page.*

Likewise, 1f the PTN value in the first format above is
greater than or equal to NOFN, the page is a private
process page (l.e., pointed to by a direct pointer from
the process' map). Otherwise (i.e., PTN(NOFN), i~ is a
process' file page pointed to by an indirect pointer
through the file's own page table, the index block.*

* In both of these cases when an index block is

involved (i.e., SPTN/PTN< NOFN), it is common to find
in the monitor listings the symbolic notation, OFN,
replacing SPTN/PTN.

-24-

Name:

CST3

Description:

Core Status Table 3. This table, indexed by
physical core page number, is referenced only
by the software and is parallel to CSTI. An
entry in this table is used for a variety of _
purposes, generally as a list pointer for groups
of page. on various queues.
Por example, when on the replaceable queue,
the left half and right half contain backward and forward list pointeTs, ~espeet1vely.
When on a swapping device queue, the right
half contains a forward list pointer and BI
i. 1 if write and I if read. Other queues
threaded through this table are the deletion
and special memory queues.
When the page is in use (not linked on one of
the queue.), it contains the local disk address
for PHYSIO and the fork • assigned to the page.

Defined in:

STG

Referenced by:

PAGEM, PHYSIO, SCHED
Format

CST3

Backward List Pointer

,

Forward List Pointer

/ \

or

I

I

Forward List Pointer

or
Flags

CSTOFK
Pork

•

CSTLOA
Local Disk Address

···
··

Physical
Page ,

··

···
···

-25-

\ /

CSTOFK

Symbol

CSTLDA

•

Fork

Bits

Pointer

Local Disk Address

Content
Set if write in progress.
The bit is cleared by the
swapper when the write
completes.

DWRBIT

SWPERR

1

Set if an unrecoverable
error occurred when this
page read in from disk/drum

DSKSWB

2

Swap to disk requested by
DDMP (periodic routine that
trickles file pages to the
disk) or by monitor when
certain monitor calls are
issued, e.g., CLOSF

3-14

CSTOFK

Process to which this page
is assi9ned (7777 is not
assigned).

15-35

CSTLDA

Local disk address for
PHYSIO

-26-

Name:

CSTS

Description:

Core 'Status Table S. This table, indexed by ph~
sical core page number, 1s referenced only by the
software and is parallel to CSTI. It is a table
of short lORSs. (See the IORS table description
for fonaat of the IRBSTS entry.)

Defined in:

STG

Referenced by:

PHYSIO
Format

CSTS

I Next Disk

Fla9S

IORB(short/long)

/ \

Physical
Page t

\ /

-27-

Name:

DEVCHR

Oescription:

Device Characteristics ~able. ~is table contains
indexed information about each device unit and is
initialized fro. the INIDVT table at syste. startup
Se. IlI11)VT table for bit definitions.

ti...

Defined in:

STG

Referenced by:

DEVlCE r DISC, GTJFN r JSYSA, JSYSF, MEXEC
Format

DEVCHR

CHAR1*

17

9

8

I

TYPE

35

18

I

MODES

/

,

NDEV

,
*CHAA1
Sit 5 can take on another meaning (i.e., DVOPN-1B5i
Fi1~ Open on Device) than the one described in INIDVT.
Note:

A resident word, DEVLCK (Free is -1), 1s used to
lock the data base in the DEVXXX Tables when they
are being manipulated.

-28-

/

"aile:

DEVeRl

De.cription:

Device Characteristics Table 1. This table,
contain. another word of information about each
device unit in the system and is initialized from
the INID~ table at syste. start up ti.e.

Defined 1n: S'1'G
Referenced by:

DEVICE, DISC, GT"",, JS'YSA, J5YSP

Format

DEVCRl

Device Characteristics (word 2)

/ \

NDEV

\ /

Symbol

Bit

Dl'SPL
Dl'ALC

•

Dl'VVL
DltNIU
DltINI

Content
Device is spooled
Device is under control
of allocator
Volume valid
Device slot not is use
Device is being initialized
currently for structures
only)

1

2
3

4

'-29-

Name:

~VCH2

Description:

Device Characteristes Table 2. This table contains
spool dir.ctory information and is parallel to th~
DEVCRl table.

Defined in:

S'1'G

Referenced by:

DISC, JSYSA
Format

DEVC;R2

01 rectory Nwnber of Spool Ql.reetory

/ \

NDEV

\ /

-30-

Na... e:

DEV'OTB

De.cr.iption:

Dispatch Table. Each device has its own di.patch
table that confor•• to the format de.cribed below.
An error return dispatch addre.. 1. placed in tho.e
word. which have no corre.ponding device function.
The naming convention for the.e table. is the
device na.e concatenated with DTB (i.e. MTADTB,
DSKnTa, TTYDTB, etc.)

Defined in:

PROLOG

Pormat

DLUKD-e

Directory Setup

NLUKD-l

Na.e Lookup
Extension Lookup

VLUKD-3

Version Lookup

PLUKD-4

Protection Insertion
Account Insertion

SLUKD-6
OP!Ml)-'

Status Modification
Open File
Sequential Byte Input
Sequential Byte Output

CLOSO-12

Clo.e rl1e
Rena.. e rile

D!tO-l4

Delete Pl1e

DMPIO-1S

Dump Mode Input

OMPOO-16

Ou.p Mode Output

-31-

-mTD-17

Mount

DSMD-29

Dismount

INOO-21

Initialize a Directory

MTPO-22

MTAPE Operations

GDSTD-23

Get Deviee Status

SDSTD-24

Set Deviee Statl,l8

RECOU-r-2S

Poree Record Out

(SOU~)

RFTAI)O-26

Read Pile

SFTADO-27

Set Pl1e Time and Date

JFNID-3"
~'NOD-31

.\TRO-32

~l.e

and Oate

Set JFN for Input
Set

"PM

for Output

Cheek Attribute

-32-

~ame:

DEVDSP

nescription:

Device Dispatch Table. This table contains the
device dispatch table for each device unit and
is initialized from the INIDVT table at system
startup tille.

Defined in:

STG

Referenced by:

DEVICE, JSYSF
Pormat

DEVDSP

Device Type Index
(Not Referenced)

Dispatch Table Address

/ \

NOEV

\ /

-33-

Name:

PEW AM

Oescription~

Device Name Table. This table contains the
SIxatT device n.. e for each device unit. The
generic device n•• e is obtained fro. INIDVT,
modified to include unit number (if device has
units) and stored in this table at syste. start
up time.

Defined in:

STG

Referenced by:

DEVICE, JSYSA, MEXEC
Pormat

OEVNAM

SIXBIT I Name I

I \

NDEV

\ /

-34-

Name:

DEVUNT

Description:

Device Unit Table. This table, contain. infomation about the job aaaoci.ted with. unit,
where the unit information in DEVUNT 1s built
at system startup utilizing data from the
INIDVT table.

Defined in:

STG

Referenced

by~

TTYSRV, DEVlCE,

JSYSA~

J~YSP,

MEXEC

Pormat

DEVUNT

Assigner's Job./Oev Fr.e(-1) Unit. or No Unit Dev(-1)
or being controlled by
the allocator (-2)

/ \

NOEV

\ /

-35-

Name:

DIRECTORY

Description:

Directory rormat. The following illustrations
show the format of a TOPS-21 directory.

Defined:

PROLOG

Referenced by:

DIRECT, DISC,

DS~ALL

0gerv i.w of .. D1 ntetury

Page"

Page 1

···
··
·

··
·
Page n

Symbol Table

Reserved

f~r

Directory Expansion

-36-

First Page of a Directory

"

17 18

DRTYP

23 24

DRVER
Ver ••

4""3""
DRRPN
Relative Page • in DIR

DRHLN
tenqth of Beader

DRNUM
Directory NUilber

ORFFS
Pointer to First Fre. Block
ORSBT
Address of Bottom of Symbol Table
ORSTP
Address of Top of Symbol Table
ORFTP
Address of Last Used .Word +1 for Strinqs and FOBs
DRrST
Pointer to Free Bit Table
DRDPW
Default rile Protection
DRPRT
Oefault Directory Protection
DRDBK
Backup Specification
DRLIO
DRLOO

Logged In Quota
Logged Out Quota

DROCA
Current Directory Allocation
DRNAM

-37-

Pointer to Directory Name String
DRPSW
Pointer to Password String
DRPRV
privilege Bits
DRMOD
Mode Bits
DRDAT

Date and Time of Last LOGIN
DRUGP
Pointer to User Group List
DROOP

Pointer to Directory Group List

DRUDT
Date and Time of Last Update to Directory
ORSD,.,
Nax , of Subdirectories

DRSDC
Count of Subdirectories

ORCUG
CRDIR allowed specifying these User Groups
DRACT
Pointer to Dir. Default Account
Spare Words

Fre. Space for Strings and rOBs

-38-

Subsequent Directory Pages

DRTYP

DRVER
Ver • •

4"13""
DRRPN
Relative Page • in DIR

DRHLH
Length of IkNd.r

DRNUM
Directory Number

DRFFB
Pointer to First Free Block

Free Space for Strings and FOBs

Symbol Table

SYMTY

SYMON
Dir. • of Sym.Tbl.

411488
-1

SYMET
Type

SY"IVL

SYMAD

Address of FDB

First 5 Characters of Name, Account or User
Name for last writer/author

···
··
··
·

\
\

/

\
\
/
/

-39-

>

/

>

35

" 1 2 3

I~·I

Addre.s of POB

Bits
0-2

Pointer

Content
Entry Type

SYMET

o•

.ETNAM
2 • .!TUNS

3-35

4 • .!TACT
Address of roB

SYMAD

Name
User Name
Account

User Name String

UNTYP

411114

Ver • •

UNLEM
Length

UNSHR
Share Count of User Name String
UNVAL
ASCIZ User Name String

-40-

Malle StrirMJ

Nfl'l'YP
4""'1

Ver. I

Nit LEN
LenCJth

NMVAL
ASCIZ Na.e String (1st 5 characters)

Extenaion String

EX1'YPE

4""""2

Var.'

!XLEN
Length

ASCIZ Extension String
Account String

ACTYP
4•••• 3
ACSRR

Ver. I
Share Count

ACVAL
ASCIZ Account String

-41-

ALLEN
Length

File Descriptor Block (FOB)
FBT'YP

FBLEN

FaVER

Ver. I

41"18"

See PnB

~l.

Len9th

for DetAil. of thia Block

1

1
Free Space

..
FRVER

FRTYP

FRLEN

Ver. I

48858"

Len9th

FRNFB
Pointer to Next Free Block or I if at end

,

Remainder of Free Block

1

-'2-

Free Storage Bit Table

Ver. I

.1161"

Length

Bit Table Containing 1 Bit per Directory Page
I - No Room on the Paqe
1 - There is Roo. on the Page

Group List

Ver. I

411'09

Group
Group

•
•

Length
Group
0

•

~

Name:

DRMBBT

D••crl"ption:

Oru. Bit Table. '!'his bit table indicate. which
pages are in use and which pages are available
in the swapping area.

Defined in:

STG

Poraat

\

l~

__________________________________________

\ \
~lCy~ind.r I

Cylinder 1
/

'_~

\

___________________________________________________lCY;ind.r

Note; The bit map for each cylinder starts on a word boundary
and contains as many full words as are needed for all of ita
pages.

-44-

n

Name:

DRMCNT

Deecription~

Dro. Count Table. ~is table, indexed by
cylinder, records the free page count for the
drum (logical swapping area). The total free
page count for all the cylinders is kept in the
storage word, DRMFRE.

nefined in:

S1'G

Referenced by:

SWPALC
Format

DRMCN'1'

Drum Free Page Count - Cylinder "

··
···
··

/ \

DRMMXB

Drum Free Page Count - Cylinder n
\ /

-45-

Name:

OSKSIZ

Description:

Disk Size Pointer Table. This table contains
pointers to the disk size data table.. DSKSIZ
is parallel to DSKUTP which contains codes for
the known disk types. When an entry .is added
to OSKUPT, • corresponding entry must be added
to PSKSI% to point to the correct size data
for that type of disk.

Oefined in:

STG

Referenced by:

DSRAte

Format

OSl(SIZ

Pointer to RPI4 Table (OSKSZI)
Pointer to RPIS Table (OSKSZI)
Pointer to RPe6 Table (OSKSZ1)
Pointer to RMI3 Table (OSKSZ3 )

Name:

DSKSZ" n

Description:

Disk Size Table (for type n). The resident
table contains size data (for disks) based
on type.
n ."'
n • 1
n - 3

Defined 1n:

STG

Referenced by:

DSICALC

for RPI4 and RPIS
for RPI6
~or

JUU3

Format

DSKSZ"n/SEGPAC-B

Sectors per Page
Sectors per Cylinder
Pages per Cylinder

CYLUNT-3

Cylinders per Unit

SECUNT-4

Sectors per Unit

B'lWCYL-S

No. of Bit Words in Bit Table per Cylinder

MINPPGa6
MAXPPw7

Min1mUll Fr •• Page. for Free Choice Allocation
Paq .. per Unit for OSKASN turning po1nt

-47-

Name:

DSKUTP

Description:

Disk Unit Type. This table contains the unit
types used by the file system.

Def ined in:

AI YSlO

Referenced by:

DSKALC
POrllat

OSruTP

RP'4 Disk Unit Code ( .trrRP4 • 1)
RPeS Disk Unit Code
RPe6 Disk Unit Code

e .UTRP5 • 5)
e .UTRP6 • 6)

RM'3 Disk Unit Code e .UTRM3 • 11)

-48-

Name:
Description:

Drua Status Table. This table is indexed as a
function of the drua (swapping space) addres••
The routine GDSTX converts a drum address into
a CST index. The CST holds the address of the
next lo~er level of storage (usually disk) for
the page stored at that address on the drum.
BWRBrf (bit 11) indicat•• i~ the page haa been
changed since being read from the lower level
storage. The page will only be copied back on
to th. lower level storage if BWRBIT is .et
(i.e., page modified) when the page is no longer
in use. A slot no longer 1n use contains a -1.

Defined in:

STG

Referenced by:

PAGEM
Pormat

11
OST

14

35

II I

Storage Address

/ \

Page
Number

~----------------------------------------------------~Orum

\ /

-49-

Naat:

DTE-STORAGE-AR!A

Description:

OTE Storage Area.
This storage area contains
storage
for
each
OTE.
It
contains
the
Communication Area for each processor in COMBAS,
the linked output packet queues (pointed to by
OTEQS), the OTE input buffers, and local storage
(i.e., ACs, PC, ,
POL)
for the OTE Protocol
Handler, OTESRV.
A packet in the COMQ area must be reformatted to
RSX28P protocol and stored in PK~ADR before being
sent over the DTE. The before and after packet
formats are described below.
Two single

packets, SNGPKl and SNGPK2 (already
formatted
as
direct
packets
to
RSX28F
protocol
See below)
are set aside for the
OTSNGL routine.
This routine is responsible for
activating lines and sending single characters over
the
OTE
if the output buffer has only one
character.
Normally output buffer characters are sent via
indirect packets over the OTE, where the indirect
packet (after being reformatted and stored in
PKTADR) is sent first followed by the line's output
buffer characters.

Defined in:

STG

Referenced by:

DTESRV, SPRSRV, MEXEC, SCRED

UPFLAG

Word to Generate Continued Message

LOADll

Says if -11 Needs to Reload

LODFRK

Handle of Monitor Pork Doing -11 Reboot

DTEDTE

The Interrupting OTE
FE Physical Unit for TS TTY

CTYUNT
DTEQS

Drive Queue Header for OTE 1
(Ptr. to 1st Queued Packet in COMO)
PI

..
Oriver Queue Header

,

for OTE n

COMQ
\

Area for Queue Packets
(apacket Size * D2e )
A

I

,
\

I

-so-

COMH

Queue Header (Points to lst Pree Packet in COMO)
OTt 1 Status Word

OTESTS

··

,

OTt n Status Word
OTE 1 Secondary Status word

OTEST~
~

·

·

OTE n Secondary Status Word

OTBBF!"
Buffer Pool
\

(Two ·03l-Word Input Buffers/RSX20F protocol OTE)

OTEFWO

\

Hdr. Word for OTt 1 Buf
(Ptr. to 2nd Input Buf" Ptr. to lst Input Buf)

··

Header Word for OTt n Buffer
OTETRA

Interrupt Return PC for OTE 1
~

··

~

f'

Interrupt Return PC for OTt 2

OTESKP

,

OTtACB

~

Local POL Stack

~

Block to Save ACs

,

Storage for Indirect Punction for OTE 1

OTtINO

··

,

Storage for Indirect Punction for OTE n
PKTAOR

,

Storage for Queue Packets
(One 3-Word Packet/RSX29P protocol OTt)

-51-

,
f'

Processor

COMBUF

•

4

II'

Index into COMBAS to get to this
Proce.sor's Comm Area

••
••

3
2
1

"

I

t •

H.ader
Area

J/

XL1I -OWned- Area

COMBAS

\
\

-To· OTEl Area

··
·

-To· OTEn Area
OTE1 ·Owned· Area
-To· KLli Area

···

\

DT!n -owned- Area

\

OTEn
\ Co_
I Area
I
\ I

-To· KLli Area
TAOll
TOIITM

,

~

/

Tim. Packet froID -11 (3 Words)
Time Packet to -11 C3 Words)

,
KLIOTA

KLINIK Data Bas. CAOli Words)
Slngle-Packet-1 Header Word

SNGPtU

,

Packet Data C5 Words)
Single-Packet-2 Header Word

SNGP~2

,
I'

Packet Data (5 Words)

-52-

\

\
Master
Process
Comm
Area
I
IComlluniI cation
I
Reqion
\
\ OTEl
\Comm
IArea
I
I

-To- OTE2 Area

,

I \

~

O1'ES1'S

"

1

2

O1'PRV
O1'EBF
Which
0'1'£;
1)'1'1
priviBuf 1s
ledged
exists in use
if set for
RSX21,
Protocol

O1'ERL

Bits

O'1'RLD
Set-)ll
is
beinq
Reloaded

4

O'1'ERL
O'1'EBI'

2

MBLK

3

6-17
18-29

MRLO
O'1'l(AC
OT5'1'I
OTEBl
D'1'EBC

31-35

D1'EST

5

6

11 18

O'1'S1'I O'1'EBl
Status Byte
Set-> Packet Count
of Last
11 is is
Split Xfer.
ill

O'1'UC

Pointer

1
1

4
5

3

29 31

O'1'EBC
0'1' EST
Byte
D'1'!
Count
Status
Re.ain
inq for
Subs_
quent
Xfer

Content
If set, DrE exists
Says which buffer is in use
for RSX21 of protocol
Por MeB, to KL11 is bloCked
on free space
If set, -11 is being reloaded
If set, -11 is ill
Status pocket is split
Byte count of list transfer
Byte count r .. aining for
subsequent transfer
DTE status
DTET11-1
KLll is receiving last
fraq.ent of message
MEll-2
-11 is receiving byte.
OT£11I-4
-11 is receiving an
indirect queue entry
0'1'£11'-11
KL11 is recelvinq 1st
frag.ent of a .es ••qe

-53-

35

DTESTl Is parallel to OT!STS and contains current
operation
data and special request bits for ·'1'0· -11
condition..
15

1

DTIPC

DTIOV

Current
Function Code

CUrren.t
Oevice Code

Pointer

Bit.

OTITM

33

34

35

DT1ID

Contents
Current funct.ion code
Current device code
··11 wants ti •• of day
Waltinq for indirect
setup

M'lrC
OT1DV
DTITM
OTIID

1-15
16-31
32
33

32

31

OTEIND (Storaqe for indirect packets)
7 8

"
IINUNT

15

17

INVLO

IINCNT
Unit

16

Count

Bits

Pointer

Contents

1-7
8-15
16

INUNT
INCNT·
INVLO

Unit
Count
If set, says unit
field is invalid

-54-

35

COfI'Q

Area for queue packets where a packet (5 words in length)
has the form:
I

OINT
Int toe for this Punction

OLINIC
Link to Next Packet

1

OrNe
runction Word for this
Request

OOZV

OLIN
1)evlce-1Jnlt I

QIIIDDI!

2

Dev. Code for this
Request

O~!

19 OCH'l'

indirect
Data Must
be Byte
Mode

~e

or •

35

Count or Byte

3

OPN'1'R
Byte Pointer fo rInd i rect Operation or Local a-bit Datum
if OCNT • •

4

QCOO
Unique Code Returned to Interrupt Routine, TTYINT
COMO are. is currently a.se.bled for room of A021 packets.

PKTADR
Storage for currently activated DT! packet for each DTE (Packet taken
from the linked list of packets on the queue in COMO and place here).
The packet has the following form:
15 16

Count
1

HDDEV
Device Code

2

HDLIN
Line

7 8

•

32

35

BDPlIC
Function

HDCNT

I

31

HDSPR
Spare
15

HODAT
Datu.·

or
15
HOOT 1
Datau. for Sin91e
Datum Packet

"

• Datum could be a character (direct packet case) or
Max • of characters to be sent (indirect packet case)

-55-

15 16
SNGPK1/2

31

Packet Byte Count

Function

Device

Spare

•

DatUID

Line t

Line t

Datu.

Line

Line t

DatUli

Line

16

" 1.2
Header Word

35

Link to Next Packet

'lags

Line

32

IIII

•t

Datwa
DatUII
DatWi

31

,Link to Next packett

Symbol

Bits

SNGONO

"

SNGAVL

1

SNGACT

2
1~-3l

Contents
On the OTE packet
queue pointed to by
OTEOS
Packet has space
available
Packet active (i.e.
DTE processinq it)
Link to next packet

COMBAS
·OWned· Area Block Pormat
1 2 3 4 5 6

•

0l'l'!N CJIIV!R

1

CMUff(

11 12

CPVER

16 17

OlMPR

19 21

OlSIZ

35

CMMAM
Processor Na.e

Pointer to Next Processor

,
C·l;(AC

-"

.

---

-

Proce.sor Keop Alive Count
PC Word
COMI PI, Word
COMI PAG, WOrd
DATAI PAG, Word

CMPDWD-11

CONI APR, Wo rd
DATAl APR, Word

CMDAPR-13

14

r

~

-57-

word "

" 1

2 3 4 5 6

II I I
Bits

11 12
CPVER

I

CMNPR

Pointer

1-3

"

CM'1'!N
CMV!R

6-11
12-16

CPVER
CMNPR

17-19

CMSIZ

21-35

CMNAM

16 17

19 2&

"ICMNAM
proc.ssor

N···I

Contents
Set If area belongs to KL1"
Com.unication area version
nuaber
Protocol veraion nuaber
Nuaber of processors
represented 1n this
are. (including owner)
Size of area In a-word
blocks
Processor name 4
(a serial number)

-S8-

8
1

1

CMPRO CMM'E

11 16 17 19 28

3

2

ou:mr

35

CMVRR CMSIZ CMPNM

-To· Proce ••or Ho.

1

CMP"
Pointer to ·To- Proce ••or's awned COllmunication Area

2

I
2
.c 12 13 14 16 17
1
3
CMPWP CML11 OIIMI 0ftS'r
CMPND
OIOP

3

3 4
"CM'rMD
Mode of Piec.ea1 Ctr.

18

19 21 27 28 35
CMOte CM1tC

19 21
CMQC'l'
(Bits 1.19 Used
Count of Word. in
by Prot. Ver. VNMCB Only)
Current Queue

35

CMPCI

Xfer

4

CMRLP

5

CMKAK
OWning proce ••or'. Copy of -To· Proce ••or's Keep Alive Count

Reload Par .. eter for ·To· Processor

11

1 1 2 3

Word II

[III

16 .17

CMVRR ICMSIZ
ICMPNM
.
-To·
I

.

Bit.

Pointer

I

CMPRO

1

CMOTE

2-3

CMM'H

11-16

CMVRR

17-19

CMSIZ

21-35

CMPNM

-59-

35

19 21

Processor Number

I

Contents
If set, it implies connected
to a XLl.
If set, there 1. a DrE
connecting this processor
and owning proce.sor
If CMOTE is set, this 1s
the number of that
connecting DrE
Protocol in use by the two
processors
Size of -to· area 1n
Seword blocks
-To· processor nuaber

" 1 234

12 13 14

Word 2

Symbol

16 17 18 19 20

27 28

CMOIC
To llIC
for Queue
Xfer
Bits

Pointer

1
2

CMPWP
CMLll
CMINI

3

CM'rST

t

13

<:MOP

17

CMPND

CMIP

18

CMTOT

19

35

CMIIC
To llIC
for Queue
Xfer

Contents
Power fail indicator - 11
wants reload (set by -11)
Initialization bit for
Mca protocol only
Valid examine if set
(should always be set)
Set if using queued
protocol
-11 doing full word
transfer (set by -11)
-11 doing indirect
transfer
-Toit e bit. Set to 1 by
KL1" in -ll's section
of -11's Comm area
after -11 sets QMode bit
or increments o-count,
and after -10 processes
the doorbell.
Cleared by KLli after
receiving Tll"DN~
Assures -11 that the
KLli has not
lost a T81"DN interrupt

21-·27

·CMOIC

28-35

CMIle

-11s wrap around count
of direct Q transfer
KL1"'s wrap around count
of direct Q transfers.

Name:

OTEDTV

De.cription:

DT! Protocol Device Dispat~h Table. The
entri .. with the dispatch address, TTYDTV
are for the C'n'. DLll. nUl and DLS device ••

Defined in:

STG

Referenc;ed by:

OTESRV
Format

DTEDTV

Re.erved for Unknown Device
TTYD1'V

TTYDTV
TTYDTV
'M'YDTV
LPTDTV
CDRDTV
iii (Unknown Device)

FEDTV

-61-

Name:

tNQIOEQ - STORAGE AREA

Oescription:

Enqueue/Dequeue Storage Area. The non-resident
local area for ~he ENOIOEO Facilty is illustrated first followed by the resident bit tables,
ENPKTB and tcKDBT.
A bit is set in the ENrKTS
bit table it the fork should be woken up or
interrupted because it owns a lock. (The
Scheduler's wake-up test routine address is
ENQTST. )

Defined

STG

iD1

Reterenced by: ENO, IPCP, DIRECT
FORMAT
RSB'1'BL*

~
,\

Rash Table fo r
ENO Locks
(Name/Number of Lock hashed)

ENOLOK

Data Base Lock For ENO and DEO
(-1 if Fre.)

ENOS PC

Count of .Fre. Space
Available for ENO's

ENOLTL

List of Long Term Locks

ENOLTS

Time of next Garbage Collect

l
\

Resident Storage:
ENFKT9

I II I · ·
Wake-up Table (1 bit/Fork)

LCKDBT

IIII··
Bit Tbl for OIR Lock ENOIOEO
(1 bit/fork)

*The name (or identifying number) of a lock block
is hashed to provide a number1 This number, modulo
the size of the hash table is used as an index
into HSHTBL. If the hashing algorithm yields the
same index for more than one lock block name, the
lock blocks will be linked together; the HSHTBL
entry will be the linked list header.

-62-

Name:

ENo-LOCK-BLOCK

De~i~ion:

Each resource 1s described in a lock block. Th.
lock block Is created at the time of the first
request.

Defined 1n:

!NO

Refere~c.d

1

3

by:

ENO

FORMAT

ENOLHC:
Sack Pointer to Last
Lock-Block on Bash Chain

!NQNHC:
Pointer to Next
Lock-alock on Rash O1a1n

ENQLLQ:
Back Po inter to
L.st O-Block on Queue

!NCJNLQ:
Porward Pointer to
'irst O-Block on Queue

ENOPLG:
Flags

ENOLVL:
Level Number
of this Lock

ENQTR:
Total • of Resources
in this Pool

ENORR:
Remaining Number of
Resources in this Pool

ENQTS:
4

Time Stamp
Time of LAst Request Locked
ENOFSP:
Fre. Block Pointer
to Free O-Block

ENOLT:
Long Term Lock List
for this Job

6

ENQOFN:
OrN, or -2, or -3,
or 4888"" + Job Number

ENOLEN:
Length of this
Lock-Block

7

ENONMS:
Number of Words in
the Mask Block

• ENOLT-5

ENQTXT:

ASCIZ String
or
588888 + User Code

-63-

11 12

I

Word.

17 18

ENQLVL
Level • of this Lock

[ ENQFLG

nags

Syabol
J:!i • .L1'l.-41

3S

Sita

Pointer

6

EN. INV-2.
D.LOK-l.

7

EN.TXT-"

9

EN. EXC-2
EN. ~ .. l

111
11
13-17

!HQCHN

18-35

ENQLVL

8

-64-

Meaning
LQng Term Block
This Q-Bloek 1s invisible
'!'he Q-Block has the Lock
Locked.
This Block has a Text
String Identity.
Request is Exclusive
~is is the Lock-Block
PSI Channel (-1 .eans job
Blocked)
Level I of this lock.

Name:

IPr
Executiv. Proce •• Table. This ._ory re.id.nt
table pointed to by the Executiv. a..e R.gi.ter
(IBR), contain. the vectored dispatch addr •••••
for syst. . ev.nts. All device int.rrupt. p•• s
control to a .pecific off.et position in this
tabl ••
This table also includ.s the executive .ection map
tabl., the ti.e of day clock and arith•• tic trap
instruction. wbich ar. execut.d wh.n arithaetic
condition. occur in executive .od••
Location. 444 to 451 ar. re.erved for .oftware and
used by D'l'ISRV.

Defin.d In:

STG

Referenced by:

APRSRV, DTESRV, MEXIC, PHDll, PRYH2
FORMAT

KIEPT+&

!lght Channel Logout Areas
Initial Channel Command
, Each: 1& Gets
Channel Status Word
~
2 Gets Last Updated Command
3 Re.erved for Channel's
,

,
r-

,

Vectored Interrupt Location
37

41

41
42

Re •• rv.d
, Standard Priority Interrupt Instruc.

S7
6&

rour Channel Block r11l Words

63
64

-65-

,

.
77

Reserved

1

~

Pointer to 8M11 Vector "able
eif 2"2" System)

SMTEP'l'wfCIEPT+l"
111
,

Re •• rved

,
r-

137

Pour 8eword DTE21 Control Blocks
Bach: I To -11 Byte Pointer
1 To -11 Byte Pointer
2 Interrupt Location
3 Reserved
4 Examine Protection Word
5 Examine Relocation Word
6 Deposit Protection Word
7 Deposit Relocation Word

DTEEBP-KIEP'l'+141
DTETB P-KI EP'l' +141
DTEINT-KIEP'l'+142
.
143
DTEEPW-KIEP'l'+144
DTEERW-KIEPT+145
DTEDPW-KIEPT+146
DTEDRW-KIEPT+147
I'

OTE1 Control Block

~

OTE2 Control Block

,
177

DTE3 Control Block

EPTMHI-KIEP'l'+21"

Available to Software

417
EPTPTI-KIEPT+421
421

LUUO fro. Executive Mode
e. LUTRP) *
Executive Arithmetic Overflow Trap

-66-

,

1

Instruction (JFCL) *
422

Executive Stack OVerflow trap
Instruction (.PDOVT) *

423

Executive Trap 3 Trap Instruction
(JP'CL) *

424
Reserved

437

441
~

443

Reserved for Software

DTEPtG-KIEPT+444

Operation" Complete 'lag

DTECPJ(-KIEPT+445

Clock Interrupt 'lag

DTECJ(l-KIEPT+446

Clock Interrupt Instruction

DTET1I-KIEPT+447

-To- 11 Argument

DTEFII-KIEPT+451

·'rom- 1l Argument

DTECMD-KIEPT+451

Command Word

DT!SEQ-KIEPT+452

DTE28 Operation Sequence Nuaber

DTEOPR-KIEPT+453

Operation in Progress Flag

DTEQHR-KIEPT+454

Last Typed Character

DTETMD-KI!PT+455

Monitor TTY OUtput Complete 'lag

P'l'Dl'l'l ~I EP!'+4 56

Monitor ftY Input nag

PTESWR-KtEPT+457

Console Swi tch Register

461

Reserved for Software

477
581

Reserved

~

587

~7-

'18

'1'1 •• sa ••

511
512

Performance Analysis Count

513
Int.rnal Counter Interrupt In.truc.

514

ZXEC SECTION I

,
577

,
EXEC SECTION 37

Available to Software

*

,

The.e value. are placed into the table when the EPT is
initialized at syste. startup.

-68-

Bx.e~t1v. '.9. Map Tabl..
This S12-word ... ory r •• id.nt
table hold. or point. to other table. that hold all of
the ..pping i~o~.tion n•• d.d by th. f1r.war. to tr.nslit' ex.cutiv. (monitor) virtual .ddr ••••• in a giv.n
•• c~ion into phy.ic.l ...ory .ddr...... It i. pointed
to by an entry In the monitor', ,.ction table 1n the
I ••cutive'roc••• Table (IPr).

Tb. fO" po •• ibl. foz-.ata for an _try 1n this table
(1~ •• , lmae4tate, .hare4, indirect or null point.rs) are
illustrated below. The d.tail. of th •• e four po •• ibl.

pointer word. a. well a. the ••chanics of the virtual
~o phy.ical tran.lation proce •• for a monitor pa9. is
identical to that de.cribed for tn. U•• r-Pa9. Map Table
(S •• U•• r-'9-Map-Tbl)

o.(ln.d il;\:

STG

FORMAT

"

/ \

Immediate Pointer

"OpCode

2

3

8

12

Acce •• Bita

STGAOR
Storage Addre••

35

1

or
Shared Pointer
2

"OpCode

3

8

35

18

Acce.s
Bits

SPrX
SPr. index
(Hold. Pq'. Stor Adr.)

2

Virtual
Pg •
O-m octal

or
Indirect Pointer
2

"

3

Access
Bits

Op
Code
3

8

9

18

17

IPPGN

35

SPrX
SP1' index
(Hold. Pg Tb's Store Adr)

PH

or
Null Pointer
2

"OpCode
I

8

3

Acee." Bits

• (Nonexistent

Pq)

I

···
* Currently MMAP is the monitor's page map table for section"

and section 1. The layout of the monitor's virtual address
space for section" is described in Appendix B of the Monitor
Structures Book.

-70-

\ /

Pe.cr1ptioa:

Pll. De.cription Block. All attribute. of a file
are stored In ita d•• cription block (rDB) aaintained
in the file'. directory. An rDa i. built in the
directory's free space area when a tile 1. ereated.
This ~.ble i. referenced by the PIR table.

Defined In:

PROLOG. MOHSlN

"R.f.~enoe4

• ABDR

by: 'DISC, DIRECT, tSDtc, -GTJlN ,JaYS", JS'!S?,
'ILIMI, LINEPR, 10, S~I!RR, DTlSRV

• n'!'YP

17 18

23 24
PlVlR

41.11 •

PI LEN

Vera •

35

LenCJth

Plrta

Flag.

nlXt.

Link to PDB at Next Extenaion

.PBIXL

nAIR
.'BADR

Disk Addre•• at File'. Index Block

PaPR,.

Pile Acee•• Bit.

518 •• 1

• 'SPRT
PlCR!

.'SCRI

Pate and ,.i.e at La.t Writ. to Pile

PlLW.

.'BUSI

DIR • of Last Writer

PBAT.

DIR

PIAU,.

•

of Author

Pointer to Author String

.PBAtrr
"PILWR

.PBUfR

Pointer to Last Writer String
nGEN
Generation Number

-71-

IPBCRN
Dir.'

(it it'. a Di r Pile)

f'

I'BACT

588"''',,1 + Account Number
or
Pointer to Account Strine)

.FBACT

5
11
FB8SZ
"PBGNR
Gens. Byte Sz

14 17 18
!'BMOC
FBNPG
Mode
• of Pages in Fl1e

6

.FB8YV

•

!'BSI%

. f of Byt.s in 1'11e

.!"BST%

PBCRV
.FBCRV

Cate and Tl.e of Creation
FBWRT

.FSWRT

Cate and Time of Last User Write
PBR!F
Cate and Tlme of Last Nonwrlte Acces •

• FBREr
FBNWR

PBNRF

•

• of Writes

• FBeNT

FBSJCI
.FS8K"

Backup Word .1

PBSll
Backup Word

.FB8Kl
.!,B8R2

of References

'2

P'BBK2
Backup Word .3
PBBK3

.FB8K3

Backup Word '4
PBBI4

.FB8K4

Backup Word '5

PBUSW
User Settable Word

.PBUSW
PBGML

Link to P'DB of Next Generation

.FBGNL
PB.M

Pointer to rile Name Block

• FSlaM
PBEXT
.FBEXT

Pointer to Extension Block

.rBLWR

Pointer to Last Writer String

-72-

35

• 1 2 3 • 5 6 7 8 9 1.

• ,SCTL

I I I I , I· I I I I I
Syabol

lit.

'1 'PM

•

n.,.,.p

2

,.UlXP

'.'DEL

..3

ntLNG
ntH,.

5
6

"'DIR

7

,a",rer

14-17

GAT

N~t.:

Pointer

27 28

35

Content

rl1. is • dir.ctory
r11. 1s not saved by backup
syst ••
rl1 • •ay have bad page.
rl1. cla.. fi.ld
Not an
• • .rBNRM
RMS file
MS file
1 • • 'BRMS

8

9

s•• Monitor Call'.
more inforaatlon.

17 18

rile is t .. porary
rile is per.anent
No exten.ion for this file
ye., file doe.n't really
exist.
rile i. deleted
rile doesn't exist (first
write not eo.pl.te)
Long file

1

PIUlex

,.UlOD

13 1 •

Referen~.

-73-

Manual (Chapter 2) for

Name:

PE-STORAGE-AREA

O.scription:

Storage area for front end deviees. Each entry
is rEN words long (except FEUNVW), where FEN
eqJal.s tha nuaber of front eDd davice ••

Defined In:

STe

~efer.nced

by:

PISRV

Format

FEUBDO

\
\

Pla9s
PEICT

PEUDBl

Current Input
Byte Count

,

PEUDB2
FEUDB3

,

PEIP'!'

}

PlFEM
Alloc

PE

PEn!

Pork

nICM
MaxillU8 Input
Byte Count

•

OWninCJ Device
PEFEI
Byte. Now in PE
\

Input Byte Pointer

PIIBP
Input Buffer Addre.s

}

PEOBP
Output Buffer Address

Input Input Pointer

PEUDB4
8

PEUNVW

2

• PEs

Input Input Pointer

The buffer are. for the front end 1. 1n the .onltor's nonr.sident
addre•• space.

PEBUPF

\

1 Pa9- in Length

-74-

\

"12

~

4 5

12

11
1'!PRK

Pork • OWning Device

I1II11
Point.er

Content

'-12

PSDn
rEBUt

3
5

PI PST
PlIOP
PIVOT

12~11

"PIM

O'l'E owning this device
Unit is blocked
Waiting for ~I Past
Input EOP declared by PI
FE ••• ignaent 1. valid
PI Allocation
Pork • owning device

Blt(s)

4

18-35

PIl'RK

-75-

tfame:

PKCNO

Description:

Pork Core Number Table. This table, indexed by
fork I, contains the core number (qiven when a
process enters the balance set) for each fork.
The core number is u.ed to set ."eorrespondinq
bit in the pager's proce.s use register (PUR)
when the fork is chosen to run.
The left half of this table is used to hold the
SPT index for the .econd page of each fork's
PSB table.
(see RPGS table for SPT index for
first page of each fork's PSB).

Defined In:

STG

Referenced by:

PAGEM, SCBED
Format

FKeNO

Core Number

FSSP1'/HWPTN
SP1'n for 2nd PC) of PSB

/ \

fork •

\ /

-76-

Na.e:

PKINT

Description:

Pork Interrupt Table. This table, indexed by
fork ., contaln. the p.eudo-interrupt coaaunication reg ister. for eacb fork. !he laft balf of
each entry contains bits recordinq the type of
reque.t. The symbols for the•• reque.ts have
right half blt a•• ignments (i.e. bits 28-31)
but are te.ted against the left half of tbetable ..

Defined in:

S1G

RefereDced by:

T'l'YS1tV, PORK, MIUC, SCB'£D

Poraat

FKINT

I Channel •

Bits

of Last PSI Req.

I \

\ I

Symbol

Content

Blt

Interrupt Reque.t(s) pending
Pork not in~.rrupt.ble
Initiate new fork
Initiate new job

I

NEWPKP(B21)
NEWJBr (1821)'

1
2
3

-77-

PSIIP(1822)

4

PSIT1F (1823·)
PSIT2F (1824)
SUSP'KR (1825
PSIWTF (lB26)
PSILOB(lB27)
FRZB1 (lB28)
FRZ82 (lB29)
PSICOB(lB38)
PSITL! (1B31)
PSIJTR(lB32)
JTPRZB(lB33)
ADRBKP (lB34)
ABPRZB(lB35)

5
6
7
8
9

11
11
12
13
14
15
16
17

Channel interrupt ~equested
in PKINTB
Terminal code Interrupt, Phase 1
Terminal code Int~rTupt. Pbase 2
Suspend fork request
Job vas 1n wait state
Logout job request
Direct freeze has been done
Indirect freeze has been done
Carrier off action request
Tl. . Liait Exceeded interrupt
JSYS trap request
JSYS trap freeze
Addre.s Break Reque.t
Addre.s Break Freeze

-78-

Name:

"KINTB

Descriptioft:

Pork I~terrupt Buffer Table. This table, indexed
by fork I, contain. the buffer for the paeudointerrupt channel requests pendin9 for e.ch fork
since the fork'. la.t PSI interrupt.

Defined in:

STG

Referenced by:

SCRED
Ponaat

P'KINTB

Interrupt Channel RequestCs)

Pending

I \

fork •

\ /

-79-

Name:

P&JOB

Description:

Fork Job Table. This table, indexed by fork .,
holds each fork's job number and JSB address
(SPT index).

Defined in:

STG

Referenced by:

APRSRV, DTESRV, ENQ, 'ILMSC, 'ORK, IPCF, MEXEC,
PAGEM, PHYSIO, SCBED
"?ormat

FKJOB

'KJOBN

FKJSB
JSe (SPT Index)

Job Number

··
··
··
··
··
···
··

-80-

/ \

Fork'

\ /

Ma.e:

PKJTQ

De.cription:

Pork JSYS Trap Queue. This doubly linked list i.
a JSYS 'rap. Queue of fork. vaiting to prograa
software interrupt (PSI) the aonitor. JTLST points
to the top fork on the linked JSYS trap. queue in
PKJTQ.
When a fork tries JTLOCK (in the JSB) and so•• other
fork ha. the lock, the fork i. added to P1tJTQ and
blocked. When the lock i . cle.red. the queue i.
scanned for the first fork (if any) waltinq Oft the
lOCk. That fork 1. re.oved from the queue and
allowed to run.

Defined in:

STa

Referenced by:

SCBED
PORMAT

l'KJTQ

Ptr. to Previous Entry

-81-

I

Ptr. to Next Entry

/ \

Name:

rDR

Oeseriptlon:

Fork Number of Reserve Pages Table. This table,
indexed by fork ., containa in the right half
the current re.erve working set size for each
fork. Also, it contains in the left half the
current age stamp (to be loaded into the pager'.
age resister when the fork is chosen to run) and
the age stamp value at the last time local garbage
collection (re.oval o~ Ie •• fr,quently u.ed
pag •• ) took p~c. for the fork.

Defined In:

STe

Referenced by:

PAGEM, SCHED
Por.at
8 9

FKNR

PXXAGE
Age -La.t XGC

17 18

P'!CAGE
Current Age

'JCWSS
Reserve Working Set Size

···
··

···
···
··
··

-82-

/ \

Fork'

\ /

Name:

PKPGS

Oe.cription:

Pork Paqe and Proce •• Storage Table. This table,
indexed by fork I, contain. the page table and
PS8 locations (SPT indexe.) for each fork.

Oefined in:

STG

Referenced by:

PORK, IPC1, JSYSA, PAGEM, SCBEC
Format

FKPGS

Run

F1(PSB
PS8 (SPT Index)
for 1st page of PS8

Page Table (SPT Index)

···
···
···
··
·

··

·
•

See PKCNO table de.cription for SPT index for second
page of PSBje

-83-

•

I \

Fork I

\ I

~ame:

PXPGS,.

Oesc ription:

This table, indexed by fork I, holds test routine
information for forks In a balance set wait state.
The te.t routine checks if wait satisfied haa occurred.
Por forks on a wait list (and therefore not in the
balance set), this table contains the time of day the.
fork entered the list.

Referenced by:

$CHED

Pormat

PKPGST

Test Routine for
BALSE'l' Wai t Satisfied

Test Data

/ \

or
Time of Oay Entered a Wait List

···

··
···
···
···
··

-84-

Fork I

\ I

Name:
Oescription:

Fork List Pointer Table. This table, indexed by
fork If gives the ch.in of forks for e.ch list
of forks 1n the syste.. That ls, It holds the
linked list of forks on TTILST, CLKLST, GOLST,
etc. A fork Is either on one of the vait-lists
or the go-list.
The right half contains the list po1nte~
to the next fo~k on the .... list and the
left half contains ~ST or GOLST. If the left
half contains WTLST, the type of vait-list can
be obtained fro. the right half of F~Q2.

Oefined 1n:

STG

Referenced by:

APRSRV, FORK, MEXEC, PAGEM, SCBEO
Format

FKPT

Current Location (GOLSTI
WTLST) or 411111 if fork
free

List Pointer

··
··
··
··
··
··
··
··

-85-

I \

Fork I

\ I

Name:

FKQl

Description:

Fork Run Queue Table 1. This table, indexed by
fork •• contains each fork·s remaining run quantum.
When this quantum expires, the process will be
requeued to a lower run position and given the
the quantum •••ociated with that run queue.

Defined in:

STG

Ref.re'ftced by:

SC'BE])

Format

P'K01

nQTM

Pork's Remaining Run Quantum

/ \

Fork,

\ /

-86-

Name:

rKQ2

Des~ription:

Pork Run Queue Table 2. This table, indexed by
fork ., contain. tbe queue level nu.ber and fork
location [i.e., list addre •• (T?ILST, GOLST, etc.)
or BA~S!T table index] for each fork.
.

Oetlned in:

STG

R.fereneed

by~

PAGIM, SCBED
roraat

FKQ2

PKQN

Queue Level Number

"LOC·
Location of Pork

/ \

.

Fork'

··

··
···

···
··
···
* If rKLOC

~ontain. a number le.s than NPB (size of BALS!T
table) I then the fork is in the balance set. Otherwise,
it cont,ins the li,t addre •• of which list it's on.

-87-

\ /

Hue:

PICSTAT

Description:

Pork Status Table. This table, indexed by fork
•• bas us.ful information when a fork blocks
and leave. the GOLST (i .... , LH (PlCPT, co.ntains
the list addre.s,'WTLST).
Th. block.d fork's entry in this table will
contain·the addrass of the test routine which,
when called, determine. if wait satisfied has
occurred for the fork.

De£ ined

in:

Ref.r.nced by:

STG
DIRECT, FORK, SCHED
Pormat

PKSTAT

'r.st Data

I

Test Routine Address

/ \

Pork I

\ /

-88-

•• ame:

rk'l'IME

Description:

~ork Time Table.
This table, indexed by fork I,
give. the, time of day (TODCLK) at which each fork
was put on its current run queue.

Defined 1n;

STG

ReterenQed bV=

$CHED
Format

P'KTIM!;

Tl~e

When Fork Put on Run Queue

/ \

Fork I

\ /

-89-

Name:

F~SP

Description:

Fork Working Set (physical in-core size) Table.
This table, indexed by fork t, contains in the right
half the number of physical pages currently assigned
to each fork. The left half is used to hold the preload size as determined by LDJOB when a fork enters
the balance set.

Defined In;
Referenced by:

-S~G

PACEM. SCBlD
Format

FKWSP

rXCSIZ
Current Size

Preload Size

/ \

Fork t

\ /

-90-

Name:

HOM

Description:

Home Block. Block on each disk unit which contains
vital statistics that cannot be built in when a
monitor is generated. These are primarily parameters of the unit and the STR to which it belongs.

Def1ne~

ip:

DSKALC

Referenced in:

DSKALC, PHYSIO, JSYSA

SIXBIT/HOM!
SIXBIT/Unit IO/
Physical Disk Address
of This Home Block

Physical Disk Address
of Other Home Block

SIXBIT/Structure Name/
HOM LUNIIII4

• of Packs in STR

Logical Unit • Within STR

aOMHOM1II5

Block' of
This Home Block

Block • of
Other Home Block

ROMP 4S l1li6

• of pages for Swapping on 'l1lis Structure
First Swapping Track on Unit
Address of Index Block of ROOT-DIRECTORY

HOMBXS"ll

Address of Index Block of
BACKUP-COP"..., -«OOT -eIRECTORY

HOMFW-12

Flags

HOMSIZ-13

Number of Sectors in This Unit

aOMBTB 1d4

Number of Tracks in Structure

HOMMIll-15

Pack Unique Code

,

Reserved for Expansion

-91-

,

HOMFE"-61
HOMFEl-62

Front End File System (sector .)
Front End File System

(t

of sectors)

,

Reserved for the Front End

HOMFE2-1"1

BOOTSTRAP. BIN Word One (Sector

HOMFE3-182

BOOTSTRAP. BIN Word Two

(I

I)

of Sectors)

Res.erved for Expansion

HOMUID-165

12 Character Unit I.D.

ROMOID-17"

12 Character OWner I. O. (POP-1l Format)

ROMFSN-173

(PDP~ll

Format)

(3 words)
(3 words)

12 Character File System Name (PDP-l1 Format) (3 words)

HOMCOD-176

8

787878

ROMSLF-177

"

This Block t

-92-

,
,

Name:'

HOME

I)escription:

Home Table. This table contains the disk pages
for the HOME and BAT blocks and the 11 Bootstrap
pro9ralll.

Defined in:

STG

Ref.r~nced

by:

DSKALC
Format

HO,..!

S

(11 Boots,trap)

1 (Home Block

)

2 ( BAT Block

)

3

Reserved

·
·
·
·
·

4

5
6
7

18

·

11

12 (Secondary Bome BloCk)
13 (Secondary Rome Block)

-93-

Name:

HOM TAB

Description:

This table contains the logical to physical mapping
(channel and unit) per logical unit, and its length
equals the maximum number of packs in a structure.

Defined in:

STG

Referenced by:

DSKALC
Format

HOM TAB

Phystcal Channel

I

Physical Unit

/ \

Logical
Unit'

\ /

-94-

IDUIL
Defined in:

PROLOG

.R"fet.nc.,d 1n:

!'t'Ll'NI, 'DIRECT

D.,crlption:

The Index Table File of the structure
currently mapped for a process. Each
structure has an index table file. The
ftle is indexed by 2- directory number
as. each entry 1. two war~ lonq. For
.ach directory on the structure, an
entry will contain the addre.s of the
rOB for the directory and the disk
addre•• of the index block for the
directory.
The table, IDXFIL, in the PSB, is mapped
from the index block of the file, STRNAM:
Bl7 MODES
CHAR2 + Number of Units

/

/

/

··
··
··
···
··
··
···

SIXBIT \Name\

I

Device Type Index • • n
Bl7
Charl

I

·

\

,

Char2 + Number of Units

-100-

\

Dispatch Adr.

\
)

Modes
/

/

/

CHARl can be a combinAtion of ·the following:
Symbol

Bit

DV"OUT
DV"IN
DV"DIR
DV"AS

"12
.35

Dn'MTm

DV"AV •
DV"ASN *
DV"MOV
DV"MNT *
T~PE

6

7
8

Meanine;
Can do output
Can do input
Has a directory
Is u.ig~le
~s a multiple-dir.~ory device
Is available to this job
Is a.sie;ned by ASHD
Is a mountable device
Is mounted

is one of the fo llowine;:
Symbol

Value

.DVDSK
.DVMTA
• DVPTP
.DVLPT
• DVCDR
• DVFE
.DVTTY
• DVPTY
.DVNUL
• DVPLT
• DVCDP

"52

7
19
11
12
13
15
17
21

Meaning
Disk
Magtape
Spooled PTP
physical line printer
Spooled
Spooled , physical card reader
Front End Device
Terminal
Pseudo TTY
Null Device
Spooled Plotter
Spooled Card Punch

,

MODES can be a combination of the following:
Symbol

Bit

Meanine;

DV"M"
DV"M1
DV"M2
DV"M3
DV"M4
DV"M5
DV"M6
DV'.'M7
DV"M10
DV"Mll
DV"M12
DV"M13
DV"M14
DV"M15
DV"M16
DV"M17

35
34
33
32
31
30
29
28
27
26
25
24
23
22
21
20

Can be opened 1n mode

•
•
•
•
•
•
•

•

•
•
•
•
•
•
•

-101-

"12
3
4

5
6
7
1"
11
12
13
14

15
16
17

CRAR2 can be a combination of the following:
Symbol
Ol%%SPL
Ol%%ALC
Ol%%VVL
Ol%%NIU
Dl%%INI

Bit

a

*

1

*

3
4

*
*

2

Meaning
Is spooled
Is under control of allocator
Volume valid
Device slot not in use
Device is being initialized
(currently for structures only)

* These bits are zero at assembly time and are set

by the monitor when appropriate in their corres%ponding device tables. (i.e. DEVCHR or OEVCH1)

-102-

Name~

IORB

Description:

I/O Request Slock. Whenever a request for
massbus I/O (i.e. DSK or MTA) occurs, an IORS
is;built for that request. It is of the long
form d••cribed below for aagtape requests and
speeial disk I/O. However, the most common IORS
format for disk I/O is a one word IORS, consisting of just the status word, IRBSTS, and stored
in the CSTS table.

Defined:

PBYPAR

Refereneed by:

PHYSIO, STO

Format

IRBSTS-g

IRLNK

Status

Next IORS

IRBMOO-l

Mode, priority, Density, Parity

IRBCNT-2

Count of Hardware Bytes Transfered
IRBTL
Transfer List Tail

IRBXFL-3

IRBHO
Transfer List Head

IRBIVA-4

Address of Termination Routine

IRBADR-S

Physical Oevice Address (if needed)

IRBLEN-6

I'

Device Dependent Data

-103-

g-IRBLNK

e
IRBSTS

1 2 3 4 5 6 7 8 9

e

1 2 3 4 5 6 17 18

I,IIIIIIIIIIIII

Symbol
IS.SHT
IS.DON
IS. ERR
IS.NRT
IS.WGU
IS.TPM
IS.EOT
IS.WLK
IS.IER
IS.DER
IS. HER
IS. BOT
IS.RTL
IS.IEL

Bits

Pointer

9

1
2

ISERR

3
4
5
6
7
8
9

ISTPM

19
11
12

13
14-17
18-35

IFSCN
IRLNK

Content
Short form (pAGEM) request
Done with this job
Error on this operation
No more retries
Wrong unit interrupted
Hit tape mark
On write only, hit physical EOT
Write locked
Inhibit error recovery
Data error
Hardware error on device
Hit BOT
Record too long (buffer too small)
Inhibit error logging
Function code
When referring to link

Function Codes for ISFCN
Symbol
IRFRED
IRFRDF
IRFWRT
IRFWTF
IRFSEK
IRFFSB
IRFBSB
IRFWTM
IRFERG
IRFREW
IRFRUN
IRFRDR
IRFRCR

Code
1
2

3
4
5
6
7

le
11
12
13
14
15

Function
Read data
Read data and format (count, key,
header)
Write Data
Write format
Seek
Forward space block
Backspace block
Write tape mark
Erase gap
Rewind
Rewind and unload
Read reverse
Recovery read

-104-

35

IRBMOO

14 5 6 17 18

"

II
Bits
15-17
27-3"
31
32-35

Pointer
TRBDM

IRBPRI
IRBPAR
IRBON

Content
"Data Mode
Priority
Parity
Density

Data Modes for IRBOM
Symbol

Code

IRMWRO
IRM6BT
IRM7BT
IRM8BT

1

2
3
4

Meaning
Word mode
Six bi t
Seven bit
Eight bit

If device is OSK, IRBLEN becomes:
IRBLEN

26 7 8 9 8 1 32

Transfer List

-105-

35

If device is MTA, IRBLEN-MTIRSD becomes:
IRPLG
Flags

MTIRSD

IRBUN
Unit No •.

IRBPS
Ptr to Buffer of pOage Ptrs
IRBOC
Original Count
(Copy of IRBCNT)

MTIRBL

Transfer List

··
··

I'

o 1 2 3 456 789

Bits

Pointer

"

IRBFR
IRBFO
lRBFA

3
4

IRBAB
IRBFF
lRBUN
IRBPB

1
2

9-17
18-35

17 18

IRBUN
Unit No

I I I II

MTIRSD

,

IRBPB
Ptr to Buffer of Page Ptrs

Content
Buffer ready for use
Current buffer flag
Active flag, lORB being filled
or emptied by service routine
lORB aborted due to an error
IORB free
Unit number
Pointer to buffer of page pointers

-106-

35

N.me:

IPCF-Me.saqe-He.der

D•• cription:

D.fin.d in:

IPcr M••••g. h.ader. Thi. table de.crib•• the format
of the m••• ag. he.d.r for •••• ag ••• nt by the Int.rProc ••• Communication. Facility.
IPCF

R.fer.nced by:

"
1
2

IPCF

MESLNIC
Link to N.xt M••••g.

MESLEN
Length of Thi. Block

MESSJN
S.nder's Job Number

MESFLG

MESSPD
Sender's

3

Flags

PID

MESLDN
Logg.d in Directory t of Sender

4

MESENS
Enabled Capabiliti •• of S.nd.r

5

MESCDN

Connected Dir.ctory t of Sender

MESACT
Account String Slack
MESWDI-17

MESWOO
Messaqe
(PTN. PH in Page Mod.)
MSFTM
Mask into Fork Page Bit Table
(PAGE Mod. only)

28

MESPAC
21

MSMI

Access Bi1:s
of Page

Index into
Fork Si t Table

-107-

~

,

Name:

IPCF -PIO -HEADER

Oescription:
~.fln.d

in:

Overhead information for each PIO in u•••
IPCF

Referenced QY:

IPCF

PIDUN

PIORQ
Receive
Quota

Unique
(LH of PIO)
PIDFLG
Flags

PIOCHN
Chn

PTDRC
Receive
Count

PIOPW
Fork Number of
Wai ting Fo rk
PIOFO
Fork Number of
Owner of this PIO

PIDNL

PIOOL
Link to
Newest Message

Link to
Oldest Message

18
PIOCHN
CRN

Symbol
PD%JWP
PO%OIS
PO%CHN
PO%NOA

Bits

Pointer

8
9

19
11
12-17

. PIOCHN

18-35

PIOFW

-108-

35
PIOFW
Fork Number of
Waiting Fork

Meaning
PIO is a Job-wide PIO
PIO is disabled
A channel is set up to
get interrupts
No access by other forks
Channel t to interrupt
waiting fork on.
Fork waiting for message
to this PIO

Hame:

IPCF-STORAGE-AREA

Description:

Inter-Process Communication Pacility Storage Area.
This non-re.ident storaqe is described followed by
the resident wake-up bit table (POFKTB). See also
the tables, PIOCHT and PIOTaL.

Defined In: STG
Referenced by:

GTJFN, IPCP, LOGNAM, MEXEC
FORMAT

SPID'l'B

~

PIOLOK

Table of Commonly Used PIOS
Lock

o~

PIO Free Pool and Data Structure

NXTPIO

Next Unique t to be used as LH of PIO

INFOPO

PIO of SYSTEM INFO

INFOPV

Publ ic Value of SYSTEM INFO PIO

PIOLST

Number of Pirst Fre. PIO, " if none

PIOMXP

Highest Page in Pages-In-Transit File

PIOPBT

SWPFRE*

,

1
,

Bit Table of Pages-In-Transit File

Free Space Header Block (7 words)

~

,

1

SWFREE*
Free Space Pool
(PIO Headers & Message.
Assigned Space here)

POFKTB

1" I I · ·

Bit Wakeup Table (l/Fork)

* Se. Swap-Fre.-Space-Pool Table.

-109-

1

Hame:

JOBDtR

Description:

Job Directory Table. This table, indexed by job I,
contains the number of the login directory for each
job.

Defined In:

STG

Referenced by:

APRSRV, 'M'YSRV, DIRECT, DISC, DTESRV, FILINI, IPCF,
JSYSA, MAGTAP, MEXEC
Format

JOBDIR

Reserved

I

Login Directory.

I \

Job •

\ /

-llO-

Name:

JOBNAM

Description:

Job Name Table. This table, indexed by job I,
contains an index into the subsystem name tables
(SNAMES, STIMES, etc.) indicating what subsystem,
if any, each job Is running. The name index is
for statistics only and is not used by the monitor.

Defined In:

STG

Referenced by:

FORK, MEXEC, PAGEM, PHYSIO, SCBED
Format

JOBNAM

II

I

/ \

Name Index

Job I

\ /

Symbol

Bit

JWAKE!'

"

HIBFL

Flag used by HIBER JSYS.
If set, implies a wakeup
signal to THIBR

1

DIAFL

Job has DIAG resources

Pointer

18-35

Content

Name index

-1ll-

N4ame:

JOBPNM

Oescription:

Job Prograa Na.e. This table, indexed by job I,
contains each job·s program name.

Oefined In:

STG

Referenced by:

DTESRV, IPCP, MAGTAP, M!X!C
Pormat

J08PNM

Program NalDe

/ \

Job t

\ /

-l12-

Name:

JOBPT

Description:

Job Process Table. This tabla, indexed by job I,
contains the number of the controlling terminal,
or -1 for a detached job, and the index of tha top
fork of the job.

Defined in:

STG

Referenced by:

TTYSRV, DEVICE, FILMSC, FORK, IO, IPCF, JSYSA,
"'EXEC, SCHED
Format

JOBPT

Controlling Terminal

I

Top Fork Index

/ \

Job t

\ /

-1l3-

NBm~~

JOBRT

Description:

Job Runtime Table. This table, indexed by job I,
contains the total runtime of each job (sum of all
forks) in milliseconds. If a word contains a -1,
the job does not exist.

Defined in:

STG

Referenced by:

ENO, FORK, IPCF, JSYSA, MEXEC, SCHED
Format

JOBRT

Runtime

/ \

Job •

\ /

-ll4-

Name:

JOBRTL

Description:

Job Runtime Limit. This table, indexed by job I,
contains the number of clocks (via TIMER JSYS)
in uae by each job and a pointer to the runtime
limit TIMER block. A description of the TIMER
block is described below. (Se. RES-FREE-SPACE).

Defined in:

STG

Referenced by:

MEXEC, SCHED, TIMER
Format
12 13

JOBRTL

TIMCNT
of Clks • in
Use

•

JOBRTP
Ptr to

Runtime Limit Block

··
··
··
··

/ \

Job •

··
·

··
TIMER Run Timer Limit Block

TIMLNK
Link to Next Block (O )
TIMTIM
Time Word (When Clock Should Go Off

e

TIMCHN

25
17 18
TIMFRK
TIMJOB
Sys. Fork Handle
Job. that
to be PaI'd
Set Clock

5 6

TIMKNL
Back Link to Previous Clock

-115-

\ /

Name:

JSB

Oescription:

Job Storage Block. Each job ha. a Job Storage
Block whic~ holds per-job information such as
the job's fork structure, line number of
controlling TTY, terminal interrupts enabled
and accounting and logical na.e information.
The JOBMAP map in the JSB points to all of the
per-job storage (including the JS8 page itself).
When the monitor references this current job's
storage area it us.s virtual addresses 628000786777. (The monitor's mapped slots in MMAP
for virtual pages 620-706 point to the JOBMAP
map via indirect pointers.)
JBCOR contains a bit table which keeps track
of which pages in the Job Storage Area are in
use (bit(s) • 0) and which are free (bit(s) - 1).
The first several pages of this Job Common Area
will always be allocated for the JSB page plus
expansion pages for the JFN blocks and for the
JSYS trap header word and trap blocks (See
FKJTQ table). The first non-reserved page
begins at FREJPA (-626999).
JSBFRE is the free block header. If a block of
words (i.e., <512 words) is required, it is
allocated from the JSFREE area in the JSB.
Blocks in the JSFREE area are linked and when
a block of words is required, the free list is
search looking for a large enough block. If the
free list area in JSFREE is depleted, a new page
(space outside the JSB in the Job Storage Area)
is allocated and its space added to the free
list for block usage.
Pages are assigned from the bit table, JBCOR,
by the routine, ASGPAG, and are used for temporary
job pages such as file window pages, magtape
buffer pages, mapping a super index block, getting
more space for the free block storage linked in
JSBFRE, and mapping EXE file directory pages.
Blocks of words are assigned from the free list,
headed by JSBFRE by the routine, ASGFRE, and are
used to hold temporary storage such as name
strings for JFN blocks, the job-wide Logical
Names List, and the Logical Name Definition
Blocks.

Defined in:

~TG

Referenced by:

PAGEM, SCHED, FORK, POSTLD, PROLOG, OSKALC, OISC,
JSYSA, JSYSF, FILINI, FREE, GTJFN, IO, IPCF,
LOGNAM, MAGTAP, MEXEC, MSTR, NETWRK, NSPSRV, TAPE

-116-

Pormat

JOB"'''P·

!

Object Map for Job-Co. .on Ar.a

1
1

SYSFK

Job Pork Ind.. to Syst.. Pork Index Tabl.
(1 Entry /Job Pork)

l'KCT'l"l

,
,.
FKJTB
,

..

..

FT. The snaf'
count in the non - orN area is indexed for taCO
sharing of the page.
l

Defined in:

STC

Referenced py:

APRSRV, FORK,

PAGEM,SCH~O

-165-

Format
ALOCX
Index

11 12 STGAOR

35

Storage Address
(Index Block page)

··
SPTSHC
STGADR
11 12
Shared Count
Storage Address
(Shared File Pg/Ovhd Pg/page of
another Pg Tb1
.>

··
·

-166-

/ \

OFN t

35

SYMBOL

BITS

POINTER
STGAOR

CONTENTS
Storage addr.ss
(Interpretation follow.)

NCORTM

12'-17

PSKAB

14

Storage address is a disk
address

DSKNB

15

Temporary bit used with
OSKAB to say that disk
address is newly aS$igned.

O~MAB

16

Storage address 1s a drum
address

PRt10B

17

Used.with DRMA! to indicate
that the swapping are. has
overflowed to the disk file
system. (Since TOPS'-28 cur'·
rently uses only the disk file
system for swapping, a drum
storage address will always
have bits 16 & 17 set.)

17'-35

Temporary bit used by the
monitor'S page trap handler
when a copy,-on,-write page
trap has occurreQ. If the
page to be copied is ~ drum
address, it ~ill be faulted
in befor these bits are used,
avoiding conflict over bit
17. These bits will signify
to a lower level routine,
SWPIN, that the page just
gotten from the free list
has no backup address and
that it 15 to get a copy of
another page.

UAABC

Non'-Core Test Mask yielding
type of storage.
Bits '<12'-17'>-8 ~,>
Bits '<18'-3S'>-Memory Pg ~dr.
Bits '<12"17.>-1 .,>
Bits '.Drum/DsK Adr~

-167-

Name:

SPTH

Description:

Special Pages Table Home Information. This
table, parallel to the SPT table is referenced
only by the software and is divided into two
parts. The first part, indexed by OFN, is used
to point .to the home address of each open file
(i.e., to its index block) and to hold status
information about each OFN.
The second part is used mainly to show the page's
origin. Por a shared file, this is indieated by
OrN " Page Number, where paqe number is within
open file, OFN. Por PSBs, JSBs, and UPTs, the SPTH
word contains I " Fork Index. The free slots in
this part are on a list chained through the SPT
where. the free list pointer resides in FRESPT.

Defined in:

STG

Referenced by:

DISC, DSKALC, FILINI, PAGEM
Format

SPTH

.1 Home

Flags

(DSK) Address of Index Block

··

··
OrN

·
I

Page Number

or

"

I
···
··
··
··

-168-

Fork Index

35

I 1 2 3 4 5 6 7 ;8 9 " 1 2 3 14

SPTR

I,

J , ,

t

I )I I I
Bits

Symbol
*PILWB

1

*THAWB
PILHB
SPTLKB

3
4

2

OFNWRB
OFNBAT
OFNERR
OFNDMO
OFNDUD

*

5
6
7
8

9

~ddre.s

of ;ndex Block : ..1

Content
Pile write bit in SPTH and ASOFN
argument
Thawed bit
-File new" bit
LH of SPTH(OFN), XB (Index Bloc~'
in use by DDMP
OFN has been ~Qd,ifi.d
Index block coo~ains a bad bloQ~
Error in fila (i ••• , MPE)
orN is on a dis~Qunt.d .tructur,
Suppress DDMP

I~' file is OPENed with thawed access (OrTHW), then botn
FILWB and THAWS will be set to 1. If OPEN'ed with restricted
acoess, then the THAW! bit will be on ~nd the FI~WB will be
o·ff.

Not~:

fil~ is opened by searching the QrN part Qf SPTH for ~~e
ind~x bl~ck a~dress. If the address is found and the ,rite
and thawe~ bits are legal, it Is a s~ar.d opening and the

A

mame index 1s used. If the addre,. Is not found, a new
entry is made from one of the free (-1) slots in SPTH.

-169-

Name:

SPTO

Description:

Special Pages Table o. This table is parallel
to the OFN area of the SPT table and contains the
structure number and open file share count for
each open file. The eFN share count Is indexed
for each opening of the file and for each shared
page within the open file.

Defined in:

STe

Referenced by:

PAGEM
Format

/ \
SPTe

STRX

OPNSHC
eFN Share Count

Structure.

erN •

\ /

-170-

'OesoriptiC)n:

Subsystem Working Set S1ze. Eaoh entry cQntalns
t~. workinq set size integral fQr a subsY$te~
program.

Defined in:

STG

Refereneed by;

MEXEC

This is a par.1Iel table to SNAf'tES",

. Fonnat
iii,

SSIZE

-171-

I

Neme1

STIMES

Description:

Subsystem Runtim... Eaeh entry contains the
accumulated runtime ot a subsystem program.
This
a.parallel table to SNAMES.

1s

Defined in:

STG

Referenced by:

MEXEC
Format

STIMES

Accumulated Runtime

-172-

Na~e:

STRTAB

Descr1ptiorq

Structure Data Block Table" Th!s table, indexed ~y
s~ruat~re number, ~ontains pointers ~o each structure d.ta block 1n the system.

Defined in:

STG

Referenced by:

I)S~LC,

PHYSIO

Format

STR1AB

Pointer to SOB

/ \

S.TR •

\ I

-173-

Name:

SWAP-FREE-SPACE

Description:

Defined in:

Swappable Free Space Pool Format. This table describes
the header area that is used in the assignment and
deassignment of swappable free space (by ASGFRE) and
the usage of this space when assigned.
STG

Referenced by:

IPCF, LOGNAM
FORMAT

SWPFRE

Adr of 1st Free Block

I

Unused

Lock on Free Space
Space Counter
Most Common Block Size
Max Top of Free Area

,

Bottom of Free Area

Temporary Work Space
Temporary Work Space
SWFREE

Free Space Pool
Space for the Assignment of:
PID Headers & Messages
ENO/DEO Blocks
System Wide Logical Name List and
Definitions Blocks
USAGE JSYS Blocks
Checkpoint Records
Network Strings

-174-

N~e~

S~M~

Description:

System Logical Name Table: This table contains
pointers to the initial ASCIZ strings for the
system lo~ical names.

Defined in:

STG

Referenced by:

LOGNAM
FORMAT

XWD[ASCIZ/SYS/],[ASCIZ/PS:/]
XWD{ASCIZ/HLP/],{ASCIZ/SYS:/l
XWD{ASCIZ/SYSTEM,] [ASCIZ/PS:/]

-175-

Description:

Startup Transfer Vectors. This table, in resident
locations 141-147, contains the startup vectors
for the monitor as well as vectors to enter £oDT.

Defined in:

STG

Referenced by:

STG, POSTLD
'J'ormat - . -

EVDDT-140

JRST DDTX
JRST SYSDDT

(EDDT)
(Reset and go to EDDT)

EVDDT2-142

JRST DDTX

(Copy of £OOT in ease
other clobbered)

EVDDT2-143

JRST SYSLOD

(Initialize disk file
system)

XPCW RLODPC

(Keep al i ve execute
address)

EVRST-145

JRST SYSRST

(Restart)

EVLOGO-146

JRST SYSGO

(Reload and start)

EVGO-147

JRST SYSGOl

(Start)

-176-

Name:

SYSERR-STORAGE-AREA

Description:

Defined in:

SYSERR STORAGE AREA. This area contains the buffer
for all SYSERR error blocks which are later
written by JOBS into the SYSERR.LOG file. In
and out pointers. into the buffer area are main.
tained for JOBS as well as pointers to the free
and rele.sed SYSERR blocks.
STG

Referenced by:

SYSERR

SYSERR HDR

S~SERR

~----------------------------------------------~~BUFFER

Body of Error Code

~----------------------------------------------~.,

.

SEBFRE

Ptr to Beginning of Free Contiguous
Area in SYSERR Buffer

SEBEFE

Ptr to End of Free Contiguous
Area in SYSERR Buffer

SEBQIN*

JOB 3 Queue - IN PTR

SEBFCT

Free Count-Contiguous Buffer Space

SeBRLQ

Ptr to Queue of Released Blocks

SEBJFN

JFN for SYSERR.LOG File

SEeHKF

Flag to wake Job S SYSERR FORK

SEIETM

Time after which failing to OPEN
SYSERR LOG File can try again
* Although the In-pointer is in this storage area the
corresponding Out-pointer in SEBQUO is in a fixed
place in lower core (i.e., location 24), so JOB Scan
queue up a BUGHLT block after a crash. One can examine
the last SYSERR block by adding to the right half of the
contents of SEBOUO, SEBDAT plus offset into SYSERR block.

-177-

(+

pg.)

,I;

SEBBFR: SYSERR BUFFER BLOCKS
S~SERR

SEBCOD
SEBSIZ
Code Blk Size with HOR

SEBCOR
-Pointer to Next Block

17

SEBFN
JOB " Function to Call

6
SEBSOF
Offset to Free
String Space

1

BLOCK FORMAT

SEHCOD
Event Code

2

SEBLEN
Block Leng th

SEHTAD
Da te and Time

3

SEHUTM
Uptime

4

SEHSER
APRIO Word
(Processor Serial Number)

5

SEBDAT-6
Body of Error Block
(Oependent on Event Ty p e
See Below)

1
Word

" 234 5 6

o

17 18

SEBCOD
SEBSIZ
Code Blk S1ze with HDR

I
35

SEBCDR
Pointer to Next Block

Bits

Pointer

3-5

SEBCOD

State Code
SBCFRE-9 on Free List
SBCREL-l Released
SBCACT-2 Active

6-17

SEBSIZ

Block Size Including Header

18-35

SEBCDR

Pointer to Next in List

Meaning

-178-

,

Word
2

I

27

8
SEHeoo

EventCo~

·1

3S

11I1.ock
SEHLEN
Len9th

Bits

Pointer

Meaninq

9-8

SEHCOD

Event Code (i.e., Block Type)
SEC'RL-l"l System Reload
SEC'BG-l"2 BUGHLT/BUGCHK/BUGINF
SEC'FE-130 Front End Error
SECtll-l31 .~~ Reload Entry
(Give. -11 Reboot Info.)
SEC'PT-169 Processor Parity Trap
SEC'PI-161 Processor Pari ty Intrp.
SEC'MB-lll Mas.bus Device Error

27-35

SEHLEN

Block Length (Including Header)
RL'LEN - System Reload Block Length
BG'LEN - BUGHLT/CHK/INF Block Lellgth
FE'LEN -F.E. Errors Blk I,.ength
Rl'LEN -F.E. Reload Entry Blk Length
PT'LEN -Proc. parity Trap Blk Length
PI'LEN -Proc. parity Interrupt Blk I!Jh
MB'LEN -Massbus Dev. Err Blk Length

-179-

Word 6 to End (Body of Error Block - Dependent on Event Type)
Event type 182
BUGHLT/CHK/INF

Error Block Data
System Name (ASCI%)

BG'SER-l

APR Serial Number

BG'VER-2

Monitor Version

BG'SOT-3

TAD of Monitor Build
Type (1,2 or 3) of BUG Call:
(BG'CBK-1: BG'INF-2: BG'HLT-3)
Address of HLT/CHK

BGUOR-S

FORKX

BG'JOB-6

J

Job Number

BG'USR-7

User Number

BG'PNM-UJ

Program Name (SIXBIT)
Message (ASCIZ)
ACS

BGUCS-l2
I

BG'PIS-32

PI Status

BG'RCT-33

Register Count

BG'REG-34

Registers (Maximum of 4)
SIXBIT Name of Check

BG'OAT-4l

Time and Date of BUG8LT/BUGCHK

BG'CNT-42

Number of BUG Checks Since Startup

BG'APS-43

APR Flags (CONI APR,)

BG'PGS-44

Pager Flags (CONI PAG, )

BG'PGO-4S

Pager Data (DATA I PAG, )

,

String Area

,

String Area

BG%LEN-76

-180-

Event Type un
System Reloaded Error Block Data
ASCII Byte Pointer to System Name
Time of Syste. Build (Unlv. Format)
System Version Number
APR Serial Number
RL'OPR-4

ASCII Byte Pointer to -Why Reload-

RL'HLT-S

BUGHLT Address (if Auto-Reloaded)
Flags
Monitor Name (Text)

-Why Reload- Answer String (Text)

RL'LENa6l

-181-

· Event Type 139
Front End Errors Data Block
Fork Numberr,Job Number
Directory Numbers
Front End Software Version
SIXBIT Name of Program
Protocol Device Code elBe-Unknown)
-Length of Data" Start of Data
DTE Number
FE%SYT-7

Event Type 131
Front End Reload

t of -11 Bytes in the Message

ERROR BLOCK DATA

Rl%NUM-"

-11 Number

Rl%STS-l

Reload Status Bits
File Name Po inter
-11 Error Word
String Area (,-D2e words)

-182-

,

Symbol
.RlOT!'
.R1OPF
• R1DPP'
.Rll"E
.RlllE
• RlASF
-.. RlRLl"
.R1PDF
.R1POF
• R1RMF

Sits
I

1
2

3
4

5
6
7

8
9

.R1BSF

1"

.R1NRL

11

.RIRTC

33-35

Contents
GTJFN failed for Dump r11e
OPENF failed for Dump File
Dump failed
To
Error on Dump
To -11 Error on Dump
ASGPAG failed on Dump
Reload failed
-11 didn't Power Dawn
-11 didn't Power Up
ROM did not ACKnowledge
the
-11 Boot Program didn't
make it to the -11
-11 took more than 1 Min.
to Reload.
Retry Count

-1"

-1"

.

2
17 18 19 2"
35
Word
~--~------------------~----~----------------~
R1%ERW.3t
IFault Code
Parity Register

Symbol

Bits
2-17

-183-

Contents
Fault code as 3 RAD5"
characters
Parity Register Valid Only
if it is Nonzero

Event Type 16"
Processor Parity Trap Error Block Data
Page Fail Word
Bad Data Word
Good Data Word
User Number
FORKX

I

JOBN

Program Name (SIXBIT)
Physical Memory Address

PT'PMA-6

Flags

PT'TRY-7

I

Retry Count

PT'LEN-l"
18

1 234

Word
PT'TRY.71

IIIII

3S

Retry Count

Symbol

Bits

PT'HRO
PT%CC P
PT%CC H
PT'ESW

1
2
3
4

18-35

-184-

Contents
Hard Error
Cache Failure
Cache in Use
Error on Sweep to Core
Retry Count

Event Type 161
Processor Parity Interrupt Error Data Block
PI ICNI"S

CONI APR
ERA

PI,rpc -2

PC

Number of Errors This Sweep
PItAAO-4

Logical 41AND- of Bad Addresses

PI'OAO-S

Logical ·OR· of Bad Addresses
Logical ·ANO" of Bad Data
Logical ·OR" of Bad Data

PI'SBD-HJ

,

PI'ADD-22 ,

SBUS DIAG Function Data

,

Fi rst 19. Bad Addresses
r-

PI'DAT-34 ,

,

First 19. Bad Data Words

,

Core Ref of First 19. Bad Add resses

,

Flags
PI'LEN-61

-185.-

Event Type 111
MASS BUS OEV Error Data Block
Device Name (if available)
Volume IO (SIXBIT)
Channel"Oeviee Type - See PHYPAR
Location of Error - Sector or File, ,Record
MB'FES-4

Pinal Error State - Oevice Dependant

MBteNI-S

CONI Initial

MBte IF-6

CONI Final
Number of Seeks
Number of Blocks/Frames Read

MB%WRT-ll

Number· of Blocks/Frames Written
Filename (Pointer)

MB%USR-13

User Making Request (Pointer)

MB%PGM-14

Program Running

MB%01I-1S

DATAl PTCR Initial

MB%P1F-16

DATAl PTCR Final

MB%02I-17

DATAl PBAR Initial

MB%02F-2B

OATAI PBAR Final
Unit Oata Block for JOB B BAT Blocks

MB%IRS-22

IORB Status Word, IS.ERR if Hard (See PHYPAR)

-186-

MB'SRE-23

Soft Read Errors

MB'SWE-24

Soft Write Errors

MB'WU:-25

Hard Read Errors

MB'HWE-26

Hard Write Errors
Position, CYL if Disk, File if Tape
SURF/SEC or Record

MB'PS2-38
MBteS'-31

Channel Loqout

MB':Sl-32

Channel Loqout 1

MBtcS2-33

Channel Loqout 2

MBtcC 1.34

"

First CCW
.'

MBtcC 2-35

Second CCW

MB'MPE-36

Count of MPE

MB'NXM-37

Count of NXM
Final Error

Co~nt

MBtcAO-41

Channel Address

MB,UAO-42

Unit Address

MB'SPEII!43

Soft Positionin9 Errors
Hard

Position~ng

Errors

Overruns
Ini tia1 1t:R

MB'Ica-46
MB'REG-47

,

Units Massbus Registers in order with their:
Final Contents" Initial Error Contents

MB'LEN-67

-187-

Name:

TT-LI~E-DYN-DATA-BLK

Description:

Teletype Line Dynamic Data Block.. This block
pointed to by the line's entry in TTACTL, holds
line specific data and is built when the line
become. active. It is deallocated when the
line becomes inactive.
T~ere are two shortened forms of the dynamic
data block, one used for a SENDALL type of
message and the other for .ending a -dingwhen any character but CTJU./C is typed on an
inactive line.

Defined in:

TTYSRV

Referenced by:

TTYSRV

TTFLG1-e
TTDAT1-l

Plags
3

8
TLTYP
Line Type

TTSALl-2

~

17 18
35
TTTYP
TINTL
Terminal Type
Internal Line Number
(index into static data)

TSALC
Send All Character Count
TSALP
Send All Byte Pointer
Device dependent word
(See Device module. for definitions)

TTBFRC-5

7 8
17 18
26 27
12 13
TOWRN
T'l'NIN
'l"l'NOU
TlMAX
TOMAX
"Wake
Up • of
• of
Max byte.
Max bytes
Count

Input
Bufs

Output
Bufs

In Input Buf

In Output Buf

Number of Characters in Output Buffer
Pointer for Removing Char from Output Buffer
Pointer for Entering Char into Output Buffer

-188-

35

7

8 9
17
TYLMD
TYLCR
TTY data Last Charcter Removed
mode for
from Input Buffer
Last Inp (For Backup Char JSYS)
Char.

TPWID
Page width

Number Characters in Input Buffer
TTIOUT-13

Pointer for Removing Char from Input Buffer
Pointer for Entering Char in.to Input Buffer
Control Character OUtput Control Words
possible Values
CCNON! - 0
CCIND - 1
CCSEND - 2
CCSIM
- 3
Bit for Terminal

TTDPSI-17

for each Char. (2 Bits/Char)
Send nothing
Indicate via Send Actual Code
Simulate Format Action
Oode Set

it

O~ferred

Interrupt

TTPSI-2e

alii for Terminal Code Set if Interrupt

TTL!NK-21

Lines linked to (9 bit$ per line)
0

TTLPOS-22

17 18
35
TPGPS
TLNPS
Current Line position in Page Current Charcter position
within Line

TTFLGS-23

e
TOFLG
. . 0 was
typed

111)

17
TPLEN
page length

TCJOB
Controlling Job Number
TTFRI<1-25

TWFRK
Fork Number In Input Wait;.
on this Line
TTPFK
Fork which is Top Fork of
a SCTTY Tree (-1 if None)

-189-

8 1 2 3 4 5 6 789

TTFLGl

30

I I 11JI 1.11.1 I
Symbol

Bits

TT'SAL

"1

ITTLCK
en". of r.>ekRI
Pointer
TTSAL

2

'l'TSHT
TTMES

TT'OTP

3

'l'TOTP

TT'FWK
TT'SFG
TT'RFG

4

TT!'WI<

5
6

TTSFG
TTRFG

TTtwFG
TT'PRM

7
8

'M'WFG
TTPRM

TT'BAC

9

TTBAC

TT'LCK

3"~35

TTLCK

TT'SHT
TT'MES

3S

-190-

Contents
Sendall being done to
this line
This is a short block
This is a system
message block
Output Is enroute to
the lIne
Porced wakeup
CTRL/S was typed
Repeat last character
(BKJFN)
Blocked on input
Don't deallocate
dynamic data
Permanent and becoming
active
Count of locks on tl1is
block

N~me:

TTACTL

Description:

T.l.~yp. A9tive Line T~ble. ~i$ re$~~.nt
table~ indeKed by lIne I, contain, a poin~er

to each active linels dynamic data block.

D.f!ned

in~

STQ

Referenced by:

M!XEC, T1YSRV

TTACTL

Addr •• ,

of dynamic1!ata-~~--eeti..".,
or .,..1 if be1:omrng ~t;ti.ve

/ \

or 9 if In.ctive

line •

\ I

... 191-

Name:

tt"1'B UFS

Description:

Teletype Buffers. This storage ar.a contains the
input and output buffers for each line (TTY and
PTY) on the system. Input and output pointers
to each buffer are kept in the line's dynamic
data block. These buffers are fixed length and
are assigned on demand. When there is no character
activity, the buffers are deassigned.

Defined in:STG
Referenced by:

TTYSRV
Format

TTBUFS

Pointer to Next Buffer

\ /

··
···
·
Pointer to Next Buffer

/1\
Buffer
\ I

···
···
Note:

The free buffers are linked and are pointed to by TTFREB.

-192-

Name:

TTCSAO
Terminal Call Spe~ial ~qu•• t Address Table.
This res~d.nt t4ble, index,d by line n~ber,
1s u~ed to hold the dispa~~p ~dd,ess of a
scheduler routine for a ~peeial 11ne r.q~.$t.
Special 11ne requests are mad, when ~he OTtO
routine is unable to obtain space for a packet
and cannot block to wait for the space~ (i.e.
process is ~OSREO, o~ re~ue~t made .t interrupt
or scheduler level). A special ~ine request
is ma4e S~ that a pa~k.t w~ll b. que~ed later
by the Scheduler. (Se~ Table, T1CSTM).

Defined in:
Refe~ence~

STG
by:

TTYSRV,

T~OUT

TtcSAO

I \

-193-

Nam e :

T'ft: STM

Description:

Terminal Call Special Request Time Table.
1his resident table, indexed by line number,
parallels the TTCSAD table and holds the
time .the Scheduler is to call the .pecial
request routine in TTCSAD.

Defined in:

STG

Referenced by:

TTYSRV, TTIME

TTCSTM

Time for scheduler to call routin. in TTCSAD

/ \

line •

\ /

-194-

Name:

TTLINV

p.finitiqn:

Terminal Type Line Vector Table. Thls v_ctor table,
indexed by device type, gives the device table
addresses of the form, TTXXVT~ These tables hol~
the device speqifie vectors fpr device tunctlons.
(See TTXXV'l' Tabl_).

Defined In:

TTYSRV

Referen~eq

by:

TTYSRV
Pot'l'Qat

TTLI~V:

IFIW !

TTFEVT

IFIW !
IFIW !

P~

Vec;:tar Tabl.

TTM(:VT*

~B.

V,etor Table

TTPTV'l'

P'l'Y

V~otor

IFIW !

TTtcVT*

CC18 Vector. Table

IFIW !

TTNTVT

IFIW !

TTDZV'l'

'.

Tapl.

I

Vector 1,ble

Ne~work

.,

PZll

V.cto~

Table
'I

~OT~.
I~ a term!nal type does not e~ist, l~s corre$ponding
vec~or
tabl. address in TTLINV w~ll be se~ equal to the ~ec~o~
table addr,ss, TTDMVTItThis t,blevec:tpn;tq routines ~!oh
BUGRL~.

* Are

currently not in use.

-195-

Name:

'M'S PIlD

Description:

Terminal Speed Word Table. This nonresld.nt
table, inde~ed by l~ne number (TTYs only),
contains the terminal speeds for .ach
terminal.

Defined in:

S~G

Referenced by:

TTySRV

Format

Input

spee~

I

Ou tpu t Spee,d

I \

TTY
11ne •

\ /

-196-

Name:

TTSTAT

Description:

Teletype Status Table. This resident table,
inde~ed by line I, contains the ter~inal
charaoteristic flags

Def ined in:

$'1'G

Referenced by:

TTYSRV

'l'TSTA'l'

Terminal

Characterist~c.

Flags

/ \

line I

\ /

o

1 2 3 4 5 6 7

17 8 9 ZIJ

12

TTYSTY
lipe ~ype

27

TSPMC
m~x.

front enQ

TT'r~M

TT'NTS
TT\FXO
TT'CON
TT\FSP
TT\FXF'
TT\IGI
TT'AUT

Blts

.,

1
2
3
4
5

6

Pointer
'rTr~

'M'N'l'S

TTrxo

,",CON
TTFSP
TTFXF
TTIGI

12-17

TTAUT
TTYSTY

2"-~7

'rSFMe

28-35

TTFBB

7

Quff~r

35

T'l'FSB
en~EI'Y

co~nt

in BIGBU,

.1

1

Symbol

fQr

~Qunt

~8

-197-

Contents
J..ine is remot~
send system l'Ilesg.
Line needs XON
Carrier is on
~ine needs speed set
Line needs XOF
Ignore input when line
is inactive
Line is auto-speed
Line type which y~e1ds
the offset into the
TTLINV table
M~x count fQr front
end buffer
Entry count in Big ~uf
Don'~

Name:

nxxVT

Description:

Teletype Device Specific Vector Table. TTXXVT is
the vector table (in generalized format) for data
and routine addr.ss.s for device xx. Th. offsets
giv.n b.low can be used when re£.rencing a device
specific vector table.
Teletype service consists of the module TTYSRV - which contains all device-independent
code, and one module for each line type. The
latter modules contain all the. device-dependent
code for their lIne type.
Each device-dependent module, of name TTXXDV,

has a transfer v.ctor table of the name TTXXVT,
wh.re XX is unique for each line type (i ••·.,
XX - FE/DZ/DC/MC/NT/PT); (S.e TTLINV Table).
Defined in:

TTYSRV

Referenced by:

TTYSRV

Length of dynamic data for this type
TT1LIN-l

First line of this type/-l no lines
Initialize tables at system startup
Activate lines at startup or restart

TTVT02-4

Clear output buffer

TTVT03-S

Set line speed

'nVT84-6

Read line speed

TTVT8S-'

Set terminal/non-terminal status

TTVT06-l0

Read terminal/non-terminal status
STO JSYS

TTVT0S-l2

STPAR JSYS

TTVT09-l3

CKPHYT - see if physical terminal

TTVT10-l4

Process XON from terminal
Deassign TTY Data Base

TTVT1.2-l6

TCOUT - add parity to character

TTVTl3-l7

Start output to line

TTVT14-20

Send XOF!' to terminal

-198-

TTV'l'lS-21

Send XON to terminal

TTVT16-22

TTCH7 - Process TTCS words

TTVT17-23

Handle carrier/on

TTV'l'lS-24

Handle carrier/off

TTV'1'19-2S

Hangup, reactivate remote line

TTVT28-26

Process XOFF from terminal

TTVT21-27

Handle CTRL/C from inactive line

TTVT22-38

BIQSTO - Store character in '1'TBBUF

TTVT23-3l

TTSND - Send character to line

TTVT24-32

Detaoh job on this line

TTVT2S-33

Handle overflow of TTBBUF

TTVT26-34

Remove character from TTBBUF

. ,

TTVT27-3S

00 TTMSG for one line

TTVT2S-36

Enable/Disable Data.ets

TTVT29-37

TTCH7 after emptying TTBBUF

TTV'l' 3" -4 "

Clear input buffer

TTVT3l-41

DOBE

TTVT32-42

Input GA

TTVT33-.43

Set Initial Values for a line

TTVT34-44

SOBE

TTVT3S-4S

Wakeup if output buffer empty

TTVT36·-46

Senda1l for one line

TTVT37--47

Senda11 for all lines

TTVT3S--S8

Adjust wakeup class

TTVTMX··Sl

Maximum number of vector entries

-199-

Name:

TTY-STORAGE-AREA

Description:

Teletype Storage Area. This resident area contains
hung and special line information, the Big Buffer,
and information about the Big Buffer. (See
TT-LINE-DYN-DATA-BLK, TTACTL, TTBUFS, TTCSAD,
TTCSTM, TTLINV, TTSPWD, TTSTAT, and TTXXVT Tables).

Defined in:

STG

Referenced by:

Tl'YSRV

CTYNIT

Unit No. on the .FEDLS Device by which the
Front End Knows the CTY

TCOERR

TCOUT Sets this if Fails in Scheduler Context

SALCNT

Count of Lines Doing SENDALL

TTFREC

Count of Free Buffers

TTFREB

List of Free Buffers

TTBIGI

Input Index into Big Buffer

TTBIGO

Output Index into Big Buffer

TTBIGC

Char Count In Big Buffer

TTBBUF

Big Buffer ("0128 Words)
I'

Storage for all TTY Input Chars. Before Being Placed
Into Individual Input Line Buffers in TTBUFS Area

TTOCNT

Count of Special Line Items

TTCQLN

Control of Current Line Number

TTHNGL

Line Being Examined for Bung

TTHNGT

Time at Which Line Will be Defined as Bung

-200-

TTHNGN

Last Hung Lin.

-,

No. of Unhangs Cone

LINKF

Linked Output Character if not "

IMECHF

I .....diat. Echo Output Char if not

TTCHIC

Input Character in TTCHI

D%CHCT*

-Clock- for 0%11 PI Check

S'NOALL

,,'

r-

"

Send All Buffer ("'016 Words)

* Only assembled if the assembly flag, SMFLG, does not
equal zero. (i.e., Have a 2"2e System).

-201-

,

Name:

UDB

Description:

Unit Data Block. This block, one per unit,
contains information about the current activity
on the unit.

Defined in:

PHYPAR

Referenced by:

PHY:SIO
Format

UOBSTs-e
UDBMBW-l

Status and Configuration Information
Memory Bandwidth Scheduling Information

DBOOT

Overdue Timer for Seeks and the Like

UDBERR

Error Recovery Status Word

UOBERP

Error Reporting Work Area if Nonzero

UOBOSP

Unit Routine Main Entry Dispatch

UDBCOS

Secondary CDS

primary COB

UOBAOR

Secondary Unit Address

Primary Unit Address

UOBAKA

Current COB

Current Chain Address

UOBVIO

Volume IO

UDBSTR

Pointer to Structure Data Block

UOBROB

Pointer to KOB, if any

UDBDSN

Drive Serial Number

UOBSEK

Seeks

UOBREO

Reads (Sectors if Disk, Frames If Tape)

UOBWRT

Writes (Sectors if Disk, Frames if Tape)

UDBSRE

Soft Read Errors

-202-

UDBSWE

Soft Write Errors

UOBHRE

Hard Read Errors

UOBHWE

Hard Write Errors

UOBPSl

Current Cylinder (if Disk), File (if Tape)

UDBSP2

Current Sector (if Disk), Record (if Tape)

UDSPWQ

Position Wait Queue Tail

Position Wait Queue Head

UOBTWQ

Transfer Wait Queue Tail

Transfer iU.!.t ,Queue aead.

UOBONR

Fork Which Owns This Unit (Maint. Mode)

UOBERC

Current Retry Count

UOBSPE

Soft Positioninq Error

UOBHPE

Hard Positioninq Error

UOBPNM

Program Name to Loq on Error

UDBUOR

User Directory Number to Log on Error

UOBSIZ

Unit Size (Number of Cylinders)

UOBFCT

Seek Fairness Count

UDBCHB

IORB Used by Home Block Check

UOBFCR

Fairness Cnt. for Read Seek Preference

UDBDDP
\
\

Device Dependent Part for MTA or for DSK
(See PHYM2 and PHYP4 monitor modules)

I

\
\

I

-203-

9 1 2 3 4 5 6 7 8 9 9 1 2 3 4 5 6 17 18
UDBSTS

31

35

I I I I I II " I I I I I I I I I I
Symbol

us.ors

lits
9

US.CHB

1:

US.POS
US.ACT
US. BAT
US.BLK

2

US. PGM

6

US.MAI
US.MRQ

8

US. BOT
US.REW
US.WLK
US.MAL
US.OIR

19
11
12
13

US. OMS

14

US.PRQ
US. TAP
US.IDB

15
16
17

Pointer

Content

usorL

Offline or unsafe
Check home blocks before any
normal I/O
Positioning in progress
Active
Bad blocks on this unit
Lock bit for this units BAT
blocks
Dual port switch in (A or B)
(RP94,5, 6)
Unit is in MAINT mode
MAINT mode is requested on this
unit
Unit is at BOT
Unit is rewinding
Unit is write locked
MAINT mode allowed on this unit
operator intervention required.
Set at interrupt level, checked
at SCHED.
Once a minute message to operator.
Used in conjunction with US.OIR
Positioning required on this unit
Tape type device
Tape - lOB seen on previous
operation
Unit Type

3
4
5

7
9

31 -35

USTYP

Type Code for USTYP
Symbol
.UTRP4
.UTRS4
• UTT16'
.UTTM2
.UTRP5
.UTRP6

Code
1

2
3
4
5

6

Unit
RP94
RS94
TU16
'!'Ma2 (as unit)
RPa5
RP96

-204-

Hame:

UCIORB

Description:

UDSKIO IORS Pool. The free tORBS are linked
together in UOIORB and this list is pointed
to by UIOLST.

Defined in:

STG

Referenced by:

PHYSIO
Format

UDIORS

\
\

\
\

\
\

\
\

I

J

-205-

Name:

UDS

Description:

Unit Dispatch Service Routine Table. This table,
one per unit type, contains vectored addresses to·
unit dependent functions, and is given in its
generalized form. The specific unit dispatch
tables are ~P4DSP (in PHYP4) for the disk device,
and TM2DSP (in PHYM2) for the magtape device.
See PHYPAR for definitions of arguments given
and returned on calls to these unit routines.

Defined in:

PHYPAR

Referenced by:

PHYSIO, PRYH2, PHYM2(MTA), PHYP4(OSK), STG
Format

UOSINI-"

Initialize

UOSSIO-l

Start I/O on an IORB, skips if O.K.

UOSINT-2

Interrupt Routine (called on interrupts for XFER done)

UOSERR-3

Initiate Error Retry (skips if no more retrys)

UDSHNG-4

Hung Reset (called from TIMER to reset hung devices)

UOSCNV-S

Convert Unit Linear Address to CYL, SURF, SEC

UDSLTM-6

Return Latency or Best Request

UDSPOS-7
UOSATN-ll

Start Positioning on IORS (skips if O.K.)
Attention Interrupt

UDSPRQ-ll

Skip if Positioning Required

UDSSTK-12

Stack Second Command, Skip if OK

-206-

Name:

UPT

Description:

Use~ P~ocess Table.
A one page User Process Table 1s
associated with the Scheduler and with each fork in the
system. (Those associated with forks may be swapped
out with the fork.) However, there is only one UPT
known to the hardware/firmware at anyone time. The
UPT known 1s the one whose address is pointed to by
the hardware User Base Register (UBR), which is set-up
when a process is chosen to run.

The UPT contains the dispatch address for process
events (i.e., traps) and the user's section map table.
Defined In:

APRSRV

Referenced by:

APRSRV, SCHED
FORMAT

'"

HWPTA*
-776""''''

~'----------------------------------~
Available to Software

\

r

I

\

\

377

4"'''' 1
417
42'"

1 UPTPPM*
\ -7764"'"

Reserved

\

Address of LUUO Block

421 User Arith. Overflow Trap Instruction

UPTTPI*
-77642'"
UPTOV1*
-776421

422 User Stack Overflow Trap Instruction
423
424

User Trap 3 Trap Instruction
Flags

MUUO OP-AC

-207-

FFL*-KIMUFL*
-776424

425

1IlUUO Old ItC

426

E of MUUO

PPC*-KIMUPC'*
-776424
KIMUEF*
-776426

42;

MOue PTocess Context

431

Kernel No Trap MUUO New PC (word)
Xernel Trap MUUe New PC

431

UPTPCW*-KIMPCW*
-776427
UPTDSP*
-776439

(woTd)

432 Supervisor No Trap MUUO New PC (word)
433

Supervisor Trap MUUO New PC (word)

434 Concealed No Trap MUUO New PC (word)
435

Public Trap MUUO New

~C

(word)

436

Public No Trap MUUO New PC (word)

437

Public Trap MUUO New PC (word)

441

Reserved for software
\

\

477
511

Paqe Fail Word

UPTPFN*
-776511

511

Paqe Pail Plaqs

TRAPFL*-UPTPFL*
-776581

512

Paqe Pall Old PC

TRAPPC*-UPTPFO*
-776592

513

Paqe Fail New PC

UPTPFN*
-776593

514
SIS

User Process Execution Time

516
517

User Memory Reference Count

511
\ ________________________________

537~

548

USERSECT

\

,

~

USECTB*

-208-

577

I

I .77654.1

\

\

USERSECT37

699

Available to software

777
Note:

Approximately 1/4 of the UPT is used for hardware
cells, leaving the r$st available to software.
The monitor currently uses this area to house the
first page of thePSa table. (See psa table
description. )

* These are monitor virtual memory addresses and are
used when the monitor wishes to reference the
current fork's User Process Table.

-209-

Name:

USER-PG-MAP-TBL

Description:

User Page Map Table. This S12-word swappable table,
holds or points to other tables that hold all of the
mapping information needed by the firmware to translate
user mode virtual addresses in a given section into
physic.l .emory .ddr ••••s. It is pointed to by an entry
in the forks' .eetion t.bl. in its U.er Proce.s Table
(UPT). (See UPT table description.)
l

The U.er P.ge M.p, indexed by a 9 bit virtual page
number (1), contains either the storag_ addr ••• for
the virtual p.ge if the pag_ exists (i. .ediate pointer)
or a pointer to where the storag_ addre.s re.ide. in
.nother table (shared or indirect pointer). The
storage addre.s can b. a •••ory, swapping area, or
disk page addre •••
If the Storage addre •• for the virtual page referenced
by the proce •• contains a memory page address (i.e.,
Storage Address Bits <12-17>-1), then the microcode,
after copying this translation information along with
the page's access bits into the CPU's Hardware Page
Table (2), concatenates this memory page number with
the index into the page to compose the complete physical
address.
.
If the storage address for the virtual page referenced
doe. not contain a memory address (i.e., Storage Address
Bits <12-17> not equal to 0), or the page is non-e.xistant
(i.e., Null Pointer word) or the page is being illegally
accessed, the microcode will cause a page trap to the User
Process Table (UPT). The monitor is then invoked to perform the analysis and resolution of the trap condition.
Defined in:
Referenced by:

PROLOG
DIAO, FORK, PAOEM, SCHEC

-210-

UPTA*

/ \
Immediate Pointer
2

"Op

3

Access Blts

Code

12

8

STGAQR
Storage Addre.s

1

3~

or
Shared Pointwt
2

fJ

Op
Code

8

3

18

Access
Bits

SPTX
6PT. index
(Holds P9'ti Stcr Adr .. )

2

35
Vlrtual
P9'

or

( "-777

oct.l)

Indirect Polnter

"Code
Op
2

8

3

Ace.ss
Bits

9

17

18

IPPGN
PN

35

SPTX
SPT index
(Holds Pg rrbl'$ Strar. Adr)

3

or
Null Pointer
2
Op
"Code

"

*

3

8

Access Bits

"

" (Nonexistent
··
·

Pg)

I

UPTA is the monitor's symbol used when it wishes to
reterence the current user's page m~p table for section " •

... 211-

\ I

(1)

A fork'. virtual la-bit addre •• within a section
Is viewed as an address within a S12-word pag.,
(i ••• , vi"rtu.l page number - 9 bits), Index into
.
page 9-bits. i

(2)

This 5l2-word table is examined first by the
microcode for the virtual page translation
information. If not there, it then goes to
the fork's UPTA in memory.
123 4 5 6 7

Page Pointer
Word
Symbol

P'l'BUB
P'l'SOF'l'
P'l'CACH
P'l'CPY
P'l'LOK

9

3S

. 10.pendent on Pointer Type in Bits <8-2>

Bits

PTRCOD

P'l'WR

a

Pointer

Meaning
Operation Code for the page
pointer type
IMMCOD • 1 Immediate Pointer
SHRCOD • 2 Share Pointer
INOCOD • 3 Indirect

3
4
S

6
7
8

Public Bit
Write Acce.s
Software Bl t
Cache Bit
Copy-on-Write (Software Only)
Page is Locked (Immediate
Pointer only)

-212-

'Pointer Types:
2 3

Immediate Pointer
Symbol

1

8 9

IAccess Bi ts

Bits

I

Pointer

0-8

11 2 3 4 5 6 7 18

35

IIIIIII
Meaning
See above

S'l'ORAGE ADDRESS
12-35
NCORTM

STGADR

12-17

Storage address
(Interpretation follows)
Non-Core Test Mask yielding
type of storage.
Bits <12-17>-0 ->
Bits <18-35>-Memory
Pg Adr.
Bits <12-17> not equal e ->
Bits <18-35>-Orum/OSK
Adr.
Storage address is a disk
address

OSKAB

14

OSRNB

15

Temporary bit used with OSKAB
to say that disk address is
newly assigned.

ORMAB

16

Storage address is a drum
address

ORMOB

17

Used with ORMAB to indicate
that the swapping area h~s
overflowed to the disk file
system. (Since TOPS-2~
currently uses only the di$k
file system for swapping, a
drum storage address will
always have bi~s 16 & 17 set.)

-213-

UAABC

2 3

I

Null Pointer
Symbol

UAAB

-te.porary bit used by the
monitor'. page trap handler
when a copy-on-write page
trap haa occurred. If" the
page to be copied i. a aru.
addre•• , it~ll be faulted
1n before th •• e bits are u.ed,
avoiding conflict over bit 17.
The.e bits will signify to a
lower level routine, SWPIN,
that the page just ,otten fro.
the fr.. list h •• no beekup
addre •• and -that it i . to gP.t
a copy of another page.

l7-35

I

8 9

II 2 3 4

IAcee •• Bitsl

~

6 7 18

35

I I I II I I
Meaning

Bits
.0-8

These bits will have a value
of I for the Null Pointer
ea.e.

17

Temporary bit used by th:t
monitor's page trap h~ndler
to say that the page has no
assigned backup address on
disk/drum.

-214-

a
Shared Pointer

1 2 3

2

8

I

IACCeSS!
Bits!

Sits

Pointer

18-35

SPTX

" 1 2 3
3

Bits

SPTX
SPT index

Meaning
See Above

"-8

Indirect Pointer

35

18

8 9

Access! IPPGN
Bits!
Page t
Pointer

a-8

The SPT index is used
to obtain from the SPT,
the page's storage
address.
17 18
SPTX
SPT index

35
.~

Meaning
See Above

9-17

'IPPGN

Page , whose value is used
as an offset into the Page
Table (pointed to by the
SPT table address plus the
SPT index in bits <18-35»
to obtain the page's translation' information.

18-35

SPTX

The SPT index is used to
obtain from the SPT the
page table'S storage
address. The table's
address plus the offset
specified in bits <9-17>
holds the virtual page's
translation information.

-215-

Monitor Program Logic Manual

DIGITAL

Copyright ec) 1978 by Digital Equipment Corporation.
The material in this .document is for informational
purposes and is subject to change without notice; it should
not be construed as a commitment by Digital Equipment
Corporation.
Dig!tal Equipment Corporation assumes no
responsibility for 'any errors that may appear in this
document.
The software described in this document is furnished
under a license and may only be used or copied in accordance
with the terms of such
license.
Digital
Equipment
Corporation
assumes no. re$ponsibility for the use or
reliability of its software on .equipment that is not
supplied by Digital or,its affiliated companies.
The following
are
trademarks
of
Corporation, Maynard, Massachusetts:
COMPUTER LABS
DBMS-ll
DEC
DECSYSTEM-20
DIBOL
FLIPCHIP
LAB-8
OS/8.
RSTS
TYPESET-l0
UNIBUS

COMTEX
DBMS-20
DECCOMM
DECtape
DIGITAL
FOCAL
MASSBUS
PDP
RSX
TYPESET-ll
DECSYSTEM-2020

Digital

Equipment

DBMS-l0
DDT
DECsystem-l0
DECUS
EDUSYSTEM
INDAC
OMNIBUS
PHA
TYPESET-8
TYPESET-20

«For Internal Use Only»

DECSYSTEM... 20 MONITOR FLOWCHARTS

I.

II.
III.
IV ..
V.

VI.

VII.
VIII.

Sched\ller

Page Fault Handling
L~v~l

JSYS Calls - Device Independent
JSYS Calls - Disk Dep,n4ent

L~vel

JSYS Calls - Magtape Dependent

~evel

Requesting DSK/MTA I/O & Interrupt Handling
JSYS Calls - TTY
Request~ng

D~pendent ~evel

TTY I/O & Interrupt Handling

1

2

.SCHEDULER FLOWCHARTS

Channel 7 Interrupt - Context Switching Overview
PISC7 SCHEDO -

PI71

Detailed Context Switching

PI72

Process Controller
UCLOCK SKCL~

-

SCHl

Process and System
Up4ate Glocks

SCH2

Clocks & Perform Action on

TCLKS -

T~st

SCDRQl -

Process Requests in Scheduler's
JOaSRT -

SKDJOB -

SGH2

~cco~nting

Select

Timeo~t

SCH2

Qu~~~

S~H9

JQb Startup

SeH9

to

SCH3

P~ocess

Ru~

GCCOR -

Global Ga+page CQlleot

SCH7

TSTBAL -

Ch~c;k

if aalance

SCH5

Set

N~eQ.s

Adj\,1semE!nt
AJBALS -

3

Adjust Balaqce Set

SeMS

4

CHANNEL 7 INTERRUPT
AN OVERVIEW
Channet 7
Interrupt

HOUSlkHP

Sit Process Clk
Flag (SKEDF3)

Do Context Swit(fhing for
Proceu Chosen to Run

Dismiss Interrupt

Set Trap to Cause
Procels to Interrupt
Here When Can
Reschedule

PI71

5

CHANNEL 7 INTERRUPT

>----4.....
Ves

Store PC in PSS
Rnet NOSKED Trap
in PSB to a NOOP
Increm.nt "In Sched"
Flav (lNSKEDt

NOSKED Procesl Can
Now Be Interrupted.
Store Its PC in Proper
ptllClt.

(ie In PISC7Rt
KISSAV
Seve Time Schld Ovhd Started
Store Fork's Runtime in FKRTT
Save User's Acs in Blk 1 in
PSB(UAC .r..1

Call Scheduler
XJEN@ [0
Set Up II Resum. Process
SCDR:

scow:
No

>--.........

KISLOI).

Set Trap at Adr. RSKED
in PSB to Caute Interrupt
On OKSKED (JSR
RSKCHK .. RSKED)

Restore Unr ACs (UAC) to Blk 1
Store Fork'. Starting Tim.
a..,.. Sched Overheed
Rntore Blk 0 ACs from
PAC Ar.. in PSB
Set up Unr or Monitor
Context D.pending on

Remember Scheduling ..
is Needed So
Increment SCHEDF3 II
Set Deferred Sched. Trap
(JSR RSKCHK .. RSKED)
No
If at Point of Return to
User (At GOUSR + 1 ),
>---~ Adjust PC to Re.xecute
Ves SETUSR When Resumed

Run Proc.ss
PFL@PPC

PI72

6

Process Scheduler
(Entry to Scheduler)

SCI-iPRE:
Flush Cur. Fork
Dump & DiSible Cache
Weit 2 ms for I/O
to Stop Before
Powering Down

Setup Sched's POL Ptr
Update TODCLK (UPDTCK)
& Increment Keep-Alive Cnt.

SWTST

SI(DJOB pSCH3

No
No

TCLKS

Schedule
Next Proceu

pSCH2

Clks81
Perform Actions
on Timeout
T<:1t

pSCH2

Set
Alarm
Clock

CI.ar SKEDF3 Flag
& Set Sched's
Chan-7 Req Flag
(SKEDF1)

Set Paging
to Sched
Context

SCH1

7

Move Old PC to
Pipe in PSB
Xfer PI Req. Info
into pSB
Set PC (PPC) to
PIRQ

Compute Increm.
Run Time & Subt.
from BSONT

Update FKTLST if nec.,
Job's Run Time,
Fork's Run Time, &
Time Since SETRT

Set Alarm to Short Cycle Time
(Move 20 MS Into SCKATM,
Sched's Alarm Cock)

Set Bit 0 " TLE Bit in

>---1.... Fork'. PSI Int.,rupt
Word In FKINT

PSIR4
Start. the Fork Up if
On a Weit Un
Otherwise, Mov.. it
to a Higher Run 0.

DISMSJ

>-V-...........

Dismiss
Current Job
(Force SKOJOB)

No

Ves

Increment Ate

Into,...,,,,,,,

Stamp and Load it

SKDLV

Into J7KNR

Do Integrals for SUMNR
& NRPLO

v••
No

Do Dev-Dep. Task. (i.e. Chk)
for OECNET Messages
Chk for Chars in TTV Buffer
Chk Oeleted·Pg Queue
Chk Forks Waiting for
Clk Wakeup
Dismist Current Process if
Page I/O Satisfied hal
Occurred
R.et TIM1 to 20 MS

CLK2
Decrement Interval
From 20 MS and
100 MS Clks
(TIM' 8& TIM2)

Ves

No

SCH2

8

OismilS Current Process
RlSet TIM2 to 100 MS
CheckWTLST
Calf Device o.p. Routines
Whose Timan Have Expired
C ..,QSKED

Balance Set Scheduler
Called to Select Process to Run

No

SKOJFC:
Remove All Forks
From the BALSET
& Collect All Pgs
That Are Not Locked
Clear (SKEOFC)
TSTBAL pSCH5
Test & Adjust
Balance Set
if Necessary

_~-I

Ves

SCH3

9

GCCOR pSCH7
Global
Garbage
Collection

Get List of BALSET
forks from BSPT Queue

Compute BALSET Inde.
& Get Fork's Entry in
BALSET Tabl.

No
No

1E?~:'::
SKCB4:

Yes

> _____.....
No

SKDJ2:
SETPPG
Setup ager:
MMAP Entries for
CurJSB8tPSB
inSPT
Age & Pur Regs
CI• ., Hdw lbl

UPDTCK

WTCHK
Chk Non-Spacial
Waiting Forks

Clear BALSET Flaos for Fork
Store Remaining Run Quant.
into RJQNT & BS Quant.
into BSQNT.
Clear Increm. Time Kept
in FKT1

XCLKS
Do Periodic Action.
CaU SKCLK pSCH2
Call SKDLV8
Call CLK2

Put Fork's Q Level & Core No.
in SJOBO (Loc 21 )
WTCHK

SETOVF:
Setup Overflow Trap (Op Code 041)
in UPT if User hu Enabled for
. Overflow Interrupts

Chk Non-Speciat
Waiting Forks

AJBALS

pSCH5

Adjust Balance Set

BKGND2:
ota, Have No Fork
to Run
(-1 .... FX)

SCH3a

10

Return to
Process Controller

Test Waiting Ballet Forks

Set Up Fork's
Test Data &
Call Test Routine
for Wait Chk

Return Runnable

SKDJS1:
SOSNEB
Remove Preload Size
From Core Reserve
(NRPMIN~ &
Deerem. NEBAL
Clear Balance
Set Wait Flag &
Decr. NBWT

PRELD
Preload
Working
Set

Compute Time Waited
and Add to Total
Wait in BSWT

t.oad as Mqch as
Possible Now

Add Wait Time t---t-'
ToDRMWT
Put Fork Back Into
BALSET Wait State,
Increment NBWT, &
Reset Time Started
to Wait in NBW Tbl.

Add Wait Time
To DWRWT

Increment Global
Garb. Collection
Flag (CGFLG)

Add Wait Time
to DSKWT

Return Unrunnable

DISMT5: '
Reduce Fork's BS Hold
Time, BS Quantum
& Run Quantum By
MIN(S MS, Actual Wait}

SCH4

11

TlSt if AJBALS

CI"r AJlODN
CIa, Running HQ
and La Sums

Save(BALSHC)ln(BSHCII
Init SUMNR Cnt to
(BALSHC) + BSPAD
(5)

AJBSHK
No

Cnt. BALSET Fork
Add WS to Accum. Sum
Remember Last Fork
in AJBLFK

AJBUQS
Update Q Sums

12

Shrink It
So It Does

(61

If More Than' Fork in the
BALSET, Remove the Last
One Kept in the BALSET
with Hold Time Left. (7)

Chk for Consistency
in BALSET Sum
Calculated & SUMNR
(BUGCHK if not OK)

AJBALY:
Set Time for Next
Periodic Call to
AJBALS
Now + 1 Sec. -+ (NXTAJB)

Shrink Fork
So It Fitl

(6)
SCH5a

13

Ve,
, _ _ _ _ _ _ _...... Sub (Diff + 2)
from Res WS and
from SUMNR

Update Q Sums for

either HQ or La
(Running Total of Pili
(Running # of Forksl

SCH6

14

Adjust SUMNA bV
(BSHC1) - (BALSCH)
Set (BALSCH) to (BSHC1)
Clear BSCHl

No

For 1st N Pgs on RPLQ,
Undo Their Ptn, Flush Their
Back Ptn, & Clear Their
CST2 Entries

Setup in P2 All the Bit
Positions for Forks in
the BALSET

Continue
Scan

GCCOR2
Store P2 Comptement (Forks Not
in BALSET) in PUBCL

Collect
Pg

Don't Collect Pg, But
Continue Scan If More
Pgs to Look at
SCH7

15

Continue Scan

Collect Page

Design Pg
From Fork

Remember Last Page
Done-in GCCLPG

Inerem.
BSHe1

SWPOMG

pPF13

Do All Swaps
Queued Above

No

Do Single Pg
SwpOut

SWPOML pPF12
Put Pg on List

Yes

SCH8

16

Scheduler Request
Processor

Get Entry From
Reg Tble, SCORQB
(Data, Disp Add

Yes

Dispatch To
Routine (i.e.
JOBSRT)

JOBSR1:

Prints "Full"
Clear TTY's
Entry in TTFORK
Table

ASSFK pSCH10
Get a
Fork

ASFSB
Assign a SPT Slot &
Adjust Shr Count

Store
NEWJBF Flag .. TTY No.
in the Pseudo-Interrupt
Communications
Table, FKINT

SCH9

17

Aslign Fork Slot
ASSFK

~
Get Fork No
From FREFK
Unked List

t
l

Set Up Wait Test
Routin. for Fork
In FKSTAT
(0,. JSKP)

t
SetUp
FKOTM-Ouantum (300ms
FKTIME - Tim. Fork Put
on Run 0 (TODCLK)
FKQN - Run Q Lev.1 (0)

t

WTCONC
Put on Wait
Queu. (9)

t
Set Flags in LH of FKINT
(400000 + ftJEWFKF)

r
Clear Entries for Fork in
Following Fork Tables
FKINTB, FKPGS,
FKCNO, FKJOB,
FKWSP

t
Set Fork's Ag.
Stamp to 100 &.
Res.ne Working
Set to 3

t
Call AS FSB Three Times
to Obtain Three SPT Slou,
Each with Their Share
Count Updated. Th. SloU
are for the Fork's PSB,&
UPT A Tables.

,

Return)

SCHIO

18

Scheduler Comments
SCHEDO:
(1)

Running averages, exponentially weighed over intervals
of 1, 5, and 15 minutes,are maintained for the number
of runnable processes overall, as well as for those in
High Run Queues and those in the Low Run Queues.

(2)

Final phase of powerdown seq. clears the priority
interrupt system and causes the system to loop iu the
ACs until power actually vanishes. If the power fail
interrupt was spurious, the loop will time out after a
few seconds and the system will be continued at
address SYSRST.
.

(3)

A very l~ted set of central functions for debugging
purposes has been built into the Scheduler. To invoke
a function, the appropriate bit or bits are set into loc 20
(SCTLW) via MDDT. The word is scanned from left to
right (JFFO)i the first bit found set on the scan
selects the function.
Bit 0

Causes the scheduler to dismiss the
current process and to stop timesharing.
Useful to effect a clean manual transfer
to Exec-mode DDT. System may be res~~ed
at SCHEDO if no IOB reset is done.

Bit 1

Causes job specified by (20)RH to be run
exclusively.

Bit 2

Forces running of Job a back-up function
before halting the system.

If loc 30 (SHLTW) is set not equal to ~" the system
will crash. (Same as setting bit 2 of SCTLW word.)

19

AJBALS

(4)

Upper Limit for LQ=MAXNR-MIN [Max HO Reserve, HQ Load Avg.* (16)]
Upper Limit for HQ=MAXNR-MIN [Max LQ Reserve, No. of LQ forks

(5)

*

(32)]

SUMNR reflects the number of timesharing pages in use. Its value
after AJBALS equals the number of pages reserved for balance set"
members plus BALSHC (the number of pages shared, but not owned, by
balance set members plus the number of locked pages) •
BSPAD reflects the number of pages set aside for balance set members
as their working set reserves grow. The real value of BSPAD is
offset by a factor of BSPADO. When forks are trying to stay in the
balance set, the adjustment algorithm allows the pad offset to be
subtracted from the accumulated sum before it checks if the fork
can fit.
i.e.,

n

(BSPAD + ~ Res. WS ) - BSPADO + Res. WS
1. MAXNR·
i=l
i
n+l
The adjustment algorithm does the opposite (i.e., adds the BSPADO
factor) for forks trying to get into the balance set. The overall
affect of this is to ensure (as much as possible) a certain number
of pages be available for balance set forks.
(6)

The shrink algorithm shrinks the fork's reserve working set by:
MIN [Reserve WS - Current WS, Accum. Sum + Fork's Res WS-MAXNR]
Notice that the fork's reserve working set will not be reduced
below its current working set.

(7)

This is the rare case of forks, with
The lowest priority one is removed.
the balance set, it is not removed.
fork to be greater than MAXNR due to

hold-time left, expanding.
If there is only one fork in
(Note: it is possible for one
the BALSHC count changing).

GCCOR
(8)

If it is a forced clear, then GCMINO is made very large so all of
core will be collected. However, its usual value is much lower.
(Currently 64 decimal).

20

~SSFK

(9)

The fork is actually placed on the GOLST at this time. WTCONC,
after putting a fork on WTLST, checks if the wait condition is
satisfied. The test routine, JSKP, gives a skip return indicating that the wait is satisfied. This causes UNBLKI to be
called which in turn calls SCHEDJ to unblock the fork and to
requeue it from the WTLST to the GOLST.

21

22

PAGE FAULT HANDLING FLOWCHARTS

PGRTRP -

Perfo'rms the Principal Accounting, Analysis,
and Resolution of Page Faults

PFl

PGTACC -

Accounts for Page Traps

PF2

XGC -

Local Garbage Collection

PF4

SWPOUT -

PFl4

NICCKS -

Swapping Out a Page

Check In-Core Size Limits

PF3

GETTPD -

Determine Cause of Trap

PF5

NIC -

Not in Core Trap

PF6

SWPINW -

PFlO

Swap In and Wait
SWPIN -

Swap In a Page

PFll

WCpy -

Write Copy Trap

PF8

ILRD -

Illegal Read Trap

PF7

ILWR -

Illegal Write Trap

PF7

TRPO -

Age

<100

Trap

PF9

23

24

Entlr H.... on Po Fault

Dispatch to Err. Handler
PGRTH: Pg Tb ParitY/Refill Error
IL R 0: Proprietary
ADRCMP: Address Compare
IlSCN: Illegal Section
ILIND: Illegal Indirect

SliWI AC P
Slitup Trap Stk Ptr
(TRAPSPI -- P
Incrlm Trap Cntr.
+1 -+ UTRPCT

No

Sliw. AC'sl-4.7,tX

> - -..... and (TRAPSWI on

r----....-1..:!!!:~~

Stk Adr +(BHC +1)

PGUNTP Retry
if RlCowe~ab".
pPF1.

PGTACC pPF2
Account for
on.
Pg Trap
If Pg Trap Tim. Flag
ilPTIMI is Set, 00 Not
Charge P. F. Handling
to Fork's Run Time

Init Tim. Int.rval of
Trap Codl unless
Already InitialiZid
lie, Nest.d Trap)

;Pg or Pg Tbl Age < 100
- - - " " (pPF9)
;Null Ptr (PPFS)

---~

\~::=::-'

25

;Writ. Copy (pPFS)

Page OK to Ref.

If 1st Trap & Including
Pg Trap Time, Read Current
Time to Complete Timing
of Trap Code & Update
PTTIM HSPTTM SPTTIM
Flags, PC -+ F F L, FPC
-+ TRAPC
OKSKED
-l-INTDF

-1

Ves

Restore Flags, PC to
TRAPFL, TRAPPC & ACs
1-4,7, CX & TRAPSW
from Stack

GOUSR:
Setup User AC BIK
as current Blk

Return
XJRST@ FFL

PF1a

26

~

Account for on. Pg Trap

XGC

pPF4

Local Garbage Collect

;
Yes
Get Subsyst.m Ind.x
(if any for job) and
account for Pg fault
Reduce R.s.rve WS
and SUMNR by X
X-R.s Ws..(Cur WS + 41

Get Diff.r.nce betwe.n
Ag. at last XGC and
Curr.nt Age (Adjust for
wrap around if nee.)

NICMGI:
NICCKS
No

;

s.t Bit for Faulted
Pg in ~he Fork's WS
Bit Tabl. in the PSB

Calculat. Ratio of Actual
Interfault Avg to Desired
(Desired • 2 x Avg Swp Lad

.,V_"_--l..... lncreas. Window Size (CAPT)
(CAPT) + ~ - (CAPT)
16

No

;

j

;

pPF3

Check for
Allowable Size

Reduce Window Size (CAPT)
(CAPT) - (CAPT) - (CAPT)
-1-6-

See if CAPT within Limits
If > CAPTMX, Set CAPT to CAPTMX
If < CAPTMN, Set CAPT to CAPTMN

PF2

27

Check Overall Size for
Physical Core Limit

Ves

Ves

'nit Temp Window Size to
7(CAPT) for Possible XGC

Reduce Temp
Window by CAPT

-8-

-2-

NIC3...,:_ _ _..

Get CurWS + 1

Set Res WS -.Cur WS + 1
Update SUMNR IBALSET TOTAL)

No

Set up Schad Test
for BALSET Size
NICTST- ACI
RDISMS

PF3

28

LOC8t G.rb... Collection

Setup to Selin
. CSTO Beyond R.. Mon

Comput. MIX No. of Pgs For
To CoUect (All of Pgs For
Proc:eu in Corel
Cllculau Cutoff Age

XGcz:r-________________

sdupto do

~

Housekeeping for
the Fork's Working Set

XGCS:
For Each Pg in the Fork's WS •
Clear iu bit in the WS Bit Tbl (in PSB)
if the Pg is:
DeI.t.d. Not in Core, or Unassigned
in CSTO (Unless Rd. Compl.l
If the Pg is Rd. Compl.te, C.II AGESN
to Asaign the Pg & S.t the Age

No

No

Ve.

DASWSP
D....ign Pg From Proceu
Decr. WSP
R...... Core No. if
WSP .. O
Mark Pg Un..signed
in CSTOFK

pF4

29

Determine Cause of Trap

Get Disp Adr
NPG

Gtt Disp Adr
WCpy

Construct
Identity
of Pg
Pointed to

Get Disp Adr
!LWR

PF5

30

Set up Sched Test
Blk until "Unlocked
ACI/OFNlKT
MDISMS

AA.D*
Adrfor File

Pv
Swpln

PI

AcctSMd
Chked
Alr..dy
Must See if
(31
Write is Poaible
Rechk Access 8t If
Can't, then go to IlRD

Get Core Adr 8t
lock it in CST1
in Ca_ Resked
Below
No

(41

aCHK
Chk for Enough
Disk SplIce for
Pg er••tion
No Room

PF~

31

Illegal Write

Illegal Reference Traps

Store Trap Stlt\.. Word
in UTRSW in PSB
(In Case User Wants it)
ILRFU:
Yes

ITRSIM
Check for ERJMp·
or ERCAL
Alter Ret Adr
With Adr Gotten
from ITRSIM
Routine and
Prune POL Ptr
(Subt. BHC + 1 )

Yes

No, Post Interrupt

PSI ROO

Simulate PUSHJ by
Updating PO L Ptr
(BHC +1) + (TRAPAP) -. (TRAPAP)
and Saving Instr Trap Adr + 2
(Ret Add on The Updated Stk. (5)
ILRFI: .--_ _ _ _--'_ _ _ _ _...,
Get Adr to Transfer to
from Word Following the
Instr Causing til. Trap

Request
Interrupt
for This Fork

Get it Seen
by Executing
CHKINT Macro
(je AOS SKEDF3
- ISB SCDCHN)

Incre, Ret Adr
Stored on Stack
(Skp over In5tr
Causing Trap)

Alter Return Adr Stored on
Stack Pointed to by AC P
by Storing Adr to Transf to

PF7

32

Copy On Write TrIP

Clnr Write Ref Bit
in Pg F.ilure Word
(TRAPSW)

GETTPD pPF5

See if Pg Rndlbl.

Handl. Oth.r

ea..

SETSPG
MIIP Th. PTin
Th. Monitor Mlp
MRPT
G.t Id,nt of
Shlrld Pg Bling Rei....

Get Ptr & Modify Ptr
Type to Immed. With
Select Access Bits8t
, CoPY' Adr and Store
in Pg TbI

RELMPG

Rei .... Orig Pg
from CPYPG

RELCPT
Cle.r Map
Entry
RELSP(;
R.I.... Monitor Map Slot

Ya

JFNDCR

SWPINP

Decrem. Map
Count for JFN

NOSKED
CALL SWPINW pPF10
OKSKED
Will Copy from CPYPG
to New Page
PF8

33

Pg Not in Existance Trap

BUGHL T if Pg Not
in Legal Range if
Monitor Trapped
or Illegal Section

Setup an Immed
Ptr With 0 for Storage
Adr & UAAB (bit 17) Set
in Pg Tble

Set err Code ~
Reg Int •• ICNXP

PSIREQ
PSI Ref.

Get Int Seen
With CHKINT IViacro

PF 8a

34

Pg or Pg Thle
Age < 100 Trap

Dispatch to One of
The Following Based
On Age Field

Set Up Sched Test
AC1/Age Field .. SWPRT Wait for Pg
ROISMS

Make Sure Enough
Pages on RPlQ

TRPSPM:
SKPNWR

pPF9a

Skp If No Writes In
Progress On Core Pg.
Otherwise Reschedule
Until Write Complete
No
TRPSPI:
RPCST
Remove Pg
From CST

ONSPMQ
Place On
SPMQ

Untrap &
Try Again

PF9

35

Set Up Sched Test
AC1/(NRPMX),. TRPOCT
RDISMS

Increment DWRCFL Flag
(Says Fork Waiting for
Write Completion)

Set up Schedule Test
AC1/Core Pg No••• DWRTST
RDISMS

Increment Global Garbage
Collection Flag (CGFLG)

unsuccessful

PF9a

36

REQUESTING DRUM OR DISK READ
(PAGEM LEVEL)

Swap In & Wait·
for Completion
SWPINW

SWPINpPF11
Swap in & Wait
f9r Completion

Swap in PT
Fix Age on Pg

OKSKED
Lock Pg in CST1
Wait to Fi nish
With PDISMS

SWPIW4:

SWPIN pPF11
Swap the
Orig Pg

SWPIW1:
Chks If Pg State Code
Says Read In Progress
and RDISMS if so

PF10

37

AGESN
Assign Pg
an Age

REQUESTING DRUM OR DISK READ (Continued)
(PAGEM. LEVEL)

When Reached
SWPOT:
Set up Sched Test

>------__-t SWPWTT ~ AC1
No

PDISMS

Decrement NRPlO &
Remove Pg From
Replacement 0 (linked
List in CST3)
(6)

Rsset Previous
Ownership

BUGHLT
No,SPT

If Adr From
SPT In Core

Store New Core
Adr (Pg From
Repl. 0) in
SPT Slot

Map PT Through
Monitor Map
Lock PT in Core

(BUGHlT if Pg in Pg
1b Already in Core)

Release Slot in
Monitor Map

PF11

38

MULTIPLE PAGE SWAP OUT ROUTINE
SWPOMI • Init List
SWPOML . Called to Add Page to Swap Out List if Possible
SWPOMG· To Begin I/O for All Pages on Swap Out List
SWPOUT . Initiate Swap Out of Single Page
Init Swap Out List

Add Pg to Swap Out List if Possible

No, Exception Case

No, XBor PT

No

GETSHR
Get Share

Count

Pg Can't be Written on Drum
or his no Drum Address
SWPOUT pPF14
Use Singl.
Pg Swpout

GDS.TX
Get DST
Index for
Drum Addr

DASDRM
Deassign
Drum Addr
Put Pg Want
to Swap Out
on End of
Swap Out List

Get Adr of Pg
On Drum & if
Modified bit is
Set~ Set Modified
Bit in CSTO Entry

Clear DST Entry &
Put its Former Contents .....- - - - - - - - - - - - - Into CST1
PF12

40

Increment Count
of Pgs on List
(SWPRCO)

Assign New Drum Storage &
Initiate °1/0 for All Pages on
SWPOUT list

G.t lilt of Pgs To 00
Get Count of Pgs left

on Ust
Increment Writes in Progress (lOIP)
DRMAM

and Drum Writers (DRMWR)

Try to Get
Specified No.
of Sequential
Pages

DRMIAD
Bump Drum Adr to
Next Page

Get Ptr to Next Gp., Tie Off
Current list & Set Up Next
list

DRMIOM
00 Multipage Write
(Calls DRMfO pPHY1
for Each Pg.)
DRMASA
Assign
Adron Drum

Store Drum Adr
in CST1 Entry
for Page & Former
Contents of CST1
(Disk Adr) into DST
Entry for the Drum
Address, Marking the
Modified Bit (BWRBIT)
if Pg to be Swapped Was
Modified in Core.

PF13

41

Set Drum Adr as
New Adr in CST1 &
Put Former Adr. in
DST

ONRQ

Put Pg on End

Return

of RPLQ

PF14

42

Swap to Disk

Entry

GDSTX

Request Write
Increm DSKWR
& 10lP

Get DST Inde.

Set Write-in-Progresl
(PSWIPI in Age Field
of CSTO

No

DSKIO pPHY1
Requests I/O
to Disk

Release DST Slot
(Satto -1) &
Put Former Contents
of DST Slot into
CST1 Entry

DASDRM
Deassign
Drum Adr.

PF15

43

PUt Pg on
Top of
RPLQ

44

Page Fault Handling Comments
PGTACC
(1) Checks if process has accrued more than or equal to
the number of age ticks of GCRATE • Currently, this
is set to 5~, which implies 2 sec.
of process
virtual time
(i.e., the age stamp is incremented
every 4~ ms of process run time).
NICCKS

(1) GNPSAS is currently initialized at system startup to
zero and is incremented/decremented only when pages
are locked/unlocked. It is currently only tested by
NICCKS as well.
GETTPD
(2) The age field when used to hold the age stamp, will
always have a value of l~~ or greater. This checks
if any of the lefthand 6 bits of the age field are
set.
NIC

(3) Co uld take the ILRD path, for example, when OPENed
file for write, but PMAPed for each of a nonexistent
page. A page would have to be created which would
then imply a write which was not enabled under PMAP.
(4) If file page faulted does not have its own SPT slot,
but has to be mapped (using indirect pointer) via
the index blk slot in the OFN area, then the index
blk will be locked in core.
(So can't be swapped in
case of reschedule.)
(5) Note in the predispatch code that ACI was stored in
SHC + 1 and AC, P, which holds a push down list
pointer, was saved in TRAPAP.

45

SWPINW
(6) SWPINW will invoke SWPIN to swap in a page irito a'
page from the RPLQ.
However, this same code can
also be entered with different flag settings and be
used to swap in a page into a page from the special
memory queue (SPMQ), a queue used by the memory
error handling code.
SWPOUT
(7) SWPOUO is called from:
SWPOTO which clears the SWPKPF bit (for
RPLQ) before calling SWPOUO and

top

of

SWPOTK (called from the UPDPGS JSYS) which sets
the SWPKPF bit
(for end of RPLQ) before
calling SWPOUO.

46

JSYS CALL FLOWCHARTS
DEVICE INDEPENDENT LEVEL
GTJFN -

Get a JFN

GJl

OPENF -

Open a File

OPI

SIN/SINR-

Sequential Input

Sl

BYTINA - Call Device Dependent Code
to Get a Byte

S2

SIOR2 -

String I/O Multiple Byte
Transfer

SOUT/SOUTR - Sequential Output

S2
S3

BYTOUA - Send Byte to a Service Routine

S4

PMAP -

Map a File or Fork

PMl

UFPGS -

Update File Pages

UDI

CLOSF -

Close a File

CLI

47

GTJFN JSYS

Assign First Free
JFN Block in JSB
(This Determines JFN #)

No
ERR·GJFX3

Parse User Arguments
Field By Field. Default
the Arguments Not
Specified if Have legal
Default
(1)

No
ERROR

Store Argument
in JFN Block
(2)

Setup User
ACI with
JFN

GETFDB
Address of FOB - FllFDB
(May Have to Create FOB
for New File)
(3)

GJ1

49

OPENF JSYS

CHKJFN
Check JFN
Validity. Set
Status Bits

Setup Dispatch
Tabl. Adr

Init JFN Blk Variables
1 -+ FILLFW(LH)
Flap-+ FILSTS

Successful
Return

Store Bytnize
in FILBYT (0 Implies
A Byte Size of a Word)

OP1

50

'1 )

PMAP JSYS

PMAPO
Call This
~-Y-e·s"" Routine
for Pgs up
to the Pg
Tble
Boundary

Destination Is a Fork

Increment
Cnt of Pgs
Mapped in

No

ERR-PMAPX2
MSETPT
Set up Pg Tables
R.I.... Old Contents
of Dest. & Have New
Contents a. Set With
Copy-on-Write Access

ERR-PMAPX1

No

ERR-PMAPX2

PM1

51

SIN/SINR JSYS
If Thit i, Special
Byte Ptr (·1 in LH)
Cr..te Equivllent
RtOul. Byte Ptr. (1)

CHKJFN
ChkJFN
Vllidity & Stt

Up Stetul FII"

Sttup& 00

Byte Blk Xfer
(4)

Rec. Size Longer
Thin User's Request

UNLCKF

Update Bytt
Ptrs in User
ACS

No

51

52

SIN/SINR JSYS (continued)

JFNIO(OEV'OTB)
Init JFN for
Input

SINTT1:
BYTINA

BYTINApS2

pS2

Get Byte
from Source

From

oft Routine

SIND

SIND

Put Byte
inU....'.
Adr. Space

Put Byte
in User's
Adr. Space

SIONXT

SIONXT

Chk if "End
of String"
Ch.r

Chk if "End
of String
Cher

No

S1a

53

Call Device DIp. Code to
Get. BYtI
~----........

BYTINX

Getml
Bytl

BUGCHK if BLKF Flag
.Set. (Should Only Be
Set by Cod. Ahlld)

BIND(DEV'DTB)
Dispatch Through
DEV'DTB Table to
Device Dependent

Codl

Strino Input/Output Multiple Byte Xf.,

Return

BYTeLT

Chk for Une #s
& Terminator

Do the
Transfer

Transfen Byte One at a Time,
Until Terminator Found or
FILCNT (Buffer Pg Cnd or
User Count Exhausted

Transfer Byte
One at a Time
Until FI LCNT
or User Count
Exhausted
Set Flag to TeU
CaUer JSYS is
Finished

Transfer Byte to User
Until Page Cnt (Buffer
or Window) or User
Count is Exhausted

54

S2

SOUT!SOUTR JSYS

If Using ( ·1, Addrl
Special Bvte Ptr,
Change to 7·Bit
Bvte Ptr.
SOUTO:
CHKJFN
Chk JFN Validity
(Err Ret if Not OK)
Setup JFN StatuI

SOUTB pS4
Send Bvte
Through Dev.
Dep. Code
SOUBYT:
SIOR2 pS2
Setup &
Do Bvte Blk
Transfer (4)

Yes

No

No

.....- - - - -......-t Return to User
JFNOO(DEV'DTB)
Init JFN for
Output

Call Device
Dep Code to
Write Out the
Record

UNLDIS

UNLCKF
Unlock the
JFN

Call Dev Dep Code
to do a Record Out

55

Unsuccessful
Error Return

Send Byt. to
Service Routine
BUGCHK if BIKF Flag
Set (Should Only Be
Set By Dew Dep Cod.)

V.s

BOUDCOEV'OTB)

Call Dev Dep.
Code Through
Dispatch Tabl.

APPNUL
Append

Null to
String
MDISMS
SIONXT

with Sched
Test Routine
From S.rvic.
Routin.

UnsuCC8S1ful
Return

S4

56

'If.

Updltt
P....
C.UII a,lnted PI...
to be Written to DI.k

UFPGI JSVS/DDMP

No,U.....ign. .
Pg -Ignor.

SKPNWR pPF9

v••

Check if Writ.

SETMG

in Progr.ea.

RDISMS if so.

R......
Index Blk
from Map

Ves, Recheck Pg

SWPOTK

Set SWPKPF .. 1
Call SWPOUO(pPF 14
to Swep Out the Pg

Allign Page

No

UD1

57

Request Swap to
Disk. Set DSKSWB
Bit in CST3' Entry

CLOSFJSVS

CLZALL

Does a CLZFF
JSYS for .FHSLF
(Fork luuing Call)

REUFN
R...... JFN

CL1

58

Not OK, Err Ret

-----t

Call Device Oap Code
CLOSO(OEV'OTB) ............

Assign Pg

Map Cntto
that JFN (2)

UNLKF
Unlock file

'fes
When
Unblked

UN LOIS
Does MDISMS .....I - - - - - - C
with Reason
Ves

UNLKF
Unlock file

No

to Blk
CL2

59

I--~""-((

Error)

60

GTJFN Comments
(1)

This code is looking for a file specification of the form:
Dev:Directory Name, type, gen;T (temporary) ;P(protection) ;A(account)
One or more fields can be defined by logical names.
If any fields are omitted from the specification, the
system will default the values as follows:
Device
Directory
Name
Generation
Protection
Account

(2)

DSK:
Connected directory
No default for disk
Null for other devices
Highest existing for input
Next highest for output
As specified for directory or
protection of next lower generation
Current user account

The internal GTJFN code uses several locations in the
JFN block as temporary cells. These locations have two
names in the JFN block table descriptions. The JFN
block storage locations set up or used by GTJFN are:
FILLCK*
FILTMP*
FILACT*
FILOPT*
FILDEV

FILDDN
FILPRT
FILSTSl
FILLNM*
FILDNM

FILNEN
FILVER
FILCOD (LH)

*Used internally only by the GTJFN JSYS.
(3)

The creation process of the FDB simply asks for space
in the directory for the FDB.

61

.OPBNF Comments
(1)

Cell FILDEV in the JFN blk has the device dispatch
table address. For example, for disk, GTJFN sets
the dispatch table address to DSXDTB. If spoolinq
to disk, GTJFN sets the dispatch table address to
SPLDTB, but the OPENP code chanqes the dispatch
table address to DSXDTB and sets up a file
specification in the JFN block.

62

· SIN!-. SOUT Comments

(1)

TOPS-20 allows a user to specify a special byte pointer

of -1" Address which is interpreted as a 7-bit byte
size beginning on the word boundary, Address.
(2)

A user can do I/O from one place to another in core by
specifying byte pointers for both source and destination.
This differs from BLT in that the use can transfer
on non-word boundaries.

(3)

For disk files, FILCNT will be the number of bytes
remaining in the window page. For magtape and other
devices it will be the number of bytes remaining in
the current paqe of the buffer.

(4)

The routineBYTBLT only moves data up to the page
boundary of the current buffer page.

(5)

If the user has not specified OF%PLN in the OPENF,
line numbers are stripped off the beqinning of each
line. (See SIN JSYS in Monitor Calls manual for
defini~ion of terminator.)

63

.PMAP Comments
(1)

A paqa is private if it is not shared between a
file and a fork.

64

UPDPGS Cpmments
(1)

Routine scans paqe table twice: first t~e to request
writes on all chanqed pages. Second time to wait for
completion of writes. '(This is faster than waitinq
for each write to complete as it is requested.)

(2)

If paqe has not been modified, a check is made to see
if the drum is full and if so, to release this page
back to the drum. The map pointer to the page will be
changed to its disk address.

65

CLOSE' Comments
(1)

If user has switched primary I/O to some other
and attempts to close it, an error results.

(2)

The page map count in FILFW reflects the number of
pages mapped and • CLOSF can't be done on a file if this
count is greatar than _ •

66

JFN

JSYS CALL FLOWCHARTS
DSK DEPENDENT LEVEL

DSKOFN -

Disk Opening of a File

OD!

ASFOFN -

Assign OFN

OD2

UPDOFN -

Update OFN

OD!

DSKSQI/O -Disk Sequential Input/Output
NEWWND DSKCLZ -

New Window Page (Next Page of File)

SDl
SD2

Disk Closing of a File

CD!

RELOFN -

Release OFN

CD2

DASOFN -

Deassign OFN

CD3

MOVDSK -

Move page Back to Dil$k

CD3

67

68

OPENF·DISK
Dev Dep Code

Disk Dew DeP. Code
Called From Table Slot
OPEND (DSKDTB)

GETLEN
Sit up FILLEN from
OFNLEN Table

Update Date Time Info
in FOB. Update Last
Writer If Writing.

If Superceding (i.e. Opened
for Write Only to an
Existing File), Delete File
and Mark File as New

Yes

DSKASN

UPDBTB

Assign Disk Space
. for Index Blk

Update Bit
Table

OPENF9:
Translate OPEN F Access Bits
to OFN Bits for SPTH
Comparison or Storage
if New OFN
(1)

OPNLNG:
ASFOFN pOD2

Yes

Assign OFN for
Super Index Blk
If Error, Err Return

Assign OF.N for
Index Block
If Err, Err Return
ASFOFN pOD2
Assign OFN for
Index Block 0
If Error, Err Return
UPDOFN pCDS
Write XB on Disk
(if Opened New File
With Thawed Access)

Store OFN in LH of
FILOFN and RH of
FILCOD
(2)

001

69

Assign OFN

OPENF • DISK (Contl

ASOFC:

Get Store Adr. for XB
and Bits Caller
Allowed to Specify

Ac:cess & Stor Adr
Stor Adr
Str. No.
Seerch OFN Portion of
SPTH Table for Matching
Str. No. & X8 Adr.

~

~

~

SPTH(OFN)
SPT(OFN)
SPTO(OFN)

PGTCAL
If This Directory on This Str.
Already Has Open Files, Store
Its ALOC1 & ALOC2 Index
Into the SPT Emry. If Not
Mlk. New ALOC1 & ALOC2
Tble Entri...

When
Rescheduled

Increment OFN Use Cnt in RH
of ALOC1

Set up Sched Tnt
OFN •• OFNLKT ~ AC1
MDISMS

Update Shr Cnt for
OFN in SPTO(OFN)

SETXB1
Map Index Blk
Through PSB Slot

>-....~
Ves
UPSHR
Update Shr Cnt
in SPTO Tbl.

RELCXB
Retease (Unmap)
Index Blk

Success Ret with
OFN in AC1

002-

70

Mark OFNWRB
bit in SPTH so
DDMP will
migrate the pg

SEQUENTIAL I/O·DSK
(String & Byta Dav Dap Coda)

SETWND

Get Byte No. of
Cur. Byte From
FllBVN in JFN BlK

Assign Pg
from JSB
~ce

NEWWNOpS02
Get Next
Pg into
Window

No

SETWND
Set Window
PgUp
CaIlIASGPAG
To AlSign.
JSBP...
Cle." FIlCNT

NEWWND pSD2
Get ·New Pg in
WindowPg.
Set FllCNT to
No. of by tel in • Pg

Upd.te OFN Length
in OFNlEN TbI

S01

71

Routine to Conv.rt Your JFN, PN to
OFN, PN. Creates Long Fil. Pg Table
if Le.... and Requested

JFNOFS

OMOCHK

Set Flq to Say
Ailow Pg Tbl,
Cr. . .

Chk That
Structure
Still Mounted

UnmapOId

Pate· in Window
JFNOF5
GetOFN" PN
For This Pg

Store Pg Adr in
FILBYT & Bytes
Per Pg into FILCNT

Map the Pg
into Window

ADJCNT
Adiust FILCNT if
FILBYN Notat
Beginning of Pg

SD2

72

CLOSF - DSK
Oev. Dep. Code

Un map Window Pg
Return Space to JSB
Free Space

Update FI LLEN
Before Close

If Opened for Write and
Have a Window, Update
FOB Entries, FBBSZ,
FBMOD, FBSIZ

v..

CNTLNG
Clo.e
Long
File

Count all
Pgs in Use
for File

SETMPG
Unmap Super
index block

Write Index
Blk to Disk
If Modified

RELPAG
Return Page
to JSB Free
Space

RELOFN p C02

Update FOB
Last Dir Change Time
(If Open for Writ.,)
Quota Info
Pg Count for File
Byte Size, Mode, Size
in Bytes

Relea.e OFN
of SuperIndex Blk

DSKDV
Delete
Excess File
Versions

COl

73

CLOSF·DSK (Continued)

UPDOFN pCD5

V••

Mark Del.t.
Pgs Flag

Writ. XB
to
DISK

No

GETSHR
G.t OFN Shr Cnt
from SPTO rbl.

Not Last Close
ofOFN
RELOF6:

No
DASOFN pCD4
Deassign OFN

SETXB1
Map XB into
PSB Map

Touch Index Pg
(So Will Be Brought
Into Core if Not

Already in Core)
SKPNWR PPF9 a

If Writes in Progress

for XB,

RDISMS
with Sk.d Test,
Pg #" DWRTST

C02

74

Froz.n Writer of
the File, Turn Off
The Write Bit

CLOSF·OSK (Continued)

Mov. All of
Pili to Disk

Yes

Scan XB & R.I....
Onlv Good Pili from
Disk Bit Tbt
CI,., XB Slot Wh.ther
Pg is Good or Bad

No
Scan XB& R......
All figs from Disk
Bit Tbl for Str and
Z.ro Each Pg's Slot
inXB

RE LOF7:

No

DWNSHR

SKPNWR pPF9a

D.crem.OFN
Shr Cnt in SPTO
(BUGHLT if Cnt
Already 0)

W.it for Writ.
to Compl.ta

Flush Cor. &
Drum Adr.

OFRQ
Put Pg on Top
of RPLQ

DEDSK

>-Y_es--l..-t Delet. Disk Adr
of XB from Bit
Tabl. for Str

RPCST

Fore. Disk Adr
Back to XB

RElCXB
Rele.se Temp
Mapping

CD3

75

1--------...-01-'

CLOSF - DISK (Continued)

SKPNWR

Move File Page
to itt Home on

O.... ign

Diak'

OFN

p PF9a

RDISMSif
Write in

0+ SPTH (OFN)
0+ ALOCX Field
in SPT(OFN)

. Protareu

No

v.

No More Files Open
for Oir., So Clear
ALOC1 & ALOC2
Entrin

Swap Pgsto

0+ OFNSHC

Disk. Remove

Decrement Open
File Cnt

Pgfrom CST3
Entry

Swap Pg into Core
8t Wait for Completion

CD4

76

CLOSF·DISK (continued)

UPDBTB
SETMPG

Update Bit
Table

Map Index Blk
Through PSB

UPDOFO
Set up, to do
chksum for XB

Write Index
Blk to Disk

Put Disk Adrs of
Existi ng Pgs in XB
Slots & Store
Checksum in XB

UDSKIO pPHY1
Write XB to Disk

MSETMP
Unmap I ndex Block

CD5

77

78

OPENF-DISK Comments
(1)

OFN bits:

(2)

For a lonq file, the OFN of index block ~ is
remembered in the JFN blk and used as the identity
of the file by t~e ENQ/DEQ facility.

O-read, lO-write, ll=thawed, Ol=restricted

79

CLaSF-DISK ,Comments

(1)

All storaqe addre.ses placed in an index blk have the
pointer type fiel; set to immediate •

./

80

JSYS's CALLS
MTA DEPENDENT LEVEL

MTAOPN -

Magtape Opening of a File

OMl

MTASQI -

Magtape Sequential Input

SMl

MTAIRQ -

Queue Up Specified I ORB

SM2

MTASQO -

Magtape Sequential Output

5M3

MTACLZ -

Magtape Closing of a File

CMl

81

82

OPENF - MAGTAPE
DEVICE DEPENDENT CODE

- - - -... Called via Contents of
OPEND (MTADTB)

Initialize Per Unit
Storage and Figure
Bytes Par Word

Store Magtape Parameters
Density -+ MTON
Parity -+ MTPA R
0-+ FILCNT, FILLEN,
FILBYT
(2)

Init Units IORBs
Init MTBUF & MTCUP
Store Prog. Name & Logged-in
Oir. Number in UOS

Error

OM1

83

SEQUENTIAL INPUT - MTA
(STRING at BYTE DEV. DEP. CODE)
Called At JSVS Len!
Through BIND (MTADTBt

MTAAS8
Call ASGPAG to Anign
JSB Pgs for 2 Buff.,..
EKh of Size RIC. Length.
Store Adr of Buf PIS in
Ust Pointed to by MTBUF

CHKERI
Chk IORBfor
E"Oft. (Ret ifsot

No

Yes

Zero FILLEN.
FILBVN. FILCNT
Mlrk IORB
As Fr..

Step to Next Pg of Buffer
Byte Ptr for this Pg .... FILBVT
MIN (No. of Bytes Left in Buf,
No. of User BytH/Pg) .... FILCNT

Stet) Buffer No. in
MTCUB for this Unit
Queue up any Fr..

IORB's (Rudy for
Filling)

Increment Buf Pg if Reading Forward
Dec:rement Buf Pg if Reading Backward

MTSQI2:
Decrement FILCNT
Increment FILBVN
Get Byte from Buffer
GETUBF
Get next IORB for User
to Empty.lf N..... to Blk.
Setup Sched Test:
IORB Waiting for ..MTARWT

No

Unsuccessful Return

SM1

84

Queu. up any Fr..
IORB's for Filling

MITR:,.=QO::.;.:_"'-_--,
~ETCSB

Qu.u. up Specified IORB

Frames Cnt "IRBCNT
Char Cnt .. I RBOC
Func Cod. -+ IRBSTS
(Adr of Wit
of Buf Pgs)-+ IRBPB
MTIR02:
For Each Pg in Buf:
1. Put Phy Pg Adr in LH
of Each Buf Pg Ptr
2. Call PHYSIO & D.w.
D.p Cod. to Set up Chan
Command Word in Xf"
Wit for the pg.

Yes

Set StatUi Bits
for IORB

Step IORB for
this Unit

,--..;:G:.::E;.;T~IR_B
__..... Should Not
Block

Get Adr of COB & UDB
for this Unit

PHYSIO pPHY2

Return

Data Mod', D.nsity,
Parity -+ I RBMOD
MTCHKA" MTAINT
-+ IRBIVA

MTAIRQ
Qu",. up
thislORB

Qu.ueup
IORB

SM2

85

SEQUENTIAL OUTPUT - MTA
STRING 8& BYTE OEV. DEP. CODE

CI'''' at JaYS Le.eI
Throuih lOUD (MTADTBI

Output Buffer

YH
Qat RlCIOrd Sin &
Convert to Hdw Bytes

Step to Nut " of Buf
Iyte Ptr for tIrit Pv ... FI LIYT

ZIfo IuffIr ,.

GETIRB
Get Next .ORB
for UMfto Fill

Decrement FILCNT
Increment FaLBYN
Sto... Byt. in luff.,
MTAIRQpSM2
Queue Up

Succ8lfu1

Chk for

Erron

Byt./Buf'" FILUN
0'" FILCNT
0'" FaLBYN

SM3

86

IORB

CLOSF - MAGTAPE

Wait for Activity
to Stop

Clear Close Func
Cnt (MTSTC)
Mlrk Close in

Progr...
Incrtm FUM Cnt

> -.......

(Used to Index Into

a Tlble EWowl
Don't Force Out
LIlt Buf.

Do Next FUM in Fat. Table Indexed by Func.
CALL MTRECO - Force Out Last Partial Buf
CALLMTCHKE - Chk if EOF's Need Writing
CALL MTABKE - Then Backspace over 2nd EOF
CALL MTFLSH - Flush Out all Remaining IORBs

MTACLA:

Wait for Finish

MTACLW

Unit nO.,MTAWAT-AC1
MDISMS

Chk if Need to Blk (Any
IORBs Left in 071
If so, Return with Sched
Test (Unit No." MTAWAT

MTPOSO
Sequential Read Go Lea"e Tape In
Correct Position (1 )

MTACLW
Wait for Activity to
Stop.

No
CM1

87

88

OPENF-MAGTAPE Comments
(1)

One can open for read and write only in dump mode.

(2)

FILCNT/Count of bytes left to use in current page of
buffer.
FILLEN/Count of bytes in buffer.
FILBYN/Buffer byte number use~ is referencing.

89

CLOSF - MAGTAPE Comments
(1) Since the monitor reads ahead, backspacing to
record read may be necessary.

90

jus~

aft~f

last user

REQUESTING DISK/MTA I/O & INTERRUPT HANDLING FLOWCHARTS
(PHYSIO LEVEL)

DRMIO/DSKIO/UDSKIO - Requesting Drum or Disk Read/Write
PHYSIO -

Queue Up IORB Request for Disk, Drum
or Magtape
SIOI -

PRYINT -

PHYI
PHY2
PHY2

Post IORB
STRTPS -

Start Unit Positioning

PRY3

STRTIO -

Start Unit Transferring

PRY3a

Disk and Magtape Interrupt Handler

PRY4

DONIRB -

PHYS

Post 10RB as Done
SWPDON/UDIINT -

Housekeep for
Drum/Disk Done

PHY8

MTAINT -

Housekeep for Magtape
Done

PHY9

SCHSEK -

Schedule "Best" Seek Request

PRY6

SCHXFR -

Schedule "Best" Transfer Request

PHY7

91

92

Called From UPDOFN for
Writing Out Index Blk.

REQUESTING DRUM OR DISK READ/WRITE
(PHYSIO LEVEL)

PAGEM Interface
DRM/DSK I/O

Get 10RB + CCW Block
From Pool. Wait if Nec.

If Writing, Set
DWRBIT Bit in
CST3 Entry for Pg.

Store Disk Adr, Count,
Function & Specific
StatuI Biu in 10RB

Set IS.SHT Bit and Function
Code into Short 10RB (1 Word
Blk in CSTS Entry for Pg)

Store UDISIE in IRBIVA
if Calle, Wants Error on
Offline Unit.

Enqueue
I/O Request

Store
Tail" Head of CCW List
Int. Routine Ad.', UDIINT
in 10RB

PHYSIO pPHY2
Enqueue I/O
Request

(I0RB ADR"
UDWDON) ~ AC1
PDISMS

No

Release this
IORB
PHY1

93

Wait for Done on this
10RB as a Pg Fault

- - -.... Call to Queue Up 10RB
for Disk/Drum or MTA

Post 10RB

SI01
Determine

GETCUB

Chan & Unit
and Pan

Get CDB &
UDB From
PAGEM Adr

10RB

Get Core Pg No.
From Offset in

CST5
Store Unit No. I~o
CST3 Entry for Pg.

Anyway,
Add to
TWQ

PHY2

94

Here When Request
Needs No Positioning

Add Req to PWQ
ONTWQ
Place IORB on
End of TWa

ONPWQ

Put 10RB
Req On End of PWQ

STRTPS pPHY3
Unit Free
Start Positioning

STRTIO pPHY3a
Start up This
10RB

PHY2a

95

Here to Start Positioning
for an IORB
STRTPS

Yes

BUGCHK
Inconsistency
Chk

No

If There is a Controller,
Set KS.ACT in KoB
(BUGH LT if Already Sed

Clear All Err Bits in
IORB StatUI Word
Store Overdue nme
for Xfer in UOB
Get Channel's oisp Adr
from CoBOSP (COB)

CoSPOS (Chan Oisp Adr)
Dispatch to Lower Level
Positioning Function

RETSKP
Succeuful Ret

Set Operator
NHded Bit

CLRPOS
Clear Positioning
Active Bits,
US.ACT & US.POS

Unsuccessful
Return
PHY3

96

Here To Start I/O
on an 10RB

Get STRTIO Exit
Adr from 10RB
(lH of IRBIVA)
DSK-UDISIE
MTA-MTCHKA

Ves

Execute Routine
DSK-Sets Bits if
Unit Offline
MT A-Sets Bit if
ABORTF on

Set Chan, Control, &
Unit Active Bits in
COB. KOB, & UDB

No

Mark in COB that a Unit
is Holding the Chan
Clear US.OI R &
US.OMS Bits (Don't
Need any longer
for Oper_ Intervention)

SETIO
Set Up For 10-Ciear
All Err Bits & Set
Overdue Time
(Now +17 Sec)

OFFTWO
Remove Req
from TWO

COSSIO (Chan Disp Adr)
Go Start I/O at
lower level

DONIRB p PHV5
Flag as Done
Unsuccessful
Return

ClRACT
Clear Chan &
Unit Active Bits

Yes

Unsuccessful
Return

Set Operator
Intervention bit
Clear Overdue n mer

PHY3a

97

Here When Int. Dev.
Hu BMn Determined

""-Se-ve-A-C-'s"'i-n-P-H-Y-A"'CS;';";;~ (COB ~r Indi·
cates thIS)

Setup Interrupt POL
(Starts et PHYIPO)
Get Channel's Oisp. Tbl
Adr. ie COBOSP (COB)

COSINT (Chan Oisp Tbl Adr)
Anal,ze Causa of Interrupt
at Channel DIp. Level
(1 )
SCHSEK pPHY6
Schedul. Seeks
(If Needed)

SCHXFR pPHY7
Schedule

Oismisslnt.

OONIRB pPHY5

SCHSEK pPHV6

Post IORB as Done

Schedul. Seeks

Here When
IORBTerminetes
INT2:
OFFPWQ

CLRPOS

Pull From PWQ

Cle., Positioning Flag

INT3:

Schedule Transfen
DONIRB pPHY5
Post IORB as Done

Pull From TWO
PHV4

98

Yes

Yes

Set Err Rec.
Bit for Chan.

ERRSET
Create Error Blk

UDSERR (Unit Disp Add
Invoke Error Retry

No Done with
Recovery

PHY4a

99

Clear Err Rec
Bit if Xferring

Here to Post an IORB Complete

Set Don. Flag
in IRBSTS

Ve.

Set Error Bit
IS.ERR in IORB

DONIR1:
No

Get Int Oi.p. Adr.
From Long IORB Entry t - -.....J
(RH of IRBIVA)

~--!.... Set Error Bit, SWPERR, in

Ve.

Short IORB for PAGEM

UOINT pPHV8 or
MTAINT pPHV9 or
MTDtNT (Dump Mode)
Do Dew (Oisk/MTA)
Dependent IORB Done
Code. (The Two MTA
Interrupt Routines
Perform the Same
Cleanup Tasks)

Notify
PAGEM

PHV5

100

Get Best Req & Remove
it from its Position in the
PWQ to the Beginning
of the PWQ

Yes

Scan Algorithm with
Read Pref Remembers
'Best'
(2)

101

ON TWO
Append to

TWO

OFFPWO
Pull Request
from

STRTPS pPHY3
Try to Start

Yes, See if
Anything Else

PHY6a

102

PWO

SCHEDULE TRANSFER

SCHLTM:
Init to Very Large
Latency & No
'Best'lORB
Time to Round
Robin

STRTIO pPHV3a
Attempt to Start
I/O

UDSL TM (Unit Disp 'fbI)

Call Dey. Dep Code to
Get Best Latency Req
From All Xfer
Requests for the Unit

pHY7

103

Setup to Continue Scan
From Last Active Unit
(Kept in CoaCUN)

XFRCHB:
If Unit Available,
Move Special 10RB
to Head of TWO

XFRX
Try to Start I/O for
this Unit
Call STRTIO pPHY3a

Try to Start I/O
for this Unit
Call STRIO pPHY3a

XFRX
Try to Start I/O
for this Unit
Call STRTIO pPHY3a

No, Try Another Unit
No

Pull 10RB from TWO
Indicate Hard Err.
Post as Done (DONIRB
pPHY51

No

PHY7a

104

No

No

No

No

No

Stack Command
Call CDSSTK (Chan Disp Tbl)

PHY7b

105

"INTERRUPT DONE" DSK/DRUM DEPENDENT CODE
Called When Long 10RB Done
for Disk (Infrequent Col.. )

-------.

Called When Short IORB
Done for Disk or Drum

Increment Page I/O
Satisfied Flag
(PSKEO)

Increm. PSKED
(Tell Sched Rd
Complete)

Clear Write Bit in
CST3 Age Field

Store Rd Done for
Pg State Code in
CSTO Entry

Put Pg on Deteted
Queue & Set Pg
State to Deleted
Dispatch to
Correet
BUGHLT

SWPER3:

Put Pg on End
of RPLQ
Find Type of
Fork Page
OFRO
Put Pg on Top
of RPLO

Dispatch to
Correct
BUGHLT

ONRQ
Put Pg on
End of RPLQ

PHY8

106

."INTERRUPT DONE" MAGTAPE DEPENDENT CODE
Called When Non-Dump Xfer Done For
MTA At Interrupt Level
MTAINT

Set "Abort All 10RB's
For This Unit"
Flag (ABORTF)

PHVKILL

MTAIND

Dequeue All Nonactive
10RB's From TWQ
for Unit

Unlock Pgs &
Mark Done
Ves
MTAINE:

Mark All 10RB's
as Aborted
(J RBAB Flag)

Call MTAINT
for Each 10RB
for This Unit

Only Want To Abort
for a Good Reason

MTAIND
Unlock Pgs &
Mark Done

MTAKIL
Mark Buffer Ready
Flag (I RBFR) &
Clear Active Bit
(lRBFA)

Kill All 10RB's Left
On Queue for This Unit

MULKCR
Unblock All
Buffer Pgs.

Decrement No. of
Requests Pending

PHY9

1.07

MTAINTis
Being Called
Recursively

, . 108

Requesting DISK/MTA I/O Comments

SIal
(1) The algorithm for queuing up a MTA request is:
If the request requires
request to the PWQ.

positioning,

append

the

If the request requires no positioning
(i.e.,
Read/Write Forward or Read Reverse)
append the
request to the TWQ only if the PWQ is empty.
Otherwise, append it to the PWQ.

109

DSK/MTA Interrupt Handling .Comments
PHYINT
(1) The channel dependent routine
(RH2INT for RH2~s)
is
called to analyze the interrupt. Lower level routines
called by RH2INT (i.e., Unit dependent routines)
return
an argument in AC, P4, to PHYINT to indicate whether to
dismiss the interrupt (P4 = ~), to schedule another
channel cycle right away (P4 < ~) or to housekeep the
current request
(P4 > ~)
before scheduling another
channel cycle.
The channel dependent routine also
records error information so that PHYINT can see if
error recovery is in progress or should be started.
The request to dismiss (P4 = ~) is invoked for example
when the done flag is on and the channel is not
occupied. The request for an immediate channel cycle
(P4 < ~) is made when a positioning done interrupt has
occurred and there is no transfer in progress. Transfer
Done requests will require further housekeeping (P4 > ~)
by PHYINT before scheduling another channel cycle.
SCHSEK

(2) The scan algorithm
performs as follows:

with

read

preference

in

effect

Take the next higher-numbered cylinder read request from
the
current
cylinder.
If
none, take the next
higher-numbered cylinder
(write)
request
from
the
current cylinder.
If none, take the lowest numbered cylinder read request
from the current cylinder.
If none, take the lowest
numbered cylinder
(write)
request from the current
cylinder.

110

JSYS CALL FLOWCHARTS
TTY DEPENDENT LEVEL

TTYOPN - Teletype Opening of a File

OTTI

TTYIN - Teletype Sequential Input

STTI

TCl/TClB - Get Character from Line's
Input Buffer

STT2

TClO -

Get a Character

STT3

TCOE -

Echo Character

STT5

TTYOUT - Teletype Sequential Output
TCO/TCOB - 1st Level: Output a Single
Character - Translate According
to Fork's Specification
TCOY -

STT4

STT5

2nd Level: Do Links & Formats
for a Particular Device

STT6

TCOUT - 3rd Level: Do Buffering
and Output 1 Character

STT7

TTSND - Send Character to Line

STT8

TTYCLS - Teletype Closing of a File

111

CLTTI

, 112

OPENF-TTY
Dev. Dep. Code

TTYOPN

CKJFTT
See if Oevice
is TTY:

Yes

LCKOVL
Lock the DEV T Is. Lock,
OEVLCK· & Go NOINT

FNOUNT
Get OEV Tbls. Index
for this Unit

RETSKP
Successful
Return

Store this User's Job No.
for Line in OEVUNT Thl.

Set Open Bit, OV%OPN,
for Line in OEVCHR Thl.

OEVAV
Unlock OEV This.
Lock,OEVLCK

Setup to Return
with SIZF Bit Set

rTYASO

Successful
Return

Setup in AC1
Line No." TSACT1/2
and MOISMS

113

Get 1 Input Char
for the Line

SEQUENTIAL INPUT· TTY
STRING & BYTE DEV. DEP. CODE

Get Un. No.. for
....- - - t.... Job from JOBPT

Yes

Get Char from
RSCAN Buffer

Perform R ESCAN
Housekeeping

Use Normal Mode
for TTVs
TTYINB:
~-I"'"

Get Dispatch Adr.,
TCIB

Get Dispatch Adr.,
TCI
(Routine that Allows
Translation)

Ves,
Try Again

TTVATW

ULKTTV

Wait for Attach

>---........
No

Unlock Dyn. Data
for Line
(Allow Alice.)

ULKTTV
Unlock Dynamic
Data for Line

Setup to Return in
AC, A, Just Byte Size
of Char Specified
at OPENF

Indicate Error to

Caller (Set ERRF Bid

STT1

114

G.t eMr From
Input Buff.,.
Called from TTYIN
Get Binary Char
from I nput Buffer
Called from TTYIN

Yes

Clear Repeat Char Flag
Get Last Char Input

Indicate Alrudy
Echoed
Set Flag to Indicate
Binary Terminal Mode

Return LF with
No Echo

TCIO pSTT3
Get a Char

TCIO pSTT3

TCITTI

TCI2:
Return

Unsuccessful Yas
Return

TCITTI

Setup to Return in

Test for TTY Interrupt
on this Char 8& Let
PSI Handle It

T1 Char. + Parity

Yes

Yes

Echo CR-LF
Call TCIECO
for Each Char

Input Request Means
Implicit Clear of
CTR UO so Clear
CTRL/O Flag. TOFLG

'Raise' Input
Char if Nee.

TCIECO
Echo Char
if Necessary

TCOE pSTTS
Echo Character

Save Last Char in TYLCH
in Dyn. Data Block for Lin.

Char in T1.
Successful Return

STT2

115

Will Echo Char if
Not Echoed by Sched.

,..""'!"""__

Get Char From
Une InpUt Buffer
Called from TCIITCIB

TCI01:

~----------""'---"""'"'i....a""'---"
No
.....- _ -..

Mak. Sur. No Oth.r
Fork is
Waiting,
Th.n
Go
Into Input'
Wait

VII

TTICNO:

BUGHLT if No
Ptr. for Char.

Sav. Data Mode
Record 1ftis Fork i.
Waiting for TTY
(in lWFRK)
Indicate No Forced
Wakeup in TTFW

Get Next Char. &
tore Updated Ptr.
in TTIOUT

ULKTTY
Release TTY Lock
&GoOKINT

TTFRKT

TTRLBF
R.I....

Buffan

Dispatch to
Function Table
TTXXVT
at Offset,
TTVT32
(FE OisP. Adr.-;' Aet.)
(P'r Oi,p. Adr. • TCIPTY
(I nput Char.))

Resolv. Conflict by
Halting Fork if it's
Inferior or Putting
it in Fork Wait
if Not
Return
Non-skip Return
to Reverify TTY
in Case W. Blocked

Perform
Housekeeping
Tasks

ULKTTY
Unlock Dynamic
Data'Blk for Line

Successful
Return
Get into AC1
Line No." TCITST

& MDISMS
,...~........... Non-Skip Ret to Say
'---""" a Block has Qccured

STT3

116

....- - - - - -...... Output 1 Char
to the TTY

SEQUENTIAL OUTPUT· TTY
STRING & BYTE DEV. DEP. CODe

Yes

Dispatch to
TCO/TCOB pSTTS
to Output Char

If 1st 3 Char of Dev. Name
are Ti"v, G~t ~~trolling
TTY No. from JOBPT

Call Output
Routine in
TTYSRV

ULKTTY
Unlock Dynamic
Data for Li ne
Setup to Send Out in
AC, A, Just Byte Size of
Char Specified at OPENF

Translation
TTYOUB:

>-_ _ _..... G.t Dispatch Adr.,
TCOS

G.t Dispatch Adr.,
TCO

No

TTYATW
Wait for
Attach

No

UlKTTY
Unlock Dynamic
Data for Line

lCKTTY
lock Dynamic
Data for Line

Indicate Error to
Caller (Set ERR F Bit)

STT4

117

TCO ~ 1st Le..... Tr.....te Accordino to Program's Desi....
TCOY • 2nd ....... Do Links & Format for a Particular Dewice
fCOITf· 3rd Lev" • Do Buffering, etc.
1st Lev": Called From TTYOUT
OutpUt. Single Char.

1st Lev": Called From TTYOUT
Output a Binary Char.

Yes

TCOUl pSTT7
Output the Char.
Without Adding Parity
No

Echo Character
Called from Scheel.
If in' Page Mode, CI_
Li.. Position Within
Page to Prewent XOFF

TC10:

Ves

Ves

Get Output Control Mode Bits
for CTRL Char.
00 • Send Nothing
01 • Indicate, ie. t
10 • Send Actual Code
11 • Simulate Format Action
(For Escape, Use $~

Get t Code 8& if

Echoing (lMECHF =/& O~,

Incr. LINKF Flag

Ves

Print Char.

Ves

STTS

118

~_ _.....

2nd Level: Called from TCO/TCOE
Dew. Idiosyncrasies
and Ch.racter Accounting

"'-~p.;."'" Handle

Send CMr. ut
Directly
TTOHA
No

>----------------s!.. ......
~-

Yes, Echo CTRL Func.

Use Char. Code to Index in CHITAS
to Pick up Disp. Adr.:
TCOUTpSTT7
or
Format Routine (ie for CR, FF etc.)
(Later Calls TCOUT)
Yes

If Lower Case
Char. Convert to ............
Upper Case

Step to Next
Position on Line

____~
TCOP
Output Char.
& Account Space

Call Routines to
Output CR & LF
& Reset Line Positio

TTC06:~~~

STT6

119

"'-ii....iiiiI!iiII,,,

3rd lnel: Called Fram TCOVITCQB
Do Buff...... ~.1 Ch....

~'!"'!'"!~,
'Iiiii......IIIiiii"

Do Parity logic By
Executing Instr. intbl.
TTXVT

Special Schad Entry Point When
Entering from TTEMES

If Parity Bit Needed
For Char., Do Parity logic
By Executing Instr. in TbI.
TTXXVT

at Ofhet

TTVT12

TTlNK3

Go Store in
Output Buffer

Scan Unk Word,
Sending Chan.
to lin. SpKified

Return

>----1..-.

Setup Sc:hed. Test Word
Line No." TCOTST
& MOISMS

Vel
TTGBF
Try to Allign
Needed No. of Buffan

....._ _ _.... Stor. Byte Ptr. (to
New Buf) into TTOUT

Store Char. in Output Buf.
Updated Ptr. in TTOIN

Setup Sched. Test Word
No. Needed" TTBUFW .....&MDISMS

~~~,

& Updated Cnt in TTOCT

Start Output to
Line if Nee.

Ves
STRTOU
Start Output to Line if Needed
Displtch to Table
TTXVT
at Offset
TTVT13
(Disp. Adr • STRT01 for TTFEVT)

STT7

120

TTSNDO
Send Chlr. Routine
NOSKD1
Turn Off DLS Chi
Call TTSND pSTT8
Turn On DlS Chan.
OKSKD1

Callable from
Non.PI Context

....

Send CMr. to Line
at Interrupt Level, or
in Schad/Procell Context with
TTY Interrupts Disabl"

--~~~ ~lIad

,...~......'""""
~';;';;'~.;.J

Start Up a Line Xfer
via the DTE20

DTECHO
Output via
Secondary

Set Waiting for 11 Done
& Line Active Flags
Incre. . Cnt. of Bytes in 11

Clear Output-Active Flag

Setup Nee. Args
for Call to DTESRV

CLENUP
Get Buf Ptr from
TTOOUT. (BUGHL T
if No Ptr.) & Save it

Step to Next Buf. if
at End of Current Buf.
& Update Ptr. in TTOOUT

Call TTR LOB to Release
Output Buffers
If Int. On Empty Output
Buf. Requested, Put
a Word in BIG BUF
with Bit TTOIRQ Set
. (Schad. (li'CH7)
Will Find ttl

Deer. Bytes in-11
Restore 6rig~ -Ptr.i~
TTOOUT
Incr. TTOCT
Go, Schad. Retry
Note Not Waiting
for Packet
(ie Clear TTFPK

Get Line No., Time Until
Event (000), & Disp. Adr.
(=TTSN10)
Simulate CTR LIS
(Set TTSFG Flag)

BUGCHK
TTSND·Unrecogniz:~_....~

Escape Code

~---

Call Dev. Dep. Code to
Send it to TTY by
Dispatching to
TTXXVT
at Offset
TTVT23
(FE Disp Adr ,. TTSND1)
(PT Disp Adr "" Ret)

STT8

121

TTQAD
Compute Time to Do Function
for Une & Save in TTIME
Save Disp. Adr. in TROUT
Incr. TTQCNT
Set Scan Ptr. to Here if
First Entry

CLOSF·TTY

Dev.Dep.Code
TTYCI.l

TTVOEA
CKJFTT
See if JFN is
TTYCL2:

> ___....... Unlock DEV Tbls.
No
Ves

Lock, DEVLCK

RETSKP
SUCCIIIfuI
Return

TTYCLO:
Indicate No Job Owns
line in DEVUNT Tbl.

LCKOVL

Indicate Line No Longer
Opened (OV%OPN Bid
in DEVCHR Tbl.

Unlock DEV Tbls.
Lock, OEVLCK

No
Successful
Return
GTCJOB

TTVCL4:

>-____... Unlock DEV Tbls.
Lock,OEVlCK

CLTT1

122

If Suppose to Blk, Setup
AC1/Line No." TSACT3
and Set BlKF Bit

Unsuccessful
Return

SCHEDULER TTY INPUT ANALYSIS & STORAGE

TTCH7 - Moves Characters from the Big Buffer
to Line Buffers
TTCHI - Initiates a PSI Interrupt if
Needed, Echoes if Appropriate
& Wakes Up Waiting Forks

123

SCHTTI

SCHTT2

124

SCHEDULER TTY INPUT ANALYSIS & STORAGE

"'~I!'PP.I~

Sched. Short Cycle Task
Moves Chan from Big Buf
to Une Buffers
Do Dev. Dep Functions for Lines

TTCH7X:

Yes

TTCOLN:
Setup to Check 8
Lines for Special
Requt!sts
Get Next Entry
(Line-No. +Char .)
Decr. TTBIGCCnt.
No
Deer. Line's Cnt. in
TTFBB ·of Big Buf
Entries

DOLINE
Do Une's Req if it's
Time to Do it. Where
Disp Adr is in TROUT
in Une's Dyn. Data Blk
Decr. TTOCNT if do Func.
Housekeep Message Blk
or Output Buf if Nee.

SNDXON
Sand XON if Needed
Do
Next
Char.
TTPSRO
Go Wake
Up Process

No
TTC05:
Start at this Line Next
Time (Store it in TTCOLN)

No,
Shouldn't
Happen

TT1CX:

Set TTCON Flag &

oi"Spa"t"ch to T-bl

TTXXVT
at Offset
TTVT17
(FE Disp Adr = TTCON1) (1)

Get 7 Bits of Char.

+ParitV

Clear TTCON Flag &
Dispatch to Tbl
TTXXVT
at Offset
TTVT17
(FE Disp Adr. = NTYCOF){i

TTCHI pSCHTT2
Put Char. in Lines
Input Buffer

SCHTT1

125

ClUed from:

TTCH7 if Chlf. Found in Bit Buf;
Initiattla PSI InterNpt if Needed;
Echoel if APfH'OPriate 8& Wak.. up
Waiting Forlu

---....

Turn off CTRL/S FI-..
ifPr...nt
Set Echo Char. Flag for
TCOUT(-1 to IMECHF)

TTCHI2:

Echo Char. via Norm..
OutPUt Stream

If in Page Mode 8& Char. a
XON/XOF, DisPitch through
TTXXVT TTV101TTV20
to po XON/XOF 8& Ref to TTCH7

+

Clr.IMECHF
8& NoteChlf.
Not Echotd

Send XOF to TTY
if Input Buf. Cnt. within
8 of the Max.

If Char. Caused Buf. to
Become Full, Request
PSI Int. if Job Enabled
for Input Buf. Full Int.
Set Char. Echoed Bit
(Most Stg Bit of 90BIt Char.)
& Clear IMECHF

Return

Assign Buff.n if
NIC. (Ring Bell 8& Ret
if Fail) Seve Ptr. in
TTIO T
If at End of Buf, Step
to Next Buf.
Store Char in Lin'l Input
Buf.
Update Ptr in TTIIN 8&
Cnt. in TTICT
SCHTT2

126

Ten Sched to Unblk Fork
(i. Call UNBLKF) if:
Data Mod. Binary or
Inp. Buf -t '032 Chan
Away from B.ing Full or
Char il in Wkup CI_
Specified by Job or
Failed to Echo a Char.

Line Not Fully Active
and/or Has No Controlling Job

Raturn

Go Create Job
on Line if LOGINs
Allowed

TTEMS
...........-t Send Short Message Send Bell
Get Ben Clear
.....------~
(i.e. Bell from
& Lose
Sched.
(3)
Char.

Interrupt Char.
TTFWAK
Force Wake
(So Program Can
See Interrupt

TTCLPS
Clear Pg Ctr.

TTCIBF
Clear Inp. Buf.
(on Double Int.)

SCHTT3

127

128

Scheduler TTY Input Comments
TTCH7
(1)

The carrier-on routine for the FE device is TTCON1.
If the line is in use or a job is being created, it
just returns. Otherwise, it creates a job by the
CTRL/C
mechanism (i.e., putting a request in
Scheduler's
Request Queue, SCDRQB)
before returning.

(2)

The carrier-off routine for the FE device is
NTYCOF.
It flushes outputs and issues an interrupt
via the PSI system if process has enabled for
carrier-off interrupt. It then issues a monitorinternal interrupt via routine, PSIR4, which causes
the top fork to go to JOBCOF in MEXEC to cause the
job to be detached.

TTC7N
(3)

TTEMES is called at Scheduler Level to send a short
message to a line.
If the line is active, it
appends characters to the line's output buffer.
If
the line is not active, it creates a message-length
dynamic block for the line and puts the characters
into this block.
TTEMES calls SCDTCO
(pSTT7) to output each character via TCOUT to the buffer or message block.

129

130

REQUESTING DTE OUTPUT & DTE INTERRUPT HANDLING FLOWCHARTS
(DTE PROTOCOL HANDLER)

DTSNGL - Queue Up a Single Character Output Request
DTEQ - DTE Request Queues for

RSX2~F

Protocol

RSX2~F

Packet

INTDTE - DTE Interrupt Handler
DNIIX - To -11 Done

DINGME -

DTE1
DTE2

DTESKD - Start a To -11 Operation
SKVERI - Process

DTE1

DTE2
DTE3
DTE4

DEQDTE - Dequeue Completed Request,
Post it, and Schedule Next
One

DTE4

TTYINT - Complete a TTY Output
Request

DTES

DNSNGL - Post Single Character Done

DTE4

l~

Received a Doorbell Interrupt

DTE6

DOFRGM - Start a To -10 Transfer

DTE7

DN10RS - To -10 Done

DTE8

TAKLC2 - Process To -10 Done for
RSX20F Protocol

DTE9

BIGST2 - Store Character into the
Big Buffer

DTE10

131

13~

REQUESTING DTE OUTPUT
Called From Interrupt, JSYS
& Scheduler Levels

DTE Request Oueue
for RSX20F Protocol
(Called from DTSNGL,
Sched. & Interrupt Levels)

Oueue up I Single
~.........' " Char Output Request
(Called from TTSND pSTTS)
~~___.......

~------~------~

Get Comm Region
Pointan

Get Interrupt Loc.,
TTYINT
(To Be Stored Into QINT
Field of a DTEO Packet)
ASGNDI
Get a Request Node
from COMO Area

DTSNG6:
DTSNG2
Add Line No. & Byte to
Single Packet
Link Packet to DTEQS Oueue
if N~t Already The,.
Update Packet's Byte Cnt
& Flag Bits (If Full,
Set SNGAV L Bit)
If DTE Inactive, Start It
CaU DTESKD pDTE2

Get a Request Node
from COMO Area
(Blk. if Nee.)
Hav~

HAVNOD:

a C.OMO
Packet Adr.

Store CaUer's Args into
Packet's Fields:
OINT, OMODE, QCNT,
OPNTR, OLIN, & QDEV

Successful
Return

DTEQ13:
Put Unique Code from
Caller into QCOD
(For TTY I NT's Benefit
at Int. Level)
DTEQ1:
Add Packet to End
ofDTEQS a.

DTE1

133

Return

Routine to S"t1 •

~--,.........

To .. 11 Operation from
~....--"" the Top of ttMt DTE's
Driver Queue
~~-....

~.....--..,

Proces. Protocol Venion 1
(RSX20F) Packets

Set DTE1 1 Bit in OTESTS &

>--........ Active Bit (SNGACT) in Single
Yes,
Packet
TSNGL Packe
(No Formatting .....- - - -....- - - -......
Nnded)
SETRGN
If Pack.t Flushed (OFNC-o),
Get My Comm.
Go to
"
Region
DEOOTE pOTE4
to Post Packet & Return

SETRGN
Get My Comm. Region
to This ·11

Get Singht Packet's
Byte Count
From Packet in COMO Area,
SetuP in PKTAOR:
HOOEV & HOfNC
& Clear HDSPR

Use Protocol's Ven. No.
in CMVRR to Pick Up
Disp. Adr in SKDVEC Tbl.
No
Indir~t

Packet

Stene Datum from
QPNTR into HOOT1
Set DTE 11 Bit in DTESTS
(·11 Receiving Bytes)
STOREG:
Vector to Dispatch Adr
& Start T;ansfer
(Oisp. Adr. • SKVER1 for
RSX20F Protocol)

Store tOIO in HDCNT &
QLIN-lif 0) into HOLIN

'*

STORG1:
SETRGN
Get My Comm. Region

Get a Packet Byte
COUnt of toio

Build 8·Bit Byte Ptr to
RSX20FFormatted Packet
Zero cM"FwDTi.e.,Byte Mode)
DTSTRT:
Store Packet's Byte Cnt in
_CMQ.CT"
Incr. To· 11 Cnt in CM11C
Store S-Bit Byte Packet Ptr~.
in DTEEBP (in ·EPT TblT

DTE2

134

Store in HDOAT
MIN [OCNT, MAXINPJ
Set Indir Bit, OTE111 in
OTESTS
Zero HOLIN

All Primary Protocol Interrupt.
Come Here After AC's Are
Stored by DTETRP Routine

DTEPRG:

Clear DTETDN Bit by CONO Instr.

DTREST
Reset the DTE

POW11:
DTEPF1

Prorl'ssing Adr.,

Tell ·11 About
Power Fail by
Ringing 11', Doorbell

DN10RS

Dismiss
Interrupt

Reload the Machine

DTREST
Reset this
DTE

Say Not Running

a Protocol
(Clear DTRLD)
CLRDTE:
Tell Job 0 of
Reload
(+1 to LOAD11)

Schedule Job 0
(+1 to JBOFLG)

DTE3

135

If DTE Inactive &
DTEGS Not Empty,
Dequeue & Post
(Via DEQDTE"pDTE4)
All Requests for this
DTE

T0-11 Done Inte...,.pt

Cle., CMIP Bit

Dequeue Completed Request,
Post it, & Scheel. Next Req.

~----..... (No Longer Doing

Indirect)

Put Next Packet on
Top of DTEQS QUeul &
Get Args from Packet

TSTSGL
See if This

is a Single
Packet Gp

RLENOD

DN11.:
Set To 11 Bit, DTE11
Store MIN[(QCNT),MAXINP]
intoCMQCT

Free the Node

Setup Approp. Byte Ptr
If a Full Word Ptr., Set
CMFWD Bit

NOTWRD:
Store Byte Ptr. into
DTEEPP
SIt CMIP Bit (i.I.
Indir. Ptr. is Set Up)

DING11
Go Ring thl ·11

If QINT=FO,
Vector to its Disp.
Adr., TTY!.~~
pDTE5

Update QCNT by No.
of Chars. Already Sent
Adjust Byte Ptr. & Store
into QPNTR

DTESKD pDTE2
Go Do Next
Part

t-....;...."-~R!!etu~r!!..Jn

Return to Post a
Single Char. Done

Put Next Packet on Top
of DTEQS Queue
Clear Single Packet Flag Wd.

DTESKD pDTE2
Reactivate the DTE

SNGPST:
For each Line No., Char Entry
in the Packe1, Pick Up the Line No.,
& With Unique Code - 0, Do the
Post Via Call to:
TTYINT pDTE5

DTE4

136

Called at Int. Level to Complete
a TTY Output Request __
(Chin. hIve been sent to
the -11, but not acknowledged)

Get Proper
Line

Get Output Ptr.• TTOOUT
. & Advance if Nee.

CNTSET
Adjust Output Cnt.

DTEQ Failed;
Restore ena. &
Arrange Schad. to
Restart Output

FNDEND
Go Get Chan.

Add Buf Cnt. (TTOCT)
to Adr. of Dyn. Data.
Store Orig. Outp. Byte
Ptr. into TTOOUT
Update No. of ChIn.
By No. of Chan. Sent
Store New Cnt in TTOCT
Store New Output Ptr.
inTTOOUT
Get Cnt. of By1lts Found
Get Int. Disp. Adr (a TTYINT)
Set Waiting for -11 Done
Bit, TTFPK
Store Line's Dyn. Data
Adr. into TTYVR2

TTYIN1:
Add No. of Chan. Sent
to F.E. Cnt, TTFCT
Clear T0-11 Done Pending
Bit, TTFPK
Get Line's Allocation
from TTIFMC

Set Line Waiting For
Unblock Bit, TTFOW

Get Line No., Cnt. &
String Data;
rOFHSO-;,.FEDLS]

FIXARGS
Fix Up the Args
Clear Output Active
Bit, TTOTP

DTEQpDTE1
Queue the Request

Clear Output Active
Bit, TTOTP & Clean up

DTE5

137

Get Args:
Line No.
Time Until Event (... 0)
Disp. Adr. (a TTSN10)
TTQAD:
Compute Time to Do Func.
for Line & Save in TTIME
Save Disp. Adr. in TROUT
Incr. TTQCNT
Set Scan Ptr. to this EntrY
if 1st Entry

~~!'!"!'!!IIII. ·10 RlCeiwd •

DoorbeIIlntarnlpt
~~!i-iiiii' Start to ·10 Transfer

Get Cormn Region

Go Reload
BUGINF·
BMi Indir. Cnt.

>---....-t

Clear Expecting
Indir. Bit (DT1ID) 1---;...<

DINGM6:
BUGINF· Incorrect
Indirect Setup

Go Reload

Dilmiss
Interrupt

No

DINGM3:
BUGINF· To ·10
CnD Don't Match
DINGM4:
BUGINF • To ·10
In Progress on
Doorbell

DOFRGM pDTE7
Start
Transfer

Set TOfT Bit in Comm

Region" (c,ifO,.n4)

Dismiss Interrupt

~!»,

BUGINF· 11'5
a Count = 0

error
DTE6

138

Routine to Start
a To ·10 Transfer

SETRGN
GetComm
Region

Get Protocol Type &
Dispatch to its uTo"
·10 Xfer Routine
(Disp. Adr =- DOFRRS
for RSX20F)

RSX20F Protocol
To ·10 Transfer
Store Approp. Byte
Ptr. in DTETBP

Save Cur. Buf &
Store Next Buf
into DTEBF
SET2:

Update Status Word, DTESTS,
From AC, P2

Set Up Approp. Byte
Ptr. (Full Word (16 Bits)
or Byte Mode) According
to CMFWD Bit

Clear DTEBC (No Pending
Operation)
Store Q Cnt (Bytes Left)
~-t....
into DTEB1
Yes
Get Neg. Wd Cnt & I Bit into
AC,B

Set ·10 is Receiving 1st
Frag. Message Bit, DTET1 F
in AC, P2

Set Doing ·10 Transfer (Last
Fragment) Bit, DTET10,
in AC, P2

Store No. Left for
Subsequent Reads
into DTEBC

If Byte Mode, Get No.
of Bytes or if Not, Word
Cnt into AC, B- &
Store Buf Size (in Bytes)
into DTEB1
DTE7

139

Start To· 10 Transfer
by Sending Contents
of AC, B, (Via DATAO
Instr.) Over the DTE

Sending
Count
Over
the DTE

Sav. Cnt. in
Next Pack.t
in aNCNT

DOFRGM pDT!7

YI I

Stlrt ttli. Ffltlmlflt

CI••r Intrlnsit Bit.
CMTOT
Get Cnt of Campi. . .
R", from DTIB1
G.t Cur. Buf from DTEBF

Clear INCNT
Find Local Residual
Cnt.
G.t Next Function

DODMS1:

M.k. Buf Byte Ptr from
Adr. in DTBFWD

G.t PICk.t Size
& DTE No.

Get INCNT

OilPa1I:h to Adr. in TbI,
FNCTBL (5)
at Func. Cod. Offset
(011P Adr· TAKLC
for DLS Line Chan)

BUGCHK
T010DN - PICk.t
TooSmtll
U••• < 128)

G'1 ArGl from PICket
Store Func with Indir.
Bit CI...... in DT1 FC
Store Dey. Cod. into DT10V
Skip Spare

'-'..........", Une Chan (for DLS)

Dismin
Interrupt
TAKLC2
Call Processing Routin.
CI •• INVLO
(Unit in Indir. Word
is Iny.lid)

Set W.iting for Indir.
Setup Bit, onlD

$lye Cl'1t in INCNT
& Lin. in ,NUNT
SIt Valid Unit Bit, INVLD

Dismiss
Int.rrupt
DTE8

140

-11 Has Sent
Line Chan.

Store Char.
in Big Buf.

BUGCHK· Odd
Byte Cnt. for
Line Chan.

Indicate Data is Char for
TTYBUF by Setting DLSRCF Bit
Get Dev. Type & Char.

GETLIN
Get Dev. Type from
DT1DV & Store into
SAVTYP

Get Internal Line
No. for this Line

Clear
SAVOFS

Get Internal Line
No. & Char into AC1
BIGSTO:
Dispatch to Tbl.
TTXXVT
at Offset
TTVT22
F.E. Disp Adr. = BIGST2
pDTE10

Get Li ne Offset
& Save in SAVOFS
ISCTY:
Save Byte Cnt in BYTC
& Byte Ptr. in BYTP

Subtract 2 from BYTC

Get Byte, Line No. & Line
Offset & Type

DTESTO
Store in Big Buf.
DTE9
1 L1 1

Called from BIGSTO
' -......~.." to Check Una Limit
at Store Char.

Beyond a.d
,..-_ _ _ _ _ _ _ _ _ Guy Cutoff

Get ·Line in AC, C
Get [.OFTOL... FEDLSJ into AC, B
Claar AC, A (To the Master)
Get .OFTLO (Tum it off Func.)
into AC, 0
.

Vel

FIXARG
Fix Arguments

Store Updated Cnt.
in TTFBB

OTEQpOTE1
Output it
SNOXOF
Send X-OFF
to Terminal

OLS$X1:
BUGCHK - Big
Buffer Overflow

Setup Wh8n to Restore

Una (tD6000)

Char.
Incr. In Ptr to
Big Buf (TTBIGI)
& AJljust for Wrap
Around if Nee.

Make it a
Longer Wait
Time (t06000)

at offset
TTVT25
F.E.Oilp. Adr· DLSSX2

Store AC1 Contents
into TTBBUF &
Increment TTBIGC

Get Oisp. Adr. to
Call TTTOBL

Big Buf Has
Overflowed
TTQAO:
Decrement Big
Buf Cnt, TTFBB

Compute Time to Do Func.
for Line & Save in TTl ME
Save Oisp. Adr. in TROUT
Incr. TTQCNT
Set Scan Ptr. to this Entry
if Fint Entry

Send X-OFF to
Terminal
OTE10

142

DTE Interrupt Handling Comments
TTYINT
(1)

The Unique Code argument of form
(0, count)
tells
TTYINT the number of characters that have been sent
to the -11 in some call to DTEQ that specified
TTYINT as its return address.
Count = 0 implies this was a single
character (DTSNGL was called)
and buffer counts have already
been updated.
Count

~

0 implies this was multiple
characters and the count must
be updated.

DINGME
(2)

T010IC and TOllIC are wrap-around counters of Indirect Transfers where T010IC is maintained by the
-11 and TOllIC is maintained by the -10. If the two
wrap-around counters are equal, it means the transfer finished correctly.

(3)

If the difference between the wrap-around counters
is greater than 1, the -11 has tried to send a
direct transfer before the last indirect transfer
finished or a doorbell has been lost in a previous
transaction.

(4)

Receiver sets TOIT equal to 1 in Sender's section
of Receiver's communication region after Sender
sets @ or increments Q count and rings the· doorbell; Receiver clears TOIT upon getting To-Receiver
Done (This assures that the Receiver doesn't lose
an interrupt).

143

DN10RS

(5)

The function table has dispc;ltches for such features
as:
• F. E. tell ing about the CTY
• String data for the CDR
• Line characters (for DLS)
• -11 Sending error information
• -11 wants or is send ing time of day
• Line dialed up, hung up or line buffer empty
.Set1ine speed or allocation
• Take -11 reload information
• Acknowledge all dev ices and uni ts
• Take KLINIK data.

144

TOPS-20 MONITOR
Job Startup

DIGITAL

Job Startup
INTRODUCTION

A job is started by putting a request in table SCDRQB,
the scheduler special request table. An entry in SCDRQB is
one word with the following format:
data in the left half
and dispatch address in the right half.
The dispatch
address for job startup is JOBSRT.
All
jobs are started
this way, including Job 0.
A request to start Job 0 is put in 8CDRQB by the system
startup code.
Requests for later jobs will be added to
SCDRQB at the TTYSRV interrupt level when the user types
CTRL/C on an inactive line.
If the job being started is Job 0, some special
initialization routines are called.

system

OVERHEAD CYCLE JOB STARTUP TASKS

Table SCDRQB is checked in the overhead cycle for
requests.
Currently, SCDRQB
is used only.for job startup
requests;
routine JOBSRT is called in the overhead cycle to
start a job.
JOB8RT checks the availability of system resources such
as the number of free 8PT slots, the amount of drum space
available, the number of free job and fork slots.
If there
are not enough system resources to start the job, the
message "FULL" is typed on the terminal and the job is not
started.
If enough resources are available to start the job, the
necessary slots are assigned in the 8PT table and the job
and fork numbers are assigned.
The fork is added to WTLST
with a null wait test of [0"JSKP]. JSKP is a routine which
will always give the skip return, indicating that the fork's
wait
is satisfied and the fork can be moved to the GOLST.
The new job and new fork flags are set in table FKINT,
indexed by fork number.
JOBSRT then returns and the
overhead cycle continues.

MIS-.1

TOPS-20M ONITOR
Job Startup

DIGITAL

When routine WTCHK is called by the overhead cycle, the
fork will be moved to the GOLST. WTCHK is called by the 100
ms. clock when there is no fork to schedule.
Note that
when Job 0 is being started, there ~ill be no other forks on
the system; therefore, WTCHK will be called to move the
fork to the GOLST.
When SKDJOB chooses the fork to run, it will see both
the new job and new fork flags and will set the PC for the
fork to PIRQ; when the fork starts, it will begin execution
there.
JOB STARTU~ TASKS IN PROCESS CONTEXT,

When the process is chosen to run, it executes code in
EXEC mode to complete job startup. When Job 0 is started,
special routines are called to finish system startup.
The
job startup routines and their functions are described
below.
1.

PIRQ (fork startup code)
The PSB and
JSB
(if
appropriate)
are
initialized and EXEC0 is stored as the PC. The
software interrupt is dismissed.
When the fork
resumes execution, the PC is EXEC0.

2.

EXEC0
If this is the first job on the system
(Job 0), call the following routines:
1.

-SEBINI - initialize SYSERR data base

2.

-FSIINI - mount
incl ud es:

the

public

1.

Call FSIDIA if the file
initialized
(FSIDIA is
define PS:)

2.

Read the home block

MIS-2

structure.

This

system is being
the dialogue to

DIGITAL

TOPS-20 MONITOR
Job Startup
3.

Create SDB and STRTAB entries for PS:

3.

-SWPINI tables

initialize

the

swapper

data

base

4.

-CHKBAT - read the BAT blocks and perform quick
consistency check for the PS: structure.

5.

-GETSWM - get swappable monitor, using VBOOT

6.

-RESLCK - lock down some resident free space

After getting the swappable monitor, the Job 0
initialization code joins normal job startup at
GOTSWM.
3.

GOTSWM
1.

-The fork structure (tables FKPTRS and
in the JSB is initialized for the job

2.

-The software interrupt
uses are reserved

3•

-JB F IN l i s call e d to in i t i ali ze J S B 1 0 cat ion s

channels

the

SYSFK)
monitor

If this is Job 0 initialization (SYSIFG equals
zero), the following tasks are completed (after
which Job 0 initialization rejoins normal job
initialization at SYSINE):
1.

-FILINI - file system initialization; if flag
MI%RFS is on in STARTF, the file system is
buil t

2.

-PIDINI - IPCF data base initialization

MIS-3

DIGITAL

4.

TOPS-20 MONITOR
Job Startup
3.

-SLNINI -

initialize system logical names

4.

-GETNAM - read MONNAM.TXT to get system banner

5.

-Initialize the time zone

6.

-Initialize accounting flags

SYSINE
1.

-Initialize job's PlD and ENQ/DEQ quota

2.

-If CRJOB JSYS, set
locations

3.

-TTYASN - assign controlling terminal number

4.

-TTCKSP - set terminal speed if necessary

controlling

job

and

TTY

If t his i s a s pe cia 1 job,
log
i t i n as
operator and dispatch to the appropriate address
from
table SPECJT,
index ed
by
job
number.
Currently the only special
job is Job 0;
it
dispatches to RUNDD, whose functions are described
below.
.
If this is a normal
job, set up terminal
information
(such as setting
terminal
type to
standard). Get a JFN on the EXEC, GET it and start
it.

5.

RUNDD (Job 0 only)

1.

-Set CTY as controlling TTY

2.

-TTSPIN -

3.

-PROINI - start primary protocol

initialize terminal speeds to null

MIS-4

TOPS-20 MONITOR
Job Startup

DIGITAL

4.

-DTRMDS - tell console front end not to
data sets

answer

5.

-Try to get time
front end;
if
operator

and date from
the
it does not know,

console
ask the

6.

-Run SETSPD to set line speeds, system
names, and other system parameters

logical

7.

-If regular startup (DBUGSW equal 0 or I), tell
all users that system is restarting

8.

-LOGSST - log system restart in SYSERR file

9.

-Run CHECKD, if necessary

10.

-SERINI
initialize SYSERR logging
fork;
starts fork at SEBRUN in exec mode. This fork
opens the SYSERR log file and MDISMSs with wait
test
[0"SEBTST].
When there is a request is
queued
for
SYSERR,
its wait condition
is
satisfied and it processes the request

11.

-USGINI - start accounting;
CHECKPOINT files

12.

-Run SETSPD to copy DUMP.EXE to DUMP.CPY and
move any queued SYSERR blocks from the dLUnp to
ERROR.SYS

13.

-Start DDMP in this fork and
CTY saying DDMP is running

14.

-IMPBEG - start NCP
systems)

15.

-NSPINI -

1~.

-Create fork and start SYSJOB in it

17.

-Go to CHKR,
the
every 10 seconds.

fork,

opens

send
if

any

USAGE

message
(for

and

to
ARPA

initialize DECnet fork and data base

MIS-5

background

task

that

runs

DIGITAL

TOPS-20 MONITOR
Job Startup
NOTE - - - - - - - - - -....

Job 0 (the DDMP fork) runs only in exec
mode, using the monitor address space.

MIS-fi

DIGITAL

TOPS-20 MONITOR
System Startup

System Startup
STARTUP VECTORS

The system can be started at one of several addresses,
depending on the kind of startup. The system startup code
begins in STG with a set of startup vectors;
the first
vector is loaded at 140.
The startup vectors and their
functions are as follows:
EVDDT=140/ JRST DDTX
Starts the monitor in EDDT;
does not do a
reset first.
Can be used
for debugging when a
restart without resetting the machine is desired.
141/ JRST SYSDDT
Resets the machine and starts the monitor
in
EDDT.
Can be used for debugging when a reset and
restart is desired or when a restart alone does not
work.
EVDDTX=142/ JRST DDTX
Copy of 140 in case 140
(Provided for historical reasons.)

is

clobbered.

EVSLOD=143/ JRST SYSLOD
Initializes the file system.
installation.

Used for

system

not

really

144/ XPCW RLODPC
Reloads vector for front end.
EVRST=145/ JRST SYSRST
Meant for use with
supported.

.MIS-7

power

fail;

DIGITAL

TOPS-20M ONITOR
System Startup

EVLGO=146/ JRST SYSGO
Provided for historical reasons.
EVGO=147/ JRST SYSG01
Normal restart.
Of these startup;vectors, only 140, 141,
143 and 147
currently
provide
really
useful and separate system
startups. Functionally, they provide:
1.

Enter EDDT -- Both 140 and 141 enter EDDT
Startup vector 141 does a reset of the machine
first by calling PIRST (to reset the PI system) and
IORST (to set up EBR, set up UBR, and clear paging
and cache).

2.

Initialize file system (vector 143)
Sets flag MI%RST in STARTF to note the file
system is being initialized and then joins regular
system startup code at SYSLOD+l.
This
flag
triggers the file system initialization in the Job
o code.

3.

Normal startup (vector 147)
Sets STARTF flag to indicate normal
and begins system startup at SYSLOD+l.

startup

SYSTEM STARTUP CODE

The system startup code which begins at SYSLOD+1 calls
routines to initialize the monitor data base, puts a job
request in the scheduler request table and goes to the
scheduler.
The scheduler schedules the Job 0 fork, which
does the remainder of system startup. The routines called
to initialize the monitor data base (before the Job 0 fork
is started), and their functions are:

MIS-8

DIGITAL

1.

TOPS-20 MONITOR
System Startup
SYSLOD code (in STG)
1.

-Execute PIRST and IORST (see above).

2.

-Ini tial i ze DTEs

3.

-Clear resident storage area

4.

-Read APR serial number

5.

-Initialize bit table data base

6.

-Read APR serial number

7.

-Set extended addressing flag to indicate
machine has extended addressing

8.

-Set up BUGCHK, BUGHLT, and
a breakpoint was set)

9.

-Note if EDDT is to be flushed

10.
2.

BUGINF

(in

if
case

-Initial ize SWPCOR

RESFPI (in FREE)
Initialize resident free pool.

3.

PAGRST (in APRSRV)
Set up EPT, scheduler's UPT
TOPS-20 paging. This includes:

and

set

up

for

1.

-Store SPT and CST base addresses in AC block
6 (microcode/software interface AC block)

2.

-Initialize CSTDAT and CSTMSK in AC block 6

3.

-In i tial ize EPT, using tempI ate IEPT0

4.

-Initialize scheduler's UPT, using template
IUPT0

MIS-9

DIGITAL

4.

TOPS-20 MONITOR
System Startup
5.

-Store KIPFS as page fail dispatch address in
sched ul er' s UPT

6.

-Set up CONOPG for KL paging, (but do not turn
on KL pag ing)

PGRINI (in PAGEM)
Initialize pager data
pag ing.

base

and

turn

on

KL

1.

-Initialize DST, SPT, SPTH, and CST tables

2.

-Assign SPT slots for running fork's PSB, JSB
and for the bit table and MMAP

3.

-Initialize MMAP

4.

-Initialize FPTABL (PAGEMs section dispatch
table); makes all sections illegal

5.

-Set up section pointer(s) for monitor in
MSECTB; set up dispatch addresses in FPTABL
for all legal sections in this monitor

6.

-Initialize MMSPTN (MMAPs SPT slot)

7.

-Set up MMAP entries for resident monitor
(virtual and physical addresses are the
same)

8.

-Set up MMAP entries for the bit table
(indirect pointers through the bit table's
index block)

9.

-Set up MMAP entries for JSB area and PSB area
(indirect pointers through the JSB and PSB
maps)

10.

-Set up ARPANET section (if this is an ARPA
machine)

MIS-10

DIGITAL

5.

TOPS-20 MONITOR
System Startup
11.

-Set scheduler context

12.

-Turn on TOPS-20 paging

13.

-Construct RPLQ

14.

-Set up core management constants

(call PGRON)

UNBINI *2020 only*
Initialize UNIBUS related data base.

6.

PH YIN I

( in PH YS IO )

Initialize the PHYSIO data base.
A CDS is set
up for
each channel
and a UDB for each disk and
magtape unit.
The IORB free list is built.

7.

TTINIT (in TTYSRV)
Initialize TTY data base.

8.

1•

- In i t i ali ze TTY b uf fer s

2.

-Initialize TTY tables that are indexed by
line

3.

-Establish line type for each line

4.

-Assign internal line numbers for all lines

5.

-Initialize BIGBUF data base

SCDIN

(in SCHED)
Initialize scheduler data base.

1.

-Initialize scheduler flags

2.

-Set up OKSKED locations (RSKCHK)

MIS-II

DIGITAL

9.

TOPS-20 MONITOR
System Startup
3.

-Set up JSYS trap queue

4.

-Initialize free fork list

5.

-Initialize free job list

fi.

-Turn off Job 0 alarm (until Job 0 fork
is' sta rted)

7.

-Initialize balance set queue

PIINIT (in APRSRV)
Initialize priority interrupt system.

10.

1.

-Set up XPCW instructions in the standard
interrupt locations for levels 4-7

2.

-Set up for power fail

3.

-Initialize DTE. (set up XPCW instructions for
each DTE vectored interrupt location and
set up the DTE PI channel for vectored
interrupts)

4.

-Set up interval timer (set up XPCW instruction
for interval timer, set the interval, and
set its P I ass i 9 nm en t )

SCDRQ7 (in SCHED)
Put a request for a new job in the scheduler
request table; this starts the first Job 0 fork.

Enter the scheduler at SCHED0;
that is, start the
overhead cycle. The overhead cycle services requests in the
scheduler request table and this starts the first Job 0
fork.
The rest of system initialization happens in process
context (Job 0 context). See the job startup description
for the rest of system startup.
(Note that the system has
not yet read in the swappable monitor, has not asked for the
time and date, etc.)

MIS-12

Appendix I
PART A
Alphabetical List of BUGHLTs,
BUGCHKs and BUGINFs

DIGITAL

TOPS-20 MONITOR

APPENDIX I

BUG(HLT,ABKSKD,
,,,,,,,Tl) BUG(HLT,RPGERR,,,,,,,T4) BUG (CHK,CKLBLK, ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,Tl) BUG (CHK,EFACF3,,,, BUG (CHK,ILDRAl,,,,T2) BUG (CHK,IMPREM,,T2) BUG (CHK, IMPTMB,,,,U) BUG (CHK,MPIDXO,,,,,,,,,,,,,,,,,<2,3» BUG(CHK,TTN~C1,,T2) BUG(CHK,TTYBBO,,T2) BUG(CHK,ULKSTZ,,,,,,,,,,,,,,,,T2) BUG (INF,IMPLEO,,,T2) BUG (INF,IMPMUL,,,,T2) BUG(INF,IMPRNO,,T2) BUG (INF,IMPRNE,,,,,,,,,,,,,,,T4) CDRSRV.MAC.3 BUG (HLT,CDILVT,ILLEGAL DEVICE TYPE) COMND. MAC .12 DATIME.MAC.54 DDT. MAC. 10 DDTBLT. MAC. 3 DDTU.MAC.4 DEVICE. MAC. 96 BUG (HLT,TTNAC8,,,,,,,,,,<~,B» BUG(CHK,DIRPGl,,' BUG (CHK,DIRSY5,,,,,,,,,,,,,,,, ,,,,,,,,,,,,,,,,,,,, ,T2) BUG(CHK,IMPMSL,,T2) BUG(INF,IMPHIF,,,T2) BUG(INF,IMPMSO,,T2) BUG(INF,IMPXBO,,,,T2) BUG (INF,IMPRNE,,,,T2) BUG(INF,IMPBSC,,,,,,U) MAGTAP.MAC.10 BUG (HLT,MTARIN,,,,,,,,,,,,,,,,,,,Tl) DISK PHYSICAL PARAMETERS NOT FOUND» ILLEGAL FUNCTION» ILLEGAL FUNCTION AT STKIO» PHYP4. MAC. 8~ BUG(HLT,RP4UNF,,,,,,,,,, SERCOD.MAC.16 APP-27 DIGITAL TOPS-20 MONITOR APPENDIX I SMPRE. MAC. 6 SMPRM~. MAC. 1 SMPRMS. MAC .14 STG.MAC.53 BUG (HLT,NSPUDF,,,,Tl) TTFEDV.MAC.9 BUG(CHK,NOFRSP,, BUG(HLT,BADTTY,,T2) BUG(CHK,TTNAC7,,T2) BUG(CHK,TTYNTB,,<2,3» VERSIO.MAC.184 APP-29 TOPS-20 MONITOR APPENDIX I DIGITAL APP-30

Source Exif Data:
File Type                       : PDF
File Type Extension             : pdf
MIME Type                       : application/pdf
PDF Version                     : 1.3
Linearized                      : No
XMP Toolkit                     : Adobe XMP Core 4.2.1-c043 52.372728, 2009/01/18-15:56:37
Create Date                     : 2011:07:15 11:01:58-08:00
Modify Date                     : 2011:07:16 03:45:02-07:00
Metadata Date                   : 2011:07:16 03:45:02-07:00
Producer                        : Adobe Acrobat 9.45 Paper Capture Plug-in
Format                          : application/pdf
Document ID                     : uuid:e97ddb81-cbe1-439e-8f87-488b2035cf5b
Instance ID                     : uuid:c76960ba-dcd1-4681-8929-95058ca9aad2
Page Layout                     : SinglePage
Page Mode                       : UseNone
Page Count                      : 865
EXIF Metadata provided by
EXIF.tools

Navigation menu