Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 Sep 2011 16:08:21 +0200
From:      Gary Jennejohn <gljennjohn@googlemail.com>
To:        Boris Samorodov <bsam@ipt.ru>
Cc:        freebsd-current@FreeBSD.org
Subject:   Re: Serial Port Configuration does not work
Message-ID:  <20110910160821.5220f1f7@ernst.jennejohn.org>
In-Reply-To: <47407562@bb.ipt.ru>
References:  <70652288@bb.ipt.ru> <47407562@bb.ipt.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 10 Sep 2011 15:57:25 +0400
Boris Samorodov <bsam@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@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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110910160821.5220f1f7>