.centre text Console Interface Handler ------------------------- .skip Earl Chew 26 Gardenia Street Blackburn Victoria Australia, 3130. .end centre .skip .autoparagraph This pseudo-device handler allows programs to: .list .list element Simulate _ sequences from software. .list element Simulate keystrokes from software. .list element Determine console ownership. .end list .header level 1 Handler Installation To operate successfully, the handler requires specialised knowledge of certain locations within RMON. At installation time, the handler ensures that these locations are consistent with its internal tables. Handler installation will fail if this is not the case. The handler can be made to reconfigure its internal tables by executing the command: .skip .indent +16 _.set ci config Once the handler has been configured, the handler will write the tables back to disk. It is not necessary to reconfigure the handler unless than monitor or the handler changes. .header level 1 Handler Utilisation All functions performed by the handler are requested using _.SPFUN requests. Attempts to perform normal IO using the handler will fail. Programs using the handler should open channel using a _.LOOKUP or _.ENTER request. All further transactions should be carried out using _.SPFUN requests. This document assumes the user is familiar with the general syntax and semantics of such requests. .header level 2 Switching Console Ownership This function will change ownership of the console. It can be used to selectively change ownership of keyboard input, terminal output or both. The _.SPFUN arguments are used as follows: .left margin +5 .set paragraph -5 func#This must be 377 to select this function. buf##Specifies the address of a word containing the address of the impure area of the job to which ownership is to be switched. wcnt#Type of switch required; less the zero implies a switch of terminal output ownership only, greater than zero implies a switch of keyboard input only, zero implies both. blk##Unused. .left margin -5 .set paragraph +5 .header level 2 Simulating Keyboard Input This function simulates a string of characters being typed at the keyboard. The string of characters passed follows the _.PRINT convention, ie termination by a 0 byte indicates a trailing CR/LF combination should be appended, whereas termination by a 200 byte indicates no trailing CR/LF combination. The _.SPFUN arguments are used as follows: .left margin +5 .set paragraph -5 func#This must be 376 to select this function. buf##The address of a string of characters terminated by either a 0 or 200 byte. wcnt#Unused. blk##Unused. .left margin -5 .set paragraph +5 .header level 2 Determining Console Ownership This function allows programs to determine who owns the terminal. The _.SPFUN arguments are used as follows: .left margin +5 .set paragraph -5 func#This must be 375 to select this function. buf##The address of a double word to hold the result. The address of the impure area of the job owning the keyboard input is returned in the first word, and the address of the impure area of the job owning the terminal output is returned in the second word. wcnt#Unused. blk##Unused. .left margin -5 .set paragraph +5 .header level 1 General Notes RT11 will check that the buf argument of the _.SPFUN request is even. So even if you intend to pass byte aligned data, it is imperative that you ensure that the first byte is word aligned. This handler has been responsible for crashing the operating system. This has occurred when a program is exiting and another program has grabbed ownership of the console. This seems to be a timing bug, but seems to have gone away. No other severe problems have been noted. When using function 376, long strings will cause the output buffer to overflow due to character echo taking place. On PRO machines this can be circumvented by breaking up the strings into 40 character chunks. Before executing function 377, the handler will check to ensure that the job specified is active. If the job does not exist, or has terminated, the function will fail and return an error. Impure area addresses can be obtained using _.GTJB calls. .header level 1 Building the Handler A command file has been supplied which will build the handler for an RT11XM system. .header level 1 Restrictions This handler has only been tried on a distributed RT11XM version 5.01 system. It probably will not work on monitors which have been sysgened with any fancy terminal support. It is not known whether it will work with version 5.02. This handler implements things which probably should be supported as EMT calls. .skip .centre --ooOoo--