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.
plex86 only runs Linux under its VM. I assumed that the implementation for something like this is different from the implementation of a full x86 VM monitor. Is the code similar enough to warrant perusal, or will it just hopelessly confuse me even more? Thanks for your help! -- Josh
I find qemu to be quite excellent x86 virtualization software. It's closer to VMware than Bochs, using dynamic translation.
Here's a link that should have more than enough information to get you started.
I've had this sig for three days.
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).
PS. They usually work by running user level code as is, and reflecting system calls to ring 1 where the guest OS runs. Or they just interpret or block translate all kernel code like VMWare does to be completely x86 compatible, even for crappy systems like Windows that need more than 2 hardware privelige levels and aren't portable. Either way, they have to call into the real Linux kernel when the guest OS actually needs access to hardware like video cards and the virtual memory subsystem.
---
Find out more about the impending downfall o
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
this page has all the open source wiki pages, and this is the front page for the site.
BTW, Con Zymaris listed out (on the OSIA list) some of the bet-your-company-on-this technologies which Microsoft has abandoned (who remembers Blackbird? How about DNA, the Distributed Network Architecture?), and more systems which Microsoft has sucked people into and then changed, requiring significant code rewrites (e.g. VB4 and again at VB7). It's a long and impressive list.
Bearing this in mind, and that Visual J++ is already way past "dead meat" stage, why on earth would anyone in their left mind be developing any new stuff in it? Christopher, if you're real, don't rely too much on your new day job...
Got time? Spend some of it coding or testing
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
Fantastic idea, I would suggest you look at the L4Ka and related projects (http://l4ka.org/projects/hazelnut/).
Please do not create a new project from scratch: there are enough.
What is needed though is adapting existing operating systems (e.g. Linux, BSD, etc) to work in these virtualised environments. Further to this, also supporting co-ooperative virtualise environments.
Your efforts in this area would be very well looked upon.
Accordining to noted troll Christopher Anthony, Windows NT is not portable! Administrators still running NT on Alpha are understandably shocked.
Windows NT was designed with a hardware abstraction layer to seperate machine dependent code from the rest of the code base. Windows NT 4.0 was launched on x86, Alpha, MIPS, and PowerPC. So much for not portable.
Plex86 is essentially a full x86 virtualization, with the exception of a few difficult corner cases that were easier to avoid (by patching the guest Linux kernel) than emulate. The same modifications could be made for any Free Software operating system, so the only reason for full virtualization would be to run proprietary OSes. The architecture of Plex86 is similar to that of proprietary x86 virtualizers: a kernel module and a user-mode program working together.
Here is a nice link on the subject: http://www.kernelthread.com/publications/virtualiz ation/
If you want a real Open Source emulator that's complete enough to run Windows XP (and do so with usable speed), QEmu is your only option. Currently it simulates a Pentium, Vesa fgramebuffer video card, and ISA NE2000 NIC.
:^).
Check out this dude's blog for screenshots of QEmu running Win2K.
Combine it with a copy of x86 glibc and a recent Crossover, you can use it to run Office XP for Windows on Linux on a Mac. Scary
Go get it from the Qemu Site.
Having said that, I would do it in this order (some of this I've already done myself):
The result should be like a primitive version of Windows 3.0, or maybe like Desqview, or maybe like this OS
So, Josh. Do you still feel like doing this?
To clarify: I'm wondering about virtualization because I'm working on a self-hosted VM monitor. (Think "ESX Server Lite".) It will be Open Source, of course, once I have anything remotely usable. (So far all I've done is set up page tables, IDT, IRQs, and use the timer interrupt to cycle the character in the upper-left corner.) Tentative name: XenOS. (Don't hold your breath...)
(Are there any well-known patents on dynamic code recompilation in software? Just curious...)
P.S. I'm using a virtualization thingy (VMware Workstation) to develop a virtualization thingy. Ironic.