[comp.sys.sun] Serial Line Settings

faulkner%jmullins@husc6.harvard.edu (Don Faulkner) (03/16/89)

In article <59@gaia.oz> munnari!gaia.oz.au!drm@uunet.uu.net (David Moline) writes:
Dave> Is it possible to alter the settings on the Sun's serial ports (ttya &
Dave> ttyb) so that they default to 8 bits no parity rather than 7 bits even
Dave> parity.

WNL> How about setting that in /etc/gettytab?  Can't you just create another
WNL> getty type entry that uses the "p8" capability, then use that getty type
WNL> on the line?...--wnl

yup - you can set the flag, and getty will proceede accordingly.  you type
your login, "/bin/login" runs, and ... guess what ... looks to me like
"/bin/login" sets back to 7/odd ... (Sun 4/260 SunOS 4.0.1)

 Don Faulkner                                       
 Building 1, Room 803
 Harvard University, School of Public Health
 665 Huntington Avenue
 Boston, MA  02115

 ARPA:      faulkner%jmullins@harvard.harvard.edu
 BITNET:    faulkner@harvard
 Telephone: (617) 732-2167

[[ Stupid software!  Let me guess:  "fixed in 4.1".  --wnl ]]

guy@uunet.uu.net (Guy Harris) (03/31/89)

>yup - you can set the flag, and getty will proceede accordingly.  you type
>your login, "/bin/login" runs, and ... guess what ... looks to me like
>"/bin/login" sets back to 7/odd ... (Sun 4/260 SunOS 4.0.1)

Bug # 1012922, as described in the Customer Distributed Bugs list in the
December 1988 Software Technical Bulletin.  As stated there:

	Synopsis: "login" blindly resets PASS8 mode

	Description:
	   "getty" supports a "p8" capability in "/etc/gettytab", which
	   is intended  to permit you to attach terminals in 8 data
	   bits, no parity bit, mode (or to run the Sun workstation
	   console in 8-bit mode).  Unfortunately, "login" turns PASS8
	   mode off, which undoes the work.  "getty" does to set PASS8
	   mode (*sic*); this means that some output from "login" will
	   be scrambled on terminals in 8 data bits, no parity bit, mode
	   even if you do not put "stty pass8" in your ".profile" or
	   ".login" file.

	Workaround:
	   Make sure you set "pass8" in your ".profile" or ".login", and
	   ignore the garbage that appears.

I think the last sentence in "Description:" should read "even if you *do*
put 'stty pass8' in your '.profile' or '.login' file."; I don't think I
said it that way when I originally submitted that bug report.  I don't
know what the scrambled sentence flagged with (*sic*) was supposed to
be....

"login" came that way from Berkeley; it can be considered a bug there, as
well, since the "f0", "f1", and "f2" flags include the local mode bits in
the upper 16 bits, and there exist other flags such as "dx" that affect
those mode bits, so "getty" *does* let you dink with those flag bits. 

The fix is to:

	1) modify "login" to leave PASS8 mode alone;

	2) modify clients of "login" other than "getty" (e.g.,
	   "in.rlogind" and "in.telnetd") to forcibly set or clear
	   PASS8, since "login" will no longer ensure that it has a
	   fixed setting).

This fix should be in 4.1, and may be in some dot-dot release as well.