Linux version of libusb that works with FreeBSD

Alexander Leidinger Alexander at Leidinger.net
Mon Dec 17 01:06:24 PST 2007


Quoting Daniel O'Connor <doconnor at gsoft.com.au> (from Mon, 17 Dec 2007  
16:26:58 +1030):

> I am wondering if anyone has tried building such a beast?
> ie a Lunux libusb that will be able to access devices in FreeBSD..
>
> The reason I'd like it is that I want to use this
> http://rmdir.de/~michael/xilinx/ in FreeBSD so I can talk to a USB JTAG
> cable.
>
> The thing I am not sure about is how ioctl's would get mangled on the
> way through.

They get interpreted as linux ioctl, as they are handled by the  
linuxulator. You could try to write a wrapper there...

> I guess the other approach would be to use a standard Linux libusb but
> emulate the device tree it uses in Linux.. Would be a lot of work
> though I think.

As long as you can specify the devices in the linux app, it's enough  
to translate the ioctl's. Apart from that, there's some kind of  
translation layer for devices already, but I don't know if it just a  
Linux major/minor -> FreeBSD dev mapping, or if you can map linux dev  
-> FreeBSD dev.

AFAIR HPS' USB stack has linux compatibility, maybe you should ask him  
/ have a look at it.

Bye,
Alexander.

-- 
Power is poison.

http://www.Leidinger.net    Alexander @ Leidinger.net: PGP ID = B0063FE7
http://www.FreeBSD.org       netchild @ FreeBSD.org  : PGP ID = 72077137


More information about the freebsd-hackers mailing list