*BSD News Article 21382


Return to BSD News archive

Newsgroups: comp.os.386bsd.questions
Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!agate!howland.reston.ans.net!xlink.net!subnet.sub.net!ppcnet.ppc.sub.org!rumtifsl.ruessel.sub.org!strix.cluster.sub.org!ura
From: ura@strix.cluster.sub.org (Ulf Andrick)
Subject: Re: Dial-in using 8,N,1 How?
Organization: Nocturnal Unix System in Kaiserslautern, Germany
References: <andy.748545008@nmr-z.mgh.harvard.edu>
Message-ID: <CDs7DE.rp@strix.cluster.sub.org>
X-Newsreader: TIN [version 1.1 PL8]
Date: Thu, 23 Sep 1993 00:43:47 GMT
Lines: 61

In <andy.748545008@nmr-z.mgh.harvard.edu> Andrew Wieckiewicz (andy@dbe.mgh.harvard.edu) writes:
: Hello all.
: Can anyone shed sime light on the problem im having in setting up 
: my dial-up line on a 386bsd 0.2.4 to be configured for 8 data bits, 
: no parity and 1 stop bit (8,N,1)?

: The modem works fine, I have it set up for hardware handshaking.  The
: port is set up "-clocal", and "cs8".  The gettytab entry calls for
: "np" - no parity.  What is happening (on occasion it is fine) is that
: when I get a login prompt, I type in a valid username, after which
: I get a garbled up phrase "Password".  The terminal 
: reset itself to 7,E,1 after I typed the username in.  What gives?
: Does 'login' set up terminal characteristics, and does it do that
: regardless of pre-set parameters via gettytab?. 

Login uses the getpass system call, which gets the terminal settings,
clears the ECHO flag and writes the terminal parameters back, as we
don't want to have the password displayed on the screen.

There doesn't seem to be anything wrong about that. The question is what
terminal parameters it picks up.

And in fact, getty sets the termios structure to the default values,
which means 7E1, regardless whatever you specify in gettytab, because
getty doesn't use termios calls at all. It uses the old style ioctls.
It seems that both sets of calls have their own independent data
structures, though they act on the same device, and the one doesn't 
know what the other has done to the terminal. 

There is a getty around, which has the old-style calls replaced by
termios ioctrls. But possibly, there are other programmes, which use the
old style calls as well. So, perhaps it would be better to set both at
the same time.

As a quick hack I've emptied the set_ttydefaults function in
/usr/src/libexec/getty/ttydefaults.c and stty'ed the appropriate 
parameters manually before starting the newly compiled getty, which 
leaves the terminal settings untouched and the password prompt unscrambled.

: For a bigger discussion, what would the effect of changing the system 
: default from 7,E,1 to 8,N,1 be?  I have no reason not to stick with
: the de-facto standard of (seems-like) all Unix systems of 7,E,1 except
: for ease of use for a user which is using a modem and dials up all 
: other systems /BBS systems at 8,N,1

For those who want to use extended character sets, e. g. to represent
national characters, 8N1 is a necessity. The 7 bit limitation should
really be obsolete nowadays.

Under primitive operating systems, the use of diacritical characters is
standard. You don't have to do or know much to configure the system so
that the ä key will produce an ä on the screeen indeed. In the Unix
world, one is still frequently confronted with badly configured systems 
and programmes that simply refuse to transmit the 8th bit. 

Instead of letting people adapt to the software, the goal should be to
adapt the software to the needs of people, maybe even non-American people.

-- 
Ulf Andrick
ura@strix.cluster.sub.org