• Aucun résultat trouvé

MISCELLANEOUS REAL-TIME SERVICES

The following is a set of services provided to master mode, mapped or unmapped real-time programs. These services

130 Miscellaneous Real-Time Services

are provided via Meta-Symbol procedure references that result in BAL linkages to monitor routines (hence the master mode requirement) as opposed to CAL 1 linkages. The rou-tines entry points are REFed as a result of the various pro-cedure calls, therefore the program must be loaded with 'reference to the MONSTK or Jl files in order to satisfy

these external references. All user registers are preserved by pushing them into TSTACK except as indicated for

Itistheuser's responsibility to return any pages obtained via M:GPP since the system keeps no record of this transaction.

INITIATE GHOST JOB

M:GJOB The M:GJOB procedure activates (or awakens) a program as a ghost job. The format of the procedure is

M:GJOB (LMN,loc)[, (ACN,loc)][, (PRI,value)]

where

LMN,loc specifies the location containing the name of the program to be activated (or awakened) as a ghost job. The name must be in TEXTC format and must not be greater than 7 characters in length. If the name is less than four characters, a word of blanks (X '40's) must immediately follow the name.

ACN,loc specifies the location containing the name of the account in which the program exists. The account name must be in TEXT format, left-justified with trailing blanks to occupy two words. The defaul t is the :SYS account.

PRI, value specifies the execution priority to be associated with the ghost job. The defaul t priority will be that defined for ghost jobs at SYSGEN.

On return, CCl is set if the named program was not found or was already active but not asleep. Otherwise, the con-dition codes are set to zero.

GET AND RELEASE DISK GRANULE

M:GDG The M:GDG procedure dynamically acquires a disk granule. The procedure has the format

M:GDG

The starting disk address of the acquired granule is returned to the user in general register 8 in the following format

The disk address shown above is in standard format for disk addresses in CP-V, where:

E is the extension bit necessary to represent a 17-bit relative sector number on large capacity disk packs. recommended that users utilize the following pro-cedures (referenced via the SYSTEM UTS directive of Meta-Symbol) when referencing disk address fields. location, containing (destined to contain) the disk address (see index below).

index is an index register containing a word dis-placement which, when added to the address given by loc, yields an effective address contain-ing (destined to contain) the disk address.

M:RDG The M:RDG procedure dynamically releases a granule acquired via M:GDG. The procedure has the format

M:RDG [*]disk address user number (for purposes of communicating this to other programs) by referencing the monitor cell

Symbol Event Resulting Action

E:CBK BREAK Control passes to the user at the address specified via an M:INT procedure call.

E:OFF Log-off The user is deleted from the system.

Miscellaneous Real-Time Services 131

Symbol Event Resulting Action

E:ERR Error The user is errored and de-I eted from the system.

E:WU Wake-up The specified user isscheduled for execution and reentered at the instruction following the M:WAIT CAll.

E:UQA Unqueue The specified user is scheduled for for execution and reentered access at the instruction following

the CALl which caused him state since an illegal current state/event combi-nation will cause the system to crash. E:CBK, E:OFF, and E:ERR may be safely reported on a user at any point in time.

CHECK INTERRUPT STATUS

M:CHKINT The M:CH KINT procedure checks the status of an interrupt. The format of the procedure call is: triggered and the interrupt processing routine has not yet finished.

STAT indicates the status of the task associated wi th the interrupt location as follows:

STAT Meaning X'80' Task is active.

X'40' Task is asleep or queued for interrupt.

132 Miscellaneous Real-Time Services

STAT X'20' X'lO' X'01'

Meaning

Task is waiting for I/O completion.

Task is blocked, waiting for a resource.

Specified interrupt is not currently as-sociated with any user (i.e., inactive).

USER is the internal user table index for the user currently associated with this interrupt.

110 SERVICES

3. I/O with parameters supplied ina pseudo DCB (M:QUE).

