joncampbell123 / dosbox-x

DOSBox-X fork of the DOSBox project
GNU General Public License v2.0
2.66k stars 378 forks source link

USB passthrough (storage, audio, webcam, scanner and other devices - like a second mouse) #3210

Open Torinde opened 2 years ago

Torinde commented 2 years ago

USB pass-through (storage, audio, webcam, scanner and other devices - like a second mouse) from host into DOSbox-X. Mostly useful for Win9x, but also can help with for dual mouse games. Here is shown an example set of USB drivers for DOS - USBUHCI, USBMOUSE, CuteMouse

Originally posted by @Torinde in https://github.com/joncampbell123/dosbox-x/issues/2412#issuecomment-1008162065

joncampbell123 commented 2 years ago

That would be cool, but to get there, DOSBox-X will first need USB host controller emulation (as a PCI device of course).

http://hackipedia.org/browse.cgi/Computer/Platform/PC%2c%20IBM%20compatible/Busses/USB%2c%20Universal%20Serial%20Bus/Host%20controller/UHCI%20Universal%20Host%20Controller%20Interface%20Design%20Guide%20%281996%2d03%29%20v1%2e1%2epdf

http://hackipedia.org/browse.cgi/Computer/Platform/PC%2c%20IBM%20compatible/Busses/USB%2c%20Universal%20Serial%20Bus/Host%20controller/OHCI%20Open%20Host%20Controller%20Interface%20Specification%20for%20USB%20%281999%2d09%2d14%29%20v1%2e0a%2epdf

Torinde commented 2 years ago

VirtualBox does that - user can connect/disconnect any USB device from the host and use it in the guest - and afterwards, when disconnected from guest the device re-connects to the host. I don't know if some code can be reused from there?

Also related - scanner/webcam emulation from picture/video file (not sure of the use case though).

Torinde commented 2 years ago

PCem doesn't have it yet as well. https://github.com/sarah-walker-pcem/pcem/issues/136

Torinde commented 1 year ago

Virtualbox - The EHCI and XHCI USB controller devices are now part of the open source base package

QEMU and Bochs also support USB emulation.

Torinde commented 9 months ago

@crazii, how will your https://github.com/crazii/USBDDOS fit with such a feature? Have you seen any potential implementations for "USB host controller emulation"?

crazii commented 9 months ago

I don't think so. It is merely a dos driver that won't support win9x guest and no host emulation at all.

Torinde commented 9 months ago

There are external USB-to-ISA adapters 1 2 - they even sell dosbox-x.conf and win9x.img files! I wonder how they get access to the USB-attached ISA slots in DOSbox-X - my assumptions are either:

The second option will be relevant for this Issue, although I think the first is more likely (because they mention a Win7/10 ISA SDK/software layer).

rderooy commented 9 months ago

Where does it say that those config files are meant for use with those ISA to USB adapters?

My understanding is that they are selling a pre-installed Win98SE/WinME OS image + dosbox-x config files.

Torinde commented 9 months ago

So, first it's stated that along with the USB2ISA you need to consider power, enclosure, cable, software.

For the software it's written than "installation software" is sufficient, but "if you have access to the ISA software source code" you can buy an extra SDK. Elsewhere they write that they "offer support for DOS under Widows operating systems".

Then, there are the same 4 options to choose: power enclosure, cable, software. Here the software is "OS images for dosbox-x" consisting of DOSbox-X.conf and Win9x.IMG. True that they don't even state DOSbox-X itself is included.

But still, the question remains - how do you access those ISA-over-USB ports in DOSbox?