RTS8V1.DOC DISCLAIMER This document file was created by scanning the original document and then editing the scanned text. As much as possible, the original text format was restored. Some format changes were made to insure this document would print on current laser printers using 60 lines per page. The original spelling and grammar has been preserved. 1-Apr-1996 DEC-08-ORTMA-A-D RTS-8 USER'S MANUAL Version 1 |-------------------------------------------------------| | Order additional copies as directed on the Software | | Information page at the back of this document. | |-------------------------------------------------------| digital equipment corporation - maynard massachusetts First Printing June 1974 The information in this document is subject to change without notice and should not be construed as a commitment by Digital Equipment Corporation. Digital Equipment Corporation assumes no responsibility for any errors that may appear in this manual. The software described in this document is furnished to the purchaser under a license for use on a single computer system and can be copied (with inclusion of DIGITAL's copyright notice) only for use in such system, except as may otherwise be provided in writing by DIGITAL. Digital Equipment Corporation assumes no responsibility for the use or reliability of its software on equipment that is not supplied by DIGITAL. Copyright @ 1974 by Digital Equipment Corporation, Maynard, Mass. The HOW TO OBTAIN SOFTWARE INFORMATION page, located at the back of this document, explains the various services available to DIGITAL software users. The postage prepaid READER'S COMMENTS form on the last page of this document requests the user's critical evaluation to assist us in preparing future documentation. The following are trademarks of Digital Equipment Corporation: CDP DIGITAL INDAC PS/8 COMPUTER LAB DNC KA10 QUICKPOINT COMSYST EDGRIN LAB-8 RAD-8 COMTEX EDUSYSTEM LAB-8/e RSTS DDT FLIP CHIP LAB-K RSX DEC FOCAL OMNIBUS RTM DECCOMM GLC-8 OS/8 RT-ll DECTAPE IDAC PDP SABR DIBOL IDACS PHA TYPESET 8 UNIBUS CONTENTS Page PREFACE v CHAPTER 1 INTRODUCTION 1-1 CHAPTER 2 USING TASKS UNDER RTS-8 2-1 2.1 THE STRUCTURE OF RTS-8 TASKS 2-1 2.2 CONCEPTS OF TASK COMMUNICATION 2-2 2.2.1 Task Synchronization and Event Flags 2-2 2.2.2 Intertask Messages 2-3 CHAPTER 3 RTS-8 EXECUTIVE REQUESTS 3-1 3.1 COMMUNICATION WITH THE RTS-8 EXECUTIVE 3-1 3.2 ERs USED TO SEND AND RECEIVE MESSAGES 3-1 3.2.1 SEND 3-1 3.2.2 WAITE 3-2 3.2.3 SENDW 3-2 3.2.4 RECEIVE 3-2 3.2.5 POST 3-3 3.3 INTER-TASK CONTROL THROUGH TASK FLAGS 3-5 TABLE ENTRY 3.4 ERs USED TO SET AND CLEAR WAIT BITS 3-6 3.4.1 BLKARG 3-6 3.4.2 UNBARG 3-6 3.4.3 SUSPND 3-6 3.4.4 RUN 3-7 3.5 DERAILING THE EXECUTION OF A TASK 3-8 3.5.1 DERAIL 3-8 3.6 USING INTERRUPTS IN RTS-8 3-9 3.6.1 SKPINS 3-9 3.7 ADVANCED RTS-8 PROGRAMMING TECHNIQUES 3-11 3.7.1 WAITM 3-11 3.7.2 Direct References to System Tables 3-12 CHAPTER 4 RTS-8 SYSTEM TASKS 4-1 4.1 CLOCK HANDLER 4-1 4.1.1 Examples of Clock Handler Calls 4-2 4.2 TERMINAL HANDLER 4-3 4.2.1 Examples of Terminal Handler Messages 4-5 4.3 LINE PRINTER HANDLER 4-5 4.4 MASS STORAGE HANDLERS 4-5 4.4.1 Example of Mass Storage Handler Call 4-7 iii Page 4.5 POWER FAIL TASK 4-7 4.6 OS/8 SUPPORT TASK 4-8 4.7 OS/8 FILE SUPPORT TASK 4-9 4.8 UDC HANDLER 4-10 4.8.1 Analog Output 4-11 4.8.2 Analog Input 4-11 4.8.3 Digital Output 4-12 4.8.4 Digital Input 4-12 4.8.5 Generic Code 4-12 4.8.6 Enable Counter 4-13 4.8.7 Read Counter 4-14 4.8.8 Disable Counter 4-14 4.8.9 Enable Contacts 4-14 4.8.10 Change of State 4-15 4.8.11 Disable Contacts 4-15 4.8.12 UDC Assembly Parameters 4-16 4.8.13 UDC Error Conditions 4-16 4.9 CASSETTE HANDLER 4-17 4.10 CASSETTE LABEL SUPPORT HANDLER 4-18 CHAPTER 5 MONITOR CONSOLE ROUTINE 5-1 5.1 MCR COMMAND ARGUMENTS 5-1 5.2 MCR COMMANDS 5-2 5 2.1 Date 5-2 5.2.2 Time 5-2 5.2.3 Name 5-2 5.2.4 Request 5-3 5.2.5 Stop 5-4 5.2.6 Disable 5-4 5.2.7 Enable 5-4 5.2.8 Cancel 5-4 5.2.9 Systat 5-4 5.2.10 Open Address 5-5 5.2.11 Examine Address 5-6 5.2.12 Deposit Address 5-6 5.2.13 Post Address 5-6 5.2.14 Exit 5-6 5.3 MCR ERRORS 5-6 CHAPTER 6 ASSEMBLING AND LOADING TASKS FOR RTS-8 6-1 CHAPTER 7 DEMONSTRATION PROGRAM 7-1 APPENDIX A RTS-8 DISTRIBUTED SOURCE FILES A-1 APPENDIX B RTS-8 COMPONENT SIZES B-1 GLOSSARY GLOSSARY-1 INDEX INDEX-1 iv PREFACE This manual describes the PDP-8 Real-Time System (RTS-8) and provides information and examples necessary for its efficient use. Knowledge of PDP-8 machine language programming is essential; in addition, the user should be familiar with real-time systems in general and with the use and operation of the OS/8 system. The following PDP-8 handbooks will be helpful for review and reference: INTRODUCTION TO PROGRAMMING, THE SMALL COMPUTER HANDBOOK, the OS/8 HANDBOOK (DEC-S8-OSHBA-A-D), the UDC8 UNIVERSAL DIGITAL CONTROL SUBSYSTEM MAINTENANCE MANUAL (DEC-08-HZDC-D), and the CAPS-8 USER'S MANUAL (DEC-8E-OCASA-A-D). v CHAPTER 1 INTRODUCTION A real-time system is a software framework under which the resources at hand (core, CPU time, peripheral devices) are divided among several tasks. The term "task" is difficult to define, as it overlaps with the definitions of "program" and "subroutine", but basically a task is a portion of machine code which performs a specific function; sometimes this function is an end in itself, sometimes it is related only to the needs of other tasks. The real-time system distributes resources to tasks at any time depending on whether the tasks can make use of them, and whether a more privileged (higher priority) task wants to pre-empt resources already in use. Most real-time systems consist of a group of programs or tasks that run at varying times or frequencies and alternate between being compute bound and I/O bound. To efficiently use the central processor, these tasks cannot be run in series since the central processor will be poorly utilized during the periods that tasks are I/O bound. In addition, real-time tasks are time-dependent in one sense or another and in general cannot wait for a slow, less important I/O or compute bound task to finish before starting execution. Multiprogramming and some sort of priority scheme for scheduling the central processor are thus required. Multiprogramming allows many tasks to be in some state of execution simultaneously. When one task cannot use all the available central processor time because it must wait for an I/O operation or is blocked by some other condition, the central processor can be switched to another task to make use of the available time. It is possible even in a multiprogramming environment that there may not be a task in an executable state to utilize this available time. While this condition is certainly possible, it is less likely to occur than in a uni-programming environment. A priority scheme is needed to distinguish the relative importance of the various tasks in the system. It must be possible to interrupt the execution of a less important task to execute a critical real-time program. A fixed priority scheme has been chosen. Fixed priority meets the above requirement, is simple and adequate, and requires low scheduling overhead. RTS-8 is a small real-time system which uses any family-of-8 processor (with the exception of the PDP-8/S). It allows up to 63 tasks to run concurrently, competing for resources on a fixed-priority basis. Included in the RTS-8 system are system tasks which control most standard Digital Equipment Corporation I/O devices (listed in Chapter 4), a task which allows interactive system control from the console terminal, and a task which allows a single copy of the OS/8 monitor system to run in the background. 1-1 CHAPTER 2 USING TASKS UNDER RTS-8 2.1 THE STRUCTURE OF RTS-8 TASKS The controlling program in an RTS-8 System is the RTS-8 Executive. The Executive decides which task should be running (based on the priorities of the tasks which are able to run) and also provides services to the tasks by means of Executive Requests, discussed later in Chapter 3. Each task in an RTS-8 system has an associated unique Task Number between 1 and 63, which serves the following purposes: 1. The Task Number is used by the RTS-8 Executive as an index to various system tables where information about tasks is kept. 2. The Task Number is used by other tasks in the system for reference in Executive Requests. 3. The Task Number determines the task's priority; the lower the Task Number, the higher the priority of the task. The Executive uses three internal tables to maintain information about the tasks in the system. Each task's Task Number is used as an index into these tables to retrieve and update information for that task. The internal tables are: 1. The Task State Table - a table of 4-word entries holding the most recent contents of CPU registers for each task as follows: Word 1 - contains the link (bit 0) the data field (bits 9-11) the instruction field (bits 6-8) Word 2 - contains the program counter (PC) Word 3 - contains the accumulator (AC) Word 4 - contains the multiplier quotient (MQ) Whenever a task is executed, the contents of its Task State Table are loaded into the corresponding CPU registers, and whenever a task stops executing, its Task State Table entry is set to the new contents of these registers. 2. The Task Flags Table - a table of l-word entries holding various bits for each task to determine whether or not the 2-1 Using Tasks Under RTS-8 task is runnable (a detailed description of these bits is provided in Section 3.3). A task is runnable only if its Task Flags Table entry contains zero. 3. The Task Input Message Queue Header Table - a table of 2-word entries which represent the "head" of the input message queue for each task: Word 1 - if zero, there are no messages in the queue; if non-zero, the word is a CDF to the field of the first message in the queue. Word 2 - if word 1 was not zero, this word is a pointer to the first message in the queue. Messages are discussed later in this chapter. 2.2 CONCEPTS OF TASK COMMUNICATION There are two main types of task communication in RTS-8--message sending and synchronization. Since synchronization is the more fundamental of the two, it will be discussed first. 2.2.1 Task Synchronization and Event Flags Whenever two processes occur independently, there may be a need for one to wait while the other finishes execution. The most common example of this is the PDP-8 terminal interface. The terminal waits for the PDP-8 to produce a printable character. When the PDP-8 has one, it alerts the terminal by issuing a TLS instruction. If the PDP-8 then has another character to print, it must first wait in a TSF;JMP .-1 loop until the terminal signals that it has finished printing the character by raising the ready flag. Then the PDP-8 exits from its loop and proceeds to print the next character. Similarly, tasks in RTS-8 may synchronize with each other by means of Event Flags. An Event Flag is a location which contains the status of an Event. An Event can be a physical occurrence such as a clock ticking, a valve closing, or a device ready flag raising, or an Event can be conceptual, as for example, a result, an inconsistency, or a certain string of characters typed by the operator. Like the terminal ready flag, an Event Flag has the states PENDING(>0) and FINISHED(=0). Thus a task can (via a message) direct another task to perform some action, at which time it will set a (mutually agreed upon) Event Flag to the PENDING value. When the second task finishes it sets the Event Flag to the FINISHED value (known as Posting the Event Flag). If the first task has been waiting for the Event Flag with the instructions: TAD Event Flag; SZA CLA; JMP .-2 then the Posting of the Event Flag will cause the first task to exit from its loop. 2-2 Using Tasks Under RTS-8 Unfortunately, the above loop ties up a vitally important resource--the PDP-8 processor. Therefore, under RTS-8, Event Flags have an additional state: WAITING(<0). Thus in the example above, the first task can tell the RTS-8 Executive it wants to WAIT until the Event Flag is FINISHED. The monitor saves the task's PC and marks in its Task Flags Table word that it is Waiting on an Event Flag; the Event Flag is set to the proper WAITING state (in this case, the proper WAITING state is octal 4000 plus the waiting task's Task Number). When the Event Flag is POSTed (via an RTS-8 Executive call) the task which is WAITING for it is automatically started by RTS-8. The mnemonic for the RTS-8 Executive Request which Waits for an Event Flag is WAITE. 2.2.2 Intertask Messages Just as Event Flags under RTS-8 are analogous to hardware device flags, messages are analogous to data-sending hardware I/O instructions (for example, TLS). That is, messages start a task (providing the task is WAITING for a message) and at the same time pass information to the task. A message under RTS-8 is a contiguous area of core storage. RTS-8 requires the first three words of the message (the Message Header) for its use. The first word of the Message Header is the Event Flag for the message. When the message is sent, the Event Flag is set in a PENDING state by the RTS-8 Executive; this signifies that the message has been sent but not yet completed. No action occurs to the Event Flag upon receipt of the message by the receiving task; however RTS-8 protocol requires that when the receiver has performed whatever action is specified (or implied) by the message, it POSTS the Event Flag. This posting serves two purposes: it informs the task which sent the message (the "sender") that the requested action has been completed, and it "frees" the message so that it can be sent again (see 2 below). The second and third words of the Message Header are used as a CDF-address pair to link the message to the next queue entry. If the receiving task is not actively waiting for a message, the message is placed on the receiving task's Input Message Queue. Messages are then queued in order of decreasing priority of the sender (increasing task number) and in the order issued if a task sends more than one message. The rest of the message may contain any desired information. Sending a message does not physically move the message information to the receiving task, but provides the receiver with the field and address of the first data word of the message. Note again that the information in a message is not copied into the receiver's area; this has several implications: 1. Data in a message should not be modified by the sender while the Event Flag for the message is PENDING. 2. The same message cannot be sent a second time before its Event Flag is FINISHed the first time. RTS-8 enforces this by checking the Message Event Flag on a SEND operation and 2-3 Using Tasks Under RTS-8 putting the sender into Event Flag Wait if the message is still PENDING. 3. It is legal for the receiving task to store information in the body of the message. In this way an "answer" to the message can be returned without the complications of sending a return message back to the sender. For example, when a task sends a message to the disk driver task requesting I/O, the error status of the completed operation is placed in a specific word in the message by the driver to indicate whether an error occurred. 2-4 CHAPTER 3 RTS-8 EXECUTIVE REQUESTS 3.1 COMMUNICATION WITH THE RTS-8 EXECUTIVE RTS-8 tasks communicate with the RTS-8 Executive via Executive Requests (abbreviated as ERs). In order to make ERs simple across field boundaries, RTS-8 uses locations 20-27 in every field as a communication region for ERs. The Executive can be called in any field via a JMS 20 instruction (hereafter referred to as a CAL). The Data Field (DF) does not have to be any specific value when the CAL is given, as the code in location 20 sets the DF to the Instruction Field (IF), sets the IF to 0 and jumps to the RTS-8 Executive. (Other instruction definitions used throughout the manual and described in Chapter 3 are POSTDS which is defined as JMP I 24, and WAITM, defined as JMS I 25.) Because the architecture of the PDP-8 does not permit reentrant programs, the RTS-8 Executive runs with task switching inhibited, i.e., interrupts are on, but higher priority tasks may not request the CPU until the Executive has finished its request. When the Executive finishes processing the request, it checks whether any higher-priority tasks have become runnable while task switching was inhibited, and, if so, it runs the highest-priority task of these. Also, because of the non-reentrant architecture of the PDP-8, the RTS-8 Executive will not honor any request to switch tasks arising from an interrupt if the interrupted task's Program Counter (PC) was less than 100. This is done to protect the RTS-8 Executive's entry point (location 20 in each field) from being destroyed. User tasks should be careful NEVER to execute any instructions below 100 in a field. 3.2 ERs USED TO SEND AND RECEIVE MESSAGES There are five ERs associated with the Messages and Event Flags described in Chapter 2. Descriptions of these follow and an example of their usage is presented in Section 3.2.5. 3.2.1 SEND Send Message Format: CAL SEND TSKNUM MESSAG 3-1 RTS-8 Executive Requests SEND sends the message located at MESSAGE in the current field to the task whose number is TSKNUM. If the receiving task is of a higher priority than the sender and is waiting for a message, the sender is temporarily suspended and the receiver runs. In any case, the sender is not put into any WAIT state once the message is sent. However, if the event flag in location MESSAG is PENDING (non-zero), meaning the message is still busy from a previous SEND, the sender will be put into Event Flag Wait on location MESSAG, and only when the Event Flag becomes FINISHED (zero) will this SEND be performed. 3.2.2 WAITE Wait on Event Flag Format: CAL WAITE EFLG WAITE checks the status of location EFLG and if it is FINISHED, returns control to the caller. If EFLG is PENDING, its state is changed to WAITING and the calling task is put into Event Flag WAIT. When location EFLG is POSTed by another task or interrupt routine, the calling task becomes runnable again. 3.2.3 SENDW Send and Wait Format: CAL SENDW TSKNUM MESSAG SENDW is exactly equivalent to the sequence: CAL SEND /SEND THE MESSAGE TSKNUM MESSAG CAL WAITE /WAIT FOR RECEIVER TO ACKNOWLEDGE MESSAG 3.2.4 RECEIVE Receive Message Format: TAD RESTRICTION /ONLY TO RESTRICT CAL /SENDING TASKS RECEIVE MADDR, 0 /MESSAGE ADDRESS STORED /HERE; CDF TO MESSAGE /FIELD IN AC ON RETURN If the AC is zero when the RECEIVE ER is issued, the calling task's Input Message Queue is examined. If there are messages in the calling task's Input Message Queue, the first (i.e., highest-priority) message is dequeued and the address of its first data word is placed in MADDR. 3-2 RTS-8 Executive Requests A CDF to the field of the message is stored in the AC. If there are no messages, the task is placed in Message Wait until such time as there are any. There is no ER which will allow a task to check for messages and not be placed in Message Wait if there are none; however a task may examine its Input Message Queue Header in field 0 first to determine the state of the Input Message Queue. If the AC is non-zero when the RECEIVE ER is issued, the calling task's Input Message Queue is searched for a message whose sender's Task Number matches the contents of the AC. If such a message is found, it is removed from the queue as specified above; if none is found the issuing task is placed in Message Wait. 3.2.5 POST Post Event Flag Format: TAD EFPTR /POINTER TO EVENT FLAG CAL POST EFCDF, CDF EFFLD /FIELD OF EVENT FLAG The Event Flag pointed to by the AC at the CAL, in the field specified by EFCDF, is set to the FINISHED (zero) state. If its previous state was WAITING, the task which was waiting for it is cleared of its Event Flag Wait. This ER never sets the calling task in a WAIT state, but if the task Waiting for the Event Flag is of a higher priority than the calling task, the calling task is temporarily suspended while the other is run. This example illustrates the RTS-8 ERs dealing with Messages and Event Flags. Since I/O and interrupts under RTS-8 have not been discussed yet, this example is trivial; i.e., there is no advantage to keeping the functions of the two tasks separate, and the entire send/receive structure is being used here as an elaborate subroutine call. A description follows the example. Task A ______ A1 ALOOP, CAL SEND /SEND TASK B A MESSAGE B MES1 A2 CAL SEND /AND ANOTHER B MES2 A3 CAL WAITE /WAIT FOR FIRST ONE MES1 A4 JMP ALOOP /LOOP MES1, ZBLOCK 3 15 /RANDOM NUMBERS 37 23 MES2, ZBLOCK 3 -1 4 3-3 RTS-8 Executive Requests Task B ______ B1 BLOOP, CAL RECEIV /GET A MESSAGE MADDR, 0 B2 DCA EFCDF /SAVE CDF FOR POST B3 TAD EFCDF B4 DCA .+1 /PUT CDF INLINE B5 HLT /CDF TO MESSAGE FIELD B6 TAD I MADDR /GET 1ST DATA WORD OF MESSAGE B7 CLA B8 STA CLL RTL /-3 IN AC B9 TAD MADDR /AC POINTS TO MESSAGE B10 CAL /EVENT FLAG POST EFCDF, HLT /CDF TO MESSAGE FIELD HERE Bll JMP BLOOP /LOOP The flow of execution in this example depends on which of the two tasks has higher priority. Assuming that at some time both A and B become runnable and task A has higher priority, the sequence of execution is as follows: Instructions Why Executed ____________ ____________ A1 Task A has higher priority than task B. A2 Task A has higher priority than task B. A3 Task A has higher priority than task B. B1 Task A is now in Event Flag Wait since MES1 was PENDING; MES1 is now in WAITING state. B2-B10 Task A is still WAITing--the RECEIV at B1 received MES1 A4 The POST at B10 posted MES1 and "woke up" A, which has higher priority than B. A1 A continues executing. A2 A tries to send MES2 again; B has not yet processed it; MES2 is PENDING. Bll Therefore, A is put into Event Flag Wait and B is resumed; MES2 is now WAITING. Bl-B10 B now receives and posts MES2. A2 This brings A out of Event Flag Wait; the RTS8 Executive has modified task A's Program Counter so that it will re-execute the offending SEND. A3 A3 now waits for MES1 to be POSTed. If task B has higher priority, the sequence of execution is: Instructions Why Executed ____________ ____________ B1 Task B has higher priority than task A. A1 Task B is placed in Message Wait since there are no messages in its input queue. A1 Loops back to A1 and sends MES1 again. 3-4 RTS-8 Executive Requests B2-B10 Task A's message brings task B out of Message Wait; since B has higher priority, A is stopped and B runs. Bll The POST at B10 sets MES1 to FINISHED but has no other effect. B1 Now task B tries to get another message. A2 There are none, so task B is put in Message Wait and A is run. B2-Bll Task A sends MES2 which "wakes up" B; B processes MES2 and B1 returns for more, A3 and is put in Message Wait. Since MES1 is FINISHED A4 the WAITE at A3 has no effect and task A A1 loops back to A1 and sends MES1 again. 3.3 INTER-TASK CONTROL THROUGH TASK FLAGS TABLE ENTRY A task's Task Flags Table entry is used by RTS-8 to determine if the task can run. A zero Task Flags Table entry indicates a runnable task. Each bit which is set in a non-zero word indicates a reason why the task cannot run. The currently defined bits and their meanings, if set, are: Octal Symbolic Meaning _____ ________ _______ 0001 DNEWT Does Not Exist Wait - This task cannot run because it is nonexistent. 4000 MSGWT Message Wait - This task is waiting to be sent a message. 2000 EFWT Event Flag Wait - This task is waiting for an Event Flag (which contains a WAITing value corresponding to this task) to be POSTed. 0400 SWPWT Swap Wait - This task cannot run because it is not in core (this bit is reserved for future RTS-8 releases). 1000 RUNWT Run Wait - This task is waiting for a RUN ER to be executed with its number in the AC, or for the operator to type "REQUEST task" to the Monitor Console Routine (see Chapter 5). 0200 EORMWT Event or Message Wait - This task is waiting for an Event Flag to be set or a message to arrive, whichever happens first. 0040 ENABWT Enable Wait - This task is waiting to be Enabled. Use of this bit is restricted to the Monitor Console Routine for use by the "ENABLE task" and "DISABLE task" commands. 3-5 RTS-8 Executive Requests 0100 USERWT User Wait - This bit is reserved for use by user-written tasks. RTS-8 does not use this bit. 3.4 ERs USED TO SET AND CLEAR WAIT BITS Several ERs exist which allow a task to explicitly set and clear wait bits in the Task Flags Table entry of another task, and to set bits in its own table-entry. 3.4.1 BLKARG Block Task for Specified Reason Format: TAD TASKNUM /OR 0 IF SELF CAL BLKARG WAITBITS TASKNUM contains the number of the task to be blocked (or not allowed to run), and WAITBITS specifies one or more bits to be set in that task's Task Flags word. Assuming WAITBITS is non-zero, this will cause the specified task to become non-runnable. If TASKNUM contains 0, the issuing task will be blocked on the specified wait bits. The TASKNUM=0 form of this ER is the only legal way to specify the issuing task as the task to be blocked; if TASKNUM is equal to the issuing task number the action of this ER is undefined. 3.4.2 UNBARG Unblock Task for Specified Reason Format: TAD TASKNUM CAL UNBARG WAITBITS TASKNUM contains the number of the task to unblock, and WAITBITS specifies one or more bits to be cleared in that task's Task Flags word. If the Task Flags word becomes zero as a result of this operation, the specified task becomes runnable; if the specified task has higher priority than the issuing task and becomes runnable, the issuing task is temporarily suspended while that task runs. This ER is a no-op if issued with TASKNUM equal to the issuing task's number. 3.4.3 SUSPND Suspend a Task's Execution Format: TAD TASKNUM /0 IF SELF CAL SUSPND 3-6 RTS-8 Executive Requests This ER is identical in action to the following instructions: TAD TASKNUM CAL BLKARG RUNWT 3.4.4 RUN Run a Task Format: TAD TASKNUM CAL RUN This ER is identical in action to the following instructions: TAD TASKNUM CAL UNBARG RUNWT The SUSPND and RUN ERs exist because their function is performed sufficiently often enough to warrant a shorthand version. An example of how they can be used follows. A data collection task is to print a report every 1000 data points without interrupting the data collection/reduction process. Data Task _________ DLOOP, TAD (-1750 /1000 DECIMAL DCA COUNT DATALP, CAL WAITE DATAEF . . . . /GET A DATA POINT ISZ COUNT /AND PROCESS IT JMP DATALP /COUNT OFF 1000 TAD (REPORT /POINTS CAL /RUN REPORT TASK RUN JMP DLOOP /KEEP COLLECTING COUNT, 0 3-7 RTS-8 Executive Requests Report Task ___________ RLOOP, CAL /AC=0, SUSPEND SUSPND /UNTIL NEEDED JMS TITLE /HAS BEEN RUN . . /PRINT REPORT . /WITH TITLE JMP RLOOP /REPORT OVER-GO /BACK AND WAIT To eliminate interference with the data collection, REPORT should have a lower priority than DATA. 3.5 DERAILING THE EXECUTION OF A TASK There is one task control ER which does not cause any wait bits to get set or cleared, but which terminates the execution of a specified task and transfers control to a subroutine. 3.5.1 DERAIL Derail a Task's Execution Format: TAD TASKNUM CAL DERAIL ADDR This ER causes a "JMS ADDR" to be simulated for the task whose number is contained in TASKNUM (the "derailed" task). ADDR is assumed to be in the same field in which the derailed task is executing. The derailed task's PC (from its Task State Table entry) is stored in ADDR; the PC entry in its Task State Table entry is then set to ADDR+1. Two important points to note about the operation of the DERAIL ER are: 1. The derailed task's AC, Link, and Data Field settings are not saved by the DERAIL ER; therefore they must be saved and restored by the derail subroutine. In this sense, a derail subroutine is very much like an interrupt at the task level. 2. The contents of the derailed task's Task Flags word are not affected by the DERAIL ER. If the derailed task is not runnable, the derail subroutine will not be executed until it becomes runnable. The DERAIL ER is generally used to signal an emergency condition to another task. For example, in a process-control environment, it is sometimes necessary to abort all operations if the room temperature exceeds some critical value. This can be checked by a task which measures room temperature every 10 seconds. It is inefficient and unmodular to include shutdown code in this "watchdog task" for all machinery being controlled. A better solution is to provide a 3-8 RTS-8 Executive Requests location to which each equipment-controlling task can be DERAILED in order to shut down its own piece of equipment. The RTS-8 Power-Fail task uses the DERAIL ER to provide a similar facility on power-fail recovery (see Section 4.5). 3.6 USING INTERRUPTS IN RTS-8 The RTS-8 Executive contains code to receive and dismiss interrupts and to perform interrupt-initiated task switching, but it does not provide room for an interrupt skip chain. Instead, the skip chain is literally a chain and is built up dynamically via the SKPINS ER. 3.6.1 SKPINS Insert Code Into Skip Chain Format: CAL SKPINS MODULE MODULE is the address (in the current field) of an interrupt processing module. An interrupt processing module has the following format: MODULE, 0 /THIS WORD GETS A POINTER /TO THE NEXT MODULE 0 /MODULE ENTERED HERE - CONTAINS /CDF CIF NEXT MODULE FIELD SKDR /SKIP ON DEVICE READY (SKP) /(ONLY IF SKDR REALLY MEANS SKIP /ON DEVICE NOT READY) JMP I MODULE /NOT READY - GO TO NEXT MODULE IN /CHAIN CDF CIF CUR /THIS ONE IS MINE - SET DF AND IF /CORRECTLY . /INTERRUPT PROCESSING . . CIF 0 POSTDS /DISMISS THE INTERRUPT, MAYBE POST /AN EVENT FLAG The RTS-8 interrupt skip chain initially consists of one such module for the system clock. Whenever a task executes a SKPINS ER, the interrupt chain is broken at the very end and the user's interrupt module is inserted. The last interrupt module points to the interrupt dismiss routine as its "next module", so that RTS-8 will try to avoid superfluous interrupts. Notice that SKPINS always inserts at the end of the skip chain. This implies that the skips in the skip chain will be ordered roughly by priority of the task which inserted them, since any SKPINS ERs in a task are usually executed as once-only code at system startup time. Once an interrupt module receives control (by having its I/O skip succeed) there are several restrictions on its execution: 3-9 RTS-8 Executive Requests 1. The Data Field and Instruction Field are those of the NEXT interrupt module; this must be corrected before any indirect addressing or jumps are performed. 2. An interrupt module may not issue any RTS-8 ERs. 3. An interrupt module should not compute excessively, since interrupts are off. Typical execution time should be under 75 microseconds; if considerably more computing than this is needed, a task should be scheduled to perform it rather than computing excessively with interrupts off. 4. Interrupt modules must not turn interrupts on, as the state of the interrupted task may be destroyed by a second interrupt. 5. On entry to the interrupt module, the AC, Link, and Data Field have already been saved, but the Multiplier Quotient (MQ) has not. Therefore interrupt modules wishing to use the MQ should save it first and restore it before dismissing the interrupt. 6. Interrupt modules must dismiss the interrupt by setting the Instruction Field to 0 and issuing a POSTDS instruction. POSTDS is currently defined as a JMP I 24 instruction. An Event Flag may be POSTed when the interrupt is dismissed by setting the Data Field to the field of the Event Flag and placing the location of the Event Flag in the AC prior to issuing the POSTDS. For example: CDF CUR /DF = THIS FIELD TAD (EVFLG /EVFLG MAY NOT BE AT LOC 0 CIF 0 POSTDS /DISMISS INTERRUPT AND POST EVFLG For example, an RTS-8 Paper Tape Punch handler task might contain sections of code such as the following: In the initialization code: CAL /LINK THE PUNCH SKIP SKPINS /INTO THE SKIP CHAIN PTPINT . . . 3-10 RTS-8 Executive Requests As a character punch subroutine: PUNCH, 0 /ENTER WITH CHAR IN AC DCA TEMP /SAVE CHAR CAL /WAIT UNTIL PUNCH READY WAITE PTPEF /SET PUNCH EVENT FLAG ISZ PTPEF /PENDING TAD TEMP PLS /PUNCH CHAR CLA JMP I PUNCH . . . Interrupt skip chain code: PTPINT, ZBLOCK 2 /USED TO CHAIN SKIPS PSF /CHECK PUNCH FLAG JMP I PTPINT /NOT READY CDF CIF CUR /SET CORRECT DF, IF PCF /CLEAR PUNCH FLAG TAD (PTPEF POSTDS /DISMISS INTERRUPT, /POSTING PTPEF . . . PTPEF, 0 /PUNCH INITIALLY READY TEMP, 0 RTS-8 does not currently provide a mechanism for dynamic removal of entries from the interrupt skip chain. 3.7 ADVANCED RTS-8 PROGRAMMING TECHNIQUES The information in this section is for the experienced RTS-8 user and should be ignored until the user has gained familiarity with the system. 3.7.1 WAITM Waiting For Multiple Event Flags Sometimes it is desirable to wait for a logical combination (AND or OR) of Event Flags. Waiting for the logical AND of two Event Flags is quite simple. The sequence: CAL WAITE A /WAIT FOR EVENT FLAG A CAL WAITE B /AND THEN WAIT FOR EVENT FLAG B waits until both A and B have been POSTed. 3-11 RTS-8 Executive Requests Waiting for the logical OR of several event flags is more difficult since there is a possible race condition between the various tests and the interrupts (or task executions) which POST the Event Flags involved. The key to waiting for an OR of several Event Flags successfully is not to allow any interrupts to occur between the testing of the first Event Flag and the placing of the task in a Wait state if none of the flags were POSTed. To accomplish this requires a special sequence of instructions and a special RTS-8 call named WAITM. WAITM is currently defined to be a JMS I 25. It must be executed with interrupts off, the Instruction Field set to 0 and the Data Field set to the current field, and it must be followed by a word containing the blocking bit(s) to be set in the Task Flags Table. The action of WAITM is equivalent to the action of the RTS-8 ER BLKARG except that a fast path through the RTS-8 Executive is taken and interrupts remain off until the blocking bits are on in the Task Flags Table. For an example of the use of WAITM, assume that a task "TASK" wants to test two Event Flags A and B. If A is POSTed, control should go to location ADONE, and if B is POSTed control should go to location BDONE. If neither is POSTed, the task must wait until one of them is POSTed. The code to perform this function is: TESTAB, IOF /INTERRUPTS OFF - DELICATE CODE TAD A SNA CLA JMP ADONE /ADONE MUST TURN INTERRUPTS ON TAD (4000+TASK /SET A TO "WAITING' STATE /INDICATING DCA A /THAT THIS TASK IS WAITING ON IT TAD B SNA CLA JMP BDONE /BDONE MUST TURN INTERRUPTS ON TAD (4000+TASK /SET B TO "WAITING" STATE /INDICATING DCA B /THAT THIS TASK IS WAITING ON IT CIF 0 CDF CUR WAITM EFWT /BLOCK TASK ON EVENT FLAG WAIT JMP TESTAB /WE'RE BACK - ONE OF THE TWO /EVENT FLAGS HAS BEEN POSTED. /GO BACK TO FIND OUT WHICH ONE 3.7.2 Direct References to System Tables A task may directly refer to locations in the RTS-8 Executive tables to obtain information about itself or any other task, as long as two restrictions are observed: 1. Due to the interrupt-driven nature of the system, these table entries may change at any time; therefore, interrupts should be inhibited while these entries are tested. 3-12 RTS-8 Executive Requests 2. System table entries may be changed only through RTS-8 Executive Requests. Symbols have been defined in the system parameter table to make references into these tables symbolic. The symbolic expressions which yield the address of the system table entries for task N are: N+TFTABL Task Flags Table Entry for task N; if zero, task N is runnable. N^2+MSGTBL Input Message Queue Header for task N; if zero, task N has no messages in its queue. N^4+TSTABL First Word of Task State Table Entry for task N. For example, for a task to determine whether it had messages in its input queue without issuing a RECEIV request, the code would be: CDF 0 /EXEC TABLES IN FIELD 0 IOF /TURN INTERRUPTS OFF TAD I (TASK^2+MSGTBL SNA CLA /ANY MESSAGES? JMP NONE /NO ION /YES The code at NONE must eventually turn interrupts back on. 3-13 CHAPTER 4 RTS-8 SYSTEM TASKS The sources of the System Tasks are supplied with the RTS-8 system. The tasks referred to as "handlers" are completely message-driven, i.e., when idle they are in the Message Wait state. Other tasks send these handlers I/O request messages, and when the handler completes the I/O operation it sets the Event Flag associated with the request message and issues another RECEIVE ER. 4.1 CLOCK HANDLER This task can be assembled to handle any of four hardware clocks (DR8EA, DK8EC, DK8EP, KW12). It accepts requests (in the form of RTS-8 messages) to perform actions after a specified time has elapsed. The clock handler uses an interval queue (whose length is fixed at assembly time by the definition of the symbol CLKQLN in the parameter file) to keep track of its pending requests. The format of a clock message is: CLKMSG, ZBLOCK 3 /3 WORDS RESERVED FOR RTS-8 COMMAND+TASKNO /TASKNO=0 MEANS TASKNO=SENDING TASK TIMEHI TIMELO EXTRA1 EXTRA2 The words TIMEHI and TIMELO specify a time interval from the present time in terms of "system ticks". The number of system ticks in a second is specified by the user in the RTS-8 parameter file via the parameter SHERTZ. The hardware tick rate (in ticks per second) is specified by the parameter HERTZ. HERTZ must be an exact multiple of SHERTZ. For example, the parameters for a line-frequency clock might be: DECIMAL HERTZ= 60 SHERTZ= 10 indicating that only 1/10 second resolution is necessary in the clock handler. Note that the maximum interval which can be expressed in TIMEHI and TIMELO is (2**24)/SHERTZ seconds. This is approximately 3 days if SHERTZ=60. The clock handler is referred to by other RTS-8 system tasks via the symbol CLOCK. This symbol should be defined in the RTS-8 parameter 4-1 RTS-8 System Tasks file to be equal to the clock handler's Task Number. It should be undefined if no clock handler is to be included in the system. COMMAND is the type of request and has the following meanings: 0000 - POST the event flag CLKMSG after the specified interval elapses. TASKNO, EXTRA1, and EXTRA2 are ignored. 1000 - POST CLKMSG immediately. Execute a RUN ER on the task specified by TASKNO after the specified interval elapses. EXTRA1 and EXTRA2 are ignored. 2000 - POST CLKMSG immediately. DERAIL the task specified by TASKNO into a subroutine whose address is specified in EXTRA1 after the specified interval elapses. EXTRA2 is ignored. 3000 - POST CLKMSG immediately. Execute a RUN ER on the task specified by TASKNO after the specified interval elapses, and re-queue this command with the parameters EXTRA1 and EXTRA2 in place of TIMEHI and TIMELO. This has the effect of running the specified task periodically with a period specified by EXTRA1 and EXTRA2. 7000 - Delete from the clock queue all requests for the task specified by TASKNO. TIMEHI, TIMELO, EXTRA1, and EXTRA2 are ignored. POST CLKMSG. The clock handler also maintains the current time-of-day (in system ticks until midnight), in locations TODH (high-order) and TODL (low- order) in Page 0 of Field 0. When this time-of-day reaches zero (i.e., at midnight), it is reset to the quantity -(SHERTZ*86400) (24 hours until midnight) and an OS/8-format date word in location DATE in Page 0 of Field 0 is incremented by one day. Note that in order for the quantity SHERTZ*86400 to be contained in 24 bits, SHERTZ must be less than 192. If SHERTZ is larger, an assembly error will result while assembling the clock handler. 4.1.1 Examples of Clock Handler Calls CAL /WITH A 50HZ SYSTEM TICK RATE, SENDW /THIS CAUSES THE CURRENT TASK CLOCK /TO "GO TO SLEEP" FOR 2 SECONDS. SLEEPM . . SLEEPM, ZBLOCK 3 /RTS-8 MESSAGE OVERHEAD 0 /SET EVENT FLAG AFTER INTERVAL 0; 144 /INTERVAL IS 100 (DECIMAL) SYSTEM /TICKS 4-2 RTS-8 System Tasks Note that by changing the 144 to the assembler expression 2^SHERTZ the above sequence becomes configuration-independent. CAL /RUN THE TASK REPORT ONCE SEND /EVERY HOUR, INDEFINITELY, CLOCK /ASSUMING A 50HZ SYSTEM TICK RATE RUNMSG . . RUNMSG, ZBLOCK 3 /RTS-8 MESSAGE OVERHEAD 3000+REPORT /RUN REPORT AFTER SPECIFIED /INTERVAL AND PERIODICALLY /THEREAFTER, 0;1 /FIRST RUN IS ALMOST IMMEDIATELY /(1/50 SECOND) 53;7440 /PERIOD BETWEEN RUNS IS 180000 /(DECIMAL) SYSTEM TICKS = 3600 /SECONDS = 1 HOUR. 4.2 TERMINAL HANDLER The RTS-8 terminal handler handles a single terminal in either line or character mode. Input in line mode is terminated by a carriage return or an ALTMODE character and may be edited using the RUBOUT and ^U characters. The RUBOUT character deletes the last valid character typed and prints a backslash; the ^U character deletes the entire line and returns the carriage. Character mode input is not echoed and is terminated by overflow of a specified character count. If multiple terminals are to be handled, multiple copies of this terminal handler must be assembled. Assembly parameters in the body of the handler specify which device codes the handler should use to access its terminal and whether the handler is to be a "console" terminal handler (the console terminal handler invokes the MCR whenever a ^C is typed on the keyboard; non-console terminal handlers treat ^C as any other character). The parameters edited into the distributed version of the terminal handler assemble it to handle the PDP-8 console terminal as a "console" device. A message to the terminal handler performs a (possibly null) output operation followed (optionally) by an input operation. The format of messages to the terminal handler is: TTYMSG, ZBLOCK 3 PACK+CRLF+IND+LINE+ASSIGN+LENGTH INBUF OUTTXT where: PACK =0 If output text is in 6-bit packed ASCII format. =4000 If output text is in unpacked ASCII (one character per word, zero word terminates). 4-3 RTS-8 System Tasks CRLF =0 If output message should be followed by a carriage return/line feed. =2000 If output message should not be followed by a carriage return/line feed. IND =0 If OUTTXT is the first word of the output text. =1000 If OUTTXT points to the first word of the output text. LINE =0 If input is in line mode (terminated by carriage return or ALTMODE). =400 If input is in character mode (terminated after "LENGTH" input characters have been read). ASSIGN =0 For normal I/O operations. =200 "Assigns" the terminal handler to the task specified by the LENGTH field. This will cause the terminal handler to only accept messages from the specified task. If another task tries to SEND a message to the terminal handler while it is assigned, the message will be placed in the terminal handler's Message Input Queue but will not be removed for processing by the terminal handler until the assignment is released. The task to which the terminal handler is assigned can release the assignment by sending a message assigning the terminal handler to task number 0. No I/O operation is performed by an assignment message. LENGTH Is a seven-bit field which specifies the maximum size of the input buffer if input is in line mode, the number of characters to input if input is in character mode, and a task number if the ASSIGN bit is set. If input is in line mode and there are LENGTH-1 characters in the input buffer, characters other than carriage return, ALTMODE, RUBOUT and ^U will not be accepted or echoed. INBUF Is a pointer to the input buffer; if it is zero, no input is taken. The input buffer is filled with input characters packed one per word with the parity bit forced on. If input is in line mode, the last character of the line is followed by a zero word (if a carriage return terminated the line) or a negative word (if an ALTMODE character terminated the line). OUTTXT Is either the first word of the output text string (if IND=0) or a pointer to the first word of the output string (if IND=1000). 4-4 RTS-8 System Tasks 4.2.1 Examples of Terminal Handler Messages HIYA, ZBLOCK 3 /RTS-8 MESSAGE OVERHEAD 0 /PACKED TEXT, END WITH CR/LF 0 /NO INPUT TEXT /HELLO/ /TEXT TO BE OUTPUT Sending the above message to the terminal handler prints HELLO on the terminal. QUEST, ZBLOCK 3 /RTS-8 MESSAGE OVERHEAD 2060 /PACKED TEXT, NO CR/LF, /48-CHARACTER INPUT LIMIT ANSWER /POINTER TO INPUT BUFFER TEXT /TYPE THE ANSWER:/ Sending the above message to the terminal handler prints TYPE THE ANSWER: on the terminal and inputs a reply without first returning the carriage. The answer obtained from the above message could be printed on the terminal by sending the following message: TYPANS, ZBLOCK 3 /THE USUAL OVERHEAD 5000 /UNPACKED TEXT, INDIRECT, WITH CR/LF 0 /NO INPUT ANSWER /POINTER TO OUTPUT TEXT 4.3 LINE PRINTER HANDLER The RTS-8 line printer handler outputs to an LE8, LS8E or LV8 line printer. The format of messages to the line printer handler is identical to the format of messages to the terminal handler, but the INBUF word and the LINE bit are ignored (the INBUF word must, however, be present). Refer to Chapter 7 for an example showing the line printer handler message. 4.4 MASS STORAGE HANDLERS This group of handlers all accept the same request message format to read or write blocks on various mass storage devices. Handlers have been written for TC08 DECtape, DF32 and RF08 fixed-head disks, and RK8 and RK8E moving-head disks. The format of messages to mass storage handlers is: MSMESG, ZBLOCK 3 UNIT RW + PAGES + FIELD BUFADD BLOKNO STATUS 4-5 RTS-8 System Tasks where: UNIT Is the number of the unit on which the operation is to be performed. DF32 and RF08 disks consist of only one unit. TC08 DECtape has units 0-7 corresponding to its physical units 0-7. RK8 disk has units 0-3 corresponding to its physical units 0-3. RK8/E disk has units 0-7. Units 0-3 correspond to the outer (lower track number) half of physical units 0-3, and units 4-7 correspond to the inner (higher track number) half of physical units 0-3. RW Is 0 for a read operation, 4000 for a write operation. PAGES Specifies the number of (128-word) pages to transfer, times 100(8)(i.e., if PAGES=2000 it means transfer 20(8) pages or 2048 words; if PAGES=0, 40(8) pages or 4096 are transferred). FIELD Is the PDP-8 field in which the transfer takes place, times 10(8) i.e., if FIELD=30 the transfer takes place in field 3). BUFADD Is the starting address of the buffer to be transferred. BLOKNO Is the block number on the device from which the transfer will begin. All devices are assumed to have 256-word blocks. On DECtape, the first 128 words of each of an even/odd pair of 129-word DECtape records are considered to be a block. STATUS Is a word which is set by the handler on completion of the operation. It will contain a zero if the operation was successful, otherwise it will contain a non-zero quantity which is the device status register. Tasks which use the mass storage handlers should test this word after the I/O operation has been completed (i.e., after the Event Flag has been POSTed) to determine if any errors occurred during the transfer. All RTS-8 mass storage handlers retry operations three times if errors are encountered before setting the STATUS word non-zero. Note that the middle three words of a message to the RTS-8 mass storage handlers are identical to the arguments to an OS/8 handler which performs the same operation. 4-6 RTS-8 System Tasks 4.4.1 Example of Mass Storage Handler Call CAL SENDW DTA /SEND A MESSAGE TO THE DECTAPE HANDLER DTAMSG /AND WAIT FOR COMPLETION TAD STATUS /CHECK THE STATUS OF THE OPERATION SZA CLA JMP ERR /BAD - GO TO ERROR ROUTINE DTAMSG, ZBLOCK 3 /RTS-8 MESSAGE OVERHEAD 4 /DECTAPE UNIT 4 4210 /WRITE 256 WORDS FROM FIELD 1 BUFFER /LOCATION BUFFER 55 /INTO BLOCK 55 (RECORDS 132 & 133) STATUS, 0 /STATUS OF OPERATION STORED HERE 4.5 POWER FAIL TASK The Power Fail Task provides the mechanism by which the system recovers from power failure. If the power-fail/auto-restart hardware option is present and if the system parameter PWRFAL was equated to a non-zero value, the SPL (Skip on Power Low) instruction is included in the interrupt skip chain. If a power low condition occurs, the processor state is saved and the processor is halted. When power comes back, the processor state is restored and an Event Flag is POSTed which wakes up the Power Fail Task. The Power Fail Task restores the clock, console terminal and OS/8 terminal if they are present, and also performs an action for each task in the system based on the contents of an internal table. Each task has a one-word entry in this table, which contains: 0 If nothing should be done for this task (default value) -1 If the EFWT (Event Flag Wait) bit should be cleared in the Task Flags Table entry for this task (i.e., this task should be taken out of Event Flag Wait) ADDR If the task should be DERAILed to location ADDR in the field in which it is executing as well as having its EFWT bit cleared. Each task in the system may alter its entry in the Power Fail Task's table by sending a message to the Power Fail Task. The format of the message is: PWRMSG, ZBLOCK 3 /RTS-8 OVERHEAD WORD where: WORD is the new contents of the Power Fail Task's table entry for the sending task. 4-7 RTS-8 System Tasks 4.6 OS/8 SUPPORT TASK This task supports the execution of the OS/8 operating system as a task under RTS-8. OS/8 is run in the top two (or more) memory fields under control of the KT8/E (standard on PDP-8/E, /F, or /M with 8K or more of core memory) or TSS-8 time sharing hardware option. The OS/8 Support task is configured at system startup time to establish a correspondence between OS/8 devices and RTS-8 handler tasks. Terminal input and output from OS/8 is ring-buffered by several characters to minimize input loss due to usurpation of the CPU by tasks of higher priority. Because of the large number of trapped CDF instructions in OS/8 and its CUSPs, response time is slower than a stand-alone OS/8 system but is still quite reasonable. Several parameters in the system parameter file control the assembly of the OS/8 support task. They are: OSFLDS Defined as the number of fields to be dedicated to OS/8. OSFLDS=2 specifies 8K for OS/8. OSKBDV Set equal to the keyboard IOT code of the OS/8 terminal (OS/8 requires its own dedicated terminal). Example: OSKBDV=03 will use the console terminal keyboard for OS/8. OSTTDV Set equal to the teleprinter IOT code of the OS/8 terminal. Example: OSTTDV=04 will use the console teleprinter for OS/8. OSNULL Specifies how many null characters must follow a line-feed character on the OS/8 terminal. This allows high-speed VT05 terminals to be used as OS/8 terminals. For standard Teletypes and parallel LA30 terminals this parameter should be set to zero. OSSYSD Equated to the task number of the OS/8 system device handler. Example: OSSYSD=DTA would specify DTA0 as the OS/8 system device. The OS/8 system which runs under the OS/8 Support Task may run all OS/8 CUSPs except BUILD and FRTS, the FORTRAN IV run-time system. All references to the keyboard and teleprinter are diverted to the specified OS/8 keyboard and teleprinter. References in OS/8 to the LE8, LS8E or LV8 line printers are diverted to the RTS-8 line printer handler if the system parameter LPT is defined; otherwise they are executed directly by the Support Task. References to the following OS/8 device names will be diverted to the corresponding RTS-8 handler if one is defined: DTA0-DTA7 RKA0-RKA3 RKB0-RKB3 ___________________________ 1) Teletype is a registered trademark of the Teletype Corporation. 4-8 RTS-8 System Tasks In addition, the OS/8 handlers SYS and DSK are diverted to the handler specified by the parameter OSSYSD. Other references to I/O under the supported OS/8 system may cause the OS/8 support task to hang in a loop. 4.7 OS/8 FILE SUPPORT TASK The OS/8 File Support Task (hereafter referred to as OS8F) allows other tasks to lookup, create, and delete files in OS/8 directories. It is included in the same source file as the OS/8 Support Task, but may be assembled independently of that task (depending on which tasks were defined in the system parameter file). The format of messages to OS8F is: OSFMSG, ZBLOCK 3 /RTS-8 OVERHEAD DEVHND^10+UNIT+FUNCT FILPTR STATUS BLOKNO LENGTH where: DEVHND Is the task number of the handler for the desired device. UNIT Is the unit number on which the operation is to be performed. FILPTR Is a pointer to a four-word filename. The PAL8 pseudo-op FILENAME may be used to generate these filenames. FUNCT Represents the function to be performed. It may have the following values: 0 Look up the specified file name and return its starting block number in BLOKNO and its (positive) length in LENGTH. 2000 Enter the specified file name into the first empty space on the device whose length is equal to or exceeds the value in LENGTH. Return the starting block number of the new file in BLOKNO. If a file of the same name previously existed on the device it is deleted. The value of LENGTH is unchanged. 4000 Delete the specified file name. 4-9 RTS-8 System Tasks STATUS Describes the final status of the operation as follows: 0 Operation successful. 1 File not found on Lookup or Delete. 2 No room for file on Enter. >2 I/O error occurred - value is hardware error status of device. -1 Invalid directory on device. If both OS8F and the OS/8 Support Task are present in a system, an interlock is set up to prevent simultaneous updating of directory blocks by both systems. Because OS/8 tends to leave directory blocks in core for long periods of time, this interlock scheme is very restrictive. Before a Delete or Enter operation is performed, OS8F waits until OS/8 is in a state in which: 1. There is no active temporary file on the OS/8 device corresponding to DEVHND and UNIT. 2. OS/8 has just loaded the Keyboard Monitor, Command Decoder, or USR into core. Lookup operations are not interlocked since they do not modify the directory. 4.8 UDC HANDLER This handler gives the user the capability of controlling all the various types of UDC functional devices. This handler performs two types of actions--immediate and deferred. Immediate actions include reading and sending analog and digital values to appropriate UDC functional devices. Deferred actions may be linked to specified events within the UDC (counters overflowing, switches being thrown) and include: 1. Run a specified task when the event occurs 2. Set the Event Flag when the event occurs 3. DERAIL a specified task when the event occurs The number of deferred requests which may be pending simultaneously is an assembly parameter of the handler. The UDC handler permits the following operations: 1. Analog Output - send a 10-bit value to an analog channel 2. Analog Input - accept input from analog subchannel 3. Digital Output - send a 12-bit value to a digital channel 4. Digital Input - read a digital channel 4-10 RTS-8 System Tasks 5. Get Generic Code - determine the generic code for a specified channel 6. Enable Counter - permit interrupts from a counter channel 7. Read Counter - read current value of counter channel 8. Disable Counter - disable interrupts from a counter channel 9. Enable Contacts - permit interrupts from a contact channel 10. Change Of State - find the current COS value for a contact channel 11. Disable Contacts - ignore interrupts from a contact channel Each operation is discussed in detail below, including the format of the message for specifying the operation. As with all RTS-8 messages, a 3-word header is required for use by the Executive. Word 4 of all UDC messages specifies one of the eleven UDC operations. An additional one to five words is also required in the UDC message to completely specify the operation. Word 10 of all UDC messages contains the error state. 4.8.1 AO Analog Output Format: AO channel number subchannel & value Channel number is the analog output channel. The subchannel and value word is formed by the subchannel (0-3) in bits 0 and 1 and the 10-bit value in bits 2-11. For example, a message for an analog output operation: AOEX, ZBLOCK 3 AO /ANALOG OUTPUT 23 /CHANNEL 23 4614 /SUBCHANNEL 2, VALUE 614 ZBLOCK 3 AOER, 0 /ERROR INDICATOR 4.8.2 AI Analog Input Format: AI channel subchannel & gain answer where channel is the analog input channel. The subchannel and gain word need only specify the gain in bits 1-3 and the subchannel in bits 9-11. The handler automatically sets bits 0 and 7 (enable conversion and read control register). The result is put in answer. 4-11 RTS-8 System Tasks AIEX, ZBLOCK 3 AI /ANALOG INPUT 17 /CHANNEL 17 3 /SUBCHANNEL 3, GAIN 0 AIANS, 0 /RESULT HERE ZBLOCK 2 AIERR, 0 /ERROR INDICATOR It is the user's responsibility to ensure for each major channel that there is sufficient time (approximately 250 microseconds) for each subchannel conversion to be completed before another is indicated. In general, it may be helpful if all A/D conversions for a major channel are initiated from the same task. 4.8.3 DO Digital Output Format: DO channel value Channel is a legal digital output channel and value is the number to be output. For example: DOEX, ZBLOCK 3 DO /DIGITAL OUTPUT 20 /CHANNEL 20 7777 /VALUE = 7777 ZBLOCK 3 DOER, 0 /ERROR INDICATOR 4.8.4 DI Digital Input Format: DI channel result Channel is the appropriate digital input channel and result will contain the value of the channel when read. For example: DIEX, ZBLOCK 3 DI /DIGITAL INPUT 27 /CHANNEL 27 DIANS, 0 /VALUE OF CHANNEL 27 WILL BE PUT HERE ZBLOCK 3 DIER, 0 /ERROR INDICATOR 4.8.5 GC Generic Code Format: GC channel result 4-12 RTS-8 System Tasks The generic code of the specified channel is put in result. For example: GCEX, ZBLOCK 3 GC /DETERMINES GENERIC CODE 27 /CHANNEL 27 GCANS, 0 /GENERIC CODE PUT HERE ZBLOCK 3 GCER, 0 /ERROR INDICATOR 4.8.6 EC Enable Counter Format: EC channel initial value reload value event action address Channel is the counter channel to be enabled, initial value is the first value to be loaded into that channel, and reload value is the value with which to reload the channel after every event. If the reload value is 0, the counter is not reloaded. The event action and address words specify what is to happen when the counter interrupts. There are three mutually exclusive possibilities, indicated by setting the appropriate bit in the event action word: bit 0 = 1 = set event flag of this job; continue execution of this job when the event occurs. Address word not used. bit 1 = 1 = run a task; run task specified by bits 4-11 of event action word. Address word not used. bit 2 = 1 = DERAIL the task; the address word is only used by the DERAIL operation and specifies the address of the DERAIL subroutine. That subroutine must be in the same field as the calling task. Bit 3 indicates how many times the action is to occur: bit 3 = 1 = do action just once. If bit 3 = 0, specified action is performed after each interrupt. Several enable counter examples follow: ECEX1, ZBLOCK 3 EC /ENABLE COUNTER 4 /CHANNEL 4 7700 /INITIAL VALUE OF 7700 7710 /RESET TO 7710 AFTER EACH EVENT 4000 /POST EVENT FLAG ON EVENT 0 /UNUSED ECER1, 0 /ERROR INDICATOR 4-13 RTS-8 System Tasks ECEX2, ZBLOCK 3 EC /ENABLE COUNTER 4 /CHANNEL 4 1205 /INITIAL VALUE OF 1205 0 /DON'T RESET 2016 /RUN TASK 16 ON EVENT 0 /UNUSED ECER2, 0 /ERROR INDICATOR ECEX3, ZBLOCK 3 EC /ENABLE COUNTER 5 /CHANNEL 5 10 /INITIAL VALUE OF 10 7700 /RESET TO 7700 1015 /DERAIL TO TASK 15 5620 /AT LOCATION 5620 ECER3, 0 /ERROR INDICATOR 4.8.7 RC Read Counter Format: RC channel result where channel is the counter channel whose current value is to be read. That value is placed in result. For example: RCEX, ZBLOCK 3 RC /READ COUNTER 6 /CHANNEL 6 RCANS, 0 /VALUE OF CHANNEL 6 PUT HERE ZBLOCK 3 RCER, 0 /ERROR INDICATOR 4.8.8 DC Disable Counter Format: DC channel where channel is the counter channel from which interrupts are to be ignored. For example: DCEX, ZBLOCK 3 DC /DISABLE COUNTER 6 /CHANNEL 6 DCER, ZBLOCK 4 0 /ERROR INDICATOR 4.8.9 ECT Enable Contacts Format: ECT bit & channel event action address 4-14 RTS-8 System Tasks where the bit & channel word specifies the bit on the contact channel from which to enable interrupts. Channel is specified in bits 4-11 and the contact bit is packed in bits 0-3 as a value from 0 - 13 (octal). Event action and address are specified in the same manner as in the enable counter function. For example: ECTEX1, ZBLOCK 3 ECT /ENABLE CONTACTS 5401 /FROM BIT 13(8) OF CHANNEL 1 2013 /RUN TASK 13 AFTER AN EVENT OCCURS ZBLOCK 3 ECTE1R, 0 /ERROR INDICATOR ECTEX2, ZBLOCK 3 ECT /ENABLE CONTACT 1001 /FROM BIT 2 OF CHANNEL 1 4000 /ON 1ST OCCURRENCE OF EVENT, POST /EVENT FLAG ZBLOCK 3 ECTE2R, 0 /ERROR INDICATOR 4.8.10 CS Change of State Format: CS channel result where channel is the contact channel whose current change of state value is to be placed in result. For example: COSEX, ZBLOCK 3 CS /READ COS 1 /CHANNEL 1 COSANS, 0 /RESULT HERE ZBLOCK 3 COSER, 0 /ERROR INDICATOR 4.8.11 DCT Disable Contacts Format: DCT bit & channel where bit & channel is specified as in enable contact, that is, bits 0-3 specify the bit (0 - 13(octal)) and bits 4-11 specify the channel to be disabled. For example: DCTEX, ZBLOCK 3 DCT /DISABLE CONTACTS 5401 /FROM CHANNEL 1, SUBCHANNEL 13(8) ZBLOCK 4 DCTANS, 0 /ERROR INDICATOR 4-15 RTS-8 System Tasks 4.8.12 UDC Assembly Parameters The UDC handler has several assembly parameters that must be specified by the user to indicate his UDC configuration. They are: RINGBF Number of interrupts that can be stored in ring buffer. NCNTR Number of counter channels. NCNTC Number of contact channels. NAD Number of analog input channels. FCTR Address of first counter. The counters must be at contiguous channels. FCT Address of first contact. Contacts must also be at contiguous channels. FAD Address of first A/D channel. Analog input channels must be at contiguous channels. These parameters are used mainly to specify the sizes of several tables in the UDC handler, allocated as 30(8) words/contact channel, 3 words/counter channel, and 16(8) words/analog channel. Note that the UDC handler currently assumes that the handler and all its tables are entirely within the same data field (although the user could easily reprogram this). When considering the size of RINGBF, keep in mind that when the buffer is full, UDC interrupts are disabled until there is room in the buffer. Each interrupt requires two entries in the buffer; i.e., actual buffer size is 2 * RINGBF. 4.8.13 UDC Error Conditions To indicate error conditions, a value is placed in the tenth word of the task's message by the UDC handler. The values and meanings are: 1. Illegal generic code for specified channel and operation 2. Channel or subchannel value not valid 3. Illegal function code It is the user's responsibility to initialize and check the error word. A no error condition puts a 0 in this location. Only errors encountered at non-interrupt time are returned in this manner, thus they may also indicate a faulty UDC hardware functional device. Generic codes of 0 or 1 encountered at interrupt time are ignored. 4-16 RTS-8 System Tasks 4.9 CASSETTE HANDLER This handler (CSA) allows the user to read and write variable-length records on DECassettes, as well as perform various special functions (rewind, write end-file, etc). There are two general categories of cassette operation: 1. Handler functions - read and write 2. Utility functions - rewind, backspace file gap, write file gap, backspace block gap, and skip to file gap It is up to the user to call these functions in a meaningful sequence. For both functions, word 1 of the message defines the cassette unit in bits 9-11 and function in bit 0 (where bit 0 = 0 means a utility call and bit 0 = 1 means a handler call). For a handler function, four more words are required: word 2 bit 0 = 0 - read 0 = 1 - write bits 6-8 - field of buffer bit 11 - do not store data (applicable to read only) word 3 - buffer address word 4 - record size in bits 4-11 word 5 - status return Cassette conventions specify a record size of 200 bytes, but the user may use any size up to 377, according to his requirements. The buffer specified by the message cannot cross field boundaries. For a read operation, the buffer is optional (although its word in the message must be included), according to bit 11 of word 2. The non-store capability can be used for advancing through a long file. Word 5 contains the contents of status register B, which is defined by the bit setting as follows: Bit Meaning ___ _______ 4 = CRC /block error 5 = timing 6 = EOT/BOT 7 = EOF 8 = drive empty 9 = read/write 10 = write lockout 11 = ready Word 5 should be examined by the user at the end of each cassette operation to check for errors encountered. For example, to write 100 words from a buffer starting at 21200 to cassette unit 3, the message is: 4-17 RTS-8 System Tasks MSG1, ZBLOCK 3 4003 /HANDLER OPERATION ON UNIT 3 4020 /WRITE FROM FIELD 2 THE 1200 /BUFFER AT 1200 WHICH IS 0100 /100 BYTES LONG 0000 /STATUS RETURN To read and not store 200 words from unit 2, the message is: MSG2, ZBLOCK 3 4002 /HANDLER OPERATION ON UNIT 2 0001 /READ AND DON'T STORE 0000 /UNUSED 0200 /200 BYTES 0000 /STATUS RETURN For a utility operation, the format of the rest of the message is: word 2 (function in bits 6-8): 10 = Rewind 30 = Backspace file gap 40 = Write file gap 50 = Backspace block gap 70 = Skip to file gap word 3 Status return For example, to request a rewind on unit 1, the message is: MSG3, ZBLOCK 3 0001 /UTILITY OPERATION ON UNIT 1 0010 /REWIND 0000 /STATUS RETURN If an error is encountered, the operation is retried 3 times, except write lock out on a write operation or error while reading CRC. The CAPS-8 USER'S MANUAL (DEC-8E-OCASA-A-D) is suggested reading for users who are unsure of cassette conventions. 4.10 CASSETTE LABEL SUPPORT HANDLER This handler supports the DEC standard cassette format and allows the calling task to lookup and enter files on cassettes in that format. This "handler" requires the cassette handler to perform the actual I/O operations involved. The cassette operations ENTER, LOOKUP and CLOSE are performed by the task CSAF which in turn calls the cassette handler (CSA). ENTER and LOOKUP require the user to put appropriate information in a record header area with which CSAF performs the file operations. The header area must be at least forty words long and cannot cross field boundaries. The format of a CSAF message is: 4-18 RTS-8 System Tasks word 1 bit 0 = 1 = ENTER bit 1 = 1 = LOOKUP bit 2 = 1 = CLOSE bits 9-11 = unit word 2 Address of header for ENTER and LOOKUP Status return for CLOSE word 3 Field of header for ENTER and LOOKUP word 4 Status return for ENTER and LOOKUP In all cases, the status return is the contents of Status Register B. For ENTER and LOOKUP, the format of the header area must conform with cassette standards (and therefore will be compatible with CAPS-8). This format is: Byte Use ____ ___ 0-5 Filename 6-10 Filename extension 11 File type 1 = ASCII 0 = undefined 12-13 File record length. Currently word 12 must be 0 14-15 Unused 16-23 Date (ASCII) specified as ddmmyy 24-37 Unused For an ENTER operation, if a file with the name specified in the header area is found on the specified unit, it is deleted. For a LOOKUP operation, the record size of the specified file is returned in location header+13 (byte 13). If the file is not found or if an error occurs, this location contains 0. The CLOSE operation is automatically followed by a REWIND. Examples of messages follow. MSG4, ZBLOCK 3 4000 /ENTER ON UNIT 0 6400 /INFORMATION IN HEADER STARTING AT 6400 0010 /OF FIELD 1 0000 /STATUS RETURN MSG5, ZBLOCK 3 1003 /CLOSE ON UNIT 3 0000 /STATUS RETURN 4-19 CHAPTER 5 MONITOR CONSOLE ROUTINE The Monitor Console Routine (MCR) provides functions which the user can request from the console terminal in order to control, inspect, and (to some extent) debug his system. The MCR indicates that it is ready to accept input by printing the prompting character ">" on the terminal. An MCR command consists of a command word (of which only the first 2 characters are significant) followed by arguments and terminated by either a carriage return or an altmode. Commands may be a maximum of 40 characters long. If the command is terminated by a carriage return, the MCR will return to the terminal for another command when it finishes processing the current command; if an altmode terminates the command line the MCR will put itself in a WAIT state when it finishes processing the command; it can be brought out of this wait state by typing ^C (CTRL C) on the console terminal. When the MCR has prompted with its ">" and is waiting for input, no other RTS-8 tasks can use the terminal; therefore if the terminal is used for something other than an exclusive MCR terminal (for instance for error logging) the operator should type ^C, type his MCR command and terminate it with an altmode character. This way the MCR will not tie up the terminal. 5.1 MCR COMMAND ARGUMENTS Certain syntactic constructions are used as arguments to several MCR commands; these are defined below: , A single comma or a single space may be used interchangeably to separate arguments to MCR commands. Task-ID A Task-ID is either a number or a name. If it is a number it represents the internal RTS-8 Task Number, which is also the task priority, of a task. If it is a name, the first 4 characters of the name are looked up in the MCR's Task Name table to produce a Task Number. Time-of-day A Time-of-day is of the form hh:mm, where hh represents hours past midnight and mm represents minutes past hh:00. Address An Address is an octal number from 1 to 5 digits in length which represents a PDP-8 memory address. If the address is less than 5 digits long the high order digits are assumed to be 0. Word A Word is an octal number from 1 to 4 digits long. 5-1 Monitor Console Routines A list of the MCR commands follows. In the header line of the description, the significant portion of the command word is capitalized. Optional arguments are enclosed in square brackets ([]) and choices will be embedded in parentheses and separated by exclamation points (!). Following the header line will be a description of the action which the command causes and possibly an example. Commands which are preceded by asterisks (*) are not present if the symbol CLOCK is not defined in the RTS-8 parameter file (indicating that there is no clock in the system). 5.2 MCR COMMANDS 5.2.1 * DAte [mm/dd/yyyy [,Time-of-day]] The date mm/dd/yyyy, if specified, becomes the system date. Only the last digit of the year is significant; all others are ignored and 197 assumed. The RTS-8 system date is automatically incremented at midnight, but all months are treated as being 31 days in length. If the second argument is specified, the system Time-of-day is set equal to it. If no arguments are specified, the current system date is printed on the console terminal in the form mm/dd/197y. 5.2.2 * TIme [Time-of-day] If a Time-of-day is specified, it becomes the system time-of-day. If no argument is specified the current system time-of-day is printed out on the console terminal in the form hh:mm. 5.2.3 NAme Task-ID,Newname The character string Newname becomes the new name of the task specified by Task-ID. The old name of that task (if any) is lost. Newname may be any length but only the first 4 characters are stored. Newname should not be the name of any other task or an error message will result. Examples: >NAME 7 REPORT Task number 7 is given the name REPO. >NAME REPORT, FOO Task number 7, which is known as REPO, is now known as FOO. 5-2 Monitor Console Routines NOTE The MCR name table is initialized at assembly time to contain the names of any DEC-supplied tasks which are listed in the parameter file (e.g., if the symbol CLOCK is defined in the parameter file as CLOCK=2, task number 2 will get the name CLCK). The MCR name table may be modified by the user to include his own task names permanently by editing the file MCR.PA after the label NMTBL. 5.2.4 REquest Task-ID [,(@Time-of-day ! Interval)[,Interval]] Where Interval is of the form: nH n hours nM n minutes nS n seconds nT n system ticks This command requests a task to run immediately (if only Task-ID is specified), at a given Time-of-day, or after a given Interval. Requesting a task clears the RUNWT bit in the Task Flags Table entry for that task. If the third argument is specified the task is rerun periodically with the Interval given in the third argument as the period. If the parameter CLOCK in the RTS-8 parameter file is not defined, the second and third arguments of this command are ignored and the given task is always run immediately. Examples: >REQUEST X Will run task X immediately. >RE FOO,@2:00 Will run task FOO at 2:00 A.M. (if it is after 2 A.M., FOO will be run tomorrow at 2 A.M.). >RE 5,lOM,5M Will run task number 5 10 minutes from now and every 5 minutes thereafter. >REQ HIPR,1T,6T On a machine with a 60 Hz clock, this command will run the task HIPR immediately, that is, .016 seconds from now, and 10 times per second thereafter. 5-3 Monitor Console Routines NOTE If, at the time the REQUEST command is executed, (which may be several hours after it is typed in) the task specified by Task-ID does not have the RUNWT bit set in its Task Flags Table entry, then the REQUEST command is a no-op. Similarly, if the task had other bits set besides RUNWT it will not be run upon execution of the REQUEST command, but will be run when the other blocking bits are cleared. 5.2.5 STop Task-ID Suspends execution of the task specified by Task-ID by turning the RUNWT bit on in the Task Flags Table entry for that task. A task which has been stopped may be resumed via the REQUEST MCR command (in this instance it is easier to think of it as the resume MCR command). 5.2.6 DIsable Task-ID Disables future execution of the specified task by setting the ENABWT bit on in the Task Flags Table entry for that task. 5.2.7 ENable Task-ID Clears the ENABWT bit in the Task Flags Table entry for the specified task, thus enabling it to run. If the ENABWT bit was not set, the command is a no-op. 5.2.8 * CAncel Task-ID Cancels any clock queue entries involving the task specified by Task-ID. This includes any entries made by the MCR (from previous timed REQUEST commands), entries involving the specified task made by other tasks (e.g., a timed DERAIL) and entries made by the specified task involving itself (e.g., a timed POST). Note that in the case of the timed POST the event flag will not be POSTed and the task may hang up forever waiting for it. 5.2.9 SYstat [Task-ID] If no argument is specified, the SYSTAT command prints a system status report. Each line of the report describes an existent task in the system. The data printed for each task are its Task Number/priority, its name (if it has one), and what blocking bits are on in its Task Flags Table entry. Each blocking bit is printed as a one-letter code, preceded by a space. The possible one letter codes and their meanings are 5-4 Monitor Console Routines E Waiting for event flag M Waiting for a message O Waiting for an event flag or a message R Waiting to be REQUESTed or RUN S Waiting to be swapped in (not in Phase 1) D Disabled U USERWT bit set In addition, an asterisk is printed at the end of the line if the task has any messages waiting in its input queue. A more detailed status report on a single task may be obtained by specifying the Task-ID of that task as an argument to the SYSTAT command. The detailed report contains all the information in the general report, followed by five octal words: WORD 1 The location of the Task State Table entry containing words 2-5. This word is followed by a colon. WORD 2 Task Link in sign bit, IF in bits 6-8, DF in bits 9-11. WORD 3 Task PC WORD 4 Task AC WORD 5 Task MQ Examples: A general SYSTAT command might produce the following sample output line: 13 CARD E * meaning task number 13, named "CARD", is in Event Flag Wait and has input messages pending. The command: >SYSTAT CARD might produce the single line: 13 CARD E * 1320: 0022 1741 0000 2525 indicating that CARD is stopped at location 21741 with its AC and Link zero and 2525 in its MQ. The SYSTAT command may be left out of the MCR assembly by setting the system parameter MCRSYS equal to zero in the RTS-8 parameter file, saving one page of code. 5.2.10 OPen Address [,Count] If Count is not specified it is assumed to be 1. Count locations starting at Address are displayed in octal on the console terminal in the form: lllll/ cccc The range of locations displayed may cross a field boundary. 5-5 Monitor Console Routines 5.2.11 EXamine Address [,Count ] The EXAMINE command is identical to the OPEN command. 5.2.12 DEposit Address,Word [,Word] [,Word].... The second through nth arguments are deposited into core at consecutive locations starting at Address. As in OPEN, field boundaries may be crossed. For example: >DEPOSIT 26132 7700,7200,50 Deposits 7700 into location 26132, 7200 into location 26133, and 0050 into location 26134. 5.2.13 POst Address POSTs the Event Flag at the specified address. This command is useful when debugging a system for simulating the effects of nonexistent tasks or devices. 5.2.14 EXIT The EXIT command causes the MCR to terminate RTS-8 execution (after pausing approximately 1 second for pending I/O to complete) and returns to the OS/8 monitor at location 07600. This command must be typed out completely or it will be regarded as an EXAMINE command. 5.3 MCR ERRORS The MCR checks each command line for errors and, if it finds one, issues one of the following messages and reprompts on the terminal for a corrected command: BAD CHAR Character was not expected where it occurred BAD NUMBER Number out of legal range or missing BAD DELIM No space or comma where one was expected BAD NAME Task name not in name table or duplicate 5-6 CHAPTER 6 ASSEMBLING AND LOADING TASKS FOR RTS-8 RTS-8 tasks are assembled with the OS/8 PAL8 assembler and the use of a parameter file. RTS-8 parameter files are all edited versions of a master parameter file which is included in the distributed sources (see Appendix A). All definitions in the master file which are to be supplied by the user are left blank in the file; i.e., a sample line in the file might be: PDP8E= /SET TO 1 IF PDP8E OR PDP8A, ELSE 0 There should be a unique parameter file created for every RTS-8 environment, where environment is a combination of the available hardware and the set of tasks being run. The parameter file is divided into 5 sections: 1. Executive specifications - these specifications control the assembly of the RTS-8 Executive and therefore are essential; specifications include whether the machine is a PDP-8/E, how much core is available, whether to save/restore the MQ, how many tasks exist in the system, etc. 2. Task definitions - this section defines symbolic names for the various system tasks. The names of all system tasks which are to be included in the system should be defined here, and any system task which is not included should have the line which defines it deleted from this section. It is recommended that this deletion be performed by inserting a slash (/) character at the beginning of the line, making the entire line a comment. The user is encouraged to add symbolic definitions of his own tasks to this section. 3. System task specifications - these specifications control the assemblies of various system tasks. They include the desired clock rate, the number of fields to allocate to OS/8, etc. The set of parameters controlling a task are all grouped together and assembled conditionally only if the task name is defined. 4. System wide definitions - these include the definitions of the symbols used in this document to describe the Executive Requests and Task Flag bits, plus many other useful definitions. This section should not be altered by users. 6-1 Assembling and Loading Tasks 5. Task setup - this section uses four symbols defined in the body of the user's task to initialize the RTS-8 table entries needed to put that task in the system. The four symbols needed are: TASK Defined to be the task number of the task, generally by a statement of the form: TASK=symbol where "symbol" is the symbolic name for the task which the user has defined in the RTS-8 parameter file. CUR Defined to contain the field of the task's starting address in bits 6-8 (e.g., CUR=10) NOTE It is the user's responsibility to place the task's starting code in the field specified by CUR. This is done by the PAL8 assembler pseudo-op: FIELD CUR%10 START Defined to be the task's starting address (not necessarily the lowest address in the task) INIWT Defines the initial wait bits in the Task Flags Table entry for this task; INIWT=0 means the task is runnable when the system starts up. Up to three tasks may be defined in one assembly; see TASK above. (The demonstration program in Chapter 7 uses only one.) The corresponding symbols for the other tasks are TASK2 and TASK3, CUR2 and CUR3, etc. The task setup section places its data into the RTS-8 tables by origining into them; no executable code is generated. To create a real-time system using RTS-8, first lay out the tasks you will need on paper. Then create a parameter file with the parameters for that system, and allocate core storage among the Executive, the system tasks, and your own tasks. Write your tasks and assemble each task preceded by the parameter file. Load the resulting binaries with OS/8 ABSLDR, placing the RTS-8 binary first. At this point you may start your system, or save it as a core image file to be run later. Each RTS-8 system task contains assembler code which causes it to be assembled for loading into a specific area of core. The user may assemble his own tasks to load into the areas of core not used by the system tasks in his configuration, or he may edit the system tasks so that they load wherever he wishes. Page zero locations and auto-index registers used by system tasks can also be redefined by editing the tasks involved. 6-2 Assembling and Loading Tasks The OS/8 BITMAP program can be extremely useful in determining that no two RTS-8 tasks are loading into the same area or using the same Page 0 locations. OS/8 BITMAP accepts a list of binary files as input and produces as output a map of core. Each location of core is represented in this map by a single digit which has the following meaning: 0 Nothing has been loaded into this location 1 Information has been loaded into this location 2 Information has been loaded into this location twice 3 Information has been loaded into this location three or more times There are only two places in core where twos are allowed to appear in the bit map. These areas are the RTS-8 Executive Tables (starting at location 01200) and the MCR name table in the MCR. Appearance of a three or a two in an area (other than those just mentioned) in the bit map is an indication that two or more tasks have loaded something into the same location. An RTS-8 system created as above has a starting address of 00200. If RTS-8 was not specifically configured for a PDP 8/E it will halt initially so that the operator may clear any stray device flags. Press START to resume operation on a PDP 8, 8/I or 8/L; press I/O PRESET followed by CONTINUE on a PDP-12. 6-3 CHAPTER 7 DEMONSTRATION PROGRAM This system will show OS/8 execution in the background with several foreground task executions, i.e., CLOCK, MCR and a line printer on a 16K PDP-8/E. OS/8 will use a 2400 baud VT05 terminal (device codes 32 and 33) and RK8E as the system device. Below is a discussion of the parameter file (lines 1-162) found in the program which follows (note that more tasks than necessary have been defined for system execution): Line # Description ______ ___________ 48 Running on a PDP-8/E or PDP-8/A 49 No tasks use the MQ, so there is no need to save and restore it 50 No powerfail hardware 51 16K machine 52 Eleven (octal) tasks *59 System has a clock (DK8-EA), this task is priority #1 61 Terminal module this task is priority #3 *62 Line printer module, this task is priority #2 63 MCR module, this task is priority #7 65 RK8E module required for OS/8 as system device, this task is priority #4 71 OS/8 background task, this task is priority #11 74 User task #1, this task is priority #5 (this is TICK), see lines 163-213 75 User task #2 (to be defined by user), this task is priority #10 80 OS/8 requires two memory fields 81 OS/8 terminal input device code=32 82 OS/8 terminal output device code=33 83 OS/8 system device=RK8E 84 VT05 at 2400 BAUD (without KL8-JA) requires 4 fill characters 87 MCR SYSTAT facility should be included in MCR assembly *90 Clock is DK8EA or DK8-EC 91 Twenty entries in clock queue *93 Hardware clock runs at 120 ticks/second *94 Number of system ticks ________________ * This demo will show a user task (UT1) as printing "TICK" on the line printer every half second. If the user does not have a clock or line printer do not execute any of the MCR commands shown before those that deal with "TIME" or starting or stopping the task named "TICK". Also do not perform the assembly named TICKER. 7-1 Demonstration Program .R PAL8 *RTS8.BNDATE \ MCR prints ">"; Type "DATE" | 02/06/74 | Current OS/8 Date is Printed | >TIME 13:00 | Enter Time (1:00 PM) | >TIME | Ask for Time ________________________| 13:00 / | |_/ Loading Binaries into >SYS \ Ask for System Status \ Core with OS/8 ABSLDR. 01 CLCK 0 | 02 LPT M | 03 TTY M | 04 RK8 M | 05 R | 07 MCR | 11 OS8 E / >NAME 5 TICK \ Call Task #5 "TICK" >SYS | Ask for System Status 01 CLCK 0 | 02 LPT M | 03 TTY M | 04 RK8 M | 05 TICK R | 07 MCR | 11 OS8 E / >REQUEST TICK \ Start TICK running; "TICK" is printed on LPT every | 1/2 second. >STOP TICK | Stop TICK >TIME | Ask Time Again 13:02 / >REQ TICK,@l3:05 \ Ask TICK to Run at 1:05 >TIME | 13:02 | Time = 1:02 >TIME | 13:03 | Time = 1:03 >TIME | 13:04 | Time = 1:04 >TIME | TICK Starts Running Again 13:05 / Time Now 1:05 >STOP TICK \ Stop TICK Task >EXIT | Return to OS/8 Monitor | ... / 7-3 Type this program with the OS/8 Editor and save it on the system device under the name of TICKER.PA. /PARAMETERS FOR RTS-8 TASKS PAL8-V9B 05/22/74 PAGE 1 1 /PARAMETERS FOR RTS-8 TASKS 2 / 3 / 4 / 5 / 7 / 8 / 9 / 10 / 11 /COPYRIGHT (C) 1974 BY DIGITAL EQUIPMENT CORPORATION 12 / 13 / 14 / 15 / 16 / 17 / 18 / 19 / 20 / 21 / 22 /THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE 23 /WITHOUT NOTICE AND SHOULD NOT BE CONSTRUED AS A 24 /COMMITMENT BY DIGITAL EQUIPMENT CORPORATION. DIGITAL 25 /EQUIPMENT CORPORATION ASSUMES NO RESPONSIBILITY FOR 26 /ANY ERRORS THAT MAY APPEAR IN THIS DOCUMENT. 26 / 27 /THE SOFTWARE DESCRIBED IN THIS DOCUMENT IS FURNISHED TO 28 /THE PURCHASER UNDER A LICENSE FOR USE ON A SINGLE 29 /COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION OF 30 /DIGITAL'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM 31 /EXCEPT AS MAY OTHERWISE BE PROVIDED IN WRITING BY 32 /DIGITAL. 33 / 34 /DIGITAL EQUIPMENT CORPORATION ASSUMES NO RESPONSIBILITY 35 /FOR THE USE OR RELIABILITY OF ITS SOFTWARE ON EQUIPMENT 36 /THAT IS NOT SUPPLIED BY DIGITAL. 37 / 38 / 39 / 40 / 41 / 42 / 43 / 44 / 7-4 /PARAMETERS FOR RTS-8 TASKS PAL8-V9B 05/22/74 PAGE 2 45 46 /RTS8 EXEC PARAMETERS - EDITED BY USER 47 48 0001 PDP8E= 1 /1 IF PDP 8/E 49 0000 EAE= 0 /1 IF SYSTEM SHOULD SAVE MQ 50 0000 PWRFAL= 0 /1 IF POWER FAIL/RESTART ENABLED IN HARDWARE 51 0030 HGHFLD= 30 /HIGHEST FIELD USED (EG 30 FOR A 16K MACHINE) 52 0011 NTASKS= 11 /NUMBER OF TASKS IN SYSTEM 53 54 /COMMON TASK NUMBERS - EDITED BY USER 55 /IT IS ADVISABLE TO DEFINE ALL TASKS HERE. NAMES GIVEN 56 /BELOW ARE USED BY SOME SYSTEM TASKS AND SHOULD BE DELETED 57 /FROM THIS LIST IF THE CORRESPONDING TASK IS NOT INCLUDED /IN THE SYSTEM 58 59 0001 CLOCK= 1 /CLOCK HANDLER - SHOULD BE HIGH PRIORITY 60 /PWRF= /POWER FAIL HANDLING TASK 61 0003 TTY= 3 /TELETYPE DRIVER TASK 62 0002 LPT= 2 /LINE PRINTER DRIVER TASK 63 0007 MCR= 7 /MONITOR CONSOLE ROUTINE 64 /DTA= /DECTAPE DRIVER TASK 65 0004 RK8= 4 /RK8 OR RK8E DISK DRIVER TASK 66 /RFO8= /RF08 DISK DRIVER TASK 67 /DF32= /DF32 DISK DRIVER TASK 68 /CSA= /CASSETTE DRIVER TASK 69 /CSAF= /CASSETTE FILE SUPPORT TASK 70 /UDC= /UNIVERSAL DIGITAL CONTROLLER TASK 71 0011 OS8= NTASKS /OS/8 SUPPORT - NORMALLY LOWEST PRIORITY 72 /OS8F= /OS/8 FILE SUPPORT 73 74 0005 UT1= 5 /USER TASK 1 75 0010 UT2= 10 /USER TASK 2 76 77 /SOFTWARE PARAMETERS - EDITED BY USER 78 79 IFDEF OS8 < 80 0002 OSFLDS= 2 /NUMBER OF FIELDS TO ALLOCATE TO OS/8 (EG 2) 81 0032 OSKBDV= 32 /OS/8 KEYBOARD DEVICE CODE (EG 03 = CONSOLE) 82 0033 OSTTDV= 33 /OS/8 TELEPRINTER DEVICE CODE (EG 04) 83 0004 OSSYSD= RK8 /OS/8 SYSTEM DEVICE DRIVER TASK (E.G. RK8) 84 0004 OSFILL= 4 /# FILLS NEEDED AFTER LINE FEED 85 > /(EG 4 FOR 2400 BAUD VT05) 7-5 86 IFDEF MCR < 87 0001 MCRSYS= 1 /1 IF MCR SYSTAT FACILITY DESIRED 88 > 89 IFDEF CLOCK < 90 0000 CLKTYP= 0 /0(DK8EA/DK8EC) OR 1(KW12) OR 2(VT8E) OR /3(DK8FP) 91 0020 CLKQLN= 20 /MINIMUM NUMBER OF ENTRIES ON THE CLOCK /OUEUE 92 DECIMAL 93 0170 HERTZ= 120 /NUMBER OF HARDWARE TICKS PER SECOND 94 0074 SHERTZ= 60 /NUMBER OF SYSTEM TICKS PER SECOND 95 OCTAL 96 > /PARAMETERS FOR RTS-8 TASKS PAL8-V9B 05/22/74 PAGE 3 97 /EQUIVALENCES: 98 99 7344 AC7776= CLL STA RAL 100 7346 AC7775= CLL STA RTL 101 7330 AC4000= CLA STL RAR 102 7350 AC3777= CLL STA RAR 103 7332 AC2000= CLA STL RTR 104 7326 AC0002= CLA STL RTL 105 106 /MONITOR CALL VALUES: 107 108 4020 CAL= JMS 20 /CALL THE EXECUTIVE 109 5424 POSTDS= JMP I 24 /DISMISS AN INTERRUPT 110 4425 WAITM= JMS I 25 /WAIT FOR MULTIPLE EVENTS 111 112 0000 SEND= 0 /SEND MESSAGE 113 0001 RECEIV= 1 /RECEIVE MESSAGE 114 0002 WAITE= 2 /WAIT FOR EVENT FLAG 115 0003 RUN= 3 /CONTINUE TASK EXECUTION 116 0004 SUSPND= 4 /SUSPEND TASK EXECUTION 117 0005 POST= 5 /POST AN EVENT FLAG 118 0006 SKPINS= 6 /INSERT CODE INTO INTERRUPT SKIP CHAIN 119 0007 DERAIL= 7 /INITIATE END-ACTION 120 0010 BLKARG= 10 /BLOCK TASK FOR REASON SPECIFIED IN ARG 121 0011 SENDW= 11 /SEND MESSAGE AND WAIT 122 0012 UNBARG= 12 /UNBLOCK TASK FOR REASON SPECIFIED IN ARG 7-6 123 124 IFDEF UDC 126 127 /TASK STATUS FLAGS: 128 129 4000 MSGWT= 4000 /MESSAGE WAIT 130 2000 EFWT= 2000 /EVENT FLAG WAIT 131 1000 RUNWT= 1000 /SCHEDULE WAIT 132 0400 SWPWT= 0400 /SWAPPER WAIT 133 0200 EORMWT= 0200 /EVENT FLAG OR MESSAGE WAIT 134 0100 USERWT= 0100 /USER SPECIFIED WAIT 135 0040 ENABWT= 0040 /ENABLE WAIT 136 0001 DNEWT= 0001 /DOES NOT EXIST WAIT 137 138 /SYSTEM LOCATIONS 139 140 1176 MSGTBL= 1200-2 /TASK MESSAGE TABLE 141 1220 TSTABL= NTASKS+2^2+MSGTBL-4 /TASK STATE TABLE - HOLDS 142 /TASK LINK,UM,DF,IF,PC,AC,MQ 143 1273 TFTABL= NTASKS+2^4+TSTABL-l /TASK FLAGS TABLE - HOLDS 144 /TASK STATUS FLAGS 145 146 0035 TSWFLG= 35 /TASK SW INHIBIT FLAG IN FIELD 0 147 0036 TODL= 36 / LOW ORDER TIME OF DAY IN FIELD 0 148 0037 TODH= 37 /HIGH ORDER TIME OF DAY IN FIELD 0 149 0040 DATE= 40 /DATE IN OS8 FORMAT IN FIELD 0 150 0041 MCREF= 41 /MCR START EVENT FLAG IN FIELD 0 151 /PARAMETERS FOR RTS-8 TASKS PAL8-V9B 05/22/74 PAGE 4 152 /TASK TABLE SETUP - "TASK", "CUR","INIWT" AND "START" 153 /MUST BE DEFINED BY TASK: 154 155 1210 *TASK^2+MSGTBL 156 01210 0000 ZBLOCK 2 /MESSAGE BUFFER INITIALLY CLEAR 157 1244 *TASK^4+TSTABL 158 01244 0011 CUR%10+CUR /INITIAL FLAGS 159 01245 5000 START 160 01246 0000 0 /INITIAL AC 0 161 1300 *TASK+TFTABL 162 01300 1000 INIWT 7-7 /TASK TO PRINT "TICK" ON THE LINE PRINT PAL8-V9B 05/22/74 PAGE 5 163 /TASK TO PRINT "TICK" ON THE LINE PRINTER TWICE A SECOND 164 165 /DEFINITIONS OF TASK PARAMETERS FOR RTS8: 166 167 0005 TASK= UT1 /I HAVE DEFINED UT1 IN MY PARAMETER FILE! 168 0010 CUR= 10 /THIS TASK STARTS IN FIELD 1 169 1002 INIWT= RUNWT /THIS TASK IS NOT RUNNABLE INITIALLY. IT 170 /IS IN "RUN WAIT". THE ONLY WAY TO MAKE 171 /THIS TASK RUNNABLE IS FOR ANOTHER TASK 172 /TO ISSUE A "RUN" EXECUTIVE REQUEST 173 /SPECIFYING THIS TASK, OR FOR THE OPERATOR /TO TYPE A "REQUEST" COMMAND TO THE MCR /SPECIFYING THIS TASK. 174 175 0001 FIELD CUR%10 /SET FIELD FOR ASSEMBLER 178 5000 *5000 /SET ORIGIN 177 178 15000 4020 START, CAL /"START" IS STARTING ADDRESS OF TASK 179 15001 0011 SENDW /SEND A MESSAGE TO THE CLOCK HANDLER 180 15002 0001 CLOCK /AND WAIT FOR THE MESSAGE EVENT FLAG 181 15003 5011 SLPMSG /THIS IS A POINTER TO THE MESSAGE 182 183 /THE MESSAGE TO THE CLOCK HANDLER TELLS IT TO POST THE 184 /MESSAGE EVENT FLAG IN HALF A SECOND 185 188 15004 4020 CAL /NOW SEND A MESSAGE TO THE LINE 187 15005 0011 SENDW /PRINTER TASK AND WAIT FOR IT TO 188 15008 0001 LPT /COMPLETE. 189 15007 5017 TCKMSG 190 191 15010 5200 JMP START /LOOP MINDLESSLY - THIS WILL ANNOY 192 /THE OPERATOR NO END, AS THE LINE 193 /PRINTER WILL GO "TICK...TICK...TICK" 194 /UNTIL HE STOPS THIS TASK WITH THE /MCR "STOP" COMMAND. 195 196 15011 9000 SLPMSG,ZBLOCK 3 /THREE WORDS REQUIRED BY RTS8 FOR /MESSAGE HEADER 197 15014 0000 0 /0 HERE MEANS "SET MESSAGE EVENT FLAG /AFTER INTERVAL" 198 15015 0000 0;SHERTZ%2 /DOUBLEWORD QUANTITY = 1/2 SECOND 199 15016 0036 /SINCE 7-8 200 201 /"SHERTZ" IS THE NUMBER OF TICKS/ 202 /SECOND. LAST 2 PARAMETERS NOT 203 /NEEDED IN THIS TYPE OF MESSAGE. 204 205 15017 0000 TCKMSG, ZBLOCK 3 /MESSAGE HEADER 206 15022 0000 0 /FLAG WORD - THIS COMBINATION OF FLAG 207 /BITS MEAN: PACKED ASCII MESSAGE CR/LF 208 /AFTER TEXT INCLUDED IN MESSAGE 209 15023 0000 0 /UNUSED - THIS SPECIFIES INPUT BUFFER 210 /FOR TELETYPE MESSAGES. 211 15024 2411 TEXT \TICK!\ /ACTUAL TEXT TO BE OUTPUT 212 15025 0313 213 15026 4100 214 $ /TASK TO PRINT "TICK" ON THE LINE PRINT PAL8-V9B 05/22/74 PAGE 6 AC0002 7326 TODL 0036 AC2000 7332 TSTABL 1220 AC3777 7350 TSWFLG 0035 AC4000 7330 TTY 0003 AC7775 7346 UNBARG 0012 AC7776 7344 USERWT 0100 BLKARG 0010 UT1 0005 CAL 4023 UT2 0010 CLKQLN 0020 WAITE 0002 CLKTYP 0000 WAITM 4425 CLOCK 0001 CUR 0010 DATE 0040 DERAIL 0007 DNEWT 0001 EAE 0000 EFWT 2000 ENABWT 0040 EORMWT 0200 HERTZ 0170 HGHFLD 0030 7-9 INIWT 1000 LPT 0002 MCR 0007 MCREF 0041 MCRSYS 0001 MSGTBL 1176 MSGWT 4000 NTASKS 0011 OSFILL 0004 OSFLDS 0002 OSKBDV 0032 OSSYSD 0004 OSTTDV 0033 OS8 0011 PDP8E 0001 POST 0005 POSTDS 5424 PWRFAL 0000 RECEIV 0001 RK8 0004 RUN 0003 RUNWT 1000 SEND 0000 SENDW 0011 SHERTZ 0074 SKPINS 0006 SLPMSG 5011 START 5000 SUSPND 0004 SWPWT 0400 TASK 0005 TCKMSG 5017 TFTABL 1273 TODH 0037 ERRORS DETECTED: 0 LINKS GENERATED: 0 7-10 AC0002 104# AC2000 103# AC3777 102# AC4000 101# AC7775 100# AC7776 99# AI 130# AO 124# BLKARG 120# CAL 108# 176 188 CLKQLN 91# CLKTYP 90# CLOCK 59# 89 180 CS 127# CT 125# CUR 158 158 168# 175 DATE 149# DCT 129# DERAIL 119# DNEWT 136# EAE 49# ENABWT 135# EORMWT 133# HERTZ 93# HGHFLD 51# INIWT 162 169# LPT 62# 188 MCR 63# 86 MCREF 150# MCRSYS 87# MSGTBL 140# 141 155 NTASKS 52# 71 141 143 OSFILL 84# OSFLDS 80# OSKBDV 81# OSSYSD 83# OSTTDV 82# OS8 71# 79 PDP8E 48# POST 117# POSTDS 109# PWRFAL 50# 7-11 RECEIV 113# RK8 65# 83 RUN 115# RUNWT 131# 169 SEND 112# SENDW 121# 179 187 SHERTZ 94# 199 SKPINS 118# SLPMSG 181 196# START 159 178# 191 SUSPND 116# SWPWT 132# TASK 155 157 161 167# TCKMSG 189 205# TFTABL 143# 161 TODH 148# TODL 147# TSTABL 141# 145 157 TSWFLG 146# TTY 61# UDC 124# UNBARG 122# USERWT 134# UT1 74# 167 UT2 75# WAITE 114# WAITM 110# V3 7-12 Notes for the bitmap below: Locations What is there _________ _____________ 00000-00002 RTS-8 Page 0 locations 00010 00017-00047 00200-01177 RTS-8 Task 01200-01377 Task Tables ( two's are legal; three's are not) 01400-01777 Clock Task 02000-02177 Clock Queue and Initializer 03000-03377 TTY Task 03400-03777 RK8E Task 06200-07577 OS/8 Support Task 10021-10025 Field 1 RTS-8 Resident 10100-10116 MCR Page 0 Locations 14600-14777 LPT Task 15000-15026 User "Foreground" Task 20021-20025 Field 2 RTS-8 Resident destroyed by OS/8 "field 1". 30021-30025 Field 3 RTS-8 Resident destroyed by OS/8 "field 0". 03400-34377 OS/8 Support unit code to set up fake OS/8 in fields 3 and 2. 7-13 BITMAP V4 FIELD 0 00000 11100000 10000001 11111111 11111111 11111111 00000000 00000000 00000000 00100 00000000 00000000 00000000 00000000 00000000 00000000 00000011 11111111 00200 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 00300 11111111 11111100 00000000 00000000 00000000 00000000 00000000 00000111 00400 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 00500 11111111 11111111 11111111 11000000 00000000 00000000 00000000 01111111 00600 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 00700 11111111 11111111 11111111 11111111 11111111 11111111 11111000 00111111 01000 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 01100 11111111 11111111 11111111 11111111 11111111 11111111 11111001 11111111 01200 22222222 22112211 22222221 22212221 22212221 11112221 11112221 22212222 01300 21212200 00000000 00000000 00000000 00000000 00000000 00000000 00000000 01400 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 01500 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 01600 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 01700 11111111 11111111 11111111 11111111 11111111 11000000 00111111 11111111 02000 11111111 11111111 11111111 11111111 11111111 11111110 00000000 00000000 02100 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00111111 02200 02300 02400 02500 02600 02700 03000 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 03100 11111111 11111111 11111111 11111111 11111111 11111111 11100011 11111111 03200 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 03300 11111111 11111111 11111111 11111111 00000000 00000111 11111111 11111111 03400 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 03500 11111111 11111111 11111111 11111111 11111111 11111111 01111111 11111111 03600 11111111 11111111 11111111 11111111 11111110 00000000 00000000 00000000 03700 00000000 00000000 00000000 00000000 00000000 00000000 00000000 11111111 7-14 BITMAP V4 FIELD 0 04000 04100 04200 04300 04400 04500 04600 04700 05000 05100 05200 05300 05400 05500 05600 05700 06000 06100 06200 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 06300 11111111 11111111 11111111 11111111 11111100 00000000 00000111 11111111 06400 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 06500 11111111 11111111 11111111 11111111 10000000 00000011 11111111 11111111 06600 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 06700 11111111 11111111 11111111 11111111 11111111 11111111 01111111 11111111 07000 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 07100 11111111 11111111 11111111 11111111 11111111 10000000 00111111 11111111 07200 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 07300 11111111 11111110 00000000 00000000 00000000 00000000 00000001 11111111 07400 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 07500 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111100 07600 07700 7-15 BITMAP V4 FIELD 1 10000 00000000 00000000 01111100 00000000 00000000 00000000 00000000 00000000 10100 11111111 11111110 00000000 00000000 00000000 00000000 00000000 00000000 10200 10300 10400 10500 10600 10700 11000 11100 11200 11300 11400 11500 11600 11700 12000 12100 12200 12300 12400 12500 12600 12700 13000 13100 13200 13300 13400 13500 13600 13700 7-16 BITMAP V4 FIELD 1 14000 14100 14200 14300 14400 14500 14600 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 14700 11111111 11111111 11111111 11111111 11111111 11111111 11110000 00011111 15000 11111111 11111111 11111110 00000000 00000000 00000000 00000000 00000000 15100 15200 15300 15400 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 15500 11111111 11111111 11111111 11111111 11111111 11111111 11110000 11111111 15600 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 15700 11111111 11111111 11111111 11111111 11111111 11000000 00000111 11111111 16000 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 16100 11111111 11111111 11111111 11111111 11111111 11111111 11100000 01111111 16200 22222222 11112211 22111111 11111111 11111111 11111111 11111111 11111111 16300 11111111 11100000 00000000 00000000 00000000 00000000 00011111 11111111 16400 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 16500 11111111 11111111 11111111 11111111 11111111 11110000 00111111 11111111 16600 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 16700 11111111 11111111 11111111 11111111 11111111 11111111 11110000 11111111 17000 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 17100 11111111 11111111 11111111 11111111 11111111 11111111 10111111 11111111 17200 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 17300 11111111 11111111 11111111 11111111 11100000 00000011 11111111 11111111 17400 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 17500 11111111 11111111 11111111 11111111 11111111 11111101 11111111 11111111 17600 17700 7-17 BITMAP V4 FIELD 2 20000 00000000 00000000 01111100 00000000 00000000 00000000 00000000 00000000 20100 20200 20300 20400 20500 20600 20700 21000 21100 21200 21300 21400 21500 21600 21700 22000 22100 22200 22300 22400 22500 22600 22700 23000 23100 23200 23300 23400 23500 23600 23700 7-18 BITMAP V4 FIELD 2 24000 24100 24200 24300 24400 24500 24600 24700 25000 25100 25200 25300 25400 25500 25600 25700 26000 26100 26200 26300 26400 26500 26600 26700 27000 27100 27200 27300 27400 27500 27600 27700 7-19 BITMAP V4 FIELD 3 30000 00000000 00000000 01111100 00000000 00000000 00000000 00000000 00000000 30100 30200 30300 30400 30500 30600 30700 31000 31100 31200 31300 31400 31500 31600 31700 32000 32100 32200 32300 32400 32500 32600 32700 33000 33100 33200 33300 33400 33500 33600 33700 7-20 BITMAP V4 FIELD 3 34000 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 34100 11111110 00000000 00000000 00000000 00000000 00000000 00000000 00011111 34200 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 34300 11111111 11100000 00000000 00000000 00000000 00000000 00000000 00011111 34400 34500 34600 34700 35000 35100 35200 35300 35400 35500 35600 35700 36000 36100 36200 36300 36400 36500 36600 36700 37000 37100 37200 37300 37400 37500 37600 37700 7-21 APPENDIX A RTS-8 DISTRIBUTED SOURCE FILES The RTS-8 source files included on the distribution tape are: FILE TASK(S) COMMENTS ____ _______ ________ PARAM.PA - System parameter file with all equates blank. Should never be altered, but should be edited to create specific parameter files RTS8.PA - (null task) RTS-8 Executive MCR.PA MCR Monitor Console Routine OS8SUP.PA OS8 OS/8 Support Task OS8F OS/8 File Support Task PWRF.PA PWRF Power Fail Task CLOCK.PA CLOCK Clock handler Task TTY.PA TTY Terminal driver Task LPT.PA LPT Line printer driver Task DTA.PA DTA TC08 DECtape driver Task RK8.PA RK8 RK8 disk driver Task RK8E.PA RK8 RK8E disk driver Task RF08.PA RF08/DF32 RF08/DF32 fixed-head disk driver Task CSA.PA CSA Cassette driver Task CSAF.PA CSAF Cassette File Support Task UDC.PA UDC Universal Digital Controller handler Task A-1 APPENDIX B RTS-8 COMPONENT SIZES The following table gives the approximate size and default origins of each component of the RTS-8 system as of the first release of the system. NTASKS = Number of tasks in system CLKQLN = Number of entries in clock queue MCRSYS = 1 if MCR SYSTAT function desired, else 0 Any fractions from divides should be dropped. Table B-1 RTS-8 Component Sizes ------------------------------------------------------------------------- | | | NUMBER OF PAGES | | | SOFTWARE | DEFAULT | REQUIRED (1 PAGE| | | COMPONENT | ORIGIN | =128 WORDS | COMMENTS | |--------------|---------------|-----------------|----------------------| | | | | | | RTS-8 | 00200 | 5+NTASKS/18