Subject: Re: PR 7170 -- init and /dev/console
To: Michael Lyle <mlyle@recourse.net>
From: Greg A. Woods <woods@weird.com>
List: tech-kern
Date: 04/20/2001 14:26:47
[ On Friday, April 20, 2001 at 02:39:03 (-0700), Michael Lyle wrote: ]
> Subject: PR 7170 -- init and /dev/console
>
> I was thinking about ways to fix this without major kludges (e.g. fixing
> up a file descriptor in the kernel before init is exec'd). I have a
> proposal which might be useful in other operating situations.
It's really not a kludge at all for the kernel to hand init a file
descriptor for the console device on stdin/stdout/stderr. That's the
way it *should* work, IMO. The kernel knows what hardware it is using
as a console and without much trickery it can even know what device
major/minor numbers it's using so that a stat() would work too.
> I was wondering what people think of either adding a special fsid_t
> to fhopen() et al or a new system call to create a fd entry for a given
> major/minor/type set.
That won't necessarily solve init's problem unless you assume that
there's always a pseudo-console device that acts as a loopback
internally to whatever the real console is (i.e. because init won't know
any other major/minor numbers). We do have /dev/console on 0,0 now, but
I'm not so sure that's a good way to do things on all ports.
--
Greg A. Woods
+1 416 218-0098 VE3TCP <gwoods@acm.org> <woods@robohack.ca>
Planix, Inc. <woods@planix.com>; Secrets of the Weird <woods@weird.com>