Re: Serial Port Configuration does not work

From: Gary Jennejohn <gljennjohn_at_googlemail.com>
Date: Sat, 10 Sep 2011 16:08:21 +0200
On Sat, 10 Sep 2011 15:57:25 +0400
Boris Samorodov <bsam_at_ipt.ru> wrote:

> On Tue, 06 Sep 2011 16:29:51 +0400 Boris Samorodov wrote:
> 
> > the port does not work as expected (at least as per The Handbook,
> > 26.2.5 Serial Port Configuration). Nether "init" nor "lock"
> > devices can be used:
> > -----
> > # uname -a
> > FreeBSD host1.ipt.ru 9.0-BETA2 FreeBSD 9.0-BETA2 #14 r225395: Mon Sep
> > 5 18:10:43 MSK 2011 bsam_at_bb.ipt.ru:/usr/obj/usr/src/sys/HOSTS i386
> > # ls -l /dev/ttyu5*
> > crw-------  1 root  wheel    0,  56 Sep  5 18:50 /dev/ttyu5
> > crw-------  1 root  wheel    0,  57 Sep  5 18:50 /dev/ttyu5.init
> > crw-------  1 root  wheel    0,  58 Sep  5 18:50 /dev/ttyu5.lock
> > # stty -f /dev/ttyu5.init 57600
> > stty: /dev/ttyu5.lock isn't a terminal
> > # stty -f /dev/ttyu5.lock cs7
> > stty: /dev/ttyu5.lock isn't a terminal
> > -----
> 
> Ping!
> 

Seems that the handbook is out of date.

Looking at /sys/kern/tty.c the init and lock devices are only used
internally and are not "real" open-able/close-able devices.

Thye're created in tty_makedev() as required using make_dev_cred(),
which is probably why they appear under /dev.

The init device is initialized in tty_init_termios() and _never_
changed after that. It's only used to initialize "real" ttys.

The lock device seems to only be used in tty_ioctl().  I wasn't
able to figure out where it gets initialized.

-- 
Gary Jennejohn
Received on Sat Sep 10 2011 - 12:08:27 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:17 UTC