[net.unix-wizards] S3/S5 tty driver

guy@sun.uucp (Guy Harris) (08/17/85)

> 	Is this why the default values for MIN and TIME are not a sane
> 1 and 0 like they should be!?!?

Yes.  I believe even AT&T considers this to have been a botch (overloading
EOF and EOL as MIN and TIME).

> Really, while orthoganality and flexibility are fine goals, so is
> *simplicity* of *use*. From what I have seen the Sys3/5 ioctl system
> is a real pain to use correctly.  In breking out the various operations
> the designers seem to have forgotten the principle of leaving the most
> common operations *simple*, ...

There's no reason for the primitive operations of a system to do something
"simple", if those primitive operations are mainly to be composed to make
"normal" operations.  You can write a routine called, say, "crmod()" to go
into character-at-a-time mode.  Have it do the low-level operations.
Primitives should be powerful and orthogonal; they should not necessarily
have a one-to-one mapping with commonly performed operations.

> The only really simple improvement was the OPOST idea, which Berkeley has
> implimented as LLITOUT!

No, they haven't.  LLITOUT turns off all output processing *and*, as a
side-effect, turns off parity on input and output.  If you have a terminal
set up for 7 bits, even parity, you can *not* go into LITOUT mode merely to
turn off NL to CR/LF mapping and tab expansion.  Turning OPOST off has no
effect on parity; it merely disables output translation and delay
processing, so it *can* (and should) be used by a full-screen program which
wants no munging of the data values between "write" and output.

In the S3/S5 driver, you can control 7 bits+parity vs. 8 bits+no parity,
stripping of input to 7 bits, XON/XOFF flow control, and input/output
translation and delay processing separately.  You can't do this with the
V6/V7/4.x drivers.  You can also do a number of things which are only of use
if you have a Frobozz-42 terminal or something strange like that, or which
are only of use if you're *really* used to V6-style handling of the kill
character and go into homicidal rage if the kill character is echoed with a
newline after it.

Some of the S3/S5 driver's complexity (like NL-to-CR translation on input -
I kid you not - or disabling the NL echo after the kill character) must be
there solely for historical reasons.  Most of its capabilities, however, are
very sensible.  It may have been a better idea to break out the specific
capabilities into multiple levels as per DMR's stream I/O system, putting
the stuff controlled by "cflags" at a level lower than the other stuff, and
permitting you to control things by plugging in different stream processing
modules rather than by flipping lots of switches on one big processing
module.

	Guy Harris