Subject: Re: On /dev/console, /dev/constty and the TIOCCONS ioctl
To: David Laight <david@l8s.co.uk>
From: Bill Studenmund <wrstuden@netbsd.org>
List: tech-kern
Date: 10/06/2003 11:07:03
--wq9mPyueHGvFACwf
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, Oct 04, 2003 at 09:02:46AM +0100, David Laight wrote:
> >=20
> > Please revert these changes, at least until they get discussed.
>=20
> I've reverted the change to /etc/ttys - the only user-visible part.

Ok. Thanks.

> > This is an area of the kernel that if you do not feel fully comfortable
> > what's going on, you shouldn't be changing.
>=20
> Indeed - it has taken me 2 days to work out what it going on, after I
> realised why what I was trying to do didn't work.

Heh.

> > > It also makes it possible to log in on the 'console' while xconsole
> > > (or similar) is running - a problem someone else mentioned yesterday.
> > >=20
> > > Without the change it is impossible for a program running from the co=
nsole
> > > to output data to the console if TIOCCONS has been used to transfer k=
ernel
> > > messages to a pty.
> >=20
> > Uhm, why not just use the real devices? Once you've installed, your=20
> > console shouldn't be moving around, so using ttyE0 or tty0 or some such=
=20
> > isn't a big deal.
>=20
> Unless there is a 'magic' way to make the console getty run on the
> underlying console device (instead on /dev/console) this doesn't work.

For an install kernel, I think /dev/console (and your change after=20
feedback) are the right thing to do. For a static box, though, I don't see=
=20
what is so bad about enabling getty on _all_ your console candidates. I=20
mean you should have a good idea of where you want the console (this=20
serial port, that frame buffer, that other conosle device...). :-)

> > Did you verify that revoke works right? Also, what are the semantics of=
=20
> > something opening /dev/console and something running on /dev/constty?
>=20
> Much the same as those of something running on /dev/console and /dev/ttyE0

Did you verify that all the twisty maze of VOP_REVOKE() will work right?=20
Before, we only revoked on one dev_t. Now we have two dev_t's that need=20
revoking.

Hmmm... Or do both /dev/console and /dev/constty both store the dev_t of=20
the underlying device, so this isn't an issue.. ??

One other related question, is /dev/console now supposed to be a=20
write-only device? If it's write-only, then the revoke issue is aleviated=
=20
(sp?).

> > Please revert it, and post a diff. While reverting would be volintary, =
if=20
> > you don't, you're setting a precident of, "It's ok because I committed=
=20
> > it." That doesn't do well for our code quality or peer review.
>=20
> I did wonder if someone would ask this...

You've reverted the user-visable bit, and we're discussing things. So=20
we're doing fine. Thanks!

Take care,

Bill

--wq9mPyueHGvFACwf
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (NetBSD)

iD8DBQE/ga9HWz+3JHUci9cRAiagAJwICRtcrPcN2HEzZYXkZ0lxNgOxUwCfSAUw
1yPw7ix30nGshSGSgBTdom4=
=zPSO
-----END PGP SIGNATURE-----

--wq9mPyueHGvFACwf--