From: rafetmad@cheshire.oxy.edu (David Giller) Subject: Logitech Bus mouse and kernel hacking: it works! but... Date: Mon, 25 May 1992 00:54:20 GMT
First off, thanks to those who brought us the Logitech Bus mouse driver.
However, we're all aware of the problems. Well, on a hunch, I went in and
did some bloody hacking on the select code. What I came up with was a one-line
hack that will allow the Logitech mouse to work correctly.
The problem is that the select() code checks for a character device by looking
in the tty tables. This leaves out all character devices that aren't ttys.
Well, to get the mouse working, go into fs/select.c, in the check_in()
function. Right after the variable declaration:
struct tty_struct * tty;
add the following line:
if (MAJOR(inode->i_rdev) == 10 && MINOR(inode->rdev) == 0) return 1;
This will allow non-blocking reads of the mouse to go through.
This points out a problem, however. In this case, a program that does non-
blocking I/O on themouse will always find input, no matter how much the mouse
has moved, if at all, and no matter how often it checks for input.
This is a temporary solution that seems to get the thing working without
bringing the system to its knees. However, the bus mouse driver needs to be
changed so that it won't return data if there is no change, and there should
be some kind of timer to limit the number of mouse events per second that
the driver is allowed to process.
-Dave
-- David Giller, Box 134 | Q: How many Oregonians does it take to screw in a light Occidental College | bulb? A: Three. One to replace the bulb, and two to 1600 Campus Road | fend off all the Californians trying to share the Los Angeles, CA 90041 | experience. ---------------------------rafetmad@oxy.edu