DC (IV) 6/12/72 DC (IV)
NAME dc -- DC-11 communications interfaces
DESCRIPTION
The special files /dev/tty0, /dev/tty1, ... refer to the
DC11 asynchronous communications interfaces. At the mo-
ment there are ten of them, but the number is subject to
change.
When one of these files is opened, it causes the process
to wait until a connection is established. (In practice,
however, user's programs seldom open these files; they
are opened by init and become a user's standard input and
output file.) The very first typewriter file open in a
process becomes the control typewriter for that process.
The control typewriter plays a special role in handling
quit or interrupt signals, as discussed below. The con-
trol typewriter is inherited by a child process during a
fork.
A terminal associated with one of these files ordinarily
operates in full-duplex mode. Characters may be typed at
any time, even while output is occurring, and are only
lost when the system's character input buffers become
completely choked, which is rare, or when the user has
accumulated the maximum allowed number of input charac-
ters which have not yet been read by some program. Cur-
rently this limit is 150 characters. When this is hap-
pening the character "#" is echoed for every lost input
character.
When first opened, the interface mode is ASCII charac-
ters; 150 baud; even parity only accepted; 10
bits/character (one stop bit); and newline action charac-
ter. The system delays transmission after sending cer-
tain function characters. Delays for horizontal tab,
newline, and form feed are calculated for the Teletype
Model 37; the delay for carriage return is calculated for
the GE TermiNet 300. Most of these operating states can
be changed by using the system call stty(II). In partic-
ular the following hardware states are program settable
independently for input and output (see DC11 manual):
134.5, 150, 300, or 1200 baud; one or two stop bits on
output; and 5, 6, 7, or 8 data bits/character. In addi-
tion, the following software modes can be invoked: accep-
tance of even parity, odd parity, or both; a raw mode in
which all characters may be read one at a time; a car-
riage return (CR) mode in which CR is mapped into newline
on input and either CR or line feed (LF) cause echoing of
the sequence LF-CR; mapping of upper case letters into
lower case; suppression of echoing; suppression of delays
after function characters; the printing of tabs as
spaces; and setting the system to handle IBM 2741s. See
getty(VII) for the way that terminal speed and type are
detected.
Normally, typewriter input is processed in units of
lines. This means that a program attempting to read will
be suspended until an entire line has been typed. Also,
no matter how many characters are requested in the read
call, at most one line will be returned. It is not how-
ever necessary to read a whole line at once; any number
of characters may be requested in a read, even one, with-
out losing information.
During input, erase and kill processing is normally done.
The character "#" erases the last character typed, except
that it will not erase beyond the beginning of a line or
an EOT. The character "@" kills the entire line up to
the point where it was typed, but not beyond an EOT.
Both these characters operate on a keystroke basis inde-
pendently of any backspacing or tabbing that may have
been done. Either "@" or "#" may be entered literally by
preceding it by "\"; the erase or kill character remains,
but the "\" disappears.
It is possible to use raw mode in which the program read-
ing is awakened on each character. In raw mode, no erase
or kill processing is done; and the EOT, quit and inter-
rupt characters are not treated specially.
The ASCII EOT character may be used to generate an end of
file from a typewriter. When an EOT is received, all the
characters waiting to be read are immediately passed to
the program, without waiting for a new-line. Thus if
there are no characters waiting, which is to say the EOT
occurred at the beginning of a line, zero characters will
be passed back, and this is the standard end-of-file sig-
nal. The EOT is not passed on except in raw mode.
When the carrier signal from the dataset drops (usually
because the user has hung up his terminal) any read re-
turns with an end-of-file indication. Thus programs
which read a typewriter and test for end-of-file on their
input can terminate appropriately when hung up on.
Two characters have a special meaning when typed. The
ASCII DEL character (sometimes called "rubout") is the
interrupt signal. When this character is received from a
given typewriter, a search is made for all processes
which have this typewriter as their control typewriter,
and which have not informed the system that they wish to
ignore interrupts. If there is more than one such pro-
cess, one of these is selected, for practical purposes at
random. The process is either forced to exit or a trap
is simulated to an agreed-upon location in the process.
See intr(II).
The ASCII character FS is the quit signal. Its treatment
is identical to the interrupt signal except that unless
the receiving process has made other arrangements it will
not only be terminated but a core image file will be gen-
erated. See quit(II). The character is not passed on
except in raw mode.
Output is prosaic compared to input. When one or more
characters are written, they are actually transmitted to
the terminal as soon as previously-written characters
have finished typing. Input characters are echoed by
putting them in the output queue as they arrive. When a
process produces characters more rapidly than they can be
typed, it will be suspended when its output queue exceeds
some limit. When the queue has drained down to some
threshold the program is resumed. Even-parity is always
generated on output. The EOT character is not transmit-
ted to prevent terminals which respond to it from being
hung up.
The system will handle IBM 2741 terminals. See
getty(VII) for the way that 2741s are detected. In 2741
mode, the hardware state is: 134.5 baud; one output stop
bit; and 7 bits/character. Because the 2741 is inher-
ently half-duplex, input is not echoed. Proper function
delays are provided. For 2741s without a feature known
as "transmit interrupt" it is not possible to collect in-
put ahead of the time that a program reads the type-
writer, because once the keyboard has been enabled there
is no way to send further output to the 2741. It is cur-
rently assumed that the feature is absent; thus the key-
board is unlocked only when some program reads. The in-
terrupt signal (normally ASCII DEL) is simulated when the
2741 "attention" key is pushed to generate either a 2741
style EOT or a break. It is not possible to generate
anything corresponding to the end-of-file EOT or the quit
signal. Currently IBM EBCDIC is default for input and
output; correspondence code output is settable (see
stty(I)). The full ASCII character set is not available:
"[", "]", "{", "}", "~", are missing on input and are
printed as blank on output; "¢" is used for "\"; "¬" for
"^"; " " for both "'" and"`"on output; and " " maps into
"'" on input. Similar mappings occur with correspondence
code output.
FILES /dev/tty[01234567ab] 113B dataphones
/dev/ttyc display data set
/dev/ttyd 113B with /dev/dn1
SEE ALSO kl(IV), getty(VII)
BUGS The primarily Model 37 oriented delays may not be
appropriate for all other ASCII terminals.