[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: lethal mice
My 2 1/2 bits:
Speaking hardware, some mice will not like being pulled out and plugged
back in. Has to do with the way the mouse micro-controller is reset, and
sometimes switched between M$ and Mouse systems mode or such. In any case,
pulling and inserting the mouse 'hot' generates one or more illegal
characters in the serial data stream. Devices designed to be hot-swappable
have a special switch in the plug, that guarantees that the data line is
separated before the other pins go, and sets the serial controller into a
state that is 'safe' for unplugging. The software in both devices must
cooperate.
Speaking software, the drivers are sometimes incapable to handle the fact
that the mouse data packet is not whole. When you pull and plug the mouse,
garbage characters enter the stream. A serial mouse packet is built out of
three serial characters if I remember well. If only 2 get through and the
driver does not reset its state it will be in the middle of the decoding
state forever, as every time you move the mouse, you give it 3 more bytes,
and it returns to the same bad state. The remedy is to reset the mouse (by
driving its power supply - usually RTS and DTR - off and then back on),
and the software decoder state machine, after a timeout (the three bytes
in the mouse packet come fast, one after the other. If they don't - reset
the port and the driver). This is a hack that could be applied to the
mouse driver code. I will take a look at it. It is very likely that gpm is
more robust than X vs. mouse garbage.
As to using gpm and X together on the same machine, I have tried, have
learned, and given up. As long as different ppl. implement the X driver
and gpm, the 2 will be different enough never to work together. Or am I
wrong ?
On Tue, 13 Jan 1998, Gaal Yahas wrote:
> Hey.
>
> My setup:
> I'm running XFree86 3.2 (-9) on a boosted-and-upgraded redhat-4.2
> system. My mouse is a psaux on-board thingie with driver compiled
> statically (not as a module). Hardware is a dusty Compaq 575e.
> X is run from script, not from xdm, and window manager is tvtwm,
> which is a virtual-desktop version of twm. It has no version of
> its own (that I could find) but thinks it comes with MIT X11R5.
>
> The problem:
>
> Unplug mouse.
> Replug it.
> Move it some: no response from mouse, keyboard is okay
> switch to a VC and back: everything back to normal
>
> BUT:
> Unplug mouse.
> Replug it.
> Move it some: no response
> Switch to a VC for a longer time, use the mouse (gpm) there
> Switch back to X: yikes, it dies, with the message:
> Fatal server error:
> Cannot open mouse (Device or resource busy)
>
> This is quite disturbing, especially when you've got anywhere
> between two and six computers on your desk and cables start
> losing. AND those 15 windows you just had in your X are snarfed.
>
> Now, the confusing bit here is who's fault is this? The X server?
> the window manager? gpm? kernel?
>
> Ideas, anyone?
>
> Gaal
>
> PS: I must admit the effects of pulling out the mouse on other
> platforms can get much worse, such as AIX cute system freeze,
> but this is still not nice!
>
>
>
>