For bochs, you don't have to write config files. You can use it's interactive menu system. For a config example, just google bochsrc, but config commands are usually easy to remember and straightforward. A big plus that you can provide a memory map for it's built-in debugger, which is superiror to gdb when it comes to debugging low-level software (things like "page", "info gdt", "info idt" etc.). Out of the three, this is the best for debugging, no doubt.
About qemu, I agree, the defaults are sane, and with the machine profile support (the -M switch) it's not that hard to configure as it used to be. You still can specify every aspect of your emulated hardware in the command line, which sometimes can be confusing, contradictional, non-intuitive, and turns out to be undocumented. Unlike the other two, it lacks a proper debugger, but who cares when you can activate a gdb-server with "-S -s"? Few examples from my makefile which can be useful:
Code: Select all
# booting with UEFI (throws a warning on disk format)
qemu-system-x86_64 -bios /usr/share/qemu/bios-TianoCoreEFI.bin -m 64 -hda bin/osZ-latest-$(ARCH)-$(PLATFORM).dd -d guest_errors -enable-kvm -cpu host,+avx,+x2apic -serial mon:stdio
# booting with BIOS from ROM
qemu-system-x86_64 -m 32 -hda bin/osZ-latest-$(ARCH)-$(PLATFORM).dd -option-rom loader/bootboot.bin -d guest_errors -enable-kvm -cpu host,+avx,+x2apic -serial mon:stdio
# booting with BIOS, specifing disk format
qemu-system-x86_64 -sdl -m 32 -d guest_errors,int -drive file=bin/osZ-latest-$(ARCH)-$(PLATFORM).dd,format=raw -enable-kvm -cpu host,+ssse3,+avx,+x2apic -serial mon:stdio
# booting on emulated Raspberry Pi 3
qemu-system-aarch64 -M raspi3 -kernel loader/bootboot.img -drive file=bin/osZ-latest-$(ARCH)-$(PLATFORM).dd,if=sd,format=raw -d int -serial mon:stdio
For VirtualBox, I agree that the lack of support for raw disk images is a big disadvantage, and that's not the only one. I use "VBoxManage convertfromraw" to create VDI, and I have also found a solution to the more-than-f*ucking-annoying-have-you-developers-ever-tried-this-sh*t UUID problem: "VBoxManage internalcommands sethduuid". It's built-in debugger is just a bit non-trivial, most commands work as expected, but minimal. Provided you could figure out how to summon that "Debug" menu. I have found lots of bugs in emulated VB (specially under mac). I have a feeling they don't want to truly emulate a hardware, but something which is good enough for running the mainstream OSes in a vm.
On maintenance, bochs is a fully software emulator (slow, but always works), while qemu and VB use a kernel module (with hardware acceleartion you got better performance, some module dependency hell and maybe security backdoors too). Usually kernel module installation works just out-of-the-box, but if VB's kdms fails you, then God help you.
Out of the the three, IMHO qemu is the winner because:
- it is supported on most platforms (win, linux, macosx) No need for special modules under linux (KVM is usually already included in every distro)
- it's SDL backend is simple, fast, reliable and available on all platforms (but lacks menus, which I don't care btw)
- it is the fastest by far (bootup time and overall emulation)
- it supports the widest hardware+firmware spectrum (not just many PC devices, but also other architectures)
- if you don't like command line, you have lots of GUI lunchers to choose from. You can also write one in python in literally 10 minutes.
Regardless, I test my OS on real hardware only when it works without problems on all of them.
Cheers,
bzt