Subject: Re: USB emul under Linux
To: Vincent <>
From: Greg Troxel <>
List: tech-kern
Date: 01/19/2005 13:29:29
  I tried that. It doesn't work. Reason : usb.h refers some system calls 
  that are idiotisms of NetBSD and do not exist in the Linux libc.

Right; that's why this is harder than it seems.  You have to use the
NetBSD-style system calls, which perhaps you can't even access under
emulation.  So you'd have to get netbsd header files and use those
instead, creating a frankensteinish 'libusb compiled on linux but with
netbsd system calls'.  This would only be useful on netbsd under linux
emulation.  But, I don't think it will be satisfying in the end, since
it won't help proprietary programs that don't dynlink against libusb.

A real solution would be to make the linux system calls work in the
kernel emulation layer.  Perhaps by creating a device "linuxusb",
calling into the regular USB code to do things, and handling the linux
ioctls, etc.  Then this would appear as /emul/linux/dev/usb0, assuming
that's how it looks, or in /proc, or whereever it is supposed to be.
The usual emulation rules - system calls behave as they would on linux
- it's just harder because you can't do it with a thin glue layer.