From owner-freebsd-current@FreeBSD.ORG Sat Sep 10 14:08:27 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E1B6106564A for ; Sat, 10 Sep 2011 14:08:27 +0000 (UTC) (envelope-from gljennjohn@googlemail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id A799B8FC17 for ; Sat, 10 Sep 2011 14:08:26 +0000 (UTC) Received: by fxe4 with SMTP id 4so4476448fxe.13 for ; Sat, 10 Sep 2011 07:08:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to :x-mailer:mime-version:content-type:content-transfer-encoding; bh=yV0wn9YLQp4gg/pGYEtEYzibzZE3wS/3ScUZ6plcOls=; b=wV0I3Flp72M7Y31yroSOuWbQZysscbBg7MWXHhIgKdgFEkMRuqg7M5Wt0mgs1lPOiX kxE0GnFJqqolqiEVhXkNDNCZtLbwaO8ewCnjbQdOgR4o+3+zADrkITODW7A+S9/M8RLY 88L1hGJKL6iC8MQqveLLlzwCN9NmWliTyiE+I= Received: by 10.223.42.24 with SMTP id q24mr1346671fae.148.1315663705659; Sat, 10 Sep 2011 07:08:25 -0700 (PDT) Received: from ernst.jennejohn.org (p578E2925.dip.t-dialin.net [87.142.41.37]) by mx.google.com with ESMTPS id m8sm4550967fae.17.2011.09.10.07.08.23 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 10 Sep 2011 07:08:23 -0700 (PDT) Date: Sat, 10 Sep 2011 16:08:21 +0200 From: Gary Jennejohn To: Boris Samorodov Message-ID: <20110910160821.5220f1f7@ernst.jennejohn.org> In-Reply-To: <47407562@bb.ipt.ru> References: <70652288@bb.ipt.ru> <47407562@bb.ipt.ru> X-Mailer: Claws Mail 3.7.10 (GTK+ 2.18.7; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-current@FreeBSD.org Subject: Re: Serial Port Configuration does not work X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: gljennjohn@googlemail.com List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Sep 2011 14:08:27 -0000 On Sat, 10 Sep 2011 15:57:25 +0400 Boris Samorodov 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