Parity on 4.x BSD UNIX ports

Guy Harris guy at gorodish.Sun.COM
Fri Apr 15 03:23:07 AEST 1988


> >2. What can be done short of a kernel change to provide a solution?
> 
> Very little.  You can run in `raw' mode, but that is entirely
> unsatisfactory, or in `litout mode', which is somewhat less so.  If you
> have 4.3BSD you can run in `litin + litout' mode and write a user level
> program to mangle, er, manage, parity over pty lines, and use that to
> work around the problem, but this is ugly and slow.

If the goal is not to permit deliberate access to the extended character set,
but merely to prevent unintended access to the extended character set (i.e., to
prevent a character from getting the 8th bit turned on by the serial port
hardware and thus to be transformed into an extended character), they can turn
on PASS8 in 4.3BSD.  This disables stripping of input to 7 bits, but
unfortunately doesn't disable stripping of output to 7 bits; it also puts the
serial port hardware into "8 bits, no parity" mode.

> >3. If there is no easy solution.  Should UNIX be modified so
> >   that it will not (optionally) generate parity on output?
> 
> The 4BSD drivers should be thrown out entirely (`thrown aside with
> great force' :-) ).  Berkeley CSRG are working on a POSIX-like tty
> interface, which will no doubt fix all this, but that is not likely to
> emerge for some time.

I presume it's POSIX-compatible, not just "POSIX-like".

> Sun may provide something useful soon, what with their AT&T deal.

Actually, we'll provide it with SunOS 4.0.  4.0 has a tty driver, development
of which was started *before* the AT&T deal, that has an S5/POSIX style "ioctl"
interface with a streams module pushed atop it that maps V7/BSD "ioctl"s into
S5/POSIX-style "ioctl"s.  (All of the BSD user interface features, except for
the "delayed suspend" character and the LTILDE bit, are implemented in the
POSIX-style "ioctl"s.  I say "POSIX-style" here because those features are
implemented according to a scheme that appeared in early POSIX drafts; the
scheme was originally proposed by Clem Cole, Jim McGinness, and somebody from
Tektronix.)

Basically, output is never stripped to 7 bits by the software; the only such
stripping is done by the hardware if you set the character width to 7 bits.
Input may or may not be stripped, depending on the setting of the ISTRIP mode.
If you set PASS8, the "ioctl" mapper will turn this into "8 bits, no parity, no
input stripping" mode, and give you a full 8-bit data path.

We also changed "getty" so that you can specify a "p8" capability in
"gettytab"; this causes PASS8 to be turned on.



More information about the Comp.unix.wizards mailing list