From owner-freebsd-arch@FreeBSD.ORG Thu Feb 14 10:08:41 2008 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3521216A419 for ; Thu, 14 Feb 2008 10:08:41 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:610:652::211]) by mx1.freebsd.org (Postfix) with ESMTP id BFB0113C44B for ; Thu, 14 Feb 2008 10:08:40 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: by palm.hoeg.nl (Postfix, from userid 1000) id 2494F1CD2A; Thu, 14 Feb 2008 11:08:40 +0100 (CET) Date: Thu, 14 Feb 2008 11:08:40 +0100 From: Ed Schouten To: Poul-Henning Kamp Message-ID: <20080214100840.GQ1340@hoeg.nl> References: <20080213150500.GH1340@hoeg.nl> <22736.1202979772@critter.freebsd.dk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Bk6L21jbBNK7V1Rv" Content-Disposition: inline In-Reply-To: <22736.1202979772@critter.freebsd.dk> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: FreeBSD Arch Subject: Re: Proposal for redesigning the TTY layer X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Feb 2008 10:08:41 -0000 --Bk6L21jbBNK7V1Rv Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello Poul-Henning, * Poul-Henning Kamp wrote: >=20 > Much of this looks very sensible, but I have a few red flags: >=20 > The current PTY implementation (both /dev/pty* > and /dev/pts/*) suffers from the problem that a > simple stat() on a nonexistent device will already > create the device, even if the user has no intention > to use it. >=20 > Last I worked on this, there were several applications in ports > that broke if this didn't work that way. You would have to be > prepared to hunt down every single bogo_openpty() function in ports > if you carry this change through. Because I know it's impossible to fix this in the nearby future, I'm planning on re-adding support for the old /dev/pty*-style TTY's, using the old allocation model, which I'll probably call `pty_compat'. We can only hope new software will use interfaces like openpty() and posix_openpt(), so we can remove this old interface in the very far future. > Move prison checks into devfs >=20 > They do not belong in DEVFS, since that would require DEVFS to know > far more about the device semantics if the individual drivers than > it ever should. >=20 > You can put it in the generic tty layer if you want, that would be > emminently sensible, but DEVFS is the wrong place for it. The reason why I was thinking about this, was because devfs already stores per-device credentials (see cdevsw's si_cred field). Say, we want to expose other resources through devfs (/dev/shm/..., etc), we could also prevent access from other prisons there as well. Of course I'm willing to leave it as it is now, if we cannot come to an agreement on this. > Clists >=20 > I would just drop clists and switch to mbufs. Even though I think it's a good idea, I'm not sure how I would implement certain features the clists offer, like quoted characters for example. Ideas are welcome. :-) > Consoles... >=20 > Consoles are not ttys and ttys are not consoles. They may share > hardware, but that does not make them the same thing. I have > analyzed the console situation in detail on the arch@ mailing list > long time ago, and you should read that analysis before you touch > the console code. I'm planning on leaving the console code alone as much as possible. The document sometimes did mention the word `console', but in those cases I was referring to drivers which provide a graphical system console, like sc(4). > Items missing from your list: >=20 > Firmly abstract line discipline from tty code I was already planning to add the termios line discipline code outside the TTY code itself. I'll also add this to the document. Thanks for your feedback. I'll make some changes to the document based on the input I've got so far. I'll add an article to the wiki which will also contain a link to the latest version of this document. --=20 Ed Schouten WWW: http://g-rave.nl/ --Bk6L21jbBNK7V1Rv Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (FreeBSD) iEYEARECAAYFAke0EygACgkQ52SDGA2eCwX24wCdEe9hkmBhpb5xtdvHIl5gULHZ 58MAn0G5hJvGlxW5znyefhelaWcoQwuN =t3M6 -----END PGP SIGNATURE----- --Bk6L21jbBNK7V1Rv--