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:11:56
--oJ71EGRlYNjSvfq7
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, Oct 06, 2003 at 07:06:11PM +0100, David Laight wrote:
> > Yes, you can.  You run the getty on the underlying hardware device
> > (e.g. /dev/ttyE0) and redirect the console however you like.  It works.
> > Something similar would work for sysinst.  Do we actually have any ports
> > left that have a separate "console" device that does *not* have an
> > underlying hardware tty?
>=20
> No, that is running a terminal on /dev/ttyE0 and having TIOCCONS
> redirecting /dev/console output elsewhere.
>=20
> The problem is that you need to run a getty on the device that is the
> console 'this time the system booted'.  This is the default for 34 ports,
> only 15 have it disabled (acorn26 an playstation2 don't have a console li=
ne).

Agreed. As mentioned in my other note, I think Thor, myself, and others=20
think that this isn't hard as you can know the set of console devices, and=
=20
run a getty on each of them.

> The i386 port almost always needs reconfiguring though!
>=20
> Additionally init uses /dev/console in single user mode (but not when
> running MAKEDEV!).
>=20
> With devfs, /dev/constty could be a dynamically generated symlink to
> the underlying console, but this is hard to do since /dev is still
> readonly in some cases when the console is needed.

No, if we have a devfs, then we'd have the kernel do the right magic for=20
us. :-)

> Actually /dev/constty could be created as a duplicate /dev entry for
> the real tty device (the major/minor is available from sysctl) during
> system boot (once / is mounted RW).  This would remove many of the
> ctty and revoke() issues.

Ooo..... That would kill a lot of problems in return for a little rc.d=20
scriptage. I vote for it! :-)

Take care,

Bill

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

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

iD8DBQE/gbBsWz+3JHUci9cRAr7PAKCHidnARmsjx992Tplu0zolEJwY8QCfb9yd
pupxyzqTvsQhaqNpTvlXs+8=
=T15z
-----END PGP SIGNATURE-----

--oJ71EGRlYNjSvfq7--