Re: The new X-Kernel !

Jesse Pollard (jesse@cats-chateau.net)
Sun, 21 Oct 2001 19:10:32 -0500


On Sunday 21 October 2001 14:17, Tim Jansen wrote:
> On Sunday 21 October 2001 19:40, James Simmons wrote:
> > It sets the hardware state of the keyboards and the
> > mice. The user runs apps that alter the state. The second user comes
> > along and log in on desktop two. He runs another small application to
> > test the mice. It changes the state which in turn effects the person on
> > desktop one.
>
> Isn't this a driver problem? If two processes can interfere when using the
> same device the driver should only allow one access (one device file
> opened) at a time. And if two processes need to access it it should be
> managed by a daemon.

Neither - It is a resource allocation problem, which all UNIX style systems
seem to lack. And second, it doesn't happen at the present time with
mice/keyboard/display unless somebody (root) did not configure the system
properly (as in leave the device inodes accessable to world) OR change the
protection to permit access.

Once a resource is allocated to a user session (not process) it should not be
accessable to other users.

Linux doesn't have a resource allocation other than the limited single open
support for character device drivers. This is usually sufficient for
keyboard/mouse/display since it is the X server that is opening the device.

It is NOT sufficient for things like tape drives. The only way to prevent
conflict at the present time is to change the ownership of the inode, and
ensure that the protection mask only permits user access. It is ALSO
necessary to ensure that no other processes have that device open at the same
time.

How those devices are controled/configured/used after allocation is and
should remain a user mode function, NOT a kernel function.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/