*BSD News Article 25421


Return to BSD News archive

Newsgroups: comp.os.386bsd.questions
Path: sserve!newshost.anu.edu.au!munnari.oz.au!spool.mu.edu!darwin.sura.net!paladin.american.edu!europa.eng.gtefsd.com!uunet!pipex!zaphod.crihan.fr!jussieu.fr!univ-lyon1.fr!frmug!fasterix.frmug.fr.net!pb
From: pb@fasterix.frmug.fr.net (Pierre Beyssac)
Subject: Re: [NetBSD 0.9] problem with elvis (vi) on serial line
References: <CI5uoB.Gpt@filetek.com> <MARK_WEAVER.93Dec18171936@tonto-slip9.cis.brown.edu>
Organization: considered harmful
Date: Thu, 30 Dec 1993 00:01:41 GMT
Message-ID: <1993Dec30.000141.268@fasterix.frmug.fr.net>
Lines: 69

In article <MARK_WEAVER.93Dec18171936@tonto-slip9.cis.brown.edu>,
 <Mark_Weaver@brown.edu> wrote:
>In article <CI5uoB.Gpt@filetek.com> jan@filetek.com (Jan Morales) writes:
>
>This is not a problem with elvis, it is a problem with the com driver.
>I'm not sure why, but certain programs change the frame type of the
>data.  If you try to use gdb to step through a program you will soon
>see a similar effect.  Or quitting out of emacs 19.22 will leave you
>at a shell prompt with a different frame type.

The affected programs are all programs using TIOCGETP then TIOCSETP.
For example most programs setting the tty to raw mode : more, vi...

>When I say frame type, I mean the number of data bits, stop bits and
>parity.  I have seen it switch between the following frame types:
>
>  - 8 data bits, 1 stop bit, no parity
>  - 7 data bits, 1 stop bit, even parity
>  - 7 data bits, 1 stop bit, no parity

That's not a problem with the com driver. I think that's a problem
with tty_compat.c and the way TIOCGETP/TIOCSETP are handled.
I'm not sure how to solve it really ; I did the following under
NetBSD 0.9 to cure the same problem : I changed in tty_compat.c
the lines

                if (iflag&INPCK) {
                        if (cflag&PARODD)
                                flags |= ODDP;
                        else
                                flags |= EVENP;
                }
                else
                        flags |= EVENP | ODDP;

to
                        if (cflag&PARODD)
                                flags |= ODDP;
                        else
                                flags |= EVENP;

The problem is that parity settings are messed up if INPCK is
not set, which is IMHO not how it is supposed to work.

A result of this patch is that INPCK is not correctly restored
then... I found this less annoying so I did not try to cure this.

A very similar (though less annoying) problem is that ECHOCTL is
forcefully set during a TIOCGETP/SETP, resulting in echos of ^H in
xterms as soon as you have used more/vi :

                lflag |= ISIG|IEXTEN|ECHOCTL;   /* XXX was echoctl on ? */

IMHO the "|ECHOCTL" should be removed.

I signaled both these problems during september at the NetBSD bugs
address, but got no answer.

>The com driver needs a serious overhaul IMHO anyway.

Even though this will not solve the parity settings problem, I
think you're right. Since I switched to FreeBSD which uses the sio
driver, I really saw the difference during connections at or above
9600 bps with my modem, and RTS/CTS/DTR/DCD handling.
-- 
Pierre Beyssac
FreeBSD@home: pb@fasterix.frmug.fr.net
SunOS4@work: pb@emeraude.syseca.fr
NetBSD, FreeBSD, Linux -- Il y a moins bien, mais c'est plus cher.