Page 2 of 2
RE:How does VMWare work?
Posted: Sun Mar 07, 2004 12:00 am
by VE3MTM
How can they patent virtualization? It's been around since the dark ages of computing. I know the new version of Solaris uses virtualization to partition the system to run programs in "seperate" systems.
Gnome.
My idea
Posted: Sun Mar 07, 2004 12:00 am
by Jarek Pelczar
I think that VMWare uses DR registers. You can set up to 4 breakpoints. Maybe VMWare monitor searches the code for few first instructions that needs emulation. Then it sets debug registers at e.g. move instructions or conditional, or far jump instructions. When debug exception occurs, it can emulate execution of this instruction and dynamically reassign Debug Registers.
Real mode can be emulated using V86 mode and protected mode can be emulated using debug registers. It can also replace the code with int3 when it runs out of debug registers and memorize replaced bytes somewhere for a while, then when instruction is emulated, it can put bytes back.
RE:How does VMWare work?
Posted: Sun Mar 07, 2004 12:00 am
by Cns
I believe Virtual PC is also a good example. I did test it under Windows and it proved to be quite as fast as VMWare, unfortunately I don't know if it is also the case with a PowerPC.
"While the Macintosh version uses an optimized CPU emulator, Virtual PC for Windows exploits the fact that host and the guest have the same architecture: there is a Virtual Machine Monitor (VMM), or Hypervisor, that runs directly on the underlying hardware alongside the host operating system. I/O (such as disk and network) is handled in the user space via the host operating system. Certain devices are entirely simulated in software (the BIOS, PIC, DMA controller, IDE/ATA controller, real-time clock, buses, the keyboard, I/O, and memory controllers, programmable timers, etc.) Several other devices are partially implemented in software, and rely on their real counterparts (input devices such as the keyboard, mouse, joystick, etc., video controller, floppy drive, network interface, audio hardware, optical drive, hard disk drive, etc.) "
more about the VMM is given with VMWare's description :
"VMWare Workstation's hosted architecture includes the following components: a user-level application (VMApp), a device driver (VMDriver) for the host system, and a virtual machine monitor (VMM) that is created by VMDriver as it loads. Thereafter, an execution context can be either native (that is, the host's), or virtual (that is, belonging to a virtual machine). The VMDriver is responsible for switching this context. I/O initiated by a guest system is trapped the the VMM and forwarded to the VMApp, which executes in the host's context and performs the I/O using "regular" system calls. VMware uses numerous optimizations that reduce various virtualization overheads."
The text gives other helpful insights :
"As mentioned earlier, the IA-32 architecture is not naturally virtualizable. Certain "sensitive" instructions must be handled by the VMM, and cannot be simply executed in non-privileged mode because they don't cause a General Protection exception. ESX Server solves this problem by dynamically rewriting portions of an operating system kernel's code to insert traps at appropriate places - in order to catch such sensitive instructions. ESX Server can run multiple virtual CPUs per physical CPU. Multiple physical network interface cards can be logically grouped into a single, high-capacity, virtual network device."
"Since virtualization-unfriendliness of IA-32 is a long standing issue, many approaches have been used to address it. Scanning code dynamically and inserting an illegal instruction before each instruction of interest is one option (which would then cause traps). You can also replace such instructions with subroutine calls.
Almost all common x86 operating systems do not use all four privilege modes provided by IA-32, which has been exploited for schemes to protect a guest operating system kernel from its user level processes."
RE:How does VMWare work?
Posted: Tue Mar 09, 2004 12:00 am
by Anton
They can patent virualization on Intel CPU, and that's what i ment, cause VMWare were the first to virtualize the intel cpu. Before them, it was belived, that it is impossible, since intels cpus are not truely virualizeble, uncless you use special (non trivial) methods.
Anton.
RE:How does VMWare work?
Posted: Fri Mar 19, 2004 12:00 am
by pjb
What Sun has done with Solaris is quite different. The separation
in Solaris still has only one kernel... it is described even by
sun as "chroot on steroids"...