Pointers for Developing x86 Virtualization?
josh asks: "For my next project, I've decided I want to do something related to x86 virtualization (the way VMware does it or Plex86 not Xen/Bochs/etc.) but I really don't know where to start. Googling hasn't been helpful (just look at the results if you don't believe me). Are there any resources for learning about this kind of x86 virtualization? I know virtual 8086 mode wouldn't work, but without that what advantage does something like VMware have over something like Bochs? Are there any F/OSS projects aimed at something along the lines of my thinking? Please enlighten me with any references and resources you might have. Thanks!"
Go to the plex86 page you linked to and download source. That's an excellent place to start. Apart from that, boning up on the difference between user and kernel modes and getting your hands on the free Intel developers' docs on the Intel website are about as good as it gets for this kind of learning.
Virtualizing the Pentium is a lot of tedious work because the Pentium just wasn't designed for it. You won't be learning much about virtualization in general, just a lot of Pentium-specific tricks. Why bother with that?
Sooner or later, Intel is going to make the Pentium virtualizable in a more straightforward way. Until then, I'd just stick with one of the available solutions (including Plex86).
Not quite. While qemu will most likely yet gain virtualization to speed it up, qemu is definitely not what the poster is asking about. qemu is an emulator just like bochs, except that qemu employs dynamic translation of cpu instructions (and caching of said blocks of code). One mode of qemu, qemu-fast, uses a linux kernel module to allow the native OS memory manangement and paging routines. In pure emulation mode memory management is also emulated. At best qemu can yield a raw cpu speed of 1/3 the host processor. Compare this to vmware which, although it seems slow, in theory can be almost full speed in terms of cpu-bound metrics.
I think that down the road qemu will adopt some virtualization techniques on various platforms. Obviously this would be limited to x86 on x86 or ppc on ppc. But it will be exciting to watch and follow qemu. I already run win2k in qemu on my 1.5 gHz athlon at quite a respectable speed.
Half of what you want is cpu documentation, Intel makes nice free guides to their 32 bit x86 cpus. Sometimes they even will send out the manuals free in book format, right now it looks like you can download them or order a free cd. Check back often because the free books(shipping free too) come and go. http://developer.intel.com/design/pentium4/manuals /index2.htm
p ub/WWW/files.html
The other main half is BIOS info, check our Ralf Brown's int list: http://www-2.cs.cmu.edu/afs/cs.cmu.edu/user/ralf/
For the rest you just need lots docs about various hardware like floppy controllers and such, check out my site for OS developers since I probably have more links listed then anyone else. Besides this stuff you might want to re-include java in your google searches because most of the research into virtual machines that I've seen uses java but alot would still apply.
My Hello World is 512 bytes. But it's also a valid Fat12 boot sector, Fat12 file reader, and Pmode routine.
Something you may want to look at is MOL (maconlinux.org). It's for PPC, but it does demonstrate how to do virtual machines like you are discussing.
Don't forget that one good thing is also your ability to write a good driver for the client OS. That can yield huge speed increases on its own.
LRC, the best-read libertarian site on the web
here are a few links from my collection on the topic:
m l u l/),
+ vmware
+ bochs
+ vax with simh-vax, see
http://www.netbsd.org/Ports/vax/emulator-howto.ht
+ xen
(http://www.cl.cam.ac.uk/Research/SRG/netos/xen/)
+ LilyVM
(http://lilyvm.sourceforge.net/index.ja.html)
+ mips64emul
(http://www.mdstud.chalmers.se/~md1gavan/mips64em
+ dosbox (http://dosbox.sf.net)
I'm mostly interested with running non-Linux (e.g. NetBSD, Solaris) in a virtual environment for using it in my "Virtual Unix Lab" training environment, see http://www.feyrer.de/vulab/).
- Hubert