Subject: Re: On /dev/console, /dev/constty and the TIOCCONS ioctl
To: <>
From: David Laight <david@l8s.co.uk>
List: tech-kern
Date: 10/06/2003 19:06:11
> > The fundamental problem I was trying to solve is that you can't
> > have use /dev/console as a terminal and support TIOCCONS redirecting
> > console output elsewhere.  NetBSD, as shipped, tries to allow both.
> 
> 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?

No, that is running a terminal on /dev/ttyE0 and having TIOCCONS
redirecting /dev/console output elsewhere.

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 line).

The i386 port almost always needs reconfiguring though!

Additionally init uses /dev/console in single user mode (but not when
running MAKEDEV!).

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.

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.

	David

-- 
David Laight: david@l8s.co.uk