Subject: Re: Getting cu working
To: None <port-sun3@NetBSD.ORG>
From: der Mouse <mouse@Collatz.McRCIM.McGill.EDU>
List: port-sun3
Date: 03/18/1996 07:03:53
> I have been struggling for the last week with getting cu working;
> I don't seem to be able to get sense out of the serial port.
> This is NetBSD 1.1 on a 3/60.

> Things like this keep happenning:

> % stty -f /dev/ttya speed
> 9600
> % stty -f /dev/ttya 2400
> % stty -f /dev/ttya speed
> 9600

> I'm guessing that whenever the serial device is closed the device is
> being reset.

Probably, or else it's being reset on open.  (For your purposes, there
isn't much difference.  It matters largely wrt what happens to
characters that arrive while the device is closed.)

> % cat >/dev/ttya
> Now I type random garbage^D

> results in dtr on the modem going on, but the ^D will not stop the
> input; ^\ causes csh to dump core, stopping it.

Sounds as though the shell's open() call on /dev/ttya is blocked,
probably blocked waiting for carrier.  Is the line set -clocal by any

> when I try cu, I get:

> % cu -s 2400 -l /dev/ttya
> Connected [ At this point DTR goes on]
> [I type a letter]
> Input/output error.
> % 

Can't help here.  I'd look at syscall traces and pore over the relevant
kernel code....

> Interrupting cu with ~z and examining the serial port shows that it
> is it is at the right baud rate, with appropriate cs8 and -parenb.  I
> am yet to work out how to extract the raw/cooked data from stty.

In this wonderful [note heavy sarcasm] new POSIX terminal interface,
there is no simple raw/cooked distinction.  You have to twiddle at
least four things to switch between raw and cooked (ICANON, VMIN,
VTIME, OPOST...and CS8 if it's set to CS7, possibly others).  [Grrr.  I
want to know what happened to the LTILDE bit!  I've _got_ one of the
terminals that was designed for!]

					der Mouse