I've been trying to add STI (still image) support to Wine, and I've made some progress. However, I see a deep and unsurmountable need to add (at least user-space) device drivers to Wine, and I would like some feedback on these ideas.
Drivers belong in the kernel.
Not necessarily. In fact, only the part that directly touches the hardware really belongs there. There's nothing wrong with doing rest of the processing (i.e. the non time-critical parts) in the userspace. In fact, that likely makes the kernel a safer place.
If there's no Linux driver for a device, then Wine cannot support it.
That would be stupid.
In that case, the first step is to write a Linux device driver for it, which has the added advantage that other native linux applications can use the hardware.
Huh? What about sane? It can e.g. use libusb quite nicely and *portably* to say access usb scanners. I.e. it flies on both windows *and* linux.
You can't load a Windows driver that accesses hardware in Wine, as Wine is a user-space application with no I/O privileges.
You could, with help of a special kernel driver to forward the requests between hardware and userspace. libusb and usbfs do that already for usb, i.e. at the current point in time wine can be able to natively support any usb device minidriver that doesn't use a class driver. Class drivers can be easily developed by snatching code from linux kernel, as long as licenses are fine of course. All that without touching the kernel in any way. And I mean here full support for *any* usb device, rain or shine. Network adapters (visible in wine only, but so what?), scanners, cheap webcams whose manufacturers don't care enough to release the specs, and the list goes on.
Cheers, Kuba