STTY(II) − PWB/UNIX 12/15/74
NAME
stty − set mode of typewriter
SYNOPSIS
(stty = 31.)
(file descriptor in r0)
sys stty; arg
arg: .byte ispeed, ospeed; .byte erase, kill; mode
stty(fildes, arg)
struct {
charispeed, ospeed;
charerase, kill;
int mode;
} *arg;
DESCRIPTION
Stty sets mode bits and character speeds for the typewriter whose file descriptor is passed in r0 (resp. is the first argument to the call). First, the system delays until the typewriter is quiescent. The input and output speeds are set from the first two bytes of the argument structure as indicated by the following table, which corresponds to the speeds supported by the TMS9902 and CI403 interface.
0(hang up dataphone)
150 baud
275 baud
3110 baud
4134 baud
5150 baud
6200 baud
7300 baud
8600 baud
91200 baud
101800 baud
112400 baud
124800 baud
139600 baud
1419200 baud
14External A
15External B
In the current configuration, only 110, 150 and 300 baud are really supported on dial-up lines, in that the code conversion and line control required for IBM 2741’s (134.5 baud) must be implemented by the user’s program, and the half-duplex line discipline required for the 202 dataset (1200 baud) is not supplied. The next two characters of the argument structure specify the erase and kill characters respectively. (Defaults are # and @.) The mode contains several bits which determine the system’s treatment of the typewriter:
100000Select one of two algorithms for backspace delays
040000Select one of two algorithms for form-feed and vertical-tab delays
030000Select one of four algorithms for carriage-return delays
006000Select one of four algorithms for tab delays
001400Select one of four algorithms for new-line delays
000200even parity allowed on input (e. g. for M37s)
000100odd parity allowed on input
000040raw mode: wake up on all characters
000020map CR into LF; echo LF or CR as CR-LF
000010echo (full duplex)
000004map upper case to lower on input (e. g. M33)
000002echo and print tabs as spaces
000001hang up (remove ‘data terminal ready,’ lead CD) after last close
The delay bits specify how long transmission stops to allow for mechanical or other movement when certain characters are sent to the terminal. In all cases a value of 0 indicates no delay. Backspace delays are currently ignored but will be used for Terminet 300’s. If a form-feed/vertical tab delay is specified, it lasts for about 2 seconds. Carriage-return delay type 1 lasts about .08 seconds and is suitable for the Terminet 300. Delay type 2 lasts about .16 seconds and is suitable for the VT05 and the TI 700. Delay type 3 is unimplemented and is 0. New-line delay type 1 is dependent on the current column and is tuned for Teletype model 37’s. Type 2 is useful for the VT05 and is about .10 seconds. Type 3 is unimplemented and is 0. Tab delay type 1 is dependent on the amount of movement and is tuned to the Teletype model 37. Other types are unimplemented and are 0. Characters with the wrong parity, as determined by bits 200 and 100, are ignored. In raw mode, every character is passed immediately to the program without waiting until a full line has been typed. No erase or kill processing is done; the end-of-file character (EOT), the interrupt character (DEL) and the quit character (FS) are not treated specially. Mode 020 causes input carriage returns to be turned into new-lines; input of either CR or LF causes LF-CR both to be echoed (used for GE TermiNet 300’s and other terminals without the newline function). The hangup mode 01 causes the line to be disconnected when the last process with the line open closes it or terminates. It is useful when a port is to be used for some special purpose; for example, if it is associated with an ACU used to place outgoing calls. This system call is also used with certain special files other than typewriters, but since none of them are part of the standard system the specifications will not be given.
SEE ALSO
DIAGNOSTICS
The error bit (c-bit) is set if the file descriptor does not refer to a typewriter. From C, a negative value indicates an error.