Subject: Re: On /dev/console, /dev/constty and the TIOCCONS ioctl
To: Bill Studenmund <wrstuden@netbsd.org>
From: Greg A. Woods <woods@weird.com>
List: tech-kern
Date: 10/04/2003 13:03:12
[ On Friday, October 3, 2003 at 20:33:18 (-0700), Bill Studenmund wrote: ]
> Subject: Re: On /dev/console, /dev/constty and the TIOCCONS ioctl
>
> On Fri, Oct 03, 2003 at 09:05:06PM +0100, David Laight wrote:
> > Anyone know where /dev/console is documanted?
> 
> This is an area of the kernel that if you do not feel fully comfortable
> what's going on, you shouldn't be changing.

Ah, Bill, how the heck do you get from asking where documentation is
(presumably so that it can be updated), to not feeling comfortable with
some part of the kernel?!?!?!?

> Uhm, why not just use the real devices? Once you've installed, your 
> console shouldn't be moving around, so using ttyE0 or tty0 or some such 
> isn't a big deal.

That just doesn't work in the real world.

Consider a sparc system with both keyboard & framebuffer as well as two
different serial ports, any one of wich can be used as the systems
console.  The PROM chooses which device is to be the system console.

If you want a login prompt on the serial console to "just work" whenever
the PROM is configured to use the serial device then you must run getty
on /dev/console.  However if some user logging in on the framebuffer
runs xconsole then this causes a serial console to be hosed.

/dev/constty is the simplest and most elegant, and in my experience the
only logical, solution to this quandry, and it's been far too long in
coming to NetBSD.

-- 
						Greg A. Woods

+1 416 218-0098                  VE3TCP            RoboHack <woods@robohack.ca>
Planix, Inc. <woods@planix.com>          Secrets of the Weird <woods@weird.com>