Bochs' USB emulation

This forums is for OS project announcements including project openings, new releases, update notices, test requests, and job openings (both paying and volunteer).
sounds
Member
Member
Posts: 112
Joined: Sat Feb 04, 2012 5:03 pm

Re: Bochs' USB emulation

Post by sounds »

Great, can't wait to try it out. On my setup it would be running under wine. But I've read an interesting article somewhere that said the Win32 API is the most stable linux API. That's a tangent I'll leave for another time.

Thank you, Ben.
stlw
Member
Member
Posts: 357
Joined: Fri Apr 04, 2008 6:43 am
Contact:

Re: Bochs' USB emulation

Post by stlw »

Hi Ben,

What do you think of integrating your changes into Bochs main ?

Thanks
Stanislav
User avatar
BenLunt
Member
Member
Posts: 940
Joined: Sat Nov 22, 2014 6:33 pm
Location: USA
Contact:

Re: Bochs' USB emulation

Post by BenLunt »

stlw wrote:Hi Ben,

What do you think of integrating your changes into Bochs main ?

Thanks
Stanislav
Hi Stanislav,

Absolutely. May I contact you at the [email protected] account to discuss and arrange this? If not, please email me with an email account you wish to use, or use the messaging service here.

fys [at] fysnet [dot] net

Thanks,
Ben
stlw
Member
Member
Posts: 357
Joined: Fri Apr 04, 2008 6:43 am
Contact:

Re: Bochs' USB emulation

Post by stlw »

Yes, of course you could
User avatar
BenLunt
Member
Member
Posts: 940
Joined: Sat Nov 22, 2014 6:33 pm
Location: USA
Contact:

Re: Bochs' USB emulation

Post by BenLunt »

Hi all,

I have been working on the Bochs USB emulation lately and have made quite a bit of progress.

First, the USB Debugger is in its initial, experimental, first stages and a Pull Request for this initial start has been submitted. Currently, it will allow you to pause the emulation and view the xHCI controller and command/event rings. Preliminary documentation can be found here. Note that it is still in its experimental stages and I will continue to add to it.

I also have been testing the device emulation for USB Compliance and found a few bugs and missed items. For example, while testing the external Hub compliance, I found that the OHCI's toggle bit emulation was not correct. A fix has since been committed to the source tree. If you have been working on your OHCI, please make sure and use the latest source.

I have tested and therefore added to the device emulation to make all devices (mostly) pass the USB compliance tests. Please see https://www.fysnet.net/bochs/images/supported.htm. (Note that this URL may change. I will try to update this post if it does) The Hub emulation now passes the per-port compliance tests, though it does not pass the Global tests due to the fact that this requires the Host Controllers to have Suspend/Resume triggering, which is not fully implemented yet.

Other than the Disk/CD-ROM super-speed emulation, all devices pass the USB compliance test suites, though note that the test is an old version and ran on a WinXP guest. The new version of the compliance test is ran on a Win10 guest, and I have yet to get the test to load a device correctly. Hence the super-speed test shows that it is still to be done. If and when I get the new test to perform on a Win10 Guest, I will then update that page to these new results. The issue here is that WinXP takes a few seconds to boot, while Win10 takes considerably longer. Hence, the ease of testing on WinXP compared to the Win10 Guest. :-)

This new device emulation which passes these tests has not had a Pull Request created yet, since I am still doing last minute tests. I hope to have a PR posted soon.

Oh, and if any of you can personally verify that a Guest not listed on the 'supported' page I noted above, supports a listed device, please let me know. I am more interested in just the opposite, a device that is not supported on a Guest when it actually should be, but either way, please let me know via a reply here, a Message via this forum, or an email (address found at URL listed below). Please note that if you send me a verification, I will include your contact information (somewhat obscured from bots) so that when something changes, you can be contacted again to re-verify. So please be accurate even if it is a junk gmail account, though a valid contact is desired. Also, I will only list somewhat known Guests, like *nix variants, etc. I know the desire to post your own, believe me, but I am looking for known, commonly used (somewhat commercially used) Guests here. Thank you.

Thanks again for everyone here, for all the comments and support. It is an enjoyable hobby.

Ben
- https://www.fysnet.net/the_universal_serial_bus.htm
User avatar
BenLunt
Member
Member
Posts: 940
Joined: Sat Nov 22, 2014 6:33 pm
Location: USA
Contact:

Re: Bochs' USB emulation

Post by BenLunt »

My USB Compliance tests on all Bochs supported devices are almost complete. I have also tested on numerous Windows(tm)(r) Guests, shown at https://www.fysnet.net/bochs/images/supported.htm. If any of you find anything contrary to my tests shown on that page, please let me know.

As soon as my tests are complete, I will have a PR posted to the Bochs github.

