From owner-freebsd-current@FreeBSD.ORG Sun May 16 15:07:03 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5738016A4D0 for ; Sun, 16 May 2004 15:07:03 -0700 (PDT) Received: from mailout1.pacific.net.au (mailout1.pacific.net.au [61.8.0.84]) by mx1.FreeBSD.org (Postfix) with ESMTP id DAA0E43D2F for ; Sun, 16 May 2004 15:07:01 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from mailproxy2.pacific.net.au (mailproxy2.pacific.net.au [61.8.0.87])i4GM6m4u010285; Mon, 17 May 2004 08:06:48 +1000 Received: from gamplex.bde.org (katana.zip.com.au [61.8.7.246]) i4GM6iLS016992; Mon, 17 May 2004 08:06:46 +1000 Date: Mon, 17 May 2004 08:06:46 +1000 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Marcel Moolenaar In-Reply-To: <20040516153420.GA13929@dhcp01.pn.xcllnt.net> Message-ID: <20040517071308.J2922@gamplex.bde.org> References: <40A26162.9030607@cronyx.ru> <20040512.200542.09569104.imp@bsdimp.com><40A4E2CB.2000007@cronyx.ru> <20040515041301.O22881@gamplex.bde.org> <40A537C8.1010407@cronyx.ru> <40A73401.5010703@cronyx.ru> <20040516153420.GA13929@dhcp01.pn.xcllnt.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-current@freebsd.org cc: Roman Kurakin Subject: Re: Sio & Puc memory mapped X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 May 2004 22:07:03 -0000 On Sun, 16 May 2004, Marcel Moolenaar wrote: > On Sun, May 16, 2004 at 10:01:18PM +1000, Bruce Evans wrote: > > > > *snip*. The only fundamentally broken thing in the uart driver's > > defaults is that they have echos enabled, so an echo war results if 2 > > ports driven by the uart driver are connected and one of them happens > > to send a character before an ioctl can be done to set a useable state. > > The uart(4) driver uses TTYDEF_xFLAG from > Are the TTY defaults in that header wrong or are those merely a > good general set of defaults that one may need to tweak in ones > particular case (e.g. depending on the device or depending on > the open mode)? They are essentially a good set of defaults for interactive shells, or almost equivalently, for getty(8) and init(8). Note that init(8) knows noththing about termios. It just opens _PATH_CONSOLE and does i/o to it. Thus console drivers must do the same termios initialization that getty would do by default, so that the single user shell doesn't have a surprising termios state. Similarly, shells don't touch most of the termios state. They mostly just do i/o to open file descriptors supplied by their parent. Changes to the whole state are usually done using stty(8). E.g., "stty sane" sets to almost the defaults given in . Not so similarly, syslog(3) and syslogd(8) know nothing about termios. They just open _PATH_CONSOLE and write to it. Thus they depend on some of the driver's defaults (only the ones that affect output) like init(8). The driver's defaults need to be programmable at runtime so that the state for syslog* can be changed. They are essentially a good set of defaults for interactive shells, They are a bad set of defaults for terminal programs and most test programs. Only the issue with echo is critical. Terminal and test programs can handle noise from bogus echoes at the cost of extra complexity, but whatever they are connected to might not. Perhaps this was more of an issue on old slow systems with buggy drivers that didn't discard input on open. The echo war could take almost 100% of the CPU so many characters could be echoed before an ioctl could be run to kill the echoes. Bruce