How to start up a DDK example driver?

Guys…I can’t believe I finally managed to get the usb DDK for the license that the university had. Thank you Masochen again for your contact!

The only trouble now is that I have only 6 more days left until my intern-ship finishes and I most probably won’t have enough time to build this freakin’ driver :frowning:

Realising this, all I want to do is load a dummy driver when the device is plugged in!

I have looked through the DDK and the documentation and just tried to find how to start the mouse example driver. It’s all built and everything and I can for instance call devu-mouse and it starts the process…but how do I check that it’s working? I just want to put some printf’s so I can see them printed on the screen.

I have a usb mouse that is currently handled by the devi-hid manager which I understand is started by the inputtrap during the boot. How can I override this so that the mouse is handled by the example driver? Do I need to mess around with the boot scripts (configuration files)? I have looked into /etc/system/sysinit , /etc/rc.d/rc.devices , /etc/rc.d/rc.sysinit but it is necessary to modify these whenever you want to load your own driver?

Thank you!

Sundance,

Congrats on finally getting the DDK. Maybe whomever takes over the internship can complete the work you started.

It’s a major pain in the you know what to bypass the io-hid manager which by default is going to get control of the USB keyboard/mouse.

Instead, just take the mouse.c code and change it slightly (personally I used printer.c since it has examples of sending to/from a USB device where the mouse.c is only from the device).

Look for this line in the example (the commented out line)
// usbd_device_ident_t interest = { 0x09db, USBD_CONNECT_WILDCARD, 0x03, 0, 0 };

and replace it with this
usbd_device_ident_t interest = { 0x09db, 0x0082, 0x03, 0, 0 };

Where the 0x0082,0x03 are the vendor/device id’s you obtain from running the usb command.

Then compile and run your driver. Then when you plug in your camera you should get your driver called (add some printfs to the insertion/removal callbacks). That’s how I started when I was writing a non-HID driver for the first time (I assume your camera is not a HID device. If it is a HID device you can’t write a driver at all because io-hid will snag the camera before your driver ever does).

Tim