Guardian Programmer's Guide

Table Of Contents
Guardian Programmer’s Guide 421922-014
24 - 1
24
Writing a Terminal Simulator
Using the interprocess-communication features described in Section 6, Communicating
With Processes, you can write a program that simulates a terminal. A user process
can communicate with this terminal-simulation process as though it were a real
terminal. This user process is typically a requester in an application designed
according to the requester/server model.
Generally, a terminal-simulation process provides an interface between a requester
process and one or more real terminals. Some of the functions a terminal-simulation
process could include are:
Multiplexing: mapping input/output requests from one or more requesters to one or
more terminals
Translating: changing certain characters during the data transfer between a
requester and a real terminal
Filtering: adding, removing, or altering information during the data transfer between
a requester and a real terminal
When writing a terminal-simulation program, you must give the terminal-simulation
process the following properties:
The terminal-simulation process must have a device subtype of 30.
The terminal-simulation process must be named.
The terminal-simulation process must accept system messages through its
$RECEIVE file.
The terminal-simulation process must specify how Setmode and Setparam
messages are to be handled.
The terminal-simulation process must handle WRITE[X], READ[X], and
WRITEREAD[X] I/O requests from requesters.
The terminal-simulation process must handle system messages such as:
Device type information request messages
Setmode messages
Setparam messages
Control messages
The terminal-simulation process must handle the BREAK key.
The remainder of this section discusses the guidelines above in detail.