Subject: Re: revoke(2), /dev/console and /dev/ttyE0
To: <>
From: David Laight <david@l8s.co.uk>
List: tech-kern
Date: 10/15/2003 18:04:25
On Wed, Oct 15, 2003 at 09:21:28AM -0700, Bill Studenmund wrote:
> On Wed, Oct 15, 2003 at 12:26:30AM +0100, David Laight wrote:
> > > > > What's supposed to happen is that the revoke on one of the nodes will 
> > > > > wander through vgonel(), and then to vclean(, DOCLOSE, ), and eventually 
> > > > > to a VOP_CLOSE() call on the underlying device. If that close happens on 
> > > > > the console device, it will end up closing the underlying device.
> > > > 
> > > > The VOP_VLOSE() on the underlying device only happens on the last close.
> > > 
> > > Are you sure of that? Look at spec_close() and remember that when we're in 
> > > vclean(), VXLOCK will be set:
> > 
> > That is true for /dev/console, but not when the cons code releases
> > /dev/ttyE0 - which is the device that needs its close routine called.
> 
> Then we should add a new flag to the ones we pass down to dev::close()
> and tell it that we are forcing the close. In that case, have the console 
> code force-close the underlying tty.

That all starts getting nastier...
I think a good aim would to have a devfs (I might start trying to write one)
that automatically makes /dev/constty the same as the underlying tty [1]
and then make /dev/console a write only device.
Once that is done a lot of the console hacks can be extracted.

	David

[1] I don't think it can be done with a startup script because init
needs the console set correctly for single use mode.

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