[ Pobierz całość w formacie PDF ]

short).
vice driver. The common code which can be shared
A wide variety of terminals is available and sev-
between these is gathered into a single le \tty.c",
eral di erent types may be simultaneously attached
to be found on Sheets 81 to 85. A set of common
to a single computer. Distinguishing characteris-
de nitions is gathered in the le \tty.h" on Sheet
tics for di erent classes of terminal include (be-
79.
sides such non-essential features as shape, size and
By way of example, Sheet 80 contains the le
colour):
\kl.c", which constitutes the device driver for a set
of DL11/KL11 interfaces. This device driver always
(a) transmission speed, e.g. 110 baud for an
needs to be present, since one KL11 interface is in-
ASR33 teletype, 300 baud for a DECwriter,
variably included in a system for the the operator's
2400 baud or 9600 baud for a Visual Display
console terminal.
unit (\VD")
(b) graphic character set, notably the full ASCII
24.1 The 'tty' Structure (7926)
graphic set and the 64 graphic subset
An instance of \tty" is associated with every ter-
(c) transmission parity: odd, even, none or inop- minal port to the system (no matter what type of
eratlve
hardware interface is used). A \ port" in this con-
text is a place to attach a terminal line. Hence a
(d) output technique: serial printer or visual dis-
DL11 supplies only one port, whereas a DJ11 sup-
play
plies up to sixteen ports.
The \ tty" structure consists of sixteen words
(e) miscellaneous: combined carriage return/line
and includes:
feed character, half duplex terminal (input
characters do not need echoing) recognition
A. t dev xed for a particular
of tab characters
t addr terminal port
(f) characteristic delays for certain control func-
tions, e.g. carriage returns may not be com- B. t speeds xed for a particular
pleted within a single character transmission t erase terminal. These values may
time, etc. t kill be set by \ stty" and
t ags interrogated by \ gtty"
As well as the wide variety of terminals which
are available and in use, there is also a variety of
C. t rawq list heads for three
hardware devices which may be used to interface a
t canq character queues: the
terminal to a PDP 11 computer. For example:
t outq so-called \ raw" input,
\cooked" input and the
DL11/KL11 single line, asynchronous
output queues
interface 13 standard
transmission rates between
D. t state status information which
40 and 9600 baud
t delct changes frequently during
t col normal processing
DJ11 16 line, asynchronous, bu ered
t char
serial line multiplexer 11
speeds between 75 and 9600 baud,
Table 24.1
selectable in four line groups
24.2 Interactive Terminals
DH11 16 line, asynchronous, bu ered,
serial line multiplexer 14 speeds,
The reader should study the information on Sheet
individually selectable DMA
79 carefully. Certain items listed below are not ref-
transmission
erenced in any essential way in the selection of code
Each of the above interfaces will work in full or
examined here.
half duplex mode handle 5, 6, 7 or 8 level codes
generate odd, even or no parity and generate a stop t_char (7940) NLDELAY (7974)
code of 1, 1.5 or 2 bits. t_speeds (7941) TBDELAY (7975)
HUPCL (7966) CRDELAY (7976) 8591: Reset the speed information (useful in the
ODDP (7972) WOPEN (7985) case of a DH11 interface, but of little interest
EVENP (7973) ASLEEP (7993) for the present selection of code)
Reset the \erase" character and the \kill"
character. (\kill" here denotes \throw away
24.3 Initialisation
the current input line".) Note that if these
Initialisation of the \tty" structures is the respon-
characters are changed away from their nor-
sibility of the various \open" routines in the device
mal values of \ #" and \@" respectively, no
drivers, for example, \klopen" (8023).
corresponding changes are made to \ maptab".
The items in Group B of Table 24.1 may be
Nor should they!),
changed by a \ stty" system call. The current values
8593: Reset the \ ags" de ning some relevant ter-
may be interrogated by a \gtty" system call.
minal characteristics (see Sheet 79):
A description of these is contained in the sec-
tions, \STTY(II)" and \ GTTY(II)" of the UPM.
These calls are invoked by the \stty" shell com-
ag bit if set ...
mand which is described in the section \STTY(I)".
Since the \stty" and \ gtty" system calls require XTABS 1 the terminal will not interpret
a le descriptor as a parameter, they can only be horizontal tab characters
applied to an \open" character special le. correctly
The two system calls share a good deal of com-
mon code. We will trace the progress of an exe- LCASE 2 the terminal supports only the
cution of \stty" below and leave the tracing of a 64 character ASCII subset
similar execution of \ gtty" to the reader.
ECHO 3 the terminal is operating in
full duplex mode, and input
24.4 stty (8183)
characters must be echoed
This procedure implements the \stty" system call. back
It copies three words of user parameter information
into \u.u arg[..]" using the parameter supplied as CRMOD 4 upon input, a \carriage
a pointer, and then calls \sgtty". return" is replaced by a
\line feed" upon output, a
\line feed" is replaced by a
24.5 sgtty (8201)
\carriage return" and a \ line
8206: Get a validated pointer to a \ le" array en- feed"
try
RAW 5 input characters are to be
8209: Check that the le is a \ character special"
sent to the program exactly
as received, without \erase"
8213: Call the appropriate \d sgtty" routine for
or\kill" processing, or
the device type. (See Sheet 46.)
adjustment for backslash
characters.
Note that the \d sgtty" routine is \nodev" for
In addition, the following bits are interro-
the line printer and paper tape reader/punch.
gated by \ ttyoutput" (8373) in choosing the
delay which should ensue after the charac-
24.6 klsgtty (8090)
ter indicated is sent, before sending the next
character:
This is an example of a \ d sgtty" routine. It calls
\ttystty" passing a pointer to the appropriate \tty"
structure as a parameter. 8,9 line feed
10,11 horizontal tab
12,13 carriage return
24.7 tysty (8577)
14 vertical tab or form feed.
A call originating from \stty" will have a second
parameter of zero. [ Pobierz całość w formacie PDF ]

  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • skierniewice.pev.pl
  •