by pthreads · 5y ago · 0 comments
On the same subject can someone recommend a book or any other resource to learn about virtual machine internals? My goal is to try to build a toy clone of VirtualBox/VMWare.
So far I have found one -- Virtual Machines by James E. Smith and Ravi Nair.
[1] https://www.amazon.com/Hardware-Software-Virtualization-Synt...
Fuchsia? :)
Another book on Libvirt will be handy since it is the de facto API for most virtualization including VMs and containers[1].
[1]https://www.amazon.com/Foundations-Libvirt-Development-Maint...
It's a really great fun way to learn the key concepts.
https://www.morganclaypool.com/doi/abs/10.2200/S00754ED1V01Y...
Bringing Virtualization to the x86 Architecture with the Original VMware Workstation (2012)
https://m.youtube.com/playlist?list=PLSkhUfcCXvqHsOy2VUxuoAf...
What I've found difficult is the step beyond that. NES and GameBoy are typical steps, however, I've been very frustrated by the confusing documentation of the GameBoy. There are 3/4 references, but one of them has significant mistakes, while another is incomplete. On the other hand, the Pan Docs should be complete and accurate.
I'm not sure if there is an easy middle ground, that, at the same time, is also well documented.
The Atary 2600 is architecturally simpler but less documented, and also requires very accurate timings. I've read somebody suggesting systems like Channel F, Astrocade and Odyssey2, but I'm not sure they're well documented.
I've personally lost my interest once I've found that building an emulator was essentially fighting specifications rather than actually building something.
All that said, emulating the CPU was pretty fun. There's a CPU test rom out there you can run with tracing and compare to the published results. I also got the background tiling from the PPU done, but the foreground processing has a lot of steps, so I indefinitely paused for now. Also, I had amazingly poor performance, so I wasn't super motivated to continue.
The 2600 has a very similar cpu, but the very limited Stella output chip means most games are very timing dependent, which means you have to be super accurate, which adds difficulty. I think you should try to be cycle accurate anyway, but it's easy to mess that up, and having some freedom would be nice.