bochs-emu / Bochs

Bochs - Cross Platform x86 Emulator Project
https://bochs.sourceforge.io/
GNU Lesser General Public License v2.1
895 stars 107 forks source link

Add Bochs user mode emulator like SDE or QEMU #388

Open stlintel opened 5 hours ago

stlintel commented 5 hours ago

For QEMU it is: QEMU User space emulator, mentioned in QEMU docs: https://www.qemu.org/docs/master/user/main.html

I believe code from QEMU could be heavily reused as well

stlintel commented 5 hours ago

In ideal world instead of copying console linux binary into Bochs and running I would

bochs [-h] [-d] [-L path] [-s size] [-cpu model] [-g port] [-B offset] program [arguments...]

Vort commented 5 hours ago

Bochs is a portable IA-32 (x86) PC emulator

From your link:

In this mode, QEMU can launch processes compiled for one CPU on another CPU.

Launching processes and emulating computers are different things in my opinion.

stlintel commented 4 hours ago

Intel SDE is also emulator of CPU as well as QEMU. For Intel SDE it is mainly to emulate future ISA, for QEMU it is to emulate one ISA on another.

But for this feature main advantage is abstraction from disk images and guest operating system. In my CPU validation code I compare Bochs implementation to SDE implementation on automatically generated unit tests, one per instruction. I generate one instruction like VDPBF16PS with millions of random inputs and compare results against same thing running on SDE. Running it locally without uploading to disk image and downloading results would be huge advantage.

How I see it ? Smth similar to Load32OSHack feature we had many years ago and deprecated.

Vort commented 2 hours ago

Running it locally without uploading to disk image and downloading results would be huge advantage.

With SSH access to guest there should not be many problems in automating this task. It looks like it can be done with relatively simple script. Am I missing something?