Also, I am looking for image files of other Guests. I would prefer a ready made, turnkey image file of that Guest, but am willing to install a "lite" version of a *nix guest. However, please note, (and I humbly admit) that I don't know much about *nix platforms and have little time using them. I am aware that some distros try to be more like the Windows GUI to help with the conversion. If you can suggest a particular one, I would appreciate it.

Thank you,
Ben
stlw
Member
Member
Posts: 357
Joined: Fri Apr 04, 2008 6:43 am
Contact:

Re: Bochs' USB emulation

Post by stlw »

sounds wrote:Great, can't wait to try it out. On my setup it would be running under wine. But I've read an interesting article somewhere that said the Win32 API is the most stable linux API. That's a tangent I'll leave for another time.

Thank you, Ben.
Hi,

The pull request with USB Debugger is pending for quite long time without any comments.
We need some evidence of use before integrating it into main trunk is Bochs github.
Can anybody reply (here or in the PR) if it is good ? usable ? has issues ? should be merged into Bochs master ?

Thanks,
Stanislav
thewrongchristian
Member
Member
Posts: 417
Joined: Tue Apr 03, 2018 2:44 am

Re: Bochs' USB emulation

Post by thewrongchristian »

BenLunt wrote: Also, I am looking for image files of other Guests. I would prefer a ready made, turnkey image file of that Guest, but am willing to install a "lite" version of a *nix guest. However, please note, (and I humbly admit) that I don't know much about *nix platforms and have little time using them. I am aware that some distros try to be more like the Windows GUI to help with the conversion. If you can suggest a particular one, I would appreciate it.
You could probably do worse than using a *BSD installer image, which if I remember correctly, provides a shell you can use to exercise any attached USB devices (as well as provide a working console that would exercise attached USB keyboard.)

FreeBSD has a "mini" memory stick installation image, about 415MB uncompressed:
https://download.freebsd.org/releases/I ... mstick.img

Or a ready made VM image (but will require logging in, and are bigger):
https://download.freebsd.org/releases/V ... 386.raw.xz

NetBSD also has smaller installation images:
https://cdn.netbsd.org/pub/NetBSD/NetBS ... 3-i386.iso

In either install case, using a USB keyboard and installing to a USB vdisk should exercise your USB stack, with little knowledge required about what you're actually doing in the guest.
User avatar
BenLunt
Member
Member
Posts: 940
Joined: Sat Nov 22, 2014 6:33 pm
Location: USA
Contact:

Re: Bochs' USB emulation

Post by BenLunt »

stlw wrote:The pull request with USB Debugger is pending for quite long time without any comments.
We need some evidence of use before integrating it into main trunk is Bochs github.
Can anybody reply (here or in the PR) if it is good ? usable ? has issues ? should be merged into Bochs master ?
For those interested, the updated user.dbk documentation, in the form of html, can be viewed at https://www.fysnet.net/bochs/documentation.php. Section 5.8 explains how to use the USB Debugger.

Thanks,
Ben
User avatar
BenLunt
Member
Member
Posts: 940
Joined: Sat Nov 22, 2014 6:33 pm
Location: USA
Contact:

Re: Bochs' USB emulation

Post by BenLunt »

thewrongchristian wrote:You could probably do worse than using a *BSD installer image, which if I remember correctly, provides a shell you can use to exercise any attached USB devices (as well as provide a working console that would exercise attached USB keyboard.)

FreeBSD has a "mini" memory stick installation image, about 415MB uncompressed:
https://download.freebsd.org/releases/I ... mstick.img

Or a ready made VM image (but will require logging in, and are bigger):
https://download.freebsd.org/releases/V ... 386.raw.xz

NetBSD also has smaller installation images:
https://cdn.netbsd.org/pub/NetBSD/NetBS ... 3-i386.iso

In either install case, using a USB keyboard and installing to a USB vdisk should exercise your USB stack, with little knowledge required about what you're actually doing in the guest.
Thank you. I will have a look.
sounds
Member
Member
Posts: 112
Joined: Sat Feb 04, 2012 5:03 pm

Re: Bochs' USB emulation

Post by sounds »

stlw wrote:Hi,

The pull request with USB Debugger is pending for quite long time without any comments.
We need some evidence of use before integrating it into main trunk is Bochs github.
Can anybody reply (here or in the PR) if it is good ? usable ? has issues ? should be merged into Bochs master ?

Thanks,
Stanislav
I'm still interested in testing it. For Reasons, I haven't gotten to it yet. Apologies! I'm still not in a position to test it soon.
stlw
Member
Member
Posts: 357
Joined: Fri Apr 04, 2008 6:43 am
Contact:

Re: Bochs' USB emulation

Post by stlw »

USB Debugger integrated into Bochs github tree after 2.8 release.
Please test and comment !

Stanislav
Post Reply