From owner-freebsd-current@FreeBSD.ORG Tue Aug 26 16:37:09 2008 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 411A81065672 for ; Tue, 26 Aug 2008 16:37:09 +0000 (UTC) (envelope-from keramida@freebsd.org) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.freebsd.org (Postfix) with ESMTP id B12848FC2E for ; Tue, 26 Aug 2008 16:37:08 +0000 (UTC) (envelope-from keramida@freebsd.org) Received: from kobe.laptop (adsl76-178.kln.forthnet.gr [77.49.123.178]) (authenticated bits=128) by igloo.linux.gr (8.14.3/8.14.3/Debian-5) with ESMTP id m7QGafef025163 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 26 Aug 2008 19:36:47 +0300 Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.14.2/8.14.2) with ESMTP id m7QGafWr020290; Tue, 26 Aug 2008 19:36:41 +0300 (EEST) (envelope-from keramida@freebsd.org) Received: (from keramida@localhost) by kobe.laptop (8.14.2/8.14.2/Submit) id m7QGaeWf020289; Tue, 26 Aug 2008 19:36:40 +0300 (EEST) (envelope-from keramida@freebsd.org) From: Giorgos Keramidas To: Ed Schouten References: <87fxot5hoi.fsf@kobe.laptop> <20080826160144.GG99951@hoeg.nl> Date: Tue, 26 Aug 2008 19:36:39 +0300 In-Reply-To: <20080826160144.GG99951@hoeg.nl> (Ed Schouten's message of "Tue, 26 Aug 2008 18:01:44 +0200") Message-ID: <87fxorlomg.fsf@kobe.laptop> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-MailScanner-ID: m7QGafef025163 X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-4.293, required 5, autolearn=not spam, ALL_TRUSTED -1.80, AWL 0.11, BAYES_00 -2.60) X-Hellug-MailScanner-From: keramida@freebsd.org X-Spam-Status: No Cc: FreeBSD Current Subject: Re: Inserting flow-control chars with an mpsafetty kernel X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Tue, 26 Aug 2008 16:37:09 -0000 On Tue, 26 Aug 2008 18:01:44 +0200, Ed Schouten wrote: > * Giorgos Keramidas wrote: >> After installing the mpsafetty changes it seems that flow-control ^S and >> ^Q characters cannot be inserted inserted anymore. I first noticed this >> when CTRL-S stopped working as 'search-forward' in Emacs, but it seems >> the same problem exists in /usr/bin/vi, vim, bash and a few other >> programs that I tested. >> >> With a kernel before the mpsafetty changes, I can fire up /usr/bin/vi >> and type in insert-mode `^V^S'. This correctly inserts a ^S character. >> With a kernel from svn revision /head@181939 ^V no longer quotes the >> next byte in vi(1) and other programs. > > There is indeed a small problem w.r.t. ^S/^Q characters with the MPSAFE > TTY code, but it is not so directly involved in the handling of the > actual characters, but a shortcoming of the pts(4) driver. > > There is this way a PTY (master device) can be configured to use `packet > mode' (TIOCPKT). When this mode is enabled, all data that is read() by > screen is prepended by a single byte, containing a bit mask of events. > These events include flush events, but also flags indicating tcsetattr() > has been called and has toggled VSTART/VSTOP. [snip explanation of packet mode] > Screen(1) is a fairly moronic written application, which uses packet > mode for no sensible reason at all. If you just comment out TIOCPKT in > /usr/include/sys/ttycom.h and recompile screen(1), your problems are > gone, right? I'll give it a try and email back. Thanks! :) > There are three ways ways to fix this problem: > > - Implement a real packet mode which properly returns the TIOCPKT_* > flags. Unlike the previous TTY layer, it is a lot harder to do this > with MPSAFE TTY, because it turns the generic TTY code into more > bloat. > > The new TTY layer has been designed to be a real front-end for the > device driver. There aren't any driver hooks (yet) to detect the > events supported by TIOCPKT, because `normal drivers' don't need these > event notifications anyway. > > - Remove TIOCPKT and TIOCPKT_* to and leave it > there to die. While there, also move definitions of other awkward > commands to this header. > > - Both. > > I was planning to prepare a changeset soonish, which removes the (in > my opinion) deprecated ioctl()'s from our header files, so I can let > the ports folks run a tinderbox to see how much breaks. This should > give us a good estimation of the best approach. I can definitely rebuild `screen' with a commented out `TIOCPKT'. On the laptop I'm testing FreeBSD stuff I also have about 620 ports that I can rebuild with `portupgrade -fa' in a day or so. If you want me to test a patch that moves TIOCPKT_* to please count me in as a tester.