Special problems exist when applying these techniques to disk I/O. Unless the volume is being managed entirely by the user, the user must be aware of the physical location of the data on the disk volume (or volumes). A random fi Ie would be the most common way of allocating space on a public or private volume fOfusebyboth privileged and non-privileged users. A random file is allocated contiguously on a public or private volume when it is opened. By system assuming that the requested byte count does not cause the transfer to cross a track boundary from a good track to

CALCULA TING PHYSICAL ADDRESSES

All of the I/O procedure calls described below are avail-able to the mapped or unmapped user. Several require that

physica I addresses by passed. For a II mapped users, the user may convert a virtual address to a physical address by using the M:MAP procedure call described previously.

In order to ensure that a mapped user is not swapped between the time that the physical address is calculated and the time the I/O is requested, the M:HOLD (Lock in Core) service should be performed.

Note, however, that a mapped, master mode program is

OA(loc) specifies the physical doubleword address of the start of the channel program.

*Ioc specifies the word address of a word which contains the physical doubleword address of the start of the channel program. (The asterisk is required. )

OCT, [*]index is the OCT index of the device associated with the channel program.

PRI, [*]priority is the priority to be associated with the requested I/O operation. Priority re-quests range from 0 to X'FF' (highest to lowest).

Priorities in the range of 0 to X'BF' are treated as real-time priority requests; X'CO' to X'FF' are treated as background priority requests. The only system I/o that operates at a real-time priority is swapping I/o (priority = X' 10'). The default priority is X'FF'.

EA, [*]Ioc is the physical address of the user's end-action routine.

eai is a word of end-action information. This information is passed back to the user's end-action routine. considered volatile (except register 11, through which re-turn is made to the monitor). The following information is passed to the end-action routine:

Re9ister Bit Fields Contents

7 24,8 -,OCT channel program command list specified by the M:EXCP call. un-mapped user always does I/O with NO-WAIT. This impl ies that the unmapped user should always (ex-cept for unusual cases) specify an end-action ad-dress in order to ascertain when the I/O has com-pleted. The mapped user will do I/O with WAIT unless otherwise specified by the procedure call.

Miscellaneous Real-Time Services 133

FC, [*]code is the function code which defines (to the device handler) the type of I/O operation to be performed. See discussion of function codes below.

DA, [*]disk address specifies, for random-access-device operations only, the disk address to be used in this I/O operation. Disk addresses are of the format described under the discussion of the M:GDG procedure call.

DCT, [*]index specifies for non-random-access-device operations only, the OCT index of the device to be used in this I/o operation.

PRI, [*]priority is the priority to be associated with the requested I/O operation. See the description of priority under the discussion of M:EXCP.

NRT, [*]value is the number of recovery tries to attempt before declaring an error.

EA, [*]Ioc is the physical address, or optionally a pointer to a location containing the physical address, of the user's end-action routine.

eai is a word of end-action information. See the end-action description under the discussion of the M:EXCP procedure call. The only difference is that BUF is the byte-address of the user's buffer as supplied by the M:NEWQ procedure call.

To assist the user in determining the correct function codes to be used with the M:NEWQ procedure calls, the follow-ing is a discussion describfollow-ing the function codes of the ex-isting device in the system.

Typewriter Handler. The typewriter handler accepts the following function codes:

134 Miscellaneous Real-Time Services

RAD Handler. The RAD handler accepts the following

4 - seek-write, seek-checkwrite

Error recovery on the RAD generally amounts to redoing the same operation when an error has been detected. One ex-ception is when a checkwrite is being performed fora write and an error is indicated. In this case, the write is done over, followed by another checkwrite. Checkwrites are performed for all writes if sense switch 1 is set on the op-erator's console. Special conditions checked for are write violation and illegal seek address.

9-Track Tape Handler. The 9-track tape handler accepts the followi ng function codes: 11 - noncorrectable read recovery 12 - write recovery

13 - correctable read reverse recovery 14 - noncorrectable read reverse recovery 15 - write tape mark recovery

7-Track Tape Handler. The 7-track tape handler accepts the following function codes:

o -

read packed