9pi
Posts: 35
Joined: Sat Aug 11, 2012 6:14 pm

usb mouse error fixed

Fri Dec 14, 2012 10:09 am

I've put up a new 9pi kernel which corrects an error in the parsing of usb mouse reports in Plan 9.

This version should work better with Logitech mice (and perhaps some others), and doesn't require the 'kbargs=-b' parameter in cmdline.txt .

If anyone still has mouse problems after switching to this kernel, please let me know.

brute_forks
Posts: 2
Joined: Fri Dec 14, 2012 1:35 pm

Re: usb mouse error fixed

Fri Dec 14, 2012 1:40 pm

Hi, thanks very much, I've been using Plan9 but have had mouse issues with my logitech mouse. How can I update the kernel?

brute_forks
Posts: 2
Joined: Fri Dec 14, 2012 1:35 pm

Re: usb mouse error fixed

Fri Dec 14, 2012 6:15 pm

I managed to find the update, and just replaced the 9pi file on my SD card with new one. Anyway, its working perfectly now and is a rather interesting OS! Thanks

faisyl
Posts: 7
Joined: Sun Jun 03, 2012 4:05 am

Re: usb mouse error fixed

Sat Dec 15, 2012 10:25 am

Where can I find the new kernel ?

User avatar
Florent
Posts: 10
Joined: Wed Nov 21, 2012 12:53 pm
Location: Belgium

Re: usb mouse error fixed

Sat Dec 15, 2012 10:59 am

faisyl wrote:Where can I find the new kernel ?
The new kernel is here : http://plan9.bell-labs.com/sources/contrib/miller/9pi
And the last source code for the kernel is here : http://plan9.bell-labs.com/sources/cont ... ler/9/rpi/

it's also possible to do a simple kernel update script that do the following steps :
* mount the sources file server in the /n directory (9fs sources)
* backup the kernel source code in the sd card.
* get the last kernel source code in the /n/sources/contrib/miller/9/rpi directory.
* compile the kernel (1 minute long).
* unmount sources

faisyl
Posts: 7
Joined: Sun Jun 03, 2012 4:05 am

Re: usb mouse error fixed

Sat Dec 15, 2012 4:51 pm

Great! Thanks.

Just another question. I was trying to fix an issue with the mouse I have and I see an error that causes kb to exit with "weird mouse maxpkt". I see a potential fix in the 9front usb/kb code that might work for me. I tried to fix the source in /sys/src/cmd/usb/kb but the kernel seems to refer to some other code, since a recompile and a new message I added doesn't show up when I reboot with the new kernel. Anything I'm missing ?

thanks in advance!
~faisyl

9pi
Posts: 35
Joined: Sat Aug 11, 2012 6:14 pm

Re: usb mouse error fixed

Sat Dec 15, 2012 8:37 pm

faisyl wrote: I tried to fix the source in /sys/src/cmd/usb/kb but the kernel seems to refer to some other code, since a recompile and a new message I added doesn't show up when I reboot with the new kernel. Anything I'm missing ?
Some of the usb drivers (kb, ether and disk for example) are embedded in the usb daemon usb/usbd, which is itself embedded in the kernel, so that these devices can be available at boot time. So if you want to change the kernel version of the usb/kb driver, it takes three steps:

Code: Select all

cd /sys/src/cmd/usb/kb && mk install
cd /sys/src/cmd/usb/usbd && mk install
cd /sys/src/9/bcm && mk

faisyl
Posts: 7
Joined: Sun Jun 03, 2012 4:05 am

Re: usb mouse error fixed

Mon Dec 17, 2012 7:11 am

Thanks. That works now. I hadn't recompiled usbd so I wasn't seeing my changes. kb doesn't exit now - and I can use my keyboard. Now to fiddle with the mouse driver code.
I'm trying to get the logitech mouse/keyboard pair (links using an RF dongle) to work and had to keep pulling my wife's keyboard to recompile the kernel.

~faisyl

9pi
Posts: 35
Joined: Sat Aug 11, 2012 6:14 pm

Re: usb mouse error fixed

Mon Dec 17, 2012 10:19 am

faisyl wrote:kb doesn't exit now - and I can use my keyboard.
Please could you let us know what you changed. Then I can update the driver in case others have similar keyboards.

faisyl
Posts: 7
Joined: Sun Jun 03, 2012 4:05 am

Re: usb mouse error fixed

Tue Dec 18, 2012 7:28 am

The change simply involves using a local maxpkt size of MaxChLen if f->ep->maxpkt exceeds MaxChLen. This is obviously broken and only prevents kb from exiting for now. I'm looking at how to fix this, potentially reading into a local buf and extracting values from there instead - like the 9front code does. I shall post a patch here if that works.

faisyl
Posts: 7
Joined: Sun Jun 03, 2012 4:05 am

Re: usb mouse error fixed

Tue Dec 18, 2012 8:33 am

Got a better fix. This works nicely. I reverted all changes to stock from contrib and simply changed MaxChLen from 16 to 64 (in hid.h). Do you think something else might break because of that ? I now have a nicely working logitech mouse/kb combo and now one free usb slot :)

9pi
Posts: 35
Joined: Sat Aug 11, 2012 6:14 pm

Re: usb mouse error fixed

Tue Dec 18, 2012 4:29 pm

faisyl wrote:I reverted all changes to stock from contrib and simply changed MaxChLen from 16 to 64 (in hid.h). Do you think something else might break because of that ?
No, that won't break anything. The buffer should probably be allocated dynamically with the exact size of maxpkt, but your solution is simpler. I'll change it in the distributed system. Thank you!

Return to “Plan 9”

Who is online

Users browsing this forum: No registered users and 1 guest