[haiku-development] Re: [GSOC] xhci or USB3.0 support

  • From: Stephan Aßmus <superstippi@xxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Thu, 24 Mar 2011 22:09:08 +0100

Hi,

On 24.03.2011 18:38, Disreali wrote:
I'm interested in adding USB 3.0 support to haiku in this year's GSOC. I>  
think the main work is implementing xhci driver.

Great, we could definitely use that. IIRC, Haiku's xchi driver was taken from 
FreeBSD.

There is no XHCI driver in Haiku and the USB stack that exists (including the EHCI, OHCI and UHCI add-ons for that stack) were written from scratch. Probably consulting the FreeBSD code, but not porting it.

I'm a newbie in haiku kernel world, would you please give me some
documentations about these kernel API, a book similar to<linux device
drivers>  will be very helpful. I only found some topics from here
http://haiku-os.org/legacy-docs/bebook/index.html, but it is marked as
legacy, so are they out of date? especially
http://haiku-os.org/legacy-docs/bebook/DeviceDrivers.html

As Jérôme mentioned, your best bet is to look at the existing USB stack and it's add-ons. It should make use of all the primitives that you mentioned and you can see how it's done in Haiku kernel drivers. It may not be a guided introduction like from a book, but it's as accurate as it can be. The BeBook documentation is still accurate as well. I don't want to confuse you with this information, but there are two different driver interfaces in the Haiku kernel. The legacy driver interface which is compatible with BeOS, most drivers use that, including the USB stack. There is also a new driver interface, but it's not completely set in stone. The only bigger difference is that drivers in Haiku are allowed to use C++ internally (the interface itself is C). Don't know if that was already possible in BeOS, but many Haiku drivers use this to achieve cleaner code, including the USB stack. Some C++ stuff cannot be used (like exception if I am not mistaken) but you can see for yourself when you dig into the code:

http://dev.haiku-os.org/browser/haiku/trunk/src/add-ons/kernel/bus_managers/usb

http://dev.haiku-os.org/browser/haiku/trunk/src/add-ons/kernel/busses/usb

Have fun and welcome!

Best regards,
-Stephan

Other related posts: