Subject: Re: com device
To: None <email@example.com>
From: Christos Zoulas <firstname.lastname@example.org>
Date: 12/24/1999 23:10:47
In article <Pine.BSF.email@example.com>,
Vadym V. Chepkov <firstname.lastname@example.org> wrote:
>I've installed NetBSD on AS1000 at last. I changed network and video
>adapters from EISA to PCI and now it works.
>But I found another problem. :-(
>This is part of dmesg message:
>com0 at isa0 port 0x3f8-0x3ff irq 4: ns16550a, working fifo
>com1 at isa0 port 0x2f8-0x2ff irq 3: ns16550a, working fifo
>So, I tried to find which logical device are correspond to these
>$ man -k com
>com (4) - serial communications interface
That is weird. I would expect to find device driver specific man pages
in man4.alpha, but the directory is not there. This a bug in our
documentation. Please send-pr it. I think it is general on the alpha.
>$ man 4 com
>man: no entry for com in the manual.
>I looked in the /etc/ttys
># AlphaStation NS16550 ("com") serial ports
>ttyC0 "/usr/libexec/getty std.9600" unknown off secure
>ttyC1 "/usr/libexec/getty std.9600" unknown off secure
># bash-2.03# stty < /dev/ttyC0 ; frozen :-(
>Ok, another try
># stty -f /dev/ttyC0
>ispeed 0 baud; ospeed 9600 baud;
>lflags: echoe echoke echoctl
>oflags: onocr onlret
>cflags: cs8 -parenb
>I'd like to install special device, which I developed, on COM1, so I tried
>to configure com-port without modem control and 2400 baud
># stty -f /dev/ttyC0 clocal speed 2400
># stty -f /dev/ttyC0 - settings isn't changed :-(
As expected. Only while the file descriptor remains open the settings
are preserved. When the file descriptor is closed, the settings revert
to their defaults.
>What I'm doing wrong or where I can read about COM devices under NetBSD on
>P.S. When I'm working on FreeBSD
>man sio and stty < /dev/cuaia0 2400 work very well.
What are you trying to do?
If you want to emulate what FreeBSD does you can:
- edit /etc/ttys and add 'softcar' to the tty you want to use [ttyC0]
- run (stty 2400; sleep 100000000) < /dev/ttyC0
- run stty -f /dev/ttyC0
Well, this is not a very useful example... Anyway...
ttys on netbsd are not like cu devices. If you want to connect to them
while there is no carrier, you need to set softcar. If you want to keep
the state of the tty, you need to keep a file descriptor open to it.