kFreeBSD and USB support
Hello.
On debian we, for a long time, used the following hack in a build script of qemu:
# Hack alert. qemu-1.3 still needs this.
# On recent kFreebsd, old USB host API has been removed,
# but qemu did not learn to use new USB API.
# Just do not build USB host support.
sed -i 's/^HOST_USB=bsd/HOST_USB=stub/' \
qemu-build/config-host.makThis isn't really FreeBSD but "kFreeBSD", which is a FreeBSD kernel (and ofcorse the kernel headers) and some more linux-like userspace - it is Debian userspace running on top of FreeBSD kernel.
This effectively disables host usb support for kFreeBSD. And since I guess the kernel headers are the same on regular FreeBSD, I think the same issue happens on regular FreeBSD too, that is, host usb does not work there as well.
What is the status of this situation now?
Thanks,
/mjt
Quoted 11 lines · Michael Tokarev
Hello.
On debian we, for a long time, used the following hack in a build script of qemu:
# Hack alert. qemu-1.3 still needs this.
# On recent kFreebsd, old USB host API has been removed,# but qemu did not learn to use new USB API. # Just do not build USB host support. sed -i 's/^HOST_USB=bsd/HOST_USB=stub/' \ qemu-build/config-host.mak
In fact, the FreeBSD ports tree Makefile for QEMU does basically the same thing -- search for 'HOST_USB' in
http://svnweb.freebsd.org/ports/head/emulators/qemu-devel/Makefile?revision=319450&view=co
Quoted 5 lines
This isn't really FreeBSD but "kFreeBSD", which is a FreeBSD kernel (and ofcorse the kernel headers) and some more linux-like userspace - it is Debian userspace running on top of FreeBSD kernel.
Quoted 7 lines
This effectively disables host usb support for kFreeBSD. And since I guess the kernel headers are the same on regular FreeBSD, I think the same issue happens on regular FreeBSD too, that is, host usb does not work there as well.
What is the status of this situation now?
On FreeBSD-current libusb has grown the functionality required by QEMU's recent libusb USB host code, and I'm using that. I assume that the current BSD host USB code works on NetBSD and OpenBSD, but don't really know; possibly they can switch to libusb as well.
Am 05.06.2013 22:17, schrieb Michael Tokarev:
Quoted 17 lines
Hello.
On debian we, for a long time, used the following hack in a build script of qemu:
# Hack alert. qemu-1.3 still needs this.
# On recent kFreebsd, old USB host API has been removed,# but qemu did not learn to use new USB API. # Just do not build USB host support. sed -i 's/^HOST_USB=bsd/HOST_USB=stub/' \ qemu-build/config-host.makThis isn't really FreeBSD but "kFreeBSD", which is a FreeBSD kernel (and ofcorse the kernel headers) and some more linux-like userspace - it is Debian userspace running on top of FreeBSD kernel.
Quoted 7 lines
This effectively disables host usb support for kFreeBSD. And since I guess the kernel headers are the same on regular FreeBSD, I think the same issue happens on regular FreeBSD too, that is, host usb does not work there as well.
What is the status of this situation now?
I believe as of FreeBSD 9 their USB stack was rewritten and thus USB host support disabled in FreeBSD ports, too.
Andreas
Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
Quoted 28 lines · Ed Maste
Quoted 11 lines · Michael Tokarev
Hello.
On debian we, for a long time, used the following hack in a build script of qemu:
# Hack alert. qemu-1.3 still needs this.
# On recent kFreebsd, old USB host API has been removed,# but qemu did not learn to use new USB API. # Just do not build USB host support. sed -i 's/^HOST_USB=bsd/HOST_USB=stub/' \ qemu-build/config-host.makIn fact, the FreeBSD ports tree
Makefilefor QEMU does basically the same thing -- search for 'HOST_USB' in
http://svnweb.freebsd.org/ports/head/emulators/qemu-devel/Makefile?revision=319450&view=coQuoted 11 lines
This isn't really FreeBSD but "kFreeBSD", which is a FreeBSD kernel (and ofcorse the kernel headers) and some more linux-like userspace - it is Debian userspace running on top of FreeBSD kernel.
This effectively disables host usb support for kFreeBSD. And since I guess the kernel headers are the same on regular FreeBSD, I think the same issue happens on regular FreeBSD too, that is, host usb does not work there as well.
Quoted 6 lines
Quoted 1 line
What is the status of this situation now?
On FreeBSD-current libusb has grown the functionality required by QEMU's recent libusb USB host code, and I'm using that. I assume that the current BSD host USB code works on NetBSD and OpenBSD, but don't really know; possibly they can switch to libusb as well.
AFAIK the BSD USB backend is supposed to work on OpenBSD, though I have
never used that support myself never having used USB within an image
under QEMU. But when libusb 1.0.16 is released and into our ports tree
I'll look into enabling the libusb support. The libusb USB backend for OpenBSD is relatively well maintained and I'd trust that working properly over the code within QEMU.
Signature · 3 lines
This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.
Hi,
Quoted 7 lines
This effectively disables host usb support for kFreeBSD. And since I guess the kernel headers are the same on regular FreeBSD, I think the same issue happens on regular FreeBSD too, that is, host usb does not work there as well.
What is the status of this situation now?
I have no idea how well the host-bsd code actually works. I've used an OpenBSD (virtual machine) for build tests. Last time I tried it did not build on FreeBSD. No idea where NetBSD (or any other variant) stands.
My long-term plan for usb-host support is to build on libusbx exclusively (merged in the 1.5 devel cycle), thereby offloading all portability issues to libusbx. Right now we are in a transition period, the old code is still around so you can flip back and forward between libusbx implementation and the os-specific bits for linux/bsd, mainly because a pretty recent linusbx version is required and also to ease regression testing. At some point in the future I want get rid of the old code though.
FreeBSD reportly has its own libusb implementation, with a library interface compatible to libusbx. That should work with kFreeBSD too. I don't know what the other BSD variants are doing, but due to libusbx being used by alot of userspace usb apps/drivers I'd expect it is present in some form usable for qemu's host-libusb code ...
cheers,
Gerd
Hi,
Quoted 23 lines · Gerd Hoffmann
Hi,Quoted 7 lines
This effectively disables host usb support for kFreeBSD. And since I guess the kernel headers are the same on regular FreeBSD, I think the same issue happens on regular FreeBSD too, that is, host usb does not work there as well.
What is the status of this situation now?
I have no idea how well the host-bsd code actually works. I've used an OpenBSD (virtual machine) for build tests. Last time I tried it did not build on FreeBSD. No idea where NetBSD (or any other variant) stands.
My long-term plan for usb-host support is to build on libusbx exclusively (merged in the 1.5 devel cycle), thereby offloading all portability issues to libusbx. Right now we are in a transition period, the old code is still around so you can flip back and forward between libusbx implementation and the os-specific bits for linux/bsd, mainly because a pretty recent linusbx version is required and also to ease regression testing. At some point in the future I want get rid of the old code though.
Quoted 5 lines
FreeBSD reportly has its own libusb implementation, with a library interface compatible to libusbx. That should work with kFreeBSD too. I don't know what the other BSD variants are doing, but due to libusbx being used by alot of userspace usb apps/drivers I'd expect it is present in some form usable for qemu's host-libusb code ...
Yes, on FreeBSD it is best to use FreeBSD's libusb replacement implementation which is API compatible, this likely is also best used on Debian-kfreebsd (as a replacement for the regular libusb).
Regular libusb currently has linux, macosx, openbsd, netbsd and win32 backends. With linux being the most feature complete, your mileage may vary on other platforms, but all the basics are there, so if necessary people could spend some time on fixing libusb's backend code for a platform they care about.
Regards,
Hans