Digital PDFs
Documents
Guest
Register
Log In
DEC-9A-MRZA-D
2000
143 pages
Original
4.2MB
view
download
Document:
FBmonProgRef
Order Number:
DEC-9A-MRZA-D
Revision:
Pages:
143
Original Filename:
http://bitsavers.org/pdf/dec/pdp9/DEC-9A-MRZA-D_FBmonProgRef.pdf
OCR Text
to mamaala ::t> ("""') A Ci) ;:;::c 0 c:: ::z t::1 ......... -n 0 ;:;::c fT1 Ci) ;:;::c 0 c:: ::z t::1 :::3: C> ::z ~ <::) ;:;::c en -< C/') ~ rr1 .:::3: -c ;:;::c 0 Ci) ;:;::c ::t:> :::3: 3: rn :::::c... C/) :::::c rn rn ;:;::c rn -n :z ("""') rn ::::3: ::t:> ::z c:: :J> I digit.al equipment. corporation DEC-9A-MRZA-D PDP-9 BACKGROUND / FOREGROUND MONITOR SYSTEM PROGRAMMER1S REFERENCE MANUAL To OBTAIN ADDITIONAL COPIES OF THIS MANUAL, ORDER NUMBER DEC-9A-MRZA-D FROM THE PROGRAM LIBRARY, DIGITA.L EQUIPMENT CORPOR:ATION, MAYNARD, MASSACHUSETTS, $4.50 01754 PRICE CONTENTS SEC'rION 1 BACKGROUND/FOREGROUND MONITOR 1.1 INTRODUCTION 1-1 1.2 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 BACKGROUND/FOREGROUND MONITOR FUNCTIONS Scheduling of processing Time Protection of FOREGROUND Core and I/O Sharing of Multi-Unit Device Handlers Use of Software Priority Levels Use of Real-Time Clock Communication Between BACKGROUND and FOREGROUND Jobs 1-1 1-3 1-5 1-5 1-7 1-7 EARDWARE REQUIREMENTS AND OPTIONS 1-8 1.3 SECTION 2 1-7 BFKM9 - NON-RESIDENT BACKGROUND/FOREGROUND MONITOR 2.1 INTRODUCTION 2-1 2.2 LOCATION AND WHEN CALLED 2-1 2.3 INITIAL OPERATION 2-2 2.4 2.4.1 2.4.2 2.4.3 2.4.4 INFORMATION COMMANDS The LOG Command (L) The REQUEST Command (R) The DIRECT Command (D) The INUSE Command (I) 2-5 2-5 2-6 2-7 2-7 2.5 2.5.1 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 2.5.7 2.5.8 2.5.9 2.5.10 2.5.11 2.5.12 2.5.13 ALLOCATION COMMANDS The ASSIGN Command (A) The FILES Command (F) The FCORE Command The FCONTROL Command The BCONTROL Command The NEWDIR Command (N) The SHARE Command (S) The NOSHARE Command The 7CHAN Command (7) The 9CHAN Command (9) The VC38 Command (V) The MPOFF Command The MPON Command (M) 2-8 2-8 2-10 2-12 2-13 2-14 2-15 2-16 2-17 2-17 2-17 2-18 2-19 2-19 2.6 PROGRAM LOAD COMMANDS 2-20 2.7 FINAL OPERATION 2-20 2.8 CONTROL CHARACTERS 2-20 2.9 SUMMARY OF COMMANDS 2-21 CONTENTS (Cont.) SECTION 3 CONTROL CHARACTERS 3.1 PURPOSE 3-1 3.2 CONTROL TELETYPE 3-1 3.3 TELETYPE HANDLER 3-2 3.4 CTRL C (tC) 3-2 3.5 CTRL S (tS) 3-3 3.6 CTRL T (tT) 3-3 3.7 3.7.1 3.7.2 3.7.3 CTRL P (tP) NORMAL CTRL P No Change REAL-TIME CTRL P 3-4 3.8 CTRL R (tR) 3-7 3.9 CTRL Q (tQ) 3-8 3.10 CTRL U (@) 3-9 3.11 RUBOUT 3-10 3.12 CTRL D (tD) 3-10 SECTION 4 3-5 3-6 3-6 LOADERS 4.1 INTRODUCTION 4-1 4.2 4.2.1 4.2.2 4.2.3 FOREGROUND LINKING LOADER Option Characters and Their Meanings Use of + Terminator Sequence of Operation 4-1 4-2 4-2 4-3 4.3 BACKGROUND SYSTEM LOADER 4-4 4.4 BACKGROUND LINKING LOADER 4-6 4.5 4.5.1 4.5.2 LOADING XCT FILES EXECUTE in the Foreground EXECUTE in the Background 4-7 4-8 4-9 4.6 ERROR CONDITIONS 4-9 4.7 SYSTEM MEMORY MAPS 4-11 CONTENTS (Cant.) SECTION 5 BACKGROUND/FOREGROUND START-UP PROCEDURE 5.1 LOADING THE B/F MONITOR 5-1 5.2 .IDLE LOADED AS THE FOREGROUND JOB 5-2 5.3 SINGLE-USER FOCAL LOADED INTO THE FOREGROUND 5-3 5.4 TWO-USER FOCAL LOADED' IN THE FOREGROUND 5-3 SECTION 6 BACKGROUND/FOREGROUND MONITOR COMMANDS (SYSTEM MACROS) 6.1 INTRODUCTION 6-1 6.2 .REALR 6-2 6.3 .REALW 6-3 6.4 .IDLE 6-4 6.S .IDLEC 6-1'; 6.6 .TIMER 6-5 6.7 .RLXIT 6-6 6.8 MAINSTREAM REAL-TIME SUBROUTINES 6-7 SECTION 7 WRITING DEVICE HANDLERS FOR THE BACKGROUND/FOREGROUND MONITOR SYSTEM 7.1 INTRODUCTION 7-1 7.2 7.2.1 7.2.2 7.2.3 FORMAT OF DEVICE HANDLER'S CAL PROCESSOR SETUP Initiating I/O .OPER Functions 7-2 7-8 7-8 7-9 7.3 FORMAT OF DEVICE HANDLER'S INTERRUPT PROCESSOR 7-9 7.4 7.4.1 SYSTEM ANNOUNCEMENTS Errors 7-13 7-13 7 ..5 STOP I/O TECHNIQUE 7-17 7.0 7.6.1 SEQUENTIAL MULTI-USER DEVICE HANDLER .WAITR 7-19 7-20 7.7 DEVICE HANDLER LISTING 7-20 CONTENTS (Cont.) SECTION 8 SYSTEM GENERATION 8-1 APPENDIX I .SCOM REGISTERS r"-1 APPENDIX II ERRORS II-1 APPENDIX III TELETYPE HARDWARE CHARACTERISTICS 1II-1 SECTION 1 BACKGROUND/FOREGROUND MONITOR 1.1 INTRODUCTION The reader is assumed to bE~ familiar with the Keyboard Monitor environment as described in the Advanced Software Monitors Manual, DEC-9A-MADO-D. It should also be noted that all material presented herein supersedes the information given in the Monitor Manual. 1.2 BACKGROUND/FOREGROUND MONn~OR FUNCTIONS The Background/Foreground Monitor is designed to control proces- sing and I/O operations in a real-time or time-shared environment. It is, essentially, an extension of the Keyboard Monitor and al10ws for time-shared use of a PDP-9 by a protected, priority, user F'!REGROUND program and an unprotected system or user BACKGROUND program. The Background/Foreground Monitor greatly expands the capabilities of PDP-9 ADVANCED Software and makes optimum use of all available hardware. It permits recovery of the free time (or dead time) that occurs between input/output operations, thus promoting 100% utilization of central processor time. FOREGROUND programs are defined as the higher-priority, debugged user programs that interface with the reaL-time environment. They normally operate under Program Interrupt (PI) or Automatic Priority Interrupt (API) control, and are memory protected. At load time they have top priority in select.ion of core memory and I/O devices, and ~t execution time they have priority (according to the assigned priority leveLs) over processing time. 1-1 Depending upon system require- ments, the user's FOREGROUND program could be an Executive capable of handling many real--time programs or subprograms at four levels of priority (with API present). BACKGROUND processing is essentially the same as the processing normally accomplished under control of the Keyboard Monitor. That is, it could be an assembly, compilation, debugging run, production run, editing task, etc. BACKGROUND programs may use any facilities (for example, core, I/O and processing time) that are available and not simultaneously required by the FOREGROUND job. Under certain circumstances, I/O devices may be shared by both the FOREGROUND and the BACKGROUND jobs. The Background/Foreground Monitor system is externally a keyboard-oriented system; that is, FOREGROUND and BACKGROUND requests for systems information, core, I/O devices, programs to be run, etc., are made via the Teletype keyboards. At run time, the Monitor internally controls scheduling and processing of I/O requests, while protecting the two resident users. The Background/Foreground Monitor performs the following functions as it controls the time-shared use of the PDP-9 central processor by two co-resident programs: a. Schedules processing time. b. Protects the FOREGROUND job's core and I/O devices. c. Provides for the sharing of multi-unit device handlers, such as DECtape, by both FOREGROUND and BACKGROUND jobs. d. Allows convenient use of API software levels by FOREGROUND jobs. 1-2 c. Provides for convenient and shared use of the system Real Time Clock. f. Allows communication b(~tween the BACKGROUND and FOREGROUND jobs via core-to-core transfers or by the shared use of bulk storage devices. 1.2.1 Scheduling of Processing Time At run time, the FOREGROUND job retains control except when it is I/O bound; that is, when completion of an I/O request must occur before it can proceed any further. In the following example, if the .WAIT is reached before the input requested l)y the . READ has becn completed, control is ·transferred to ,\ lowc'r priori ty FOlmGROUND segment or to the BACKGROUND job until the input for the FOREGROUND job is completed. .READ 3, 0, LNBUF, 48 /READ TO .DAT SLOT 3 .WAIT 3 /WAIT ON .DAT SLOT 3 Since multi-unit device handlers can be shared by FOREGROUND and BACKGROUND programs, there is a mechanism by which a FOREGROUND I/O request will cause a BACKGROUND I/O operation to be stopped immediately so that the FOREGROUND operation can be honored. is On completion of the FOREGROUND I/O, the BACKGROUND I/O resumed with no adverse effects on the BACKGROUND job. The FOREGROUND program can also indicate that it is I/O bound by means of the .IDLE or .IDLEC command (Section 6.3 - 6.4). 1-3 This is useful when the FOREGROUND job is waiting for real-time input from anyone of a number of input devices. Consider the following example (see Section 6.1 for description of real time read .REALR command). .REALR 1, Q,LNBUFl, 32, CTRLl, Nl /REAL .REALR 2, 2,LNBUF2, 42, CTRL2, N2 /TIME .REALR 3, 3, LNBUF3, 36, CTRL3, N3 /READS . IDLE If .IDLE is reached before any of the input requests have been satisfied, control is transferred to a lower priority FOREGROUND segment or to the BACKGROUND job. The lower priority job retains control un"til one of the FOREGROUND input requests is satisfied. Control is then returned to the FOREGROUND job by executing the subroutine at the specified completion address (CTRLl, CTkL2, CTRL3) and at the priority level specified by Nl, N2, N3 which may be: Value of N Q 4 5 6 7 Level Mainstream (lowest level) Current level (level of ~EALR) Software level 5 Software level 6 Software level 7 1-4 NOTE If real-time reads (.REALR), real-time writes (.REALW), or interval timer (.TIMER) requests arc employed in the BACKGROUND, N may be set to 0, 4, 5, 6, or 7, but is converted to 0 since the BACKGROUND job can run only on the mainstream level. This allows the value of N to be preset in cases where a BACKGROUND program is to be subsequently run in the FOREGROUND. 1.2.2 Protection of FOREGROUND Core and 1/<2,. The FOREGROUND job's core is protected by the Memory Protection Option (Type KX09A). The BACKGROUND job runs with memory protE~ct enabled; the FOREGROUND job runs with memory protect disabled. Protection of the FOREGROUND job's I/O devices is accomplished via the hardware by the memory protect option, which prohibits lOT and Halt instructions in the BACKGROUND area; and the software since the Monitor and lOPS screen all I/O requests made via I/O Macros. Also, the Monitor and the BACKGROUND Loaders prevent the BACKGROUND ~ob from requesting I/O which would conflict with that of the FOREGROUND job (for example they would not honor a BACKGROUND request for a paper tape handler being used by the FOREGROUND job). The Background/Foreground Monitor allows sharing of mUlti-unit, mass-storage device handlers d.mj (such as, DECtape, Magnetic Tape, ui sk Letwecn BACKGROUND and I;'OREGROUND jobs). 1-5 Using these multi-unit handlers, n files can be open simultaneously, where n equals the number of .DAT slots associated with the particular bulk storaqe device. Some multi-unit handlers require external data buffers (assigned at load time) ,one for each open file. These buffers are acquired from and released to a pool by the handler as needed. When this count is not accurate (because of the .DAT slots not Doing used simultaneously), the keyboard command FILES (Section 2.5.2) can be used to specify the actual number of files simultaneously open. Both the FOREGROUND and BACKGROUND jobs can indicate their file requirements by means of the FILES keyboard command. The multi-unit handlers are capable of stacking one BACKGROUND I/O request. operation This provision is made to simulate exactly program as it would occur under Keyboard or I/O Monitor (i.e., :lingle user) control. Thus, control is returned to the BACKGROUND JOD to allow non-I/O related processing when the handler is preoccupied with an I/O request from the FOREGROUND job. For example, if the FOREGROUND job has requested DECtape I/O with a .READ, and is waiting for its completion on a .WAIT, control is returned to the BACKGROUND job. If the BACKGROUND job then re- quests DECtape I/O with a .READ, the handler will stack the request and return control to the BACKGROUND job following the . READ. The BACKGROUND job can then continue with non-I/O related proccssinq asthouqh the .REl\D were being honored. 1-6 In hardware configurat.ions which include the Automatic Priori ty Interrupt (API) option, the Background/Foreground Monitor allows convenient use of software priority levels of the API by the FOREGROUND job. The BACKGROUND job is permitted to use only the mainstream level. 1.2.5 Use of Real-Time Clock The Background/Foreground Monitor provides for convenient and shared use of the system real-time clock. It will effectively handle many intervals at the same time; thus, the real-t:imc. clock can be used simultaneously by both BACKGROUND and FORE·GROUND jobs. Communication Between BACKGROUND and FOREGROUND ,Jobs 1.2.6 The Background/Foreground Monitor allows communication between BACKGROUND and FOREGROUND jobs via core-to-core transfers. 'l'his is accomplished by means of a special "Core I/O device" handler within lOPS. Complementing I/O requests are required for a core- to-core transfer to be effected; for example, a FOREGROUND .READ (.REALR) from core must be matched with a BACKGROUND .WRITE (.REALW) to corc. Two possible uses of this feature are: d. rrhc~ BACKGROUND job could be related to the FOREGROUND job, and as a result of its processing, 1-7 pass on information that would affect FOREGROUND . 9rocessing, or vice-versa. b. The BACKGROUND job could be a future FOREGROUND job, and the current FOREGROUND job, being its predecessor, could pass on real-time data to create a true test environment. Communication between two jobs can also be done by storing and retrieving data on shared bulk storage devices. 1.3 HARDWARE REQUIREMENTS AND OPTIONS The following hardware is required to operate the Background/ Foreground Monitor System: a. Basic PDP-9 with Teletype, b. Memory Extension Control, Type KG09A, c. Additional 8192-Word Core Memory Module, Type MM09A, d. Memory Protection Option, Type KX09A, e. External Teletype System, including at least*: (1) One Teletype Control, Type LT09A or LT19A, (2) One Teletype Line Unit, Type LT09B or LT19B, (3) One Teletype, Model KSR33, KSR35 or equivalent**, '*'l'he basic system Teletype is normally assigned to the BACKGROUND environment. One Teletype of the external Teletype system must be reserved for the FOREGROUND job; additional Teletypes may be assigned to either BACKGROUND or FOREGROUND functions. If the API option is available, a Type LT19A Teletype Control and a Type LT19B Line Unit are recommended. **Model 37 Teletypes are not supported. Model 33 or 35ASR Teletypes are supported only to the extent that they operate as KSR's only; their paper tape input and output facility cannot be used. LT09's and LT19's may not both appear in the same configuration. 1-8 f. Bulk Storage System, comprising either: (1) One DEC tape Control, Type TC02, and two DECtape Transports, Type TU55 (three recommended), or (2) One Disk System, Type RB09 (and one DECtape Control, Type TC02, and at least one DECtape Transport, Type TU55), or (3) One Disk System, Type RF09/RS09 (and one DECtape Control, Type TC02, and at least one DECtape Transport, Type TU55) The following options curr,:!ntly supported by software may be added to improve system performance (as noted) : Effect Additional 8192-Word Core Memory Modules, Type MM09B and MM09C (to a maximum of 32,768 words) Increase the maximum f:i ;~C' of both BACKGROUND and FOREGROUND programs that can be handled by the system. Automatic P~iority Interrupt, 'I'ype KF09A Allows for quicker recognition of requests for service by I/O devices. Extended Arithmetic Element, Type KE09A Increases speed of arithmetic calculations. Additional DECtape Transports, Type TU55, or IBM-compatible Magnetic Tape Transports, Type TU20 or TU20A and Tape Control Type TC59 Allows greater bulk storage capability, simultaneous use of storage media by more programs. Since only one file may be open at a time on IBMcompatible magnetic tape transports, more than two Type TU20 or TU20A transports may be desirable for some applications. 1-9 Automatic Line Printer, Type 647 Provides greater listing capabilities. 200 CPM Card Reader, Type CR03Bl Allows card input and control cards for BACKGROUND Batch processing. Additional Teletype Line Units, Type LT09B, (or LT19B) and Teletypes, Type KSR33, KSR35 or equivalent** (up to a maximum of 1610 LT09B or LT19B units, requiring four LT09A or LT19A controls) . Provides additional output devices if multiple FOREGROUND jobs may require simultaneous output or BACKGROUND jobs wish to use multiple devices. 1 The Type CROlE and Type CR02B Card Readers, although no longer sold by the Company, are supported by software in the BACKGROUND/FOREGROUND System. Note: The 339 Programmed Buffered Display is supported by software. 1-10 SECTION 2 BFKM9 - NON-RESIDENT BACKGROUND/FOREGROUND MONITOR 2.1 INTRODUCTION BFKM9 is the title of the non-resident portion of the Background/Foreground Monitor. It is identical in nature to the Keyboard listening section of the Keyboard Monitor, with which the reader is assumed to be familiar. BFKM9 reads and interprets commands typed by the user at a control teletype (there is one Background control teletype and one Foreground control teletype). There are three kinds of commands which the user may type: 2.2 a. Requests for information, such as, a directory listing of unit ~ of the system device; b. Allocation parameters, such as, core size, number of open files, and I/O devices to be used; c. Load a system or user program. LOCATION AND WHEN CALLED BFKM9 is loaded from register 12000 of the highest core bank to the top of memory and iB transparent to the user since it is always overlayed. When the Background /Foreground system is loaded or reloaded to start a new Foreground job, the Resident Monitor is first loaded into lower core from unit ~ of the system device, either by use of the paper tape bootstrap or by typing CTRL C at the' Foreground control teletype. The Resident Monitor then brings the Non-resident Monitor into the top of memory. 2-1 When operating in the Foreground, BFKM9 runs with memory protect disabled. After the Foreground user program has been loaded and has started to run, the Non-resident Monitor is re-loaded, with memory protect enabled, to converse with the user at the Background control teletype. BFKM9 is also re-loaded whenever the Background job exits or the user types CTRL C at the Background control teletype. In both the Foreground and Background, after the user has given a command to load a program, the Non-resident Monitor brings the System Loader into memory from the system device, overlaying the Non-resident Monitor. 2.3 INITIAL OPERATION When BFKM9 is started for the Foreground job, it must perform some initialization of which the following is of interest: a. Set the contents of .SCOM+25 to 2. This sets the initial size of free core to be allotted to the Foreground job, in addition to the space required by the Foreground user programs. The user may assign more free core by issuing the FCORE command, described in section 2.5.3. b. BFKM9 checks the entire Foreground Device Assignment Table (.DATF) to see if any of those .DAT slots request the teletype handler and the unit number currently assigned to the Background control teletype. If so, those slots Qrc changed to the Foreground control teletype Qnd a message is output as in the following example. 2-2 EXAMPLE 1: The Foreground control teletype is TTl, the Background control teletype is TT~, and the initial contents of .DATF slots 1 and 3 refer to TTA~. .DATF slots 1 and 3 will be changed to refer to TTAI and the following message will be printed on the Foreground control teletype: FGD .DATS CHANGED TO TTAl: 1 3 FKM9 VIA $ The Non-resident Monitor identifies itself to the Foreground user by printing FKM9 VIA and types $ whenever it is ready to accept a command. When BFKM9 is started for the Background job, it performs initialization of which the following is of interest: a. It builds the initial configuration of the Background . DAT table (. DA,]~B). Any. DATB slots which request a single user version of a device handler (for example, DTB or DTC) will be changed to the multi-uni t handler (DT1~ in this case) if it is already in core for the Foreground job or if it is the resident system device handler. b. BFKM9 will check all Background .DAT slots to make certain that they do not conflict with Foreground I/O. The Resident Monitor contains, for this purpose, a table (.IOIN) which lists all I/O handlers and unit numbers in use. The following occurs: (1) If a handler for this I/O device is not already in core, the Background .DAT slot is left untouched. (2) If a single user handler for this device is already in core for use by the Foreground job, by definition the Background job may not use this device. Therefore 2-3 the Background .DAT slot is cleared (set to zero). (3) If the multi-unit handler for this device is in core, but the device unit number in question is not assigned to the Foreground job, Background is allowed to share that handler. Unit ~ of the system device may always be used by the Background job. (4) If the Background .DAT slot requests a multi-unit handler and unit number already assigned to the Foreground, normally this is illegal and that .DAT slot will be cleared. However, some users may wish to allow both jobs to access the same unit. This is permitted only for bulk storage devices (DECtape, Disk, etc.) provided that the Foreground user typed the command SHARE, explained in section 2.5.7. If the initial Background .DAT table was altered by clearing .DAT slots for the reasons given above, a message will be output to the Teletype as in the following example. EXAMPLE 2: The Foreground job is running and has been assigned device handlers and unit numbers DTA1, DTA2, TTA1, TTA2, and LPA (line printer handler - not shareable). The initial Background .DAT table contains conflicting requests as follows: .DAT SLOT CONTENTS -IS DTAI -12 -4 LPA~ DTA2 TTA2 3 The following will be printed on the Background control teletype when BFKM9 is £irst loaded: BGD .DATS CLEARED BECAUSE OF FGD I/O: -15 -12 -4 3 FCONTROL TTAl 2-4 FGD DEV-UNITS: TTA2 DTAI DTA2 BKM9 VIA $ FCONTROL indicates which unit is the Foreground control teletype. The remainder of the message indicates what I/O is being used by the Foreground job. The Monitor identifies itself to the Background job user as BKM9 VIA and signals that it is ready to accept a command by printing $. 2.4 INFORMATION COMMANDS The following information commands exist in Background/Fore- ground: USE To print a comment To examine .DAT slots To obtain a directory listing To list information about core and I/O in use by the Foreground. COMMAND LOG REQUEST DIRECT IN USE 2.4.1 The LOG Command (L) This command is legal in both Foreground and Background and may be abbreviated by the single leti:er L. on the Teletype. It is used to record comments Unlike all other commands, LOG is terminated only by the character ALTMODE, so 1:hat multiple comment lines may be typed. LXAMPLE 3: $ LOG THIS LINE) AS WELL AS THIS ONE) AND THIS ONE ARE IGNORED Q\LTMOD~ $ 2-5 2.4.2 The REQUEST Command (R) This command is legal in both Foreground and Background and may be abbreviated by the single letter R. It is used to examine the contents of all or part of the user's .OAT table. The Fore- ground user may examine only the Foreground .OAT table and the Background user only the Background .OAT table. This requests a printout of the entire .OAT table. No example is given since R is essentially the same request as in the Keyboard Monitor System. FORM 2: RuUSER) This requests a printout of the contents of all the positive numbered .OAT slots. The result, again, is the same as in the Keyboard Monitor System. FORM 3: RuXYZ~ Here, XYZ stands for the name of a system program; e.g., MACRO, PIP, F4, LOAO, etc. The names given must be identical to those used to load the programs. The information printed, as in the Keyboard Monitor System, is those .OAT slots used by the given system program. Since, at present, the only system program load commands allowed in the Foreground are LOAD, GLOAO, PIP and EXECUTE, only these four may be used in Foreground REQUEST commands. 2-6 FORM 4: Ru.DATuj, k, 1, ... , r, s) Here, j, k, .1, etc., are .DAT slot numbers. EXAMPLE 4: $R u .DATw -3, -1, 4, 7} TTAI DTA2 NONE LPA~ $ 2.4.3 The DIRECT Command (D) This command is legal in both Foreground and Background and may be abbreviated as D. The format is: Dun) where n = a unit number (~ through 7) on the system device. Directory listings have been altered in BFKM9 to print the number of free blocks before thE~ file names. The background user may not request directory listings of any units owned by the Foreground job unless the Foreground user typed the SHARE command (see below). 2.4.4 The INUSE Command (I) rrhis command is legal only in the Background and may be abbreviated by the single letter I. It causes the Monitor to print the first free core location above the Foreground job, the Foreground control teletype unit. number and any other I/O used by Foreground. 2-7 EXAMPLE 5: $ I) 1ST REG ABOVE FGD 323.01 FCONTROL = TTA2 FGD DEV-UNITS: DTAI LPA.0 $ 2.5 ALLOCATION COMMANDS The following commands assign parameters, control and conditions: COMMAND ASSIGN FILES FCORE FCONTROL BCONTROL NEWDIR SHARE NOSHAPE 7CHAN 9 CHAN VC38 MPOFF MPON 2.5.1 PURPOSE To assign I/O handlers to .DAT slots To specify handler file capacity To set up Foreground free core To select Foreground control teletype To select Background control teletype To write a new file directory To allow jobs to share same I/O units To nullify effect of SHARE To specify 7-channel MAGtape operation To specify 9-channel MAGtape operation To load the VC38 character table To let Background access all of core To nullify effect of MPOFF The ASSIGN Command (A) This command is legal in both Foreground and Background and may be abbreviated by the single letter A. Its format and function are, with a few exceptions, identical to the same command in the Keyboard Monitor System. 2-8 The format is: AuDDLNum, n, •.. , pi ... IDDLNum, n, •.. , where DD stands for the two letter device name~ P) e.g., DT for DECtape, LP for line printer, etc. L is the third letter of a device handler name and is optional. If not given, the letter A is assumed~ e.g., DTI = DTAI. The "A" version of a handler is the multi-unit, shareable handler, provided that one exists. LPA, for example, is not a multi- unit handler. N is the unit number to go with the device handler and is also optional. = DTA~. If missing, N is assumed to be g, e.g., DTA Therefore, DT = DT.0 = DTA = ... , p stand for .DAT slot numbers. DTA~. The letters m, n, The slash (I) separates handlers. To clear out a .DAT slot, assign NONE to it. If any error is detected in the command, none of the assignments will be made. The Foreground and Background users may make assignments only to their respective .DAT tables. Foreground may not assign TTA.0 if, for example, that is the Background control teletype. Since DTA is permanently in core with the Resident Monitor (assuming that DECtape is the system device) DTB, DTC, etc., when assigned, will automatically be changed to DTA. This applies as well to ll<.lIlUlcr assignments made in the Background whenever the multiunit version of the handler is in core for Foreground use . .2-9 Background .DAT slot assignments are tested to insure that they do not conflict with Foreground I/O, as explained in section 2.3. Whenever the Monitor detects such a conflict, it will print the message: OTHER JOB's DEV-UNIT To insure that no conflict can occur when assigning the coreto-core handler, COA., the unit number, independent of what the user typed, is set to ~ for Foreground and 1 for Background. The core-to-core handler disregards the unit number. 2.5.2 The FILES Command (F) This command is legal in both Foreground and Background and may be abbreviated as F. The purpose of this command is to save core space by limiting the number of I/O buffers assigned to multiunit device handlers. The format of the FILES command is: where DD stands for the multi-unit handler or device name (e.g., DTA or DT) and N for an octal file count. EXAMPLE 6: Assume that the Foreground user programs are being loaded into core by the Foreground Linking Loader and that these programs use .DAT slots 1 through l~. (.IODEV 1, 2, 3, .•.. , l~). Further, assume that all l~ slots were assigned to DECtape, DTAn (the unit numbers are unimportant to this discussion). 2-10 Most multi-unit handlers, DTA being one of them, require that I/O buffers be assigned to them externally. This is done by the various loaders. In this example, the Foreground Linking Loader, seeing that no FILES command was given for the handler DTA, must assume that the user wants l~ files open simultaneously. This will require l~ buffers, each 6~S octal words in size. The FILES command is used to tell the loaders to assign a given number of buffers for a particular mUlti-unit handler based on the maximum number of files that the user programs will have open simultaneously. Each multi-unit handler has a maximum open file capacity; for example, DTA may have up to 2~ octal. If IS I/O buffers are assigned for DTA in the Foreground, then only up to IS may be assigned for Background. The FILES command issued in ·the Foreground specifies only Foreground I/O buffers. Thus, to limit the number of I/O buffers assigned to the Background, the FILES con~and, for the same multi-unit device, must also be issued in the Background. At load-time, I/O buffers are set aside in core by the Loaders. The buffers are recorded in a table within the Resident Monitor, . BFTAB , but are not flagged for the exclusive use of particular device handlers. A-t run-time, E~ach multi-unit handler which needs a buffer must request a buffer from the Moni tor. The handler must. also release the buffer to the pool when i t is no longer needed. The resident buffer, permanently assembled into the Resident Monitor, is always available to the Background job. This buffer is assumed to be as large as the largest I/O device buffer (6~S octal words) . In the event that the Background job were to .IODEV only one .DAT slot whjch is linked to a multi-unit handler 2-11 that requires external buffers, could save 6~~ (DTA. for example) the user registers by typing: $FILESuDTu~' That is, assign one less buffer than is needed. In the FILES command, the pseudo-device is recognized. size of the external buffer for this pseudo-device is octal. The l~~ Some functions in multi-unit handlers may require a smaller buffer size than others. If the user were only to use the former function type, he could type, for example, and $FILES .. n. $FILE~DTw~ In DTA., .TRAN and .MTAPE commands only require the smaller buffer. 2.5.3 The FCORE Command This command is legal only in the Foreground and may not be abbreviated. The format of the FCORE command is: FCOREwN ~ where N is the amount (in octal) of free core requested for the Foreground job. ~s in the Keyboard Monitor System, unused (free) core is defined by the address pointers in the registers .SCOM+2 and .SCOM+3, the lowe[:i t and the highes t free core location, respectively. Since both the Foreground and the Background jobs have their own separate free core areas, the values in .SCOM+2 and .SCOM+3 are changed appropriately whenever control passes from one job to ·the other. 2-12 The FCORE command allows the Foreground user to specify how much free core his program will need, in addition to that required to load his program. It is possible for all of core to be assigned to Foreground. This means, however, that there will be nc room for Background to run, which is perfectly legal. If -this is the case, the message: SORRY, NO ROOM FOR BGD is printed on the control teletype: 2.5.4 The FCONTROL Command This command is legal only in the Foreground and may not be abbreviated. It is used to transfer the control teletype to some other teletype unit. The format of the FCONTROL command is: where N is the number (octal) of any teletype on the system. If N is already the Foreground control teletype, the command is ignored. If N is the current Background control teletype, the two teletypes are swapped but no message will be printed to this effect. Changing the Background control teletype may affect Foreground .DAT slots and an appropriate message will be printed on the Foreground control teletype. Th~s the next section on the BCONTROL command . .2 --13 is fully explained in Wh(~n FCONTROL changes the Foreground control teletype, the following action takes place: a. The following message is printed on the old control unit: CONTROL RELINQUISHED ABORT b. The system is reloaded from the system device. c. The Monitor prints FKM9 VIA $ on the new Foreground control unit and is ready to accept commands there. 2.5.5 The BCONTROL Command This command is legal both in the Foreground and in the Background and may not be abbreviated. It is used to transfer the Background control teletype to some other teletype unit. The format of the BCONTROL command is: BCONTR°LuN) where N is the number (octal) of any teletype on the system. This command is illegal and is ignored if unit N belongs to the Foreground job. Even though unit N may have been assigned to a Foreground .DAT slot, it does not belong to the Foreground job unless it happens to be the Foreground control teletype or unless the Foreground user programs contained an .IODEV to that .DAT slot. This command is also ignored if unit N is already the Background control teletype. 2-14 If BCONTROL is issued in the Foreground or if the Background control telE2type is changed because of an FCONTROL command, all Foreground .DAT slots which now refer to the new Background control unit will be changed to the Foreground control unit to avoid I/O conflict. Should that situation occur, the fol- lowing example shows what would be printed on the Foreground control unit: FGD .DATS CHANGED TO TTAI -6 2 7 l~ If BCONTROL is issued in the Background, the followinq action takes place: a. The following message is printed on the old control unit: CONTROL RELINQUISHED b. tc is printed on the new unit, c. The Non-resident Monitor (BFKM9) is reloaded for Background from the system device d. The Monitor prints BKM9 VIA $ on the new Background control teletype and is ready to accept commands there. This command is legal in both Foreground and Background and may be abbreviated by the single letter N. .2-15 Just as in the Keyboard Monitor System, this command allows the user to write a new file directory on some unit of the system device. However, space will not be reserved for a tQ (CTRL Q) area. The format of the NEWDIR command is: NwM~ where M is some unit number (octal) on the system device. Unit ~ may not be used. The Background may not write a new file directory on a unit that belongs to the Foreground unless the Foreground has issued the SHARE command (see below). This command is legal only in the Foreground and may be abbreviated by the single letter S. Its purpose is to allow the Background job to assign and to use the same units of any I/O devices that belong to the Foreground job, provided that they are bulk storage devices (DECtape, Disk, Magtape, etc.) and that the device handlers are the multi-unit versions. The user must be careful when allowing this condition to occur. The "tape" could be fouled i f ~~_-t:~. jobs were to try to use the same uni t for output at the same time. The SHARE command also removes the restriction that the Foreground user program may not use unit ~ on the system device. this unit is reserved for the Background. The format for this command is: SHARE~ 2 --16 Normally, 2.5.8 The NOSHARE Command This command is legal both in Foreground and in Background and may not be abbreviated. It nullifies the effect of any pre- vious SHARE command; i. e., dOE~s not allow the Background to share device units with the Foreground. When NOSHARE is issued in the Background it may cause some Background . DAT slots to be cleared. A. message, as in Example 2, will be printed to that effect. The command format is: 2.5.9 NOSHAR.E) The 7CHAN Command (7) This command is legal only in the Foreground and may be abbreviated by the single character 7. The effect of this com- mand is to clear bit 6 in .SCOM+4 to inform the Magtape device handlers that the default assumption is 7-channel operation. The format of the 7CHAN command is: 7CHAN) 2.5.10 The 9CHAN Command (9) This command is legal only in the Foreground and may be abbreviated by the single character 9. It sets bit 6 in .SCOM+4 to inform the Magtape device handlers that the default assumption is 9-channel operation. 2-17 The format of the 9CHAN command is: 9CHAN ) 2.5.11 The VC38 Command (V) This command is legal in both Foreground and Background and may be abbreviated by the single letter V. No action is taken until a command has been given to load a program. At that time, if the VC38 command was given, the Non-resident Monitor will seek and load the file VC38TB DMP from unit fO of the system device. The VC38 c~aracter table is used in conjunction with the 339 display handler, DYA., when the system does not have a VC38 hardware character generator. The table is loaded into core such that its base address is a multiple of l~fO~ octal. The base address is stored as the first word in the 339 Pushdown List. The address of the Pushdown List is in .SCOM+12. The VC38 command given in the Background will be accepted but ignored if the 339 display handler is assigned to the Foreground. The format of the VC38 command is: VC38) 2-18 2.5.12 The MPOFF Command This command is legal only in i:he Foreground and may not be abbreviated. Format: MPOFF} Normally, Background may not modify nor transfer to registers within the Resident Monitor and the Foreground job; it also cannot issue rOT's. The MPOFF command signals the Resident Monitor to set the hardware protect bound to zero and also allows Background rOT's to be issued. 2.5.13 The MPON Command (M) This command is legal in both Foreground and Background and may be abbreviated by the letter M. Format: MPON) The MPON command nullifies the effect of MPOFF, thereby protecting the Foreground job from the Background job in the normal manner. 2-19 2.6 PROGR~M LOAD COMMANDS In the Foregound, only four load commands are legal: LOAD), GLOAD) , PIP) 'and EXECUTE u XXX). viated by the single letter E. EXECUTE may be abbre- LOAD and GLOAD have the same meaning and effect as in the Keyboard Monitor System. The following program load commands exist in the Background: PATCH; CHAIN) F4) F4A} EDIT) PIP) EXECUTEuXXX) 2.7 LOAD) GLOAD} DDT) DDTNS) SGENl DUMP-) UPDATE) " CONV) FINAL OPERATION After BFKM9 has received a program load command from either the Foreground or Background, it will bring the System Loader (.SYSLD) into the top of core overlaying BFKM9. In the Foreground, .SYSLD is actually the Foreground Linking Loader. In the Background, .SYSLD loads Background System Programs, including the Background Linking Loader. 2.8 CONTROL CHARACTERS While control is in BFKM9, the user may type CTRL P to terminate execution of the current command and to restart. Restart in this manner does not nullify the effect of 2-20 previous ly executed commands; €!. g ., wi 11 not reset the . DAT table to its initial configuration. To reload the Monitor for the current job, the user may t:ype CTRL C. 2.9 LEGAL IN F B F B F B F F F B B F B F B F B F B F F F F F B F B B B B B B B F B B B F B F B B B B F 13 13 13 SUMMARY OF COMMANDS ABBREVIATION A COMMAND EXAMPLE DTu- 4 ) ASSIGNuDTAl u 2, 3/TTlwl, BCONTRO~2) D F I L N R S 7 9 M V E 4/ DIRECTu .0') F CONT ROLu.lJ FcoREu14.0't) FILE SuDTu 3) INUSE) LOG u . . . . . .. €LTMOD~ NEWDIRa..,S) NOSHAREj REQUES~XXX) or REQUESTuUSER)or REQUEST u .oAT j ,k, 1) or REQUEST). SHARE) ~g~~~.•. MPO~~) MPON} VC38) CHAIN) CONV) DDT) DDTN~ DUMP) EDIT) EXECUTEuXXX) F4) F4A) GT.JOAD) LOAD) Ml~CRO) Ml~CRO~J PATCHI PIP) SGEN) UPDATE) 2-21 SEc'rION 3 CONTROL CHARACTERS 3.1 PURPOSE Control characters are single characters typed by the user at a teletype which request special action by the Monitor. Except for the character RUBOUT, all control characters are formed by holding down the control key CTRL while striking the appropriate letter key. The characters CTRL U and RUB OUT are used as "erase" characters during teletype input or output. CTRL C, CTRL P, CTRL S, and CTRL T are used to interrrupt the operation of the current program and to transfer control elsewhere. CTRL R is used to restart I/O after a not-ready condition has been detected for some device. CTRL Q stops the current job and dumps memory onto a specified area of some unit of the system device. CTRL D effects an end-of-file condition during tele- type input. 3.2 CONTROL TELETYPE In the Background/Foreground System, which may accommodate up to 17 (decimal) teletype units, two teletypes are designated as control teletypes (one for Background and one for Foreground). Initially, it is assumed that unit ~ (the console teletype) is the control teletype for Background and unit 1 is the control unit for Foreground. 3-1 Control teletypes differ from the other units in two ways: 3.3 a. They are used to converse with the Non-resident Monitor and system programs in order to set up parameters and conditions for a job and to initiate the loading and execution of programs. b. Certain control characters are recognized only at control teletypes; i.e., are ignored if they are typed on the other teletype units (see section 3.4 and following). TELETYPE HANDLER The multi-unit teletype handler (TTA) which is imbedded in the Resident Monitor, makes special tests for control characters when it re~eives typed input. Normally, when no .READ request has been issued to a teletype, characters received from that unit are ignored unless they are control characters. A descrip- tion of the action taken in each case is given in the following paragraphs. 3.4 CTRL C (tC) This character is ignored unless typed at a control tele- type. It will be echoed to the teleprinter as tC. If CTRL C is typed at the Background control teletype, the Background job will be aborted and the Non-resident Monitor will be loaded to start a new Background job. Foreground is not affec- ted. CTRL C typed at the Foreground control teletype aborts both the Foreground and the Background jobs. 3-2 In this case, the entire system is restarted; that is, the Resident Monitor and the Nonresident Monitor are reloaded to start a new Foreground job and the message ABORT is printed on the Background control teletype. 3.5 CTRL 5 (t5) CTRL 5 is recognized only at a control teletype and, specifically, only after the Monitor has printed t5. This is the result of loading a user program by giving the 'command $LOAD (instead of $GLOAD)to the Non-resident Monitor. Both commands bring in the Linking Loader to load user programs. LOAD-AND-GO. $GLOAD means $LOAD means load the user programs, signal the user that this has been done (by printing t5), and then wait for the go-ahead signal (when the user types CTRL 5) . This feature allows the user to set up I/O devices before starting his program. When CTRL 5 is typed by the user and is accepted by the Monitor, t5 is echoed back to the teleprinter. 3.6 CTRL T (tT) This character is recognized only at the Background control teletype when the user has called in the system program DDT. When CTRL T is typed and accepted, it is echoed to the teleprinter as tT. CTRL T provides a means of interrupting the execution of a user program and transferring control to DDT. When CTRL T is typed, the Monitor saves the status of the Link, extend memory, 3-3 and memory protect along with the interrupted PC in .SCOM+7 so that DDT will be able to return control to the user program at the point at which it was interrupted. The contents of the AC at the time of interruption is returned in the AC and saved by DDT. 3.7 CTRL P (tP) CTRL P is the interrupt and restart character available to user and system programs. When it is typed on some teletype and is accepted by the Monitor, tP is echoed to the teleprinter on that unit. fn of the Background/Foreground system there are two types CTRL P functions: 1) NORMAL CTRL P and 2) REAL TIME CTRL P. The two CTRL P functions are described, individually, in paragraphs 3.7.1 and 3.7.3. Setting a CTRL P restart address (ADDR) is accomplished by issuing the I/O MACRO .INIT to any .DAT slot linked to the Teletype handler. The format of the .INIT macro is: .INIT A,M,P+ADDR which is expanded by the MACRO assembler into the following machine code: 3-4 LOC LOC+l LOC+2 LOC+3 where A M CAL M8 +A 9 _ 1 7 1 P+ADDR g Jl 17 a .DAT slot number (octal radix) transfer mode ADDR - Jl Input 1 Output a IS-bit address (octal) of a restart point in the program or of the entry point of a closed real-time subroutine. Normal CTRL P Mainstream (REAL-TIME) Jl lfOJl~JlfO P priority code 2fOfOfOJlfO 3fOfOJlJlfO 4 50 JlJl 5050 SfOfOJlJlJl 6 JlJlfOJlfO 7 50 fOfO JlfO No chanqe to CTRL P Priority level of the .INIT API level S API level 6 API level 7 Background requests to an l\.P I level (4JlfOJlYffO - 7 fOfOfOJlfO) wi 11 be converted to Mainstream since Background programs cannot use the API software levels. 3.7.1 NORMAL CTRL P A .INIT to set up a NORMl\L CTRL P (priority code 50) may be done only to a control teletype. NORMl\L CTRL P was so named because the action taken when the user types CTRL P is nearly the same as in the Keyboard Monitor System. When a control teletype has been set up for a NORMAL CTRL P and that character is typed by the user, the teletype handler 3-S will abort all Teletype I/O for that job (Background or Foreground). The Monitor will, when control is at Mainstream,· save the status of the Link,extend memory, and memory protect with the interrupted PC in .SCOM+IO (whose contents are swapped in and out for Background and Foreground), return the interrupted AC to the AC, and transfer control to the restart address ADDR as specified by the last .INIT. Note: When the Monitor processes a CTRL T or a NORMAL CTRL P, it kills any pending mainstream realtime routines to be run by zeroing the contents of .SCOM+S7 (Foreground) or .SCOM+61 (Background). The user's program (if NORMAL CTRL P) or the user (if .CTRL T) must zero the entry points of all his mainstream real-time routines. CTRL P and CTRL T do not affect API level real-time requests. If the restart address ADDR = ~, CTRL P to the given teletype will be disabled; i.e., ignored if typed (except if P = 3.7.2 3~~~~~). No Change If .INIT for a given teletype unit contains the priority code 3~~~~~, the restart address is ignored and the status of CTRL P to that unit is not changed. 3.7.3 REAL-TIME CTRL P A .INIT to set up a REAL-TIME CTRL P may be done to any teletype unit. When so set up and the user types CTRL P, I/O to that teletype is aborted. Control eventually goes to a closed real- time subroutine, ADDR, at the priority level defined by P, 3-6 in the same manner as for a .REALR, .REALW or .TlMER request. If the restart address ADDR = ~, CTRL P to the given tele- type will he disabled; i.e., ignored if typed. REAL-TIME CTRL P is useful for multi-user programs, for instance, multi-user FOCAL, where each teletype has the ability to interrupt and restart. 3•8 CT RL R ( t R) In the Background/Foreground system, I/O device handlers which detect a not-ready condition will request the Monitor to print a message on the appropriate control teletype. The line printer handler message, for instance, would be: LP~ NOT READY The unit number has no significance for the line printer. Some single-unit handlers, such as the card reader handler, use the unit number designation to indicate the cause of the not-ready condition. After the message has been printed, the user should ready the device and then type CTRL R, which is echoed as tR. I/O for that device is then resumed. While the Monitor is waiting for the user to type CTRL R, the user's program continues execution provided that it is not huruj up waiting for completion of I/O from the not-ready device. The Monitor can handle one not-ready condition per job. Should a second not-ready request occur while another is being processed, 3-7 job execution will be aborted with a .ERR ~~4 terminal error. 3. 9 CTRL Q (tQ) CTRL Q may be typed at any time, but it is ignored if it is not issued at a control teletype. The purpose of typing CTRL Qis to stop program execution and to dump all of core memory onto a specified area of some unit on the system device. The dump starts with block l~l octal on the given unit and overlays any data that may have existed in that area on the output device. octal blocks (1~1-2~~); a 32K system; 2~~ A 16K system will dump a 24K system, octal blocks 14~ octal blocks l~~ (l~l - 24~); (1~1-3~~). To insure that CTRL Q will not overlay useful data, the user must employ the system program PIP to write a new file direc- tory on that unit, using the (S) switch to reserve space for CTRL Q. For example: >NuXXuu(S) ) where XX is the device name and u the unit number. Note that the size of the CTRL Q area reserved is based on the amount of core existing in the system in which the new directory is written. The area reserved on a DECtape in a 16K system is not sufficient to do a protected CTRL Q in a 24K or 32K system. 3-8 When the Monitor accepts CTRL Q, it first terminates execution of the job (Foreground if Foreground CTRLQ, Background if Background CTRL Q). This involves calling all device handlers tied to that job to stop I/O, clearing all Monitor queues of entries for that job and disabling all control characters for that job except CTRL C. The Monitor then prints tQ on the appropriate control teletype and reads one character. The user must then type the number of the unit on which the dump is to occur. may not be used. Unit zero If the SHARE command is not in effect, a dump may not be done to a unit vlhich belongs to the other job. If the Monitor rejects thE~ typed character, it prints tQ again and waits for another character. When the unit number is accepted, the dump takes place; then the Monitor is automatically reloaded. CTRL Q does not affect Foregrourid. A Background A Foreground CTRL Q, on the other hand, aborts the Background job. It is not possible to load and restart a core dump in Background/Foreground. 3.l~ CTRL U (@) CTRL U may be typed at any teletype unit. If a .READ or .REALR was issued to some teletype and the user decides he wants to "erase" everything he has typed for that read request, he may type CTRL U, which will be echoed to the teleprinter as @. 3-9 The .READ or .REALR will still be in effect and he may then retype the input. While output to a teletype is being done as a result of a .WRITE or .REALW, the user may type CTRL U to terminate the write. In this case nothing is eChoed to the teleprinter. 3.11 RUB OUT This character is recognized only while the user is typing input to satisfy a .READ or .REALR request. typed, RUBOUT deletes the last input character. When For example, if the US2r has typed ABC and then RUBOUT, the C will be "erased". If he now types another RUBOUT, the B will be "erased". Every time a character is so removed, the character is echoed to the teleprinter. 3.12 CTRL D (tD) The character CTRL D is recognized at all teletypes and is echoed back as tD. When typing input, CTRL D effects an end-of-file condition by terminating the .READ or .REALR request and storing the end-of-file, buffer header. ~~1~~5, in the input line Since the word pair count returned is a ~, any characters typed prior to the CTRL D for the same read request will be lost. 3-10 SECTION 4 LOADERS 4.1 INTRODUCTION There are three program Loaders in the Background/Foreground system. On the system file directory they are listed as .SYSLD SYS, BFLOAD BIN and EXECUT BIN . . SYSLD is an absolute system program that functions as two loaders: when it is called in for Foreground loading, it is the Foreground Linking Loader; when it is called in for Background loading, it is the Background System Program Loader. BFLOAD is the Background Linking Loader. EXECUTE operates in both Foreground and Background as a loader of overlay programs (XCT files) built by the CHAIN system program. A description of CHAIN and EXECUTE is given in the utility manual. 4.2 FOREGROUND LINKING LOADER Link loading of the Foreground job is initiated by typing GLOAD (Load-and~Go) or LOAD (Load-and-·Pause) to the Moni tor at the Fore- ground control teletype. The Foreground Link Loader (.SYSLD) is then brought into the top of memory, overlaying the Non-resident Monitor. The following message will then be printed: FGLOAD VIA > The;.,. signals the user that he may now type in his command string. The command string format is nearly 'the same as for the Linking Loader in the Keyboard Monitor System. 4-1 The only change is the addition of memory map options, which must precede the list of user program names. The format is as follows: >options+mainprog, others, ... ALTMODE 4.2.1 Option Characters And Their Meanings Character P 4.2.2 Meaning Print program names and their assigned relocation factors C Print common block names and their assigned locations G Print global symbol names and their definitions Use of + Terminator Prior to the terminator + all characters except option characters are ignored. Carriage return preceding the + starts a continuation line headed by>. ALTMODE preceding the + restarts the Loader; therefore, no loading is done unless the character + appears in the command string. If no option characters precede the +, the default assumption is that no memory map is to be printed. After the +, type the program names (main program first - no extensions) separated by comma or carriage return. the command string with ALTMODE. Terminate Before the terminating ALTMODE has been typed, the Loader may be restarted by typing CTRL P. 4-2 4.2.3 Sequence of Operation Once the command string has been accepted, the Loader will perform the following sequence of operations: a. Load all user programs, specified in the command string, from .DATF -4. These programs are loaded from the bottom of core up, starting at the top of the Resident Monitor. Calls to external library routines via .GLOBL, co:mmon block definitions, and . IODEV requests are-' saved in the Loader's symbol table, built fro:m the bottom of the Loader down. Programs containing executable code (which excludes BLOCKDATA subprograms) are relocated such that they do not overlap core bank boundaries. b. If a library search is necessary and the contents of .DATF -5 is non-O, the Loader will seek the user library, .LIBR BIN, via that .DAT slot, and will load all requested library routines which it finds. I/O device handlers mus-t not be in the user library". c. If a library search is still necessary for non-I/O routines, the Loader will search the system arithmetic Library, .F4LIB BIN, via .DATF -7 in the same manner as above. I/O device handlers must not be in .F4LIB. d. If any I/O handlers must be loaded, the Loader searches through the system I/O Library, .IOLIB BIN, via .DATF -7. After this has been done, program loading has terminated. e. At this point, all undefined common blocks are defined and assigned core space. Common blocks are allowed to overlap core banks. f. If t.here are still some undefined global symbols, they will be matched with common block names and, if a match is found, defined as the base address of the matching common block. g. For aLl mUlti-unit device handlers in use for the user's programs, external I/O buffers are assigned core space (if necessary) and recorded in .BFTAB within the Resident Monitor. The number of such buffers depends on the $FILES counts 4-3 given by the user to the Non-resident Monitor or, if no counts given, the number of .IODEV'ed .DAT alots calling those handlers. I/O. buffers are allowed to overlap core boundaries. 4.3 h. The amount of free core assigned to the Foreground job (contents of .SCOM + 25) is added to the current size of assigned Foreground core to determine the upper limit of the Foreground job. Pointers to t~~ first and last registers in Foreground free core are then stored in .SCOM+2 and .SCOM+3, respectively. i.. The Loader now exits to the Resident Monitor. The Resident Monitor prints tS and waits for the user to type CTRL S, if the Loader is called by the LOAD c~mmand. Control then is given to the start address of the user's main program, which was stored in .SCOM+6 by the Loader. BACKGROUND SYSTEM LOADER Loading of all system programs is done by the System Loader (.SYSLD), which also performs link loading for the Foreground. Initiation of the loading cycle is done when the user, in the Background, types a request to the Non-resident Monitor to load a system program; e.g., $PIP, $EDIT, etc. The Non-resident Monitor puts a code number in .SCOM+5 to tell the System Loader which program to load. The System Loader is then loaded into upper core overlaying the Non-resident Monitor . . SYSLD contains a table which lists the .DAT slots used by each system program. Information about the load address, start address, size and initial block number on the system device for each system program is available in block 4-4 l~l (SYSBLK). To load in a system program in the Background, .SYSLD performs the following operations: a. For each .DAT slot (with non-O contents) required by a system program, it determines which device handlers are needed; and, if a library search is necessary, it brings in the handle.rs from the file .IOLIB BIN on the system device through .DATB -7. They are loaded starting immediately above the top of the Foreground job. b. I/O buffers are then assigned core space immediately above the handlers as in the description in paragraph 4. 2g. ThE~ hardware memory protect bound is set above the handlers and buffers. c. If the load command was $LOAD, $GLOAD, $DDT or $DDTNS, the Background Link Loader (BFLOAD), a relocatable file, is loaded starting just above the new hardware protect bound. d. For all other system programs, .SYSLD builds a short routine just above the hardware protect bound to bring in the program overlaying the System Loader. e. Finally, . SYSLD exi ts ,to the Resident Moni tor which establishes the new hardware protect bound and then passes control to the system program via the address stored by .SYSLD in . SCOM+5. The Loader allows the loading of absolute .LOC programs prior to loading any relocatable files. This permits the user to load programs which may overlay parts of the Resident Monitor. Mixing of absolute and relocatable .LOC's in the same program file is not allowed and will be flagged as an error. The L:::>ader insures that the relocatable proqrams do not overlay any of the absolute programs. 4-5 The Foreground Linking Loader is also responsible for loading the system program PIP in the Foreground. The Foreground version of PIP exists in the system as the relocatable file PIP BIN. It is loaded by typing PIP as a command to the Non-resident Monitor. 4.4 BACKGROUND LINKING LOADER Externally, the Background Linking Loader (BFLOAD) looks nearly the same to the user as the Foreground Linking Loader. When it has been loaded, it prints the following message on the Background control teletype: BGLOA[· V1A > The command string processing is identical with that of the Foreground Linking Loader (see 4.2). If the Load command was $DDT or $DDTNS, the system program DDT (a relocatable file) has already been loaded into the top of core via .DATB -1, prior to reading in the command string. Once the command string has been accepted, the Loader will perform the following sequence of operations: a. Load all user programs specified in the command string from .DATB -4. These programs are loaded from the top of core down. Calls to external library routines via .GLOBL, common block definitions, and .IODEV requests are saved in the Loader's symbol table, built from the top of the Loader upwards in core. Programs containing ex'ecutable code (which excludes BLOCKDATA subprograms) are relocated such that they do not overlap core boundaries. 4-6 4.5 b. Same action as described in 4.2b, using .DATB -5. c. Same action as described in 4.2c, using .DATB -7. d. If any I/O handlers must be loaded, the Loader searches through .IOLIB BIN via .DATB -7. The handlers are relocated to run in lower core, that is, as if they were being loaded upwards in core starting just above the Foreground job. They may, however, be loaded above the Loader at this point in time because the Loader is in the way. c. Same action as described in 4.2 e,f,g. Common blocks are assigned space in upper core; I/O buffers, in lower core. f. The hardware memory protect bound is established above the I/O handlers and buffers. Common blocks may go below the hardware protect bound. g. If DDT was loaded and a symbol table was requested (not $DDTNS), the symbol table is compacted to delete entries not needed by DDT. The Loader determines where the symbol table should be moved; and, along with the I/O handlers which were loaded into upper core, builds a special .EXIT list which tells the Resident Monitor where to block transfer each segment. The DDT symbol table may be loaded bAlow the hardware protect bound. h. The Loader then exits to the Resident Monitor, which performs the block transfers, sets the new hardware memory protect bound, and transfers control to DDT (via .SCOM+5) or to the user program (via .SCOM+6), pausing to print ts and waiting for the user to type CTRL S if the Load command was $LOAD. LOADING XCT FILES XCT files are overlay programs built by the system program CHAIN and run by the system program EXECUTE. Loading of an XCT file in either the Foreground or the Background is initiated by 4-7 typing EuXXX or EXECUTEuXXX to the Monitor (where XXX is the file name without the extension XCT). The Non-resident Monitor, BFKM9, stores the filename (.SIXBT format) in .SCOM+l¢7, ll¢ and III for the Foreground or .SCOM+112, 113 and 114 for the Background. If EXECUTE's .DAT slot requests the resident system device handler, the Monitor stores "XCS" as the extension. If EXECUTE's handler is different from the resident handler, the Monitor stores the extension "XCT." The System Loader is then called in, overlaying the Nonresident Monitor in upper core. 4.5.1 EXECUTE in the Foreground The following operations are carried out when EXECUTE is used in the Foreground: a. EXECUTE's handler, if different from the resident h~ndler, is loaded immediately above the Monitor. b. 'rhe System Loader, which must open the XCT file, checks the extension. If "XCS", meaning EXECUTE's handler is the resident handler, load the file via .DAT -7. If "XCT", load via .DAT -4. Set the extension to "XCT". c. Read the XCT file and check that it was indeed built to be run in the Foreground of a PDP-9. d. Save the upper and lower core limits of the overlay structure and check that it'does not overlay the Resident Monitor. e. Decode the .IODEV bit map in the XCT file. Set the loading bound immediately above the area of core to be occupied by the overlay structure and then load all I/O handlers required by the XCT file. Also, load another copy of EXECUTE's handler (the first copy will be overlayed). 4-8 f. Load in EXECUTE. g. S~me h. The Loader exits to the Resident Monitor. The Monitor gives control to EXECUTE, whose start address is stored in .SCOM+6 by the Loader. action as described in 4.2g and h. The following operations are carried out when EXECUTE is used in the Background: 4.6 a. EXECUTE's handler, if different from the resident handler, is loaded inunediately above the Foreground job. b. Same action as described in 4.S.I.b. c. Read the XCT file and check that it was built to be run in the Background of a PDP-9. d. Save the lower core limit of the overlay structure and test, when EXECUTE has been loaded, that they do not overlap. c. Decode the .IODEV bit map in the XCT file and then load any I/O handlers needed by the file. f. Same action as described in 4.2g. g. Set the hardware memory protect bound above the I/O buffers and then load EXECUTE starting above this bound. h. Same action as described in 4.3.e. ERROR CONDITIONS The number of different error messages in the Loaders has been exp2nded in Background/Foreground. 2, Section A2.S. These are tabulated in Appendix The error number is passed on to the Resident 4-9 Monitor by a special error .EXIT macro (CAL sequence). Loader errors are non-recoverable. After the error message is printed, the Monitor will automatically be reloaded to start another job. 4-10 4.7 SYSTEM MEMORY MAPS Memory Map A 16K System Bootstrap 8K o The System Bootstrap is loaded at the top of core via the paper tape reader in HRM format. 4-11 Memory Map B ~~~~~~-r~---System Bootstrap 8K - - - - - - • SCaM + l2J --iI"'i--r--r--:r---r-,-4 .SCOM + Monitor including the mUlti-unit teletype handler and the system device handler. ~----Resident o The System Bootstrap automatically loads the Resident Monitor from the system device into lower core. 4-12 Memory Map C .SCOM--+-16K .....----Non-resident Monitor 8K .SCOM + .SCOM + ....----Resident Monitor o The Resident Monitor loads the Non-resident Monitor (via the resident system device handler) into upper core, overlaying the System Bootstrap. 4-13 Memory Map D . SCOM---3Io- 16K . .______ Foreground Linking Loader (. SYSLD) . SCaM + 3 --;..+-.L----''---L.._-I 8K - - _ _ _ .SCOM + .SCOM + ~---------Resident Monitor o To load a user FOREGROUND program, the Non-resident Monitor brings in the Foreground Linking Loader (.SYSLD), overlaying itself. 4-14 Memory Map E .SCOM--~)o 16K Foreground Linking Loader (. SYSLD) I/O Handlers Symbol Table .SCOM + .SCOM + .SCOM + .SCOM + protect bound protect bound Foreground free core User's I/O Handlers and I/O Buffers Foreground user programs -_---,W-,_~_ _ _ _~Hardware r-__~__~~~~~~~~~=oftware Foreground Job Resident Monitor The Foreground Linking Loader first brings in any additional I/O handlers required for loading. Then it loads the user program(s), library routines, user I/O handlers and I/O buffers, and allocates Foreground free core. The software memory protect bound is established just above the Foreground job. The hardware memory protect bound, because it can be set only in increments of lK decimal, will leave some unused space between it and the Foreground job. The software protect bound allows this space to be used for dynamic data storage by the Background job. For a description of loading of Foreground XCT files, see Memory Map L. 4-15 Memory Map F · SCOM----II.... -16K Non-resident Monitor .SCOM + · SCaM + · SCaM + .SCOM + .SCOM + bound bound job Resident Monitor o When the FOREGROUND job becomes I/O bound, control is transferred to the BACKGROUND job. The Resident Monitor loads the Nonresident Monitor (via the resident system device handler) into upper core. It then gives control t~ the Keyboard Listener (within the Non-resident Monitor) to await a BACKGROUND keyboard command. Memory protect is enabled while the Background job is running. 4-16 Memory Map G .SCOM-----I..... 16K ~~_____ .SCOM + Background System Loader (. SYSLD) 3------~1~~-~~-L~ .SCOM + .SCOM + .SCOM + .SCOM + .SCOM + ~-------Hardware ~----Software protect bound protect bound Foreground Job 1----- Res iden t Moni tor o When a BACKGROUND keyboard command requests loading of a system or user program, the Non-resident Monitor brings in the System Loader, overlaying itself. Note that the BACKGROUND System Loader and the FOREGROUND Linking Loader arc physically the same program. 4-17 Memory Map H . SCOM------,..... 16K Background -System Program .SCOM + 3- )10 Background Free Core .SCOM + 32~ .SCOM + .SCOM + .SCOM + .SCOM + __----Hardware Protect Bound ~-----Software Protect Bound ~~~~~~~_~__----Background I/O Buffers Background I/O Handlers Foreground Job ~------Resident Monitor o If the BACKGROUND request is for a system program, the System Loader loads the system program I/O handlers up from the top of the FOREGROUND job, allocates I/O buffer space, and loads the system program at the top of core (overlaying the System Loader). Control is returned to the Resident Monitor, which sets the memory protect bound above the buffer space and given control to the system program. 4-18 Memory Map I .SCOM ~16K · SCOM + 3 P/// ~ Background System V// rL.....L-L----L--I Loader (. SYSLD) J I · SCOM + 2 - - - - - - - - t- ~Background Linking Loader .SCOM + 32-.-----------.SCOM + 1 · SCaM + 25 .SCOM -I- 31 --- >- Moni t.or () If the BACKGROUND program is a user program*, the System Loader loads the Linking Loader I/O handlers up from the top of the FOREGROUND job and loads the Linking Loader such that the memory protect bound can be set just below it., *Uscr programs may be loaded along with the system program DDT. 4-19 Memory Map J .SCOM .SCOM + ... ll----~ 16 K 3J -E,- Background user Programs Library Routines ~_Background User I/O Handlers .SCOM + 2 - - - - - - i..... ~-=---;;;:;;';-;::::"';",". ~ Loader's Symbol Table ~ Background . SCaM + 32 _____~ ~Hardware .SCOM + Linking Loader Protect Bound Prote~t Bound . SCaM + .SCOM + Foreground Job o The Bl.CKGROUND Linking Loader overlays the System Loader by loading user programs down from the top of core. User I/O handlers, presuming that they cannot fit in core b(~tweenthe FOREGROUND job and the bottom of the Loader, are loaded into upper core but relocated to run just above the FOREGROUND job so that they memory protect bound can be set above them. Common blocks and I/O buffers are not shown in this memory map. 4-20 Memory Map K .SCOM-----------~~~16K OII!'---- Background User Programs and Library routines - - - - User's Common Blocks .SCOM + 3--------~I~~~I~~uwy .SCOM+ 32~ .SCOM + 2 } - _ .SCOM + 31 ~ ~~-L-..\~~~-'r-'--"-.!-~ .SCOM + l*l . SCaM + 2 ~r------'~'" I-~..,x-~-......><-.->'_r__"+ ~..--Background handlers Foreground Job 8K ....-I...E:----Resident Monitor o The .EXIT from the Linking Loader causes the user program I/O handlers to be block transferred to their running position, the memory protect bound to be set just above the I/O buffer space, and control given to the user program. if DDT was also loaded, it resides at the top of core, above the user programs. Its symbol table, built by the Loader, is block transferred by the Monitor to start at the software protect bound. *If DD7 is loadGd, .SCOM + 1 will be set to point at the start of DDT symbol table. 4-21 Memory Map L .SCOM symbol table .SCOM + .SCOM + .SCOM + .SCOM + protect bound protect bound ~ Foreground free core ------~~~~~~~ ~~~~~~~EXECUTE ~ . /0 ~~~~~~~ Foreground Job Handlers + I/O buffers including 2nd copy of EXECUTE's handler Core occupied by OverlaY,structure -=- ~ ~--=-:. =- J } lIs t copy of EXECUTE's n I / O handler t---r--r--~-r---r--1 o System Loader first loads EXECUTE's I/O handler (if not the resident handler) in order to read the XCT file. The core limits of the overlay structure are read from the file as well as the request for I/O from its .IODEV bit map. 'rhe requested handlers, including a second copy of EXECUTE's handler, are loaded above the core area to be occupied by the overlay structure. Then I/O buffers are created, if necessary, and EXECUTE is loaded above them. Finally, Foreground free core, the software protect bound and the hardware protect bound are established. rrhe 4-22 Memox:'y Map M .SCOM Core occupied by Overlay structure .SCOM + table 3--------~)o . SCOM + 2 -~-------~ I-"-''>''''---'--'-->-'~~ .SCOM + 32-------------~·1 .SCOM + 31------~--------~~-~~~~r;' .SCOM + 25--~---------~.1-~~~~-=~~~ protect bound Pro.tect Bound Background I/O handlers and I/O buffers Foreground job 8K - - - - - - Monitor o The System Loader loads EXECUTE's I/O handler (if not in core) in order to read the XCT file. The core limits of the overlay structure and tJne I/O requests in the . IODEV bit map are read from the XCT file. The user's I/O handlers and I/O buffers are then laoded above EXECQTE's handler, and the hardware protect bound is established above them. EXECUTE is loaded above the bound and Background free core is set up from the top of EXECUTE to the bottom of the overlay area. 4-23 SECTION 5 BACKGROUND/FOREGROUND START-UP PROCEDURE 5.1 LOADING THE B/F MONITOR Before startup procedures can be carried out, the user must generate a working system (usin~ supplied with the system. Refer to Section 8 for .SGEN proce- .SGEN) from the master tape dures. In Disk systems, the Monitor and system programs are assumed to be on Unit ~. In DECtape systems, mount the working system tape onto DECtape unit 8 (i.e., 1) ~) and perform the following: Load appropriate paper tape Bootstrap in the reader. 2) Momentarily depress Reader TAPE FEED pushbutton to clear end-of-tape flag. 3) Set console address switches as follows: If you have a - 4) Set switches to - 16K System 37637 24K System 57637 32K System 1'7637 Press and release in sequence the console I/O RESET and READ IN switches. 5-1 When loaded, the monitor identifies itself and indicates its readiness by outputting the following on the Foreground control Teletype (i.e., norma1iy unit 1) FKM9 VIA $ The paper tape bootstraps used to load the Background/Foreground monitor are identical to those used in the PDP-9 Keyboard Monitor system. The bootstrap restart address, however, is different (i.e., .SCOM+11 = register lIla) because the resident Monitor contains a copy of the bootstrap. The three examples given in paragraphs 5.2, 5.3 and 5.4 are intended to get the user "on the air". Note that the symbol $ is output by the Monitor to indicate that it is ready. to accept commands, whereas">"and "*" are used by system programs to denote readiness. The symbol ® in the text below indicates the typing of an ALTMODE terminator. 5.2 .IDLE LOADED AS THE FOREGROUND JOB An Idle job is loaded in the Foreground to allow immediate use of the Background. Refer to section 6.3 for a discussion of .IDLE. FKM9 V1A $A ~TA~ DKA~ $GLO D FGLOAD V1A >+-IDLE ® -4 /The program "IDLE" is on unit /~ of the system device /Ca11 the Loader to Load-and-Go /The Loader is in core /Load "IDLE BIN". 5-2 When IDLE is loaded, no indication is given on the Fore- ground control teletype. Control passes to the Background and the Non-resident Monitor is loaded into core. The Monitor identifies itself on the Background control teletype as: /The Monitor is now ready to /accept background commands. BKM9 VIA $ 5.3 SINGLE-USER FOCAL LOADED INTO THE FOREGROUND FKM9 VIA $A fDT~ -4 /FOCAL is on the "system tape". $A DT 3 $A TTl 5 $FCORE lfdfJfJ $GLOAD /Library input to FOCAL. /Library output to FOCAL. /Free core for FOCAL buffer area. /Call Loader to Load-and-Go. FGLOAD VIA >+-FOCAL, FNEW ® /Load FOC.A.L and its library, FNEW LI?Kfd FOCAL V3A /The Loader is in core. /FOCAL is in core and lis ready to accept commands. * Once FOCAL is running in the Foreground, the Non-resident Monitor will be loaded into core as explained in 5.2. 5.4 TWO-USER FOCAL LOADED IN 'rHE FOREGROUND FKM9 VIA $A fDTm LDKm -4 $A TTl 1 $A DTI 2 $A TT2 3 $A DT2 4 $FCORE 3fJfJfJ $GLOAD /FOCAL2 is on the "system tape". /Teletype for user #1. /Library In/Out for user #1. /Teletype for user #2. /Library In/Out for user #2. /Assign 14fJfJ (Octal) locations of free /core for each user. /Call the Loader to Load-and-Go. FGLOAD VIA /The Loadl~r is in core. ;>-<FOCAL2 ,FNEW @ /Load two'-user FOCAL and its /library, FNEW. POCAL V3A /FOCAL is in core and will * /identify itself on each user's teletype. 5-3 SEc'rION 6 BACKGROUND/FOREGROUND MONITOR COMMANDS (SYSTEM MACROS) 6.1 INTRODUCTION The System MACROS unique to the Background/Foreground Monitor are listed and described briefly in Table 6-1. The Monitor Macros listed are available in addition to the Macros provided in the Advanced Keyboard Monitor System for use in programs that are to be run in the Background/Foreground environment. Detailed descriptions of the Macros are given in the remainder of this Section. 'rABLE 6-1 Background/Foreground System Macros Name Purpose .REALR Real time transfer of data from I/O device to line buffer (real-time READ). .REALW Real time transfer of data from line buffer to I/O device (real-time WRITE) . . IDLE Allows FOREGROUND job to indicate that control can be given to lower levels of the FOREGROUND job or to the BACKGROUND job until completion of any FOREGROUND real-time transfer or clock interval. .IDLEC Allows FOREGROUND Mainstream to give control to BACKGROUND job with FOREGROUND continuinq ufter the .IDLEC on completion of any FOREGROUND rCul-time transfer or clock interval. .'rIMER Calls and uses real-time clock and allows priority level to be established. .RLXIT Accomplishes the exit from all real-time subroutines that were entered via .REALR, .REALW, .TIMER or real-time CTRL pl requests. See Section 3.7. 6-1 6.2 .REALR FORM: '. RE,ALR A, M, L, W, ADDR, P VARlALLES: A = .DAT slot number (octal radix) f1 1 M = Data Mode 1 { 3: lOPS binary Image binary lOPS ASCII Image Alphanumeric Dump Mode L 15-bLt buffer address W Line buffer word count (decimal radix) I including the two-word header (octal radix) 2 ADDR = IS-bit address of closed subroutine that is given control when the request made by the .REALR is completed. P API priority level at which to go to ADDR P Priority Level fJ 4 5 Mainstream Level of . REALR API software level 5 API software level 6 API software level 7 6 7 EXPANSION: LOC LOC+l LOC+2 LOC+3 LOC+4 CAL+lfJfJfJ~+M6-8+A9-17 IfJ L .DEC -W .OCT ADDR+PO-2 /Decimal Radix /Octal Radix IData modes 5, 6 and 7 are passed to all I/O handlers. 2The subroutine specified by a .REALR, .REALW, .TIMER or realtime CTRL P should not be used at more than one priority level. The subroutine is entered via a JMS and thus cannot be protected against re-entry. 6-2 DESCRIPTION: The .REALR command is used to transfer the next line of data from the device assigned to .DAT slot A to the line buffer in the user's program. In this operation, M defines the modes of the data to be transferred, L is the address of the line buffer, W is the number of words in the line buffer (including the two-word header), and ADDR is the address of a closed subroutine which should be constructed as shown in the following example. EXAMPLE 1: ADDR STRUCTURE OF A REAL-TIME SUBROUTINE o /Entry point DAC S AVE AC /Eave AC /Any system Macro may /be issued at this point. 6.3 LAC SAVEAC /Restore AC .RLXIT ADDR /Return to interrupted /point via Monitor CAL .REALW FORM: .REALW A, M, L, W, ADDR, P VARIABLES: A = .DAT slot number (octal radix) { ~ = IOPS binary 1 = Image bina-i:y 2 = IOPS ASCII 3 = Image Alphanumeric 4 = Dump Mode Ml= Data Mode L IS-bit Line buffer address (octal radix). W Line buffer word count (decimal radix), fucluding the two-word header ADD~= IS-bit address of closed subroutine that is given control when the request made by the . REALvv is completed. 1 Da ta modes 5, 6 and 7 are passE~d to all I/O handlers. 2See footnote 2, page 6-2. 6-3 P API priority level at which to go to ADDR priority Level P Mainstream Level of .REALW API software level 5 API software level 6 API software level 7 ~ 4 5 6 7 EXPANSION: LOC LOC+l LOC+2 LOC+3 LOC+4 CAL+l~~~~+M6-B+A9-17 11 L .DEC "'W .OCT ADDR+Po- 2 /Decimal Radix /Octal Radix DESCRIPTION: The .REALW command is used to transfer the next line of data from the line buffer in the user's program to the device assigned to .DAT slot A. In this operation, M defines the mode of the data to be transferred, L is the address of the line buffer, W is the count of the number of words in the line buffer (including the two-word header), and ADDR is the address of a closed subroutine which should be constructed as shown in EXAMPLE 1 above. 6.4 . IDLE FORM: . IDLE EXPANSION: LOC LOC+l CAL 17 DESCRIPTION: The FOREGROUND job in a Background/Foreground environment can indicate that it wishes to relinquish control to lower levels of the FOREGROUND job or to the BACKGROUND job by executing this command. This is useful when the FOREGROUND job is waiting for the completion of real-time I/O from anyone of a number of I/O requests that it has initiated or for completion of .TlMER requests. The .IDLE is the logical end of the current level's processing; that is, control never returns to LOC+2. If the .IDLE is issued at a FOREGROUND API software level, it effects a debreak (DBR) from that level so that pending real-time 6-4 routines at that level will not be executed until the level is requested again. If the .IDLE is issued at FOREGROUND Mainstream, control goes to the BACKGROUND job. If the .IDLE is issued at BACKGROUND Mainstream, control is returned to the .IDLE CAL. 6.5 .IDLEC FORM: .IDLEC EXPANSION: LOC LOC+I CAL+I~J~JiY DESCRIPTION: Identical to .IDLE except when issued at the FOREGROUND Mainstream level. In this case, control goes to the BACKGROUND job, and LOC+2 is saved as the FOREGROUND Mainstream return pointer. The next time control returns to FOREGROUND (at any priority level), FOREGROUND Mainstream processing will resume at LOC+2 when Mainstream becomes the highest active FOREGROUND level. 6.6 .TIMER FORM: .TIMER N, ADDR, P VARIABLES: ~ = Number of clock increments (decimal radix) ADDlf= IS-bit add.ress of closed real-time subroutine to handle interrupt at end of interval P API priority level at which to go to ADDR lTo transfer control to subroutine ADDR at priority level P immediately, N should be set equal to zero. 2The subroutine specified should not be used at more than one priority level. The subroutine is entered via a JMS and thus cannot be protected against re-entry. 6-5 P priority Level fJ Mainstream Level of .TIMER API software level 5 API software level 6 API software level 7 4 5 6 7 EXPANSION: LOC LOC+I LOC+2 LOC+3 CALI 14 ADDR+Po-2 .DEC -N /Decimal Radix DESCRIPTION: .TIMER is used to set the real-time clock to N increments and to start it. Each clock increment represents 1/60s for 60 Hz systems and 1/50s for 50 Hz systemi. When the Monitor services the clock interrupt, it passes con"trol to location ADDR+l with the priority level set to P. The coding at ADDR should be in closed subroutine fo:rm, as in EXAMPLE 1. 6.7 .RLXI':.' FORM: .RLXIT ADDR VARIABLES: ADDR = l3-bit entry point address of the real-time subroutine from which an exit is to be made. EXPANSION: LOC LOC+I CAL ADDR 2~ DESCRIPTION: .RLXIT is used to exit from all real-time subroutines that were entered via .REALR, . REALW , .TIMER or real-time CTRL P requests. The instruction just preceding the .RLXIT call should restore the AC with the value of the AC on entrance to this subroutine. .RLXIT will restore the link from bit ~ of the contents of ADDR . . RLXIT protects against re-entrance to BACKGROUND or FOREGROUND Mainstream real-time subroutines. When the contents of ADDR is non-zero, the subroutine is assumed active; .RLXIT sets the contents of ADDR to ~, thus making it availlWhen bit 8 of CAI~ is set to I, an abort • TIMER is effected. All intervals having the same address and priority level (LOC+2) will be aborted. 6-6 able again. NOTE: Real-time subroutines should initially hav.e their entry point register set to fO; and restart -procedures, enteredvla CTRL P or after CTRL T, shOUTd reset all entry pOlnts to ~. 6.8 MAINSTREAM REAL-TIME SUBROUTINES Mainstream real-time subroutines in the Foreground are not equivalent to those in the Background due to the manner in which I/O busy situations are handled. If the Background becomes I/O busy, the Monitor "sits on" the Background CAL instruction (while Background is in control) until it can be processed. Therefore, Background Mainstream real-time routines can be executed despite the fact that Background Mainstream is I/O busy. If Foreground Mainstream is I/O busy, Foreground Mainstream real-time routines cannot be executed until the busy situation is terminated. This is due to the fact that control is given to the Background whenever Foreground Mainstream becomes I/O busy_ The device handler responsible for the busy situation is rememberod in the Foreground Mainstream busy flag. Mainstream real-time routines cannot then be run because they too could become busy. This situation can be avoided either by usinq .REALR or . REALW in conjunction with . IDLE or . IDLEC, or by usinq . v-7AITR to prevent Foreground Mainstream from becoming I/O bound. 6-7 SECTION 7 WRITING DEVICE HANDLERS FOR THE BACKGROUND/FOREGROUND MONITOR SYSTEM 7.1 INTRODUCTION Writing a handler which will run in the Background/Foreground Monitor environment requires adherence to certain established conventions which differ from those in the Keyboard Monitor environment. The CAL handler in the Monitor has been implemented to do as @uch of the function processing as possible. In giving control to the I/O handler, the CAL handler will have set up registers in the I/O handler with all pertinent information (arguments) of the CAL in the most accessible state, and will then transfer control to the appropriate function processor via the JMP table in the I/O handler which begins at word 208. There are three types of I/O device handlers that one may wish to develop to operate under the Background/Foreground Monitor System: 1. Single user --- This handler can be used by either the Foreground job or the Background job but not both during the same core load; that is, it is dedicated to one job and the Monitor System will not permit the other job to be connected to it. 2. Sequential Multi-user --- This handler can be connected to both the Foreground and the Background job and they both can utilize it on a sequential, first come-first served basis. 3. Multi-user --- This handler can be connected to both the Foreground and the Backqround jobs with the Foreground job having priority on usage. If the Background job is using the handler and Foreground requires it; the Background I/O will be deferred until the Foreground I/O has been completed. This section will be primarily devoted to describing the development of single-user handlers. After having done this, it will show the transition fro:m single use to sequential multiuse. 7-1 I/O handler type 3 (Multi-user) is too involved to be presented without example listings (such as our Multi-user DECtape handler) and personal consultation regarding the philosophies of the Background/Foreground Monitor System. Consultatio~ is available to customers whose applications require type 3 handlers. 7.2 FORMAT OF DEVICE HANDLER'S CAL PROCESSOR The first 37 (octal) words of the I/O handler must have the format described in the following pages. An assembly listing of the Background/Foreground line printer handler (LPA) is appended to this section for reference. WORD~: JMS SWAP /SWAP is in the I/O handler The SWAP subroutine must execute WORDS which restores the state of the program interrupt and DBK from level ~ of the API. The presence of this routine becomes functionally necessary for type 3 (Multi-user) handlers to accomplish swapping from Background to Foreground usage. The I/O device independ~nce of the system requires that all handlers look alike to the outside world (namely, the CAL handler). WORD 1: Foreground Busy Register must be assembled with ~ contents ~=Not Busy Non~=Busy (Current .DAT slot number, 18 bits if negative) WORD 2~ Background Busy Register ~=Not Non~=Busy must be assembled with ~ contents Busy (Current .DAT slot number, 18 bits if negative) 7-2 The CAL handler checks the validity of the .DAT slot number for this job (Foreground or Background), checking for its existence, whether or not a device has been assigned to it and if the appropriate handler was loaded. The CAL handler then checks the appropriate busy register and proceeds as follows: 1) If the flag indicates that the handler is already busy, the job becomes I/O bound at this level. 2) If the flag indicates not busy, it is set to busy and the CAL handler processes the function and passes the request on to the device handler. Note that .WAIT's and .WAITR's are completely processed by the CAL handler and are not passed on to the I/O handler If the corresponding flag indicates: 1) 2) BUSY a) For .WAIT in the Foreground, control is given to a lower Foreground level or the Background. b) For .WAIT in the Background, hang on the CAL. c) For .WAITR in either the Background or Foreground, control goes to the address in LOC+2 (which must be above the hardware memory protect bound if in the Background) . NOT BUSY - Fall through. WORD 3: Foreground .CLOSE register -- must be assembled with fJ contents !J=.CLOSE not in progress NONfJ=.CLOSE in progress 7-3 WORD 4: Background .CLOSE register --- must be assembled with ~ contents ~=.CLOSE not in progress Non~=.CLOSE in progress WORD 5~ ION or IOF (state of PIC on INTERRUPT or CAL entries). WORD &: Same as WORD 5 on CAL entries; DBR on INTERRUPT entries. WORD~: WORD l~: Return pointer. The CAL handler places the address of CALXIT in this register. JMP FUNC After checking the validity of function and subfunction codes, the CAL handler places a JMP to the appropriate entry in the function JMP table (words 2~-32) of the I/O handler in this register. WORD 11: User CAL in progress. register. The CAL handler sets this ~=Foreground l=Background WORD 12: .DAT slot number (IS-bits if negative). CAL handler sets this register. The WORD 13: Unit number for Multi-unit devices in Bits ~-2, with bits 3-17 containing the address of the CAL. The CAL handler sets this register. lWhen a hardware interrupt occurs to this I/O device handler, the interrupt processor must: a) Save the state of the program interrupt in Word 5 b) Place a DBR in Word 6 c) and place the interrupted program counter (with link, extend mode and memory protect bits) in Word 7. 7-4 The CAL handler makes a general check for validity on: a) b) c) d) e) f) g) File type Data Mode MAGtape subfunction code Transfer directions .OPER subfunction code All addresses Word counts and will pass on what appears to be legitimate values . . Each handler must then make its own validity determination with respect to the device it controls. will always accept data modes ~ For example, the CAL handler through 7; however, the device handler may only accept a subset of these. The contents of words Word 14 through Word 17 vary with the function being processed. l\.dj acent to what will appear in each of these words is the limits on the values that will be accepted and passed on by the CAL handler. WORD 14: .INIT --- File type ~=input l=output .READ, .REALR .WRITE, .REALW - Data Mode 2 .MTAPE .TRAN .OPER binary l=imaqe binary 2=IOPS ASCII 3=Imaqe ALPHA 4=DUMP 5=DUMP ALPHA 6=are passed on 7=by the CAL handler ~=IOPS --MAGtape function --Transfer direction --Subfunction code 7-5 (~-178) (~-3 (1-3 ) WORD 15: .INIT --- User restart address plus code bits (~-2) .READ, .REALR .WRITE, .REALW --- Line buffer address (checked for memory violation on software protect bound (SCOM+3l) if Background job . . DLETE , .RENAM .FSTAT, .ENTER, .SEEK --- Address of Directory entry block (checked for memory violation on .SCOM+31 if Background job) . • 'rRAN --- Core starting address (checked for memory violation on .SCOM+31 if Background job . WORD 16: . INIT --- Address of Register which is to have standard buffer size placed in it (checked for memory violation on .SCOM+31 if Background job) . . TRAN, . READ , .REALR -- Line buffer word count (from CAL ARG. LIST). Counts are checked for core fit and negative value if Background job . . WRITE, .REALW --- Line buffer word count (from line buffer word pair ct., except for dump mode and Mode 5 which use counts from CAL argument list.) Counts are checked for core fit and negative value if Background job. WORD 17: .TRAN --- Device address tBlock number) .FSTAT --- Address of register which will have the device code put in bits ~-2, (checked for memory violation on . . SCOM+31 if Background job) . . REALR, .REALW --- Address to give control to on completion of I/O request and priority level in bi ts ~-2 1 , (checked for memory violation on .SCOM+32, the hardware protect bound, if Backqround job). lIf--it is a Background CAL, bits ~-2 of this register will always contain ~, which indicates Background Mainstream. If it is a Foreground CAL and there is no API, bits ~-2 contain 1, the Foreground Mainstream code. 7-6 Function JMP Table Ignored functions, functions that do not issue lOT's at the CAL level, and error functions must set up to have the Foreground or Background busy flag (Words 1 a~d 2, respectively) cleared during the protected exit routine (which begins at LPTIO in the line printer handler). WORD 32: JMP INIT /Function 1 /Function 2 JMP OPER JMP SEEK /Punction 3 /Punction 4 JMP ENTER /Function 5 JMP CLEAR /punction 6 JMP CLOSE JMP MTAPE /Function 7 JMP READ ( .REALR) /Function 1.0 JMP WRITE ( . REALW) /Punction 11 NOP /.WAIT or .WAITR never get to I/O handler /Punction 13 JMP TRAN WORD 33: .0 WORD 34: SUBRF WORD WORD WORD WORD WORD WORD WORD WORD WORD WORD 2~: 21: 22: 23: 24: 25: 26: 27: 30: 31: /Storaqe for .SCOM+35, the "in an interrupt service" flag. /Stop FGRD I/O subroutine When the Foreground job terminates (.EXI1', tc, terminal error, etc.) this routine in every Foreground device is called at Mainstream level to effect the controlled shutting down of the device (see 7.4). WORD 35: /Stop BGRD I/O subroutine SUBRF For single user device handlers (devices that cannot be shared by Foreground and Background) , the same subroutine can be used for FGRD and BGRD STOP I/O. WORD 36: /Handler I.D. code This word has other values (Non-0) for devices that require special consideration from the CAL handler. 7-7 7.2.1 . SETUP On the first (and only on the first) .INIT to a device handler, the device handler must call .SETUP to connect the device handler's interrupt service routine to the appropriate API channel register or program interrupt skip chain entries. The address of .SETUP can be found in .SCOM+55 (155 ), 8 Calling sequence: LAC * DAC JMS* LSDF LPINT (. SCOM+55 LPTEMP LPTEMP /SKIP lOT /ADDRESS OF INTERRUPT SERVICE If this is not done, the first hardware interrupt for this device will be deemed an illegal interrupt and processed accordingly. It is imperative that all lOT's that initiate hardware operations be executed during protected (API level ~, IOF) exit from the handler to assure that the exit takes place prior to the hardware operation completing and causing re-entry to the handler at the interrupt level for servicing. CAL function requests that require more than one hardware operation should cause the 2nd throuqh Nth operations to be initiated at the interrupt level durinq protected exit. 7-8 A handler should not cause sitting on a CAL until the entire function is completed because this prevents opt.imum usage of central processor time for the duration of the function. The user cannot do other things while the hardware operations proceed. 7.2.3 .OPER Functions .OPER functions (.FSTAT, .RENAM and .DLETE) are unique in that they return information in the AC. For device handlers that wish to utilize this function, the method is as follows: On completion of .OPER operation, the interrupt service level of the handler sets the appropriate close register (Word 3 if Poreground, Word 4 if Background) to: l=File not present INFORMATION+l=File present (where information is the device block number). The information must not = -1 As at the completion of other I/O requests, it sets up to have the appropriate busy flag (Word 1 if Foreground, Word 2 if Background) cleared during protected exit. 7.3 FORMAT OF DEVICE HANDLER'S INTERRUPT PROCESSOR Figure 7-1 contains a detailed flow chart of the interrupt service routine of a single-user handler. This is the actual flow chart of the LPA. handler whose listing is appended to this section for reference. 7-9 fnterrupt Processor of Device Handler in BACKGROUND/FOREGROUND MONITOR Environment LPINT Save AC, PC, L, XM, MP in WORD7 of handler. Save status of PIC in WORD5. len-tered WI. th-memory - -I Iprotect disabled and I .- ...... "', at hardware level (API I I~r_ PIcl...?~~e~ice_ _ _ .l [Jfave contents of .SCOM+35 in WORD33 of handler _ _ _ _ _ _ _ _ _ _- L_ _ _ _ _ _ _ _ _ _ _ _ _ _ ~ non ~ to .SCOM+35 (on exit, .SCOM+35 is returned to its saved state) I When -:-SCOM+35 i-; no~"".01 lat least one interruptr .- .- L:>ervic=- i~ in ..Erogre~l Wh;n -locatio;-~ i s -;'on ~ I lat least one interrupt I I~ervic-=- is .....in .J?rogr-=ss I 1 - Set location to ~ ")--L--~ ~ Clear STOP I/O Switch Clear flag, enable PIC, DBR to WORD6 of handler~------~ N >--------:~ Process Interrupt Set up to issue next lOT in protected (API and ~----~PlC) exit routine. y LPEMPT L. _ _ Set up to have BGRD or FGRD flag cleared during protected exit routine. ~ busy Figure 7-1 IWORD I 1 Ofhandlerl lindicates BGRD orl --I FGRD ownership ofl 1.2/~ reque.:..t ~ _ ..J Interrupt Service Routine, Flow Chart 7-10 Ithi; is -the -commo~1 Iprotected exit fori ,interrupt and CAL I I~ntr~s ______ , LPNOR Check for device ready prior to initiating I/O LPTIO FEh"Ts-was-an - , IRaise to API level ~, IOF NOTE: linterrupt I The addrese of Iservice entry I CALL4 is in ---:::;..-- --,./" .SCOM+S4 (154 8 ) ./" CALL4 initiates JMS CALL an API (or WORD7 pseudo API) WORD33 level 4 interrupt with the level 4 interrupt processor LPT.6 controlling r----------------~------------~ restore .SCOM+3S from BGRD to FGRD WORD33 of handler transitions and realtime requests. Clear BGRD and/or FGRD busy flag as previously set up. I LPIOT ~l execute setup lOT (IOF if completE!d) ! J Irestore AC DBK from level ~ execute WORDS which is the exit status of PIC jcxecute WORDG (DBR i f interrupt entry, same as WORDS if CAL entry) exit Figure 7-1 (Cont.) 7-11 LPT3l Raise IOF NOTE: The address of IOBUSY is in .SCOM+52 (152 8 ). If the FGRD job became I/O bound on this handler., IOBUSY will prime the Monitor to continue the FGRD job on the busy CAL. /' / ION DBK from API level (Check if-thi;-I ·Idevice involvedl ......1 it; .1/0. busy I I~F!:..u~t2:..0n ___ 1 ~ N LPNOR Raise to API level IOF ICall real=- --I ~ I time processor 1 I with level/ I subroutine I, I""", La~d~e~ J-~ AC .J NOTE: The address of REALTP is in .SCOM+Sl (ISla). REALTP pr ilfles the Monitor to honor real-time requests. ' ION DBK from API level ~ ITO determine whether the completed operation is real-time: a) WORDl~ WORD 3 ~ b) and WORDl7 must be must contain a JMP to WORD27 (. WRI'rE or . REALW) . (READ or .REALR) or non-~. Figure 7-1 7-12 (Cont.) Please note that interrupt service routines (the coda beginning at LPINT in the LPA. handler) must be set up to operate with or without API. 7.4 7.4.1 SYSTEM ANNOUNCEMENTS Errors All device handler error messages should be terminal; that is, should terminate the operation of user programs. After the printing of the error message, the user has the option of typing CTRL P (to restart his program at the CTRL P restart address), CTRL T (to return to DDT), CTRL Q (to take a dump of memory), or CTRL C (to return to the Monitor to load another job). Device handlers that wish to set up an error condition should use the following coding sequence: (. SCOM+66 LAC* TEMP DAC LAC ( 4~~2~~ ISA IOF CODE LAW JMS* TEMP AUXARG XX DBK ION /CLEAR BUSY FLAG (WORD 1 or WORD 2) /EXIT HANDLER VIA PROTECTED EXIT. /POINTER'TO ERRORQ /SUBROUTINE. /RAISE TO API /IJEVEL ~. /SEE BELOW. /CALL ERRORQ. /AUXILIARY ARGUMENT. /RETURN HERE. The first argument, given in the AC to ERRORQ, may be loaded either by LAW code or by LAC code in the following format: 7-13 Code Bits ~-5 are ignored Bit 6=1 means terminal error Bit 7=1 means Background error l Bit 8=1 means Foreqround error l Bits 9-17 is a 3-diqit error code The auxiliary argument, following the JMS to ERRORQ, will be printed in the error message as a 6-digit octal number. The error message will be printed in the form: .ERR NNN XXXXXX where NNN = the 3-digit error code xxxxxx = the 6-digit auxiliary information The actual printing of the error message and processing of the error will be done only after all interrupt processing has ceased and when control is no longer in the CAL handler. 7.4.2 Recovery from I/O Device Not Ready Condition The Background/Foreground monitor system is designed to handle simultaneously one not-ready condition per job. This is a limitation but a reasonable one based on Keyboard Monitor (single-user) experience. I/O handlers that can encounter and detect not-ready conditions must adhere to the following ground rules in their announcement of the non-terminal error and in their continuation once the condition has been corrected. IBits 7 and ·8 may both be set if the error applies to both the Foreground and the Background jobs. 7-14 Since all 1/0 in B/F handlers must be initiated in the common, protected exit routine of the handler (the code beginning at LPNOR in the line printer example), it is there and only there where not-ready conditions should be checked and handled. 1 Prior to executing the desired IOT, check for not-ready with the code at LPNOR which is as follows: LPNOR IDO WHATEVER IS NECESSARY ITO DETERM,INE WHETHER IDEVICE (UNIT) IS READY. JMP LPRDY IDEVICE READY. IWITH THE DEVICE (UNIT) NOT READY IT lIS NOW NECESSARY TO DEFER THE IDESlRED lOT, ANNOUNCE THE NONITERMINAL ERROR, AND EXIT FROM. THE IHANDLER SET UP TO CONTINUE WHEN ItR IS TYPED O~ THE USEP'S CONTROL ITELETYPE. LPIOT !Sl\VE DESIRED lOT. LAC LPIOTB DAC I LAC (IOF IEXECUTE IOF IN DAC LPIOT IPLACE OF lOT. JMS LPMSG IINITIATE NOT READY MSG. LPRDY Where the code at LPMSG is as follows: ISUBROUTINE TO CALL A ROUTINE IN THE RESIDENT IMONITOR TO INITIATE A NOT READY MESSAGE. ICALLING SEQUENCE: I JMS LPMSG I RETURN WITH LPCTLR NON-~ IF I REQUEST HONORED, OTHERWISE, I LPCTLR IS SET TO ~ AND A I TERMINAL ERROR WILL RESULT I IThe exception to this is when a handler can only determine not ready at the interrupt level; that is, after it has issued the desired lOT and an error flag results. 7-lS LPMSG LPARGl LPARG3 ~ /DETERMINE WHICH JOB (FGRD OR BGRD) /IS CURRENTLY MANIPULATING THTS DEVICE. LAC LPA.+ll /~=FGRD,l=BGRD DAC LPARGl LAC LPCTLR /EXIT IF MESSAGE SSA!CMA /ALREADY REQUESTED JMP* LPMSG /FOR THIS DEVICE. DAC LPCTLR /SETtR FLAG. LAC UNITNO /UNIT NUMBER (BITS DAC LPARG3 /~-2) IF APPLICABLE. LAC * (.SCOM+64 /POINTER TO tR DAC LPTMPl /QUEUER IN MONITOR. LAC (4~~2~~ /RAISE TO API ISA /LEVEL ~ AND IOF /TURN OFF PIC. JMS* LPTMPl /GO TO tR QUEUER. XX /~=FGRD, l=BGRD • . ASCII /LP/ /DEVICE NAME .LOC .-1 ~ /UNIT NUMBER (BITS ~-2) IF APPLICABLE LPFRA + 2~~~~~ /FGRDtR SUB AND DEVICE'S API LEVEL LPFRA + 2~~~~~ /BGRDtR SUB AND DEVICE'S API LEVEL DSM LPCTLR /REQUEST NOT HONORED-TERMINAL ERROR. ION /PIC ON (RETURN HERE IF HONORED). DBK /DEBREAK FROM LV~ JMP* LPMSG Where the code at LPFRA is as follows: /SUBROUTINE ENTERED AT API LEVEL 2, PIC OFF. /WHEN tR IS INPUT FROM KEYBOARD, EVEN IF DEVICE IS /ONLY CONNECTED TO PIC, AN API HARDWARE /LEVEL (~,1,2,OR 3) MUST HAVE BEEN SPECIFIED. LPFRA ~ DSM LPCTLR /CLEAR tP FLAG /DO WHATEVER IS NECESSARY /TO DETERMINE WHETHER DEVICE (UNIT) /IS READY /IF STILL NOT READY, CALL LPMSG /TO CAUSE NOT READY MESSAGE TO BE /OUTPUT AGAIN. LPMSG JMS JMP LPFOUT /BYPASS lOT. LPIOAC LAC /AC FOR lOT IF APPLICABLE. LPIOTB XX /DEFERRED lOT. LPFOUT ION /PIC ON. DBR /DEBREAK FROM LEVEL ~. JMP* LPFRA /'rTfF. CONTROL R(fR) IN PROGRESS FLAG /MUS'.r TNI'l'IALLY BE CLEARED IN THE /S'J'OP I/O ROUTINE. r,PC'rLH ftJ /tR FLAG 7-16 7.5 STOP I/O TECHNIQUE In the Background/Foreground Monitor environment, it is necessary to have some orderly means of stopping I/O in progress. (.EXIT, tc, terminal error, When a job terminates ('te.), Ul(\ Monitor SYf:;tem must assurc~ is rdlUt down before! t:h(~ from cor~. i.t rcmovns that is that all I/O for that job associatQd device handlers This is accomplished via the following method: a) Word 34 of every device handler points to the Foreground STOP I/O subroutine which is internal to the handler. b) Word 35 of every device handler points to the Background STOP I/O subroutine which for single-user handlers can be the same as the Foreground STOP I/O routine. c) When a job terminates, the Monitor calls the appropriate STOP I/O subroutine at Mainstream level which actually accomplishes the orderly shut down of I/O. d) For devices that can sf:op I/O hardwarewise, via an lOT, this plus steps 4, 5, 6, and 9 must be done. For devices that cannot stop I/O hardwarewise via an lOT, the following procedure can be used: 1) Raise to level fJ of the API and turn off the program interrupt to protect against getting interrupted in mid-decision. 2) Check the fR flag. If it is set, clear the software flag that will be tested in Step 8 and bypass Step 3. This is done because no I/O is under way if this handler is waiting on a tRw 7-17 3) Check the appropriate busy register (WORDl WORD2). If it is not set, no I/O is in progress; therefore, we do not have to wait tor its completion. If it is set, set a software flag that will be tested in Step 8. o~ 4) Clear the appropriate busy register (WORDl or WORD2). 5) Clear the appropriate .CLOSE register (WORD3 or WORD 4 ) • 6) Clear the tR flag (see Section 7.4.2). 7) Debreak (DBR) from API level ~ and turn on the program interrupt to allow servicing of hardware flags that may have or will occur. 8) If the appropriate busy register had been set, sit in a tight loop testing the software flag that was set in Step 3 above, I.E. LAC SSA JMP FLAG .-2 FLAG is the STOP I/O switch that must be cleared (SET=~) by the interrupt service routine on all interrupts that are final. Final means that no other flags will occur without more I/O being initiated via an lOT. The interrupt service routine must also make a decision whether or not to initiate more I/O. When the appropriate busy register (WORDl or WORD2) has been cleared, (Step 4) this should indicate that no new I/O should be started. (See the flow chart in Section 7.3). 9) Exit from the STOP I/O subroutine. 7-18 7.6 SEQUENTIAL MULTI-USER DEVICE HANDLER To accomplish the transition from a single-user device handler to a sequential multi-user device handler, the following procedures must be adhered to: a) The device handler mus"t be the "A" version; that is, LPA., MTA., etc. as the Background/ Foreground Moni tor Sys"tem will only allow "A" versions to be connected to both jobs simultaneously. Also, this shareability must be specified to the B/F system"at generation time. b) The SWAP subroutine (pointed to by WORD~ of the handler) must set both busy registers (WORDI and WORD2) to prevent the Foreground job from forcing itself in before the Background job has completed its operation. This is in addition to and prior to its normal duties as outlined in 7.2. c) There must be two unique stop I/O subroutines, one for Foreground (pointed to by WORD34) and one for Background (pointed to by WORD35) . Before executing the STOP I/O procedures, both subroutines must first determine if the I/O belongs to their respective job. This is done by testing WORDII, (~=Foreground I/O, I=Background I/O). They should do nothing if the other job is in control. In Step 2 of the stop I/O Routine, if the tR flag is set, the I/O busy routine in the Moniter (pointed to by .SCOM+52) must be called in CUHC the Foreground job is I/O bound on this d(~vice . d) Bacause the SWAP ~jubrou"tine sets both busy registc~rs (WORDI and WORD2), the CLEAR BUSY FLAG routine that sets up to have the flags cleared during protected e~it from the device handler must always set up to have both flags cleared. The STOP I/O subroutines should also clear both busy registers. 7-19 7.6.1 .WAITR When a sequential multi-user device handler is being used by the Background job, the Foreground job will become I/O bound if it attempts to use the same handler. The .WAITR monitor function affords both the Foreground job and the Background job a means of determining that the handler is available before requesting I/O from and to it. This feature is only useful when the job has other things which can be performed while it is waiting for the handler to free up. 7.7 DEVICE HANDLER LISTING A listing of the Background/Foreground line printer device handler (LPA) is given on pages 7-21 through 7-34 of this section. 7-2Q I L PAGE D A ~ .., • 1 I 70 65 0 1 706502 A 706566 706526 706546 706601 A· A A A 706602 706606 A A 706626 A 0000133 A A ., .• ,TITLE LPA. ED IT ~4 , .•. 2 DEC 69 ILPA.---8AC~GROUND/FOREGROUND MONITOR SYSTEM. ILPA.=LINE PRINTER (647) HANDLER, ICALLING SEQuENCE: ICAL+.OAT SLOT (9-17) IFUNCTION IN ARGUMENTS, WHERE N IS A FUNCTION OF FUNCTION. INORMAL RETURN LSDF=7e6501 ISKIP ON DONE FLAG -CONNECTED TO INTERRUPT LPCB=7e6502 ICLEAR DONE FLAG, CLEAR PRINTER BUFFER, ISET aONE FLAG ILOAD PR!NT[R RUFFER 1 CHAR (Ae 12-17) LPL1=706566 ILOAD PRINTER RUFFER 2 CHAR (AC 6-11. 12-17) LPL2=706526 ILOAD PRINTER BUFFER 3 CHAR (AC 0-5.6-11,12-8) LPLD=706546 ISKIP ON ERROR FLAG -NOT CONNECTED TO LSEF=706601 IINTERRUPT ICLEAR DONE FLAG LPCF=706602 ICLEAR DONE FLAG, SELECT PRINTER, LPPB=706606 IPRINT BUFFER, CLEAR BUFFER, SET ~ONE FLAG ILOAD SPACING BUFFER CAC 15-17), SPACE LPLS=706626 15ET DONE FLAG .MED=3 .SCOM=10~ kHHH:'0 ~'~HH"1 000e2 R R R 000~3 R 001304 000e5 R 00e~6 000?-7 00010 130011 00012 1301313 00014 00015 00016 00017 00020 00021 00022 e~0?3 R R R R R R R R R R R R R R R ~W024 R 0~025 R tL~026 R 00027 00030 ~"~I.3J 100525 R 001Zl00~ 7413040 7 4 0040 A A A A A A A 74004(]J 740040 740040 740040 740040 740040 740C!l40 740040 A A A A A A A A 600046 600523 600 Ci 12 600523 R R R R R 000000 000000 0000013 740~40 600'523 600V140 R R R 600'123 600512 600167 R R R ,~ ]~!'~~~ ,~ LPA. .GLOBL LPA. JMS SWAP o €I " '" LPSWCH XX LPWRD6 XX LPTOUT XX 1ST ART OF OATA REGISTERS. IFOR SINGLE-USER DEVICES, LPWD10 XX XX LV2WC XX LPSVAC XX LPWPC XX LPLBHP XX LP8CT XX LPWo17 XX lEND OF DATA REGISTERS. IBEGIN~"G OF FUNCTION DISPATCH TABLE. JMP LPIN JMP LPIGN JMP LPERR JMP LPIGN JMF LPIGN JMP LPCLOS JMF LPIGN JMP LPERR LWRITE JMP LPWRT LV2FC XX IFOREGROUND BUSY REGISTER. IBACKGROUND BUSY REGISTER IFOREGROUND .CLOSE REGISTER. IBACKGROUND .CLOSE REGISTER. lION OR IOF lION OR IOF OR DBR IRETURN POINTER IJMP FUNCTB ICAL OWNER (0=F,1=B) 1.0AT SLOT NUMBER IUNIT NUMBER (BITS 0-2) CAL ADDRESS (BITS 3-17) IW14 IW15 - LiNE BUFFER ADDRESS. IW16 IW17 I. I NIT I.OPER - IGNORED. I.SEEK - ERROR. I.ENTER - IGNORED. I.CLEAR - IGNORED. I.CLOSE I.MTAPE - IGNORED I.READ <.REALR) - ERROR I.WRITE <.REALW) I.WAIT (.WAITR) PROCESSED COMPLETELY BY CAL HANDL PAGE LPA. ........, I N N 2 Jr~P 0/032 00033 00034 00035 00036 00037 R R R 00040 00041 140:;'12 140434 750001 04043'3 R R A R R R ~0042 R R R 00043 00044 00045 R R R 00046 00047 00050 00051 R R R R 740v:4? A ~v0531. 0?0000 R R A ~HHH'0e A ~W~531 200M~2 R 600\764 R 750001 A 04\iW12 040e'31 2e0Mn R R R 00052 R 00053 00054 R 060016 220604 R 040~53 00055 R 00056 00057 00060 00061 00062 00063 00064 R R R R R R R 120053 706501 000350 200062 040053 600063 200605 0401H' R R R R A R R R R R R SCOM35 LP~ERO I.TRAN - ERROR 1ST OR AGE FOR .SCOM+35 IFGRD STOP 1/0 SUBROUTINE 18GRO STOP 1/0 SUBROUTINE IHA"'JOLER 10 LPERR xx LPSTP LPSTP o 171 LPTMPl I.CLOSE LPT ROUTINE DlM LV2WC LPCLOS O~M PGECNT CLA!CMA DAC LPIOAC LAC (LPLS LPSPCE JMP LPCOMD IINIT LPT ROUTINE. LPIN CLA!CMA DAC LV2WC DAC LV2FC LAC (64 DACo LPA.+16 LAC* <.SCOM+55 LPIN2 OAC LPIN2 JMS* LPIN2 LP57T LSDF LPINT LPWORD LAC • +2 DAC LPIN2 LPHRTB JMP .+1 LP3CHR LAC (LPCB LPCO~D DAC LPIOT ICOMMON EXIT SEQUENCE FOR CAL lAND INTERRUPT LEVEL ENTRIES. I I 00065 00066 00067 00070 00071 011'072 011'073 00074 00075 00076 00077 R R R R R R R R R R R 00100 R R 00101 00102 00103 00104. 00105 QhH06 00107 00110 00111 00112 R R R 100120 220606 040037 100571 200006 54016'5 741000 600100 120037 000007 000033 200033 060607 74017100 74\iH?00 21710f10 R R R R R R R R R R LPT.6 A A R LPFCLR LPBCLR R 0401V12 R 0401 (~3 20043'5 74004"0 200(}13 703304 R R A R A R R LPTIO R R A R R R LPNOR LPIOT JMS LAC* DAC JMS LAC SAO SKP JMP JMS* LPA.+7 SCOM35 LAC DAC* NOP LPNRDY (.SCOM+54 LPTMP1 LPRAIS LPWRD6 LPDSR LPT.6 LPTMPl IFORM FEED. IINITIALI2E #LINES/PAGE COUNTER ISET UP TO 00 1/0 DURING IPROTECTED EXIT. ISET UP FOR FORM FEED ON INTERRUPT FROM LPCB. 152 (DECIMAL)---RETURN ISTANDARD LINE BUFFER SItE TO USER. - ONCE ONLY CODE. I I.SETUP - THESE 6 REGISTERS ARE OVERLAYED. LEVEL ICHECK IF DEVICE READY. IADDRESS 10F CALL4 IRAISE TO API LEVEL 0, TURN PIc OFF. IINTERRUPT ICAL IPC SCOM35 <.SCOM+35 Nap (NOP LAC LPFCLR DAC LPBCLR OAC LPIOAC LAC XX LAC LPSVAC DSK IRESTORE IN INTERRUPT IHANDLER FLAG. INOP IF FGRD BUSY FLAG NOT TO BE CLEARED INOP IF BGRD BUSY FLAG NOT TO BE CLEARED IRESET ISWITCHES. lAC FOR lOT IIOF OR lOT IRESTORE AC. IFROM LEVEL 0. LPA. 3 0?121 00122 q 62:1271 R R R R R A A R 00123 R 2?\~11~ R 0e124 00125 R R 04v1163 2et1574 ;:' \:' 11_ 3 114 4'70'70"i ~,~, 4e07l~fl Z?115 V'Z116 0Z117 4e1011'" 4Q'10117 0v12~ e'70':'(A91 620?,~iJ7 7i'6f~1 e~126 ~:;"1011 ~ e0127 00130 1010131 62012(11 R R R R R XC'T lION lION LP~.+5 XCT LPA.+6 OR rOF OR lOF OR D8R XCT +. XC T • + 1. JMC". LPNRDY LPA.+7 0 LS~F JMP~ LPNRQY IDEVICE READY. LAC LPIOT ISAVE lOT. OAC LPIOTB LAC LP!OF IEFFECTIVELY DEFER lOT, D/lC LPIOT JMS LP~SG IINITIATE NOT READY REQUEST. Jt-1 P * LPNROY ISUSROUTINE TO C_lL A ROUTINE IN THE RESIDENT MONITOR TO IINITIATE A ~OT READY REQUEST. ICALLING SEQUENCE: I JMS LPMSG I RETURN wITH LPcTLR NON-0 IF REQUEST I HO~OREJ; 0 OTHERWISE. I . N \.N 00131 00132 021133 00135 100136 00137 100140 100141 010142 1010143 00144 1010145 010146 010146 vHH oi 6 00147 el01~el P 1O{,0Vl~0 R R q q 2010556 P R R R R R R R R R P R R 740201 A R A LPMSG ~ LAC 620131 R JMFo 1040556 200011 0410144 220611 1040037 1010571 1210037 7 4 10040 462 4 00 000000 R DAC LAC DAC R LAC~ R R R DAC JMS 1000NH' 2(110154 200154 A R R R R A. LPCTLR S~A:C~A JMS~ LPARG1 LPCTLR LPA.+11 LPARGl (.SCOM+64 LPTMPl LPRAIS LPTMPl XX R R R ITO API LEVEL 0, PIC OFF IGO TO tR QUEUER 10=FGRD, l=BGRD A .LOC 140556 1010576 620131 IPOINTER TO tR QUEUER .ASCII ILPI A .-1 ~ LprRA+20~0~0 LPFRA+20~~00 / 100151 010152 1010153 ItR FLAG. IAVOID DUPLICATE CALL. I.ERR 4 ALREADY REQUESTED. ISET tR IN PROGRESS FLAG. 10=FGRO, l=BGRD LPCTLR LPLOhR LPMSG R R R IUNIT NUMBER IRE TURN ADDRESS AT LEVEL 2 /SAME FOR RGRO ITERMINAL ERROR. REQUEST NOT HONORED IPIC ON, OE8REAK FROM LV 0 I ISUBROUTINE FNTEREO AT API LEVEL 2. PIC OFF. WHEN tR FROM KEYBOARD lIS ASSOCIATED WITH LINE PRINTER. I LPFRA e 00154 0?155 R 000vH:~(II A R 140')56 R rt~ ~01'56 R 7066011 A R R R R A LSEF ~Wl157 R 6N~16? 00160 00161 ..,0162 q R R 100131 600164 2lH,435 iHH63 R 740Vt4Vl JMP JMS JMP LPIOTB LAC XX LPCTLR ICLEAR tR FLAG .+3 LPf'4SG LPIOTB+l LPIOAC INOT REAnY CONnlTION INOT CORRECTED. lAC FOR lOT IEXECUTE SAVED lOT. PAGE 4 ~1 ~116 4 R f.'? 00166 R R 7i7J07:42 703344 J v1 16 7 (",1170 R R (~0171 R ~Q1172 R LPA. ~h~ 1 0"173 00174 ""0175 00176 00177 00200 100201 00202 ~~02(j13 00204 00205 00206 00207 00210 00211 R R R R R R R R R R R R 7'? kHlVl 1 A lil4~4')(Jl R R R R A R R R R R R R R A R A R R R 0410212 R 777775 040062 140060 R R A 6?01~4 200(1"114 540612 6010176 765007 600513 220 01 15 500A13 04(1H"14 140012 440015 44V'l015 140V131 777770 I 0 ~\ A LPOSR IWRITE LPWRT LPOK LPTSTR '-I I "" ..c:- 00212 0v.l213 00214 00215 00216 00217 00220 00221 00222 00223 00224 00225 1016226 160227 00230 ~0231 00232 00233 V'~234 00235 00236 00237 R R R R R R R R R R R R R R 777770 040016 200614 040304 440450 60023') 7770010 340014 0413014 741300 600301 22001t; eJ40~~55 440015 A R R R R R A R R A R R R R R R 2?VW1t; R R 040V'15A 440(i11t; R R 77777~ A R R R 0 4 16 4 50 777770040057 200056 R A R R R LPCONV R LPGET5 LPGET6 IFROM LEVEL 2 JMP". LPFRA LPT RDUTINE. CLA!CMA I IN! T REFORE CALL TO .LPCONV OAr LP'5Cf-, IDATA ~OOE SITS 15-17 LAC LPA.+14 SAn ( 2 JMP LPOK IIOPS ASC I I LAw 50~7 IILLEGAL DATA MODE. JMP LPER06+1 IWPC LAC* LPLSHP AND (3770100 DAC LPwPC O~M LV2WC IMOVE L. B. POINTER ( ! N USER'S IS~ LPLBHP IAREA) TO 1ST DATA WORD. 1St LPLBHP O~M LV2FC IIOPS ASCII MODE NO FORM CONTROL LAW 177710 IINITIALltE SWITCH AT LPCONV OAC LPCONV LA~ 17775 13 CHAR. COUNTER FOR 13/6 WORD. DAG LP3CHR DiM LPWORD ICLEAR DATA WORD. ITHIS ROUTINE GETS THE INEXT 7-BIT ASCII CHAR. IF ROM THE 5/7 LINE BUFFER (USER'S AREA) lIT RETURNS WITH IT RIGHT IJUSTIFIED IN AN OTHERWISE ICLEAR AC. ILP5CH MUST BE SET TO 1777777 BEFORE THE INITIAL ICALL TO LPCONV, LPWPC TO WPc INCLUDING HEADER, ILPLBHP TO 1ST DATA WORD IN L.B.(USER'S AREA) IINITIALI2ATION LAW 17770 IFOR DAC LP8CT ICONTROL CHAR. LAC (SAD LPCTAB ISCANNING. DAC LPVTST IS~ LP5CH. IMODIFIED FOR HOR. TAB. JMP LPGET5 ITHIS 5/7 PAIR NOT EXHAUSTED. LA~ 17000 TAO LPWPC ISKIP ON NON 0. DAC LPWPC SNA!SPA IWORD PAIRS EXHAUSTED JMP LPEND IPICK UP NEXT LAC* LPL8HP IWORO PAIR OAC LP57T IS~ LPLBHP LAC* LPLBHP OAC LP57T+1 ISl LPLBHP LAW 17773 IRESET CHAR. COUNTER IFOR THIS WORD PAIR DAC LPt;CH LAW 17770 DAC LP57T+2 IGO THROUGH SHIFT LOOP 7 1/2 TIMES .• LAC LP'57T+l n8f< LPA. PAG~ 5 ;. :124 0, L, vW2 4 1 R 242 V10243 R R (:2244 p VI~245 R 00246 R R R R R R R R R 74 Vi:' ~? 44 0v' =:; 7 6V10?4t:; 5(iH101 '5 6i'0?5:; 040V'5f. 2 C' .~ ,? 5"5 (,1.rl ~0247 002')0 00251 00252 00253 0.¥'l254 0.0255 0.0.256 00.25.7 00260 0121261 0.0.262 0.0.263 0.026 4 00265 1210266 HAL ~ ISf LP,)7T+2 R JMP R R R ANn (177 A 04,' 7::;') R R R 6eV?37 540fl::; 600.212 340.3,)7 R 741101? A R R R R 340616 R R 340.617 R 500621 7411~H~ A R R 240.?6(~ R 4409\62 R R R R R 6e0273 R' R R R 440012 040 4 35 20062? 600.064 742010 742010 7 4 2(i'lV' 51iH'l616 R R R R A A 34~~62~ ""'-.I I N V1 0.CiJ267 00270 0121271 00272 00273 00274 00275 00276 00.277 0031il0 R R R R R R R 003vH 003~2 00303 R 013304 00305 00306 00307 00310 00311 00312 00313 00314 0111315 R 00316 00317 00320 A 04006~ R R 600212 R R 200t-2~ R R 040012 60.0332 R R 740?4!i1 600316 440304 440016 600304 540446 600301 540447 A R R R R R R R R 600212 R R R R R R R 2e0~1r, R 04~H)31 R 600212 R R R R R R R 600.~21 LPCON1 R 6~0.30.4 IGOT CHARACTER. LPCONl DAC LP,)7T+1 LAC LP,)7T RAL DAC LP')7T JMP LPGET6 SAD (177 JMP LPCONV TAU LPM40 SPA JMP LPVTST TAD (777700 SPA. TAn ( 4\11 TAD (1 00 AND (77 XQR LPWORD 1S2 LP3CHR JMP LPCON3 JMF) R 74 .,? 1.0 . +, LPCON2 IDELETE RUBOUTS. 1-40 ICHAR. (.d0.---CONTROL CHAR. 1-1"H!1 1140-176 MAPPED INTO 100-136 16-BIT TRIMMED. ICONSTRUCT 3/6 WORD. 13 CHARAcTER COUNTER. IDATA. WORD COMPLETE. IINDEX DATA WORD COUNT 1St: LV2WC OAC LPIOAC LAC (LPLO JMP LPCOMD ISHIFT CHARS. LEFT RTL LPCON3 RTL RTL lIN CASE LINK WAS ON. AND (777700 OAC LPWORD IGET NEXT CHAR. JMP LPCONV lEND OF CHARACTER STRING OR CARR. RETURN ( lOPS ASCII) LPEND LAC (47 OAC LV2WC IpAD LAST WORD WITH SPACES. JMP LPHT3 CHAR. IN AC. ICONTROL CHARACTER ROUTINE. XX IS AD LPCTAB-SAD LPCTAB+7 LPVTST IVERTICAL FORM CONTROL CHAR, JMP LPFORM ISAO LPCTAB+N-SAD LPCTAB+N+l IS~ LPVTST 1St: LP8cT JMP LPVTST SAO LPCTAB+l?1 ICARRIAGE RETURN. JMP LPEND SAD LPCTAB+l1 IHORI~ONTAL TAB. JMP LPI-IT IDELETE MEANINGLESS CHAR. JMP LPCONV ICO~PUTE FORt-' CONTROL CODE A.NO PLACE lIN LV2FC LPFORM LAC LP8CT 1 ... ,3. H. IN D. B. OAC LV2FC JMP LPCONV ICONVERT HOR. TAB TO N SPACES, WHERE N IS THE NUMBER - LPA. 003:;Jl 0(11322 0032:; ~0324 ~03?5 00326 00327 00330 00331 00332 00333 Vl0334 00335 00336 00337 00340 00341 00342 ~ I tv en PAGE 6 R 2?0V,1? R R 744:i'1~ A R R 340r1? R 340t'24 R R 34006? R R R R 740300600326 34042'5 0 4 0(7;61 200626 0 4 0212 761004'" 440061 600263 77777111 040212 600212 R R R R R R R R R R R 00343 00344 00345 00346 00347 00350 00351 00352 00353 00354 00355 00356 00357 00360 00361 00362 00363 00364 00365 12!12!366 00367 00370 00371 1210372 00373 00374 00375 00376 1210377 R R R R R R R R R R R 0040~1 1210401 R p 00402 00403 R 1210404 R R R R R R R R R R R R R R R R R R R R 340f,2S 04QHH3 220~36 A R R R R R A R R A R R R R 040007 200372 600361 600343 R 04~W13 R R R R A A A R R R R 200350 040007 140350 700314 750100 777740 340372 040005 220607 040033 750001 060607 2~0350 7412!21210 160036 706602 700042 200165 040006 140555 200001 340VlC1!? 74120V1 R R R A R R A R A A R R R R R A 6004S1 R 200012 741200, 600451 R A R INECrSSARY T (I HAVE THE NEXi CHAR. I r--. COLUr--~ 11.21,31.41.51 ...• 111. LPHT IOATA ~ORO GOU~T LAC LV?WC IX2 CLL!RAL IX3 TAU LV2WC TAn ( 4 TAn LP3CHR ICURRE/lJT ",ORO CHAR, COUNTER. TAn (777766 1-1~ (DECIMAL) SMA!StA JMP • -2 TAD LPOVRP OAC LPHRTB LPHT3 LAG (JMP LPHT2 nAC LPCC~~V LAW 40 LPHT2 1St: LPHRTB JMP LPCON2 LAW 17770 DAC LPCONV JMP LPCONV IINTERRUPT HANDLER. DAG LPSVAC ISAVE AC LPPIC LAC* LPtERO ISAVE PC, L, EM, MP DAC LPTOUT LAC LPION JMP LPSTON IPIC ENTRY. JMP LPPIC LPINT IAPI ENTRY, SAVE AC. DAC LPSVAC IPC, L, EM, MP LAC LPINT ·DAC LPTOUT DtH LPINT 10=API ENTRY IREAt) 1/0 STATUS 10RS SMA!CLA IPIC OFF -- SUlLO JOF LPM40 LAW 17740 /PIC ON -- ION TAD LPION LPSTON OAC LPSWCH LAC* <.SCOM+35 OAC SCOM35 CLA!CMA OAC* <.SCOM+35 LPINT LAC StA IPIC ENTRY LPtERO DtM* ICLEAR LPT DONE FLAG LPCF ION IENABLE PIC LPION LAC LPOBR DAC LPr4RD6 ICLEAR STOP 1/0 SWITCH OtM LPSTPS LAC LPA.+1 TAD LPA.+2 SNA 100 NOT CONTINUE I/O IF IBOTH 8USY FLAGS ARE 0 LPEMPT JMP IINITIATE MORE OUTPUT IF APPROPRIATE. LAC LV2WC LPTOK SNA JMP LPEMPT LPA. PAGE 7 4f115 R 7411(i1? A V'\" 4 fi'!6 R 6(~041? R JMP LPCLSE ~q407 F 540A27 R SAil 0\'1410 00411 00412 e0413 00414 00.4:15 00416 R 60041~ R JMP LPSPPR R 600.?07 R R R 14k~01? R R 0~417 00420 00421 00422 .00423 00424 00425 100426 :~ 77772f: A 34\434 74(:?01 R R R 21012P31 5410425 R 60.0430 R 500630 R R 540630 140434 R 040435 777776 R A 1040.031 60.0044 R R R 14001? 440434 2010('31 R R R R R R A R R R 100427 R IOl1430 00431 010432 100433 R R R 60.0064 R R 010434 R 0000.100 A 00435 R 1010436 R 010437 R R R 777752 777761 777762 777753 A A R 777763 A R 010440 010441 00442 100443 1010444 1010445 1010446 1010447 10104510 R R A A R 777764 77776rJ1 777754 777755 777751 R 100100.100. A A A A A A 1010451 R 11010476 R 220A3? 040.037 R R 100571 R R R R R 004'12 R 100453 00454 00455 010456 R R R R 12100.37 00457 R 11010576 2010633 R R SPA (50 IBUFFER FULL, JMP LPTSTR LV?WC lIS PAGE FULL? 177106 TAO PGECNT IYES - FORM FEED StA!CMA LAC LV2FC SAD LPOVRP IOVERPRINT. JMP LPOVER AND (7 SAO (7 IINIT #LINES/PAGE CNT DiM PGECNT IVERT. SPACING BEFORE PRINTING OAC LPyOAC LPVMOV LAl-i 17776 LPOVRP OAC LV2FC JMP LPSPCE IWORD COUNT EXHAUSTED. LPOVER DtM LV~WC IINCREMENT #LINES/PAGE CNT 1St PGECNT IPRINT BUFFER. LAC (LPPB JMP LPCOMD o IINITIALltED TO 0 WHEN AT TOP OF FORM PGEC"lT I1NCREMENTED BY 1 UNTIL 58(1~) LINES I HAVE BEEN OUTPUT OR FORM FEED IS ENCOUNTERED LPIOAC o ITABLE OF ASCII CONTROL CHAR'S'SCANNEO BY LPT IN lOPS ASCI I MODE 777752 ILF-EVERY LINE 0 ---12 LPCTAB ---21 777761 IOC1-EVERY 2ND LINE 1 ---22 777762 IDC2-EVERY 3RD LINE 2 ---13 777753 IVT-EVERY 6TH LINE 3 ---23 777763 IDC3-EVERY 10TH LINE 4 ---24 777764 IDC4-EVERY 20TH LINE 5 777760 IDLE-OVER PRINT 6 ---2~ ---14 777754 IFF-TOP ON NEXT FORM 7 777755 ICR ---15 777751 IHT ---11 LP5CH ~ 15/7 COUNTER ISET UP SWITCH IN EXIT ROUTINE TO ICLEAR FOREGROUND OR BACKGROUND BUSY REGISTER AS IA FUNCTION OF WORD11, AND PLACE 10F IN LPT IIOT REGISTER SO THAT NO ·NEW 1/0 WILL BE STARTED. LPEMPT JMS CLFLAG lIS THiS DEVICE INVOLVED IN 1/0 BUSY SITUATION. IADDRESS OF LPT31 LAC* (.SCOM+52 IIIO BUSY TESTER nAC LPTI1Pl IRAISE TO LEVEL 0 AND TURN OFF PIC JMS LPRA!S LAC (LPA. JMS* LPTMPl JMS LPLOWR LPCLSE LPSPPR Dttl.l LAW I IROUTINE TO DETERMINE 1F THIS 1/0 tWAS A REAL TIME REQUEST OR NOT. LPA. 8 LAC R R R JMP LAC SA.G SKP JMP 0(~463 R 0~464 R R 54W~1111 R R 600065 220635 040037 Hi0"571 0~473 0V'474 00475 I 60QlVti"5 2Vi0f.,4 741?~(i' 465 0;'Q66 00467 0.0470 00471 0,0472 N 00 S:\J A F P (i1,,~ """-J A t?461 0(11462 00476 00.477 00500 00501 00502 00503 00504 00505 005~6 00507 005113 0~511 p R R R R R 74H~9J(i\ 200~17 120037 100576 6~~0.65 A R R R R R R R R P 000~100 R R R R R R R R R R R 200.574 1340110 A R R 200CJ.11 R 740200 613135137 21313543 1340102 620.476 2013544 1340103 620476 R R R R R R A R IF REAL TIME. LPW017 INOW LPNOR (JMP UIR I TE INOT .REALW LPW010 IJMP FUNCTION /.REALw INOT REAL TIME REQUEST. IAOOR. OF IREAL TIME PROCESSOR g LPNOR <.SCOM+51 OAC LPTMPl JMS LPRAIS LAC LPWD17 JMS* LPTMPl J~lS LPLOWR JMP LPNOR ISUBROUTINE TO SET UP CLEARING OF THE IAPPROPRIATE BUSY FLAG (AT PROTECTED EXIT TIME) lAND NULL (IOF) LINE PRINTER lOT IREGISTER. CLFLAG 0. IIOF LPIOF LAC LPIOT OAC IWORO 11 OF LIVE REGS. LAC LPA.+11 /0=FGRO, l=BGRD S2A JMP .+4 IFOREGROUND LPFBSY LAC LPFCLR OAC CLFLAG JMP* IBACKGROUND LPBBSY LAC LPBCLR DAC JMP* CLFLAG LAC~ / R 00516 00.517 00520 130521 00522 R R 000512 765006 13413037 2013013 0413566 2130011 7413200 2013636 2413037 11313557 00523 00524 R R 1130476 60006"5 005?5 R ~00~00 A 0~526 R R 400V0"5 R A 00512 00513 130514 ~0515 R R R R R R R LPERR=. LPER06 IILLEGAL FUNCTIONS (3131313 IBGRO R LAC 513136 LPTMPl LPSVAC LPTAUX LPA.+11 A SlA LAC XOR JMS LPTMPl LPTERR A R R R R R R LA~ OAC LAC OAG R R I 00.527 00530 R 70330.4 6213525 00531 R 0.013000 R A LPIGN JMS CLFLAG JMP LPNOR ITHIS SUBROUTINE IS EXECUTED BY THE ICAL HANDLER VIA WORD 0 OF THIS I/O IHANOLER JUST PRIOR TO GIVING CONTROL ITO THE HANDLER AT THE APPROPRIATE IENTRY IN THF FU~CTION DISPATCH TA8LE. SWAP ~ XCT LPA.+5 ISTOP 1/0 SURROUTINE LPSTP ~ lION OR IOF IFROM LEVEL 0 OB~ .)MP * ICLEAR BUSY FLAG SWAP LPA. ,/,,~5~2 VJ?33 fi~534 0:1535 ~jl~536 0~537 0C~54Vl 00541 0Vl542 00543 00544 ~H154 5 00546 00547 00550 00551 005')2 00553 00554 00555 00556 PAGE 9 R R lH~C:;;71 ~ .)MS 2(7;\I!')5A ~ LAC StA:CLA JMP LAC TAr SlA!CLA CMA OAC OlM OtM OtM OlM alM jMS LAC StA jMP jMP* 0 w R R 7'50?'i'? A 6'?!0')4? R R R R R R R 3407;0? 75J20V' R R R R R R R R R R R 200001 74 l CJ,0:1 R A A 04 55') R 14~i 'Hoi R 140002 140 0 03 140004 140556 10!0576 200555 740200 600'551 620531 000000 000000 R R LPCLER LPFBSY LP88SY R R R R A R R A A LPSTPS LPCTLR I I 'J I N 1..0 00557 00560 00561 00562 00563 00564 00565 00566 00567 00570 R R R R R R R R R R 000~00 040564 220637 040037 100571 740040 120037 740040 100576 620557 A R R R R A R A R R LPRAIS LPCTLR LPCLER LPA.+1 LPA.+2 LPSTPS LPA.+1 LPA.+2 LPA.+3 LPA.+4 LPCTLR LPLOWR LPSTPS .-2 LPSTP '" R 0~575 00576 '00577 00600 0060.1 R 000000 R R R 200640 705504 7VHHl02 620571 R R vH~0~eJeJ A R 703304 700042 620576 A R R A A R A 706(:.2f> A *L IT A *L IT 0vHH'64 00604 ~0605 R 706')02 006Q'6 R 000154 00607 R 00013~ 0~603 R A 0e100~~ R R R 0060~ A 0001')~ *LIT -L IT A *LIT A -LIT A A IIF 1/ 0 IS UNOrR WAY SET ISTOP SwITCH. ICLEAR 1/0 BUSY SWITCHES. ICLEAR CLOSE SWITCHES. /'R FLAG IALLOW INTERRUPTS. IWAIT UNTILL I/O IS DONE. /STOP I/O SWITCH, /,R IN PROGRESS IF NON-0. ISUBROUTINE TO CAUSE OUTPUTTING OF ERROR MESSAGE. LPTERR 0 /LAW CODE LPTLAW OAe <.SCOM+66 LAC* LPTMPl OAC IRAISE TO API LEVEL 0 AND TURN OF PIC. JMS LPRAIS ILAW CODE XX LPTLAW jMS* LPTMPl XX LPTAUX JMS LPLOWR jMP* LPTERR I 00571 00572 00573 00574 IPROTECT 100 "JOT HANG IF IfR IN PROGRESS. ISUBROUTINE TO RJ\ISE TO API LEVEL 0 lAND TUR~ OFF PIC. LPRAIS 0 (400200 LAC ISA LPIOF IOF jMP* LPRAIS ISUBROUTINE TO DEBREAK FROM API LEVEL 0 lAND TURN ON PIC. LPLOwR 0 OBK ION LPLOWR JMP* .END LPA. PAGE 0'1610 R 740·~?'0 0~611 R ~~ .~ 61 '2 vH613 R R 0?0:lf:l4 000V02 IiL"'614 R 0'~615 R R t~616 """'J I \.N 0 10 011617 00620 00.621 00622 00623 0vl624 00625 00626 00627 00630 00631 00632 00633 00634 00.635 00636 00.637 00640 R R R R R R R R R R R R R R R R R R 377000 5421 4 36 000.177 77770,11 000c:'!40 000100 000077 706546 00.017>47 1000((1;;'4 777766 600335 0000'50 000007 706606 000152 000000 600030 000151 003000 000166 400:?00 A *LIT A *LIT A *LIT A *LIT R *LIT A *LIT A *LIT A *LIT A *LIT A *LIT A *LIT A *LIT A *LIT 1. *LIT R *LIT A *L IT A *LIT A *LIT A *LIT R *LIT R *LIT A *LIT A *LIT A *LIT A *LIT NO ERROR LINES LPA. '-J I ~ ~ PAGE 11 p CLC:-L~~: ~Q'476 LP aRC>. LPA. LPR8S' ;')0144 R ~~~V1~ R 0V'!544 R LP8CL~ ?'V"H13 706502 R LPCB LPCF LPCLER LPCLOS LPCLSE LPCOM[) LPCONV· LPCO!'-41 LPCON2 LPCON3 LPCTAB LPCTLR LPOSR LPEMPT LPEND LPERR LPER06 LPF8SY LPFCLR LPFORM. LPFRA LPGET5 LPGET6 LPHRTB LPHT LPHT2 LPHT3 LPIGN LPIN LPINT LPIN2 LPIOAC LPIOF LPION LPIOT LPIOTB LPLBHP LPLO LPLOwR LPLS LPL1 LPL2 LPMSG LPM4e LPNOR LPNROY LPOK LPOVER LPOVRP LPPB A 7066V'2 A 00542 0""040 R 0~412 R 00064 00212 00252 00263 00273 R R ~'le4~6 R R R R R 0~5'56 R 0~165 R R 00451 003V'1 000512 00512 00543 00102 00316 00154 00235 00237 00061 00321 00335 00332 00523 000 4 6 00350 00053 00435 00574 00372 00110 00163 00015 706546 00576 706626 706566 706526 00131 00357 0~065 00120 00176 0e430 00425 706606 R R R R R R R R R R R R R R R R R R R R R R R A R A A A R R R R R R R A """-J I \.N N LPA. PAGE LPPIC LPRAIS LPSPCE LPSPPR LPSTOI\J LPSTP LPSTPS LPSVAC LPSWCH LPTAUX LPTERR LPTIO LPTLAW LPTMP1 LPTOK LPTOUT LPTSTR LPT.6 LPT31 LPVMOV LPVTST LPWD10 LPWD17 LPWORD LPWPC LPWRD6 LPWRT LPZ!ERO LP3CHR LP5CH LP57T LP8CT LSDF LSEF LV2FC LV2WC LWRITE PGECNT SCOM35 SWAP .MED .SCOM 00343 00571 00044 00413 00361 00531 00555 00013 00005 00566 00557 00070 00564 00037 ,00402 00007 00207 00100 00452 00424 00304 00010 00017 00060 00014 00006 00167 0f(1036 00062 00450 00055 00016 706501 706601 00031 00012 00030 00434 00033 00525 000003 000100 12 ~ R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R R A A R R R R R R A A LPA. PAG~ LPA. ,MEO 01'2>71 ~ 00?l7~ A .-< LPSWC~1 0ee?5 LPwR06 LPTOUT 0re26 0ee(7 0?312 0??12 LPW01~ LV2WC LPSVAC LPWPC LPLBHP LP8CT LPW017 LWRITE LV2FC SCOM35 ""-J I Vol '-."4 ~ 3 q Q tWl! 3 R q q 00014 0NH5 R R ~0e16 R 0~~17 R 000:;2 R Ii 1!'0031 LP~ERO 00036 LPTMPl LPCLOS LPSPCE LPIN LPIN2 LP57T LPWORO LPHRTB LP3CHR LPCOMO LPNOR LPTIO LPT.6 .SCOM LPFCLR LPBCLR LPIOT LPNROY LPMSG LPARG1 LPFRA LPIOTB LP08R LPWRT LPOK LPTSTR LPCONV LPGET5 LPGET6 LPCONl LPCON2 LPCON3 LPENO LPVTST LPFORM LPHT LPHT3 LPHT2 LPPIC 01!'037 R R R 00.043 R 00033 00044 q 00046 00053 000'55 00060 00061 R p 0~062 R R R 00064 00065 00070 00100 000100 00H".2 00103 00110 00120 00131 00144 00154 00163 R R R R R A R R R p R R R q ~0165 R 00167 R 0~176 R 00207 00212 00235 00237 00252 0PJ2f3 00273 R R 003el 0~304 ee316 00321 00332 00335 00343 R R R p R R R R R R R R """-J I \JJ ...t::" LPA. PAGE: LPI"r LP"'4'? LPSTO\ LPION LPTOK LPCLSE LPSpPR LPVMOV LPOVRP LPOVER PGECNT LPIOAC LPCTA8 LP5CH LPEMPT LPT31 CLFLAG LPERR LPER06 LPIGN SWAP LPSTP LPCLER LPFBSY LP88SY LPSTPS LPCTLR LPTERR LPTLAW LPTAUX LPRAIS LPIOF LPLOWR LSDF LPCB LPL2 LPLD LPL1 LSEF LPCF LPPB LPLS 003'50 00357 00361 0e372 14 R R R R 00402 00412 00413 00424 00425 00430 00434 R 0~435 R R R 00436 00450 00451 00452 00476 ~00512 00512 00523 00525 00531 00542 0~543 00544 00555 00556 00557 00564 00566 00571 00574 00576 706501 706502 706526 706546 706566 706601 R R R R R R R R R R R R R R R R R R R R R R R R R A A A A A 7066~2 A A 706606 706626 A A SECTION 8 SYSTEM GENERATION The system utility program .SGEN, used to tailor a Background/Foreground tape to operate in different hardware configurations, is not available at this time. 8-1 APPENDIX I .SCOM REGISTERS The function of the .SCOM (§ystem COMmunication) Registers is to provide, among the various program elements of the Background/Foreground Monitor System, an easily accessible set of registers which contain communication pointers, data words, and program flags indicating the state of the system. The .SCOM table begins at location lfiYfiY8 within the Resident Monitor. Location lfiYfiY is referred to as .SCOM or .SCOM + • and the (N+ l)th register is referred to as .SCOM + N. Each .SCOM register has a special meaning and format. present, there are about 115 8 such registers. At Slots at the end will be allotted for future expansion as needed. REGISTER DEFINITIONS: The following list indicates the contents of each .SCOM register. Those which are fixed at assembly or system generation t:ime and never changed are marked by (F). Some .SCOM registers must have a Foreground value and a Background value. Therefore, their contents must be swapped from one to the other, depending upon which job has control. They are flagged by (S). have been reserved for future software. Some .SCOM registers If their contents (format) a:e as yet unspecified, they will be flagged with (U) • .SCOM + fiY (F) Pointer to the highest register in core (37777, 57777, or 77777). I-I .SCOM + 1 (a) Address just above the Resident Monitor when the Non-resident Monitor has been loaded for Foreground. (b) Address just above the Foreground job when the Resident Monitor has loaded the Nonresident Monitor in the Background. If the system program PIP is called, this will be the first location of its .DEV table. (c) For DDT in the Background this points to the start of its symbol table. . SCOM + 2 (S) (a) Same as (a) for .SCOM + 1 . (b) Normally used by user and system programs to indicate the first (lowest) location in free core. (c) For DDT in the Background this points to the first location after the symbol table, which is also the first Location of free core. .SCOM + 3 (S) .SCOM + 4 Normally used by user and svsteIl! prog.rams ___ _ to indicate the last (highest) locatIOn--fn free core. For the Foreground, this is also the highest location allocated to the Foreground job. Bits indicate machine configuration: (F) (F) (F) (U) (F) (F) Bit ~l Bit 1 Bits 2-5 Bit 6 2 fJ=NO API; I=API fJ=No EAE i l=EAE fJ (Reserved and unused) ~=7-channel MAGtape 1=9-channel MAGtape Bit 7 ~=Bank Mode (PDP-9) Bits 8-13 Unassigned Bit 14 l=Background/Foreground Bits 15-17 Drum size for RM~9= ~=No drum 1=32K (RM,0'9A) 2=6SK (RM,09B) 3=13IK(RM,eJ9C) 4=262K(RM~9D) 5=S24K(RM,09E} lThe presence or lack of EAE is determined dynamically by the Resident Monitor. 27/9-channel default operation may be set by Foreground Keyboard command. 1-2 .SCOM + 5 (a) Initially this points to RESINT, the address of the initialization section in RESMON. The paper tape bootstrap loader transfers control indirectly through this location. (b) When calling the System Loader to bring in a system program, the Non-resident Monitor stores here the code number of the program to be loaded. (c) When running a system program, its start address is stored here. (a) When the Non-resident Monitor calls the System Loader to load user programs, bits ~ - 2 indicate which command was ,given to the Monitor: .SCOM + 6 $LOAD, $GLOAO, $DOT, or $DDTNS. Bit ~ 1 if $OOT or $DDTNS (DDT load) Bit 1 = ~ if $LOADi Bit 1 = 1 if $GLOAD Bit 2 = ~ if $DDTi Bit 2 = 1 if $DDTNS (b) When the user programs have been loaded, the start address of the main program is stored here. The load command code bits (~-2) remain as in (a). The interrupted PC plus L,XM,MP are saved here for DDT in the Background when CTRL T has been typed . .SCOM + 7 . SCOM + l~ (S) The interrupted PC plus L,XM,MP are saved here after a. NORMAL CTRL P has been typed and honored . . SCOM + 11 (F) Bootstrap restart instruction . . SCOM + 12 (F) Pointer to the 339 Pushdown list within the Resident Monitor. 1-3 ·SCOM + 1) (F) Pointer to the .IOIN 1 table in the Resident Monitor. .SCOM + 14 (F) Pointer to the .MUD 2 table in the Resident Monitor. . SCOM + 15 (F) Pointer to the .BFTAB 3 table in RESMON . .SCOM + 16 (F) Pointer to .DATF 4 , Foreground .DAT slot ~, in the Resident Monitor. .SCOM + 1'7 (F) Pointer to .DATB 4 , Background .DAT slot ~, in the Resident Monitor. . SCaM + 2fJ (U) Reserved for PDP-15 . . SCOM + 21 MAGtape status register . . SCOM + 22 Reserved for MAGtape handler • .SCOM + 23 (F) Twos complement size of the Monitor's transfer vector table (used by system generator) . . SCOM + 24 (F) Pointer to the Monitor's transfer vector table (used by System Generator). 1.IOIN is the table which indicates which I/O devices are in core, which units on each device are spoken for, and which job (Background or Foreground) owns them. 2. MUD is a table listing all available multi-unit device handlers, with pertinent information about those handlers. 3. BFTAB is a buffer table containing pointers to and the sizes of all external I/O buffers that were set up by the loaders. 4.DATF is the Device ~ssignment Table for Foreground . . DATB is the Device ~ssignment Table for ~ackground. 1-4 (a) Prior to loading the Foreground job, the amount of free core requested by the $FCORE command is stored here. If no $FCORE command is given, the default assumption is 2 registers. ·SCOM + 25 (b) After the Foreground job has been loaded, this register contains a pointer to the register immediately above the Foreground core area . . SCOM + 26 (S) Contains ~ if Foreground is in control and 1 if Background is in control . . SCOM + 27 (F) Pointer to lOT Skip literal table in the Monitor (used by System Generator) . . SCOM + 3.0 (F) Pointer to PI Skip Chain. .SCOM + 31 (a) The Software Memory Protect Bound set from .SCOM + 25 after the System Loader has loaded the Foreground job. (b) Set to point just above the Background I/O handlers and I/O buffers after the Background job has been loaded. .SCOM + 32 (a) Pointer to the Hardware Memory Protect Bound (or where it should be set). Contents (. SCaM + 32) 3 contents (. SCaM + 31). . SCOM + 33 Background Program Counter, including L,XM,MP . .SCOM + 34 (F) Address of the resident teletype handler .SCOM + 35 Interrupt Service Flag. Non-~ indicates that control is in some interrupt service routine . . SCOM + 36 (F) (TTA). Bits to tell the teletype handler which units are model 33 (specific bit = ~) and which model 35 (specific bit = 1). Bit ~ corresponds to unit ~; bit 1 to unit 1; and so on. 1-5 .SCOM + 37 (F) . SCOM + 4~ . SCOM + 41 Pointer to CALER. Used to detect attempt to re-enter CAL handler and to trap CAL* instructions . CAL Flag. Non-~ if control is in the CAL handler (indication necessary for interrupt servicing) . "Who's running in the Background" Flag . Bit ~ = 1 if a Loader is running. Bits 1-17: 17777 ~ 1 2 3 4 5 6 7 10 11 12 13 14 15 Non-resident Monitor user program or DDT EDIT MACRO PIP F4 SGEN DUMP UPDATE CONV MACROA F4A EXECUTE CHAIN PATCH . SCOM + 42 Level 5 (API, Foreground) busy register . Zero indicates level 5 non-busy. Non-zero indicates that Foreground level 5 is idle waiting for some I/O to complete. Set non-~ with the initial address of the device handler doing the I/O. If the device is teletype, the unit number + 4~~~~~ is stored here instead . . SCOM + 43 Same as .SCOM + 42 for Foreground level 6 . . SCOM + 44 Same as .SCOM + 42 for Foreground level 7 . . SCOM + 45 Same as .SCOM + 42 for Foreground Mainstream level. I-6 ·SCOM + 46 Foreground level 5 I/O satisfied flag. Zero indicates that level 5, which was I/O bound, can be started up again . . SCOM + 47 Same as .SCOM + 46 for level 6. . SCOM + 5.0 Same as .SCOM + 46 for level 7 . . SCOM + 51 (F) Pointer to REALTPI in the Resident Monitor . . SCOM + 52 (F) Pointer to IOBUSy 2 in the Resident Monitor . . SCOM + 53 (F) Pointer to LV4 Q 3 in the Resident Monitor . . SCOM + 54 (F) Pointer to CALL4 4 in the Resident Monitor . . SCOM + 55 (F) Pointer to .SETUp s in the Resident Monitor . . SCOM + 56 (F) Pointer to GETBUF 6 in the Resident Monitor . lREALTP is a subroutine to process real-time requests. 2 IOB USY is a subroutine to check for I/O busy termination. 3 LV 4Q queue is a list of I/O handlers which are waiting to complete their interrupt service processing at API level 4. 4CALL4 is a subroutine to initiate an API level 4 request. 5. SETUP is the routine initially called by all I/O handlers to set up skips in the PI skip chain or API channel registers. 6GETBUF is a routine called by the I/O handlers which assigns buffer areas to the handlers via .BFTAB. 1-7 .scaM + 57 If non-~, a pointer to the entry point of the last Mainstream Foreground real-time subroutine in the chain of subroutines to be run when Foreground Mainstream gets control . . SCOM + 6,0 Pointer to the entry point + 1 of the first subroutine in the chain of Foreground Mainstream real-time routines to be run when Foreground Mainstream gets control. . SCOM + 61 Same as .SCaM + 57 for Background . . SCOM + 62 Same as .SCaM + for Background . .scaM + 63 Argument for API instruction ISA when interrupts at API software levels are to be requested. . SCOM + 64 (F) .scaM + 65 . SCOM + 66 6~ Pointer to CR.QR l in the Resident Monitor . Set non-~, while a Foreground user program is running, to indicate that the resident buffer may not be used by the Foreground. The resident buffer must be available to the Background, which presumably changes jobs more often, for U:3e by the Monitor and the Loaders. (F) Pointer to ERRORQ2 in the Resident Monitor . .SCOM + 67 (F) Pointer to Foreground control character table in TTA . . SCOM + 7,0 (F) Pointer to Background control character table in TTA. lCR.QR is a routine called by I/O handlers to initiate a devicenot-ready request. 2ERRORQ is a routine called to enter information in the Foreground and/or Background error queue. and to set the error flags in .SCOM + 71. 1-8 .SCOM + 71 .SCOM + 72 Error flag. The following conditions exist if the respective bit = 1: ~ - Background error 1 - Foreground error 2 - Background terminal error 3 - Foreground terminal error (F) Pointer to the Foreground error processing subroutine plus the 2~~0J0 bit to turn on extend memory after a DBR . . SCOM + 73 (F) Same as .SCOM + 72 for Background error subroutine . . SCOM + 74 Saved argument for Foreground error routine ISA instruc·tion . . SCOM + 75 (F) Contains JMS IGNORE, a call to a dummy interrupt service routine, used during error processing . . SCOM + 76 (F) Twos comple:ment count of the number of teletypes on the machine. .SCOM + 77 $SHARE Flag (to allow Background to share Foreground I/O bulk storage units. Nonzero indicates that SH~RING is allowed. . SCOM + 100 (F) Pointer to ENTERQl in the Resident Monitor . Will contain ~, instead, if ENTERQ routine not assembled into the Monitor . . SCOM + 101 If set non-zero by the Foreground keyboard command, $MPOFF, Background enters EXEC mode. The memory protect boundary register is zeroed to allow Background to modify and transfer to any location in core. Background IOT's will still trap to the Monitor but the IOTws will be executed. lENTERQ is a subroutine which makes entries in the API queue. 1-9 1~2 (U) Unused .SCOM + 1~3 (U) Unused · SCOM + 1~4 Unused · ;;COM + (U) . SCOM + 1.05 (F) Twos complement size of the PI skip chain . (Used by System Generator) . · SCOM + 1.06 (F) Pointer to the register immediately above the Resident Monitor (set by the Non-resident Monitor after it has built the .MUD table) . .SCOM + 1.07 .SCOM + 11.0 . SCOM + 111 Used to store the file directory entry block of the XCT file to be EXECUTE'd in the Foregr?und . .SCOM + 112 .SCOM + 113 . SCOM + 114 Used to store the file directory entry block of the XCT file to be EXECUTE'd in the Background . .SCOM + 115 (F) Maximum number of teletypes allowed, which is a function of an assembly parameter in the Monitor (Used by System Generator). 1-10 APPENDIX II ERRORS ERROR HANDLING IN BACKGROUND/FOREGROUND The processing of errors detected by the Resident Monitor, I/O handlers, the Linking Loader and the System Loader has l>(~(~n chanqcd in the Background/Foreqround Sys tern from the way they are treated in the Keyboard and I/O Monitor Systems. The most significant chang'e is the introduction of terminal and non-terminal errors. A terminal error stops execution of the job associated with the error. This causes all I/O handlers assigned to that job to be called to stop I/O that may be in progress and all Monitor queues to be cleared of entries for that job (Background, Foreground or both). A non-terminal error is one that does not necessarily warrant aborting the operation of the offending job. A non- terminal error message is entered into a queue for the appropriate job and is printed on the appropriate control teletype when that unit is free. While the printing of non-terminal error messages is pending or in progress, operation of the offending job is suspended. Thi~j restriction does not apply to I/O handlers, which may continue interrupt processing. The format for error messages generated by the Resident Monitor, I/O handlers and the Loaders is: .ERR HNN XXXXXX 11-1 where NNN = error code XXXXXX = auxiliary information These errors are tabulated on pages 2-4,-5,-6 and-7. Errors detected by the FORTRAN Object Time System (OTS) are formatted as follows: .OTS NN where NN error code OTS errors are listed on page 2-8. CONTINUATION AFTER ERROR .OTS errors are terminal errors. After OTS has printed the error message, it exits to the Monitor. Therefore, after an .OTS error the user does not have the option of restarting his program. Non-terminal .ERR errors do not terminate the operation of user programs. Continuation, following the printing of the error message, is automatic. Terminal .ERR errors terminate the operation of user programs. After the printing of the error message, the user has the option of typing CTRL P (to restart his program at the CTRL P restart address), CTRL T (to return to DDT), CTRL Q (to take a dump of memory), or CTRL C (to return to the Monitor to 11-2 load another job). If the error occurred while control was in the Non-resident Monitor or in a Loader, the user does not have the options indicated above. The Monitor will automatically be reloaded. ERROR CALL Routines that wish to set up an error condition, I/O device handlers for example, should use the following coding sequence: LAC * DAC. LAC ISA IOF LAW JMS* AUXARG XX DBK ION (.SCOM + 66 TEMP (4~f02~fO CODE TEMP /POINTER TO ERRORQ /SUBROUTINE. /RAISE TO API /LEVEL ~. /SEE BELOW. /CALL ERRORQ. /AUXILIARY ARGUMENT. /RETURN HERE. The calling program must be operating with memory protect disabled in order to be able to issue lOT's. The first argument, given in the AC to ERRORQ, may be loaded either by LAW code or by Code h~C code in the following format: Bits fO-5 are ignored Bit 6 fO means non-terminal error Bit 6 1 means terminal error B-Lt 7 1 means Background error nit 8 1 means Foreground error Bits 9-17 is a 3-di g it error code both bits (7 and 8) may be set to 1 To avoid the possibility of future conflicts, user programs and device handlers should utilize codes 6fOfO - 777. 1I-3 The auxiliary argument, following the JMS to ERRORQ, will be printed in the error message as a 6-digit octal number. The error message will be printed in the form: .ERR NNN XXXXXX where NNN = the 3-digit error code XXXXXX = the 6-digit auxiliary information The actual printing of the error message and processing of the error will be done only after all interrupt processing has ceased and when control is no longer in the CAL handler. BACKGROUND/FOREGROUND MONITOR ERRORS (.ERR) The following abbreviations are used below in describing the auxiliary information: L - bit ~ is the status of the link XM- bit 1 is the status of extend memory MP- bit 2 is the status of memory protect CAL AI,DR - bits .3-17 contain the address of the CAL in error. ERROR NO. AUXILIJ>..RY INFORMAT.ION TERMINAL ILLEGAL CAL FUNCTION L, XM, MP, CAL ADDR YES CALl ILLEGAL L, XM, MP, CAL ADDR YES .DAT SLOT ERROR (erroneous .DAT slot number or .DAT slot not tied to an I/O handler) L, XM, MP , CAL ADDR YES ILLEGAL INTERRUPT L, ERROR XM, MP, PC YES IThe auxiliary information, depending on the source of the error, is sometimes UNIT i, CAL ADDR. 11-4 ERROR NO. ~~4 AUXILIARY INFORMATION ERROR TERMINAL MORE THAN ONE DEVICE NOT READY .ASCII /XX/ i XX = DEVICE NAME ILLEGAL . SETUP RETURN ADDRESS FROM YES .SETUP (ADDRESS IN CALLING DEVICE HANDLER) ILLEGAL HANDLER FUNC'rION L, XM, MP, CAL ADDRI YES ILLEGAL DATA MODE or SUBFUNCTION CODE L, XM, MP, CAL ADDRI YES ~l~ FILE STILL ACTIVE UNIT # , CAL ADDR YES ~ll SEEK/ENTER NOT UNIT # , CAL ADDR YES ~12 UNRECOVERABLE DECTAPE ERROR STATUS REGISTER B (Bits 0-1) AND UNIT (Bits 15-17) YES ~13 FILE NOT FOUND UNIT # , CAL ADDR YES ~14 DIRECTORY FULL UNIT # , CAL ADDR YES .0'15 DECTAPE FULL UNIT # , CAL ADDR YES ~16 OUTPUT BUFFER OVERFLOW UNIT # , CAL ADDR YES ~17 TOO MANY FILES FOR Hl\'NDLER UNIT #, CA.L ADDR YES .0'2~ DISK FAILURE DISK STATUS REGISTER YES ~2l ILLEGAL DISK ADDRESS UNIT #, CAL ADDR YES ~22 TWO OUTPUT FILES ON ONE UNIT UNIT #, CAL ADDR YES ~23 ILLEGAL WORD COUNT L, XM, MP, CAL ADDR YES EXECU,]~ED YES (Either the word count was positive or the starting address plus the absolute value of the word count exceeded existing memory) IThe auxiliary information, depending on the source of the error, is somet im(~s UNIT #, CAL ADDR. 11-5 ERROR NO. AUXILIARY INFORMATION ERROR TERMINAL fJ27 ILLEGAL DISK UNIT UNIT #, CAL ADDR YES fJ3l NON-EXISTENT MEMORY REFERENCE L, XM, MP, PC YES fJ32 MEMORY PROTECT VIOLATION L, XM, MP, PC l YES fJ33 MEMORY PARITY ERROR L, XM, MP, PC YES fJ36 BACKGROUND MEMORY PROTECT VIOLATION ATTEMPT VIA CAL ARGUMENT L, XM, MP, CAL ADDR YES fJ5{J .TIMER REQUEST CANNOT FIT IN CLOCK QUEUE OR BACKGROUND REQUEST REMOVED TO MAKE ROOM FOR FGRD REQUEST ______- ADDRESS OF REAL TIME NO SUBROUTINE THAT WAS TO GET CONTROL ON COMPLETION OF INTERVAL fJ52 MAINSTREAM REAL TIME REQUEST IGNORED BECAUSE ROUTINE IS ALREADY ENTERED PRIORITY LEVEL/SUBROUTINE ENTRY POINT NO ENTRY THAT WOULD NOT NO FIT, (PRIORITY LEVEL/ SUBROUTINE ENTRY POINT) .053 {J55 NO BUFFERS AVAILABLE RETURN ADDRESS FROM GETBUF (ADDRESS IN CALLING DEVICE HANDLER) YES fJ56 ILLEGAL .ERROR CAL 2 L, XM, MP, CAL ADDR YES fJ57 ILLEGAL .EXIT CAL L, XM, MP' CAL ADDR YES fJ6fJ .INIT NOT EXECUTED CAL ADDR YES ,061 TOO MANY NON-TERMINAL ERRORS NUMBER OF KRRORS DISCARDED NO 2.0.0 ILLEGAL TELETYPE UNIT L, XM ,MP, CAL ADDR YES IIf a memory protect violation occurs because of a Background JMP instruction, the PC is the effective address rather than the location of the JMP. 2A special error call to the Monitor (CAL code 16) is available for use only by the Loaders. II-6 LOADER ERRORS (.ERR) All Loader errors are terminal. The auxiliary informa- tion which is printed is irrelevant. l~~ l~ 1 1~2 1~3 1~4 1.05 1.06 1~7 ll~ III 112 113 114 115 116 117 l2~ 121 122 123 NO ROOM IN CORE FOR PROGRAM SEGMENT PROGRAM AND SYMBOL ,]~ABLE OVERLAP .BFTAB OVERFLOW .IOIN TABLE OVERFLOW $FILES COUNT OVERFLOW PARITY ERROR, CHECKSUM ERROR, OR BUFFER OVERFLOW ILLEGAL LOADER CODE (Bad input data) COMMON BLOCK SIZE ERROR 1 MISSING GLOBAL{S) ILLEGAL .DAT SLOT NUMBER . DAT SLOT CONTENTS == x:1 SAME DEVICE - DIFFERENT HANDLERS2 ILLEGAL HANDLER CODE (Illegal.DAT slot con"tents) ABSOLUTE PROGRAM ERROR 3 FOREGROUND CAN'T USE UNIT .0 ON SYSTEM DEVICE 4 NO ROOM TO BUILD .EXIT LIST XCT FILE OVERLAYS EXECUTE XCT FILE OVERLAYS THE MONITOR XCT FILE OVERLAYS THE SYMBOL TABLE XCT FILE NOT BUILT FOR THIS CONFIGURATIONs lCOMMON Block size declared differently when Block size previously fixed in HLOCKDATA subprogram. ~only one version of a device handler may be in core. .DAT slot requested a different handler for a device when another handler for that device was already in core. 3 An absolute .LOC program may not be loaded once relocatable programs have been loaded. Absolute and relocatable .LOC in same program is illegal. 4$SHARE command was not given. Con figuration word in IIXCT II file indicates if it was built to run on a PDP-9 or PDP-IS and Background or Foreground. 5 11-7 OBJECT TIME SYSTEM ERRORS (.OTS) All .OTS errors are terminal and no auxiliary information is printed: ~-4 5 6 7 l~ 11 12 13 14 UNUSED ILLEGAL REAL SQUARE ROOT ARGUMENT ILLEGAL DOUBLE SQUARE ROOT ARGUMENT ILLEGAL INDEX IN COMPUTED GOTO ILLEGAL I/O DEVICE NUMBER ILLEGAL INPUT DATA ILLEGAL FORMAT STATEMENT ILLEGAL REAL LOGARITHMIC ARGUMENT ILLEGAL DOUBLE LOGARITHMIC ARGUMENT 11-8 APPE:QlDIX III TELETYPE HARDWARE CHARACTERISTICS SYSTEM REQUIREMENTS AND OPTIONS The multi-unit teletype handler assumes that the teletype configuration consists of: a. A Model 33 or Model 35KSR b. from 1 to 4 LTl9A or controls, and c. from 1 to 1610 Model 33 or Model 35KSR teletypes interfaced to the LT19A or LT09A controls. The console teletype has console teletype, L~09A i~s multi-station teletype own set of IOTs 7 operates as half-duplex and is connected to the PIC (Program Interrupt Control). It cannot be connect:ed to the API. LT09A multi-station teletype controls can handle from 1 to 5 teletype lines and is connected only to the PIC. The LTl9A is identical to the LT09A except that if a machine has API it will operate at API levE~ll 3, using channel registers 74 and 75. Teletypes connected to LT09 or LTl9 controls are operated in full-duplex mode, which reqU!ires the software to echo characters input from the Keyboard back to the teleprinter. LT09/LTI9 lOTs Whether LT09 or LTl9 is u:soed, the lOT's associated with a particular teletype unit are the same. 111- 1 The following tables list the device and subdevice codes associated with each teleprinter and keyboard and indicate the logical unit numbers which the teletype handler associates with them. The console teletype, which is not connected to the LT09/LT19 controls, is defined to be logical unit J. 'l'ABLE 1: 1 to 5 units; UNIT PRINTER CODE KEYBOARD CODE LOGICAL UNIT # XX400X XX402X XX404X XX406X xx420X XX410X XX412X XX414X xx416X XX430X 1· # LT09A/ LT19P. #1 1 2 3 4 5 UNIT PRINTER CODE KEYBOARD CODE LOGICAL UNIT # XX400X XX402X XX404X XX406X XX440X XX410X xx412X XX414X XX416X XX450X 1 2 3 XX420X XX422X XX424X XX426X XX442X XX430X xx432X XX434X XX436X XX452X 1 2 3 4 1 2 3 4 5 2 LT09A's or LT19A's 4 11 5 6 7 10 12 TABLE 3: 11 to 15 Units; UNIT PRINTER CODE KEYBOARD CODE LOGICAL UNIT # XX400X XX402X XX404X XX406X XX460X XX410X XX412X XX414X XX416X XX470X 1 2 # LT09A/ LT19A #1 4 5 6 to 10 units; 5 L'l'09A/ LT19A #2 2 3 TABLE 2: # LT09A/ r,rr19A #1 1 LT09A or LT19A 1 2 3 4 5 III-2 3 LT09A's or LT19A's 3 4 15 TABLE 3: (cont'd) 11 to 15 units; 3 LT09A's or LT19A's # PRINTER CODE KEYBOARD CODE LOGICAL UNIT # ----- LT09A/ LT19A #2 1 2 3 4 5 xx420X xx422X xx424x Xx426X xX462X XX430X XX432X XX434X xx436X XX472X 5 6 7 10 16 LT09A/ LT19A #3 1 2 3 4 5 XX440X XX442X xX444X xX446x xX464X xx450X XX452X xx454X Xx456X XX474X 11 12 13 14 17 UNIT TABLE 4 : LT09A/ LT19A #4 16 units; 4 LT09A's or LT19A's UNIT # PRIWfER CODE KEYBOARD CODE LOGICAL UNIT # 1 2 3 4 Unused Unused Unused Unused XX466X Unused Unus·ed Unused Unused XX476X 20 5 (The setup for the first three controls would be as in Table 3). TELETYPES In the Background/Foreground System, teletype models are presumed to have certain hardware characteristics: Model 33: No horizontal tabbing mechanism No vertical tabbing mechanism No form feed mechanism Model 35: Has all three of the above. III-3 The teletypes are assumed to be KSR (Keyboard Send/Receive) units. ASR (Automatic Send/Receive) teletypes may be used; however, their paper tape input and output capability cannot be used. The system will not support Model 37 teletypes. 111-4
Home
Privacy and Data
Site structure and layout ©2025 Majenko Technologies