Subject: Help Me Understand Serial Ports...
To: None <netbsd-users@netbsd.org>
From: Alex Dumitriu <alex@bitblot.com>
List: netbsd-users
Date: 03/11/2003 16:39:40
OK, so I'm working on setting up a console server on NetBSD1.6.1RC2. I'm
having some problems getting serial communications to work properly.

First, a general question: If I'm seeing something on the serial port when
tip-ed into it (ie garbage with some recognizable bits) it should be
safe to assume that I don't have a DTE/DCE problem (that is to say, I'm
neither missing a null-modem, nor have a superfluous one) correct?

Alright, that aside, I have a few devices that I can't talk to properly,
but let's just pick one: I have a hardware RAID that wants a 38400 8n1 no
flow control terminal. Those settings work fine on a laptop with
hyperterm.
My /etc/remote entry looks like this:

oldraid:dv=/dev/tty02:br#38400:pa=none:dc:

and I've stty-ed the serial port to look like this:

# stty -f /dev/tty02 -a
speed 38400 baud; 0 rows; 0 columns;
lflags: -icanon -isig -iexten -echo -echoe -echok -echoke -echonl
        -echoctl -echoprt -altwerase -noflsh -tostop -flusho -pendin
        -nokerninfo -extproc
iflags: -istrip -icrnl -inlcr -igncr -ixon -ixoff -ixany -imaxbel -ignbrk
        brkint -inpck -ignpar -parmrk
oflags: -opost -onlcr -ocrnl -oxtabs -onocr -onlret
cflags: cread cs8 -parenb -parodd -hupcl clocal -cstopb -crtscts -mdmbuf
        -cdtrcts
cchars: discard = ^O; dsusp = ^Y; eof = ^D; eol = <undef>;
        eol2 = <undef>; erase = ^?; intr = ^C; kill = ^U; lnext = ^V;
        min = 1; quit = ^\; reprint = ^R; start = ^Q; status = ^T;
        stop = ^S; susp = ^Z; time = 1; werase = ^W;

As near as I can figure, this should work, but I just get garbage. I've
twiddled pretty much every flag (or at least every flag associated with
byte size, stop bits, flow control, etc...) to no good effect. What am I
missing? What else can I try?

 -Alex Dumitriu