Comment 140 for bug 550625

Revision history for this message
Andrew Skalski (askalski) wrote :

I applied the Dell patch (I had to modify it somewhat to make it apply cleanly), and verified that it successfully enables vertical scrolling. It still doesn't support syndaemon, but it's a big improvement from what we had before. Attached is a 64-bit psmouse.ko that I built against 2.6.32-24-generic.

When I have some time, I'll see about putting together a description of how I used virtualbox to manipulate the PS/2 driver. Here's the short version:

# Enable logging in the kbd driver. Output will be written to ~/.VirtualBox/Machines/YourMachineName/Logs/Vbox.log
export VBOX_RELEASE_LOG=dev_kbd.e.l.l2.l3.f
VirtualBox [--args]

Snapshot your VM, just in case.

In the VM settings, disable "VT-x/AMD-V" (System -> Acceleration), then start up your VM.

The logs will look like:

00:00:10.810 kbd_write_mouse: kbd: write mouse 0xff
00:00:10.810 void kbd_queue(KBDState*, int, int): mouse command response: 0xfa
00:00:10.810 void kbd_queue(KBDState*, int, int): mouse command response: 0xaa
00:00:10.810 void kbd_queue(KBDState*, int, int): mouse command response: 0x00

This is the Windows driver conversing with VirtualBox's mouse emulation code (virtualbox-ose-3.1.6-dfsg/src/VBox/Devices/Input/DevPS2.cpp).

From that point, I replaced the kbd_write_mouse() function with my own version which, instead of emulating a mouse, would blindly reply to mouse commands by returning bytes from a hard-coded array. When it runs out of array data, reply to all further commands with 0xFA (OK).

At first, I started with an empty array of responses. Then I went through many iterations of:

1) Boot up the VM. Figure out what the Windows driver is trying to do next, after exhausting my array of reply data. Power off the VM.

2) Switch to Linux, send that new command to my touchpad via the serio_raw driver (see the script I posted to https://bugzilla.kernel.org/show_bug.cgi?id=14660). Read the touchpad's response, and add it to the end of my array.

3) Rebuild VirtualBox (debian/rules build), install the updated .so files (VBoxDD*.so) to /usr/lib/virtualbox.

4) Repeat.