Subject: Re: Review wsdisplay status device
To: Julio Merino <jmmv@hispabsd.org>
From: Gregory McGarry <g.mcgarry@ieee.org>
List: tech-kern
Date: 06/24/2002 08:04:11
Julio Merino wrote:

> The following patch creates a new minor device inside wsdisplay space
> (c, 47,254) that can be used to retrive events that happen from inside
> wsdisplay. I've named it /dev/wsdisplay but this can be changed if
> you want... This patch implements this device using the same technique
> as wsmouse or wskbd. It uses an wsevent queue where kernel injects
> events and the user can read them.
> 
> I've also added a ioctl routine for the device to group some more
> ioctl's inside this device (i.e. get active console number by hand,
> instead of when it happens).
> 
> This patch will help the console mouse driver to know when wsdisplay
> events happen (user changes screen, enters X... this last one has to
> be implemented) and act consequently to avoid console corruption.

The only problem I can see is that you're reading the dynamic state
from the kernel.  Once you return to userland, there is no guarantee
that the returned value is correct any more.  You can tell if an
event occurred, but not infer any precise kernel state.

	-- Gregory McGarry <g.mcgarry@ieee.org>