Page 1 of 1

usb mouse error fixed

Posted: Fri Dec 14, 2012 10:09 am
by 9pi
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.

Re: usb mouse error fixed

Posted: Fri Dec 14, 2012 1:40 pm
by brute_forks
Hi, thanks very much, I've been using Plan9 but have had mouse issues with my logitech mouse. How can I update the kernel?

Re: usb mouse error fixed

Posted: Fri Dec 14, 2012 6:15 pm
by brute_forks
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

Re: usb mouse error fixed

Posted: Sat Dec 15, 2012 10:25 am
by faisyl
Where can I find the new kernel ?

Re: usb mouse error fixed

Posted: Sat Dec 15, 2012 10:59 am
by Florent
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

Re: usb mouse error fixed

Posted: Sat Dec 15, 2012 4:51 pm
by faisyl
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

Re: usb mouse error fixed

Posted: Sat Dec 15, 2012 8:37 pm
by 9pi
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

Re: usb mouse error fixed

Posted: Mon Dec 17, 2012 7:11 am
by faisyl
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

Re: usb mouse error fixed

Posted: Mon Dec 17, 2012 10:19 am
by 9pi
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.

Re: usb mouse error fixed

Posted: Tue Dec 18, 2012 7:28 am
by faisyl
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.

Re: usb mouse error fixed

Posted: Tue Dec 18, 2012 8:33 am
by faisyl
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 :)

Re: usb mouse error fixed

Posted: Tue Dec 18, 2012 4:29 pm
by 9pi
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!