May 15, 2007

USB enters beta, OHCI driver comitted

Hello there ;)

Last few weeks were horrible. Tons of important things to do in my private life, at my work and here, with AROS (The AROS Research Operating System :)). That was the reason for no posts for a really long time. When I had time for AROS, I was fighting with strange behavior of my UHCI driver with hardware I own. It seemed to me that some devices are refusing to talk with the driver at all, namely the mass storage ones. I do know that I have not written the driver yet, but the base USBDevice class should be able to initialize them at least.

The reason was very simple. The beloved BIOS support and the presence of USB2.0 controller (namely the EHCI) in my system. The EHCI may route some USB ports to legacy UHCI/OHCI hardware, but it doesn't have to. A small EHCI driver I wrote fixes this problem - it resets the EHCI controller and routes all USB ports to the USB1.1 legacy. Now (and after proper BIOS-handoff procedure required to switch the USB legacy support from BIOS off) I may fully use the UHCI driver and hot-plugging is working as expected.

Tonight I have committed the first version of the OHCI driver - it was pre-alpha unstable and non-working release at 9 PM, but I have successfully fixed it by midnight ;). The release which will come to the nightly build is still very noisy, but works. It was really a pleasure to see that my USB devices work on my wife's PC, with OHCI hardware :).

Let me tell you what works and what doesn't. The current USB stack should work properly on all machines containing USB1.1 UHCI and OHCI controllers. Even if you have USB2.0 onboard, you will be able to use USB1.1 mode only. Sorry for that. The USB2.0 EHCI driver will come, but I cannot tell when exactly. The drivers are able to do control and interrupt transfers. Bulk transfers will be easily added soon, but isochronous ones will have to wait a while - until I write a driver for USB device requiring them. Hot-plugging is working of course - without that USB makes no sense for me ;). There is one USB class for devices now - the HID class. It handles successfully USB mice, keyboards (without special keys which are not handled by AROS anyway) and some (perhaps all) tablets already. The command line/GUI tools are still missing. I plan to add some PCITool-like application.

USB stack enters beta stage now. I will hunt for bugs and improve the code. It still needs some semaphore locking here and there.

Anyway, have fun :)



Anonymous Chris Hodges said...

Good Work!

BTW: You should be aware of a bug in UHCI VIA chipset implementations which will cause the controller to go dead when it encounters a babble condition (reception of more bytes than expected) and that there's no good workaround for it. I have a few devices here with broken firmware that return more bytes than requested on control transfers, reproducably killing the controller. A workaround would be to always ask for multiple of MaxPktSize and copy the last packet to the target memory manually.

Also good luck on Isochronous transfers. Please spend some time in crafting the API so that realtime applications will work smoothly (which is not that easy). Poseidon is still lacking this one (it has support for ISO transfers, but the current API is not suited for RT apps).

9:05 AM  
Anonymous business security systems said...

Congratulations, you just earned yourself an entry in my feed reader, great blog. Please come visit my site safe home security give me any valuable feedbacks.

12:57 PM  
Anonymous occupational health and safety program said...

There is obviously a lot more than this. Would you mind telling me how long it took you to gather your content? Please come visit my site safety regulations when you got time.

12:57 PM  

Post a Comment

<< Home