Page 1 of 1

Can VirtualBox API be used for hardware emulation?

Posted: 21. Feb 2021, 22:12
by miths3
I was curious if parts of VirtualBox API can be used for hardware emulation rather than virtualisation?

Re: Can VirtualBox API be used for hardware emulation?

Posted: 22. Feb 2021, 11:29
by mpack
No, the API essentially just gives you an alternative user interface, though in this case the user is a program. AFAIK there's not much if anything it can do that you can't do with VBoxManage.

I'm not sure I see the distinction between hardware emulation and hardware virtualization. For everything except the CPU it comes to the same thing? Virtualization is what you are trying to achieve. Hardware emulation is how you do it.

If the question is: can I write my own hardware emulations and use them in VirtualBox then the answer is sure, if you have the same expertise as one of the devs. You have to look up the data sheets for all of the chips being emulated, and write code to exactly reproduce their behaviour at I/O and IRQ level. Then you link that module into the VirtualBox sources and add more code to make it selectable from the API. I'm assuming that every guest OS will already have drivers for this hardware so you won't need to write that too. Then submit this monster patch to Oracle.