written 2.6 years ago by |
Solution:
The Evolution of Virtual machines:
The layered approach described is taken to its logical conclusion in the concept of a virtual machine.
The fundamental idea behind a virtual machine is to abstract the hardware of a single computer (the CPU, memory, disk drives, network interface cards, and so forth) into several different execution environments, there by creating the illusion that each separate execution environment is running its own private computer.
Normally, a process has additional features, such as system calls and a file system, that are not provided by the bare hardware.
The virtual-machine approach does not provide any such additional functionality but rather provides an interface that is identical to the underlying bare hardware.
Each process is provided with a (virtual) copy of the underlying computer.
There are several reasons for creating a virtual machine, all of which are fundamentally related to being able to share the same hardware yet run several different execution environments concurrently.
Users thus are given their own virtual machines. They can then run any of the operating systems or software packages that are available on the underlying machine.
The virtual-machine software is concerned with multiprogramming multiple virtual machines onto a physical machine, but it does not need to consider any user-support software.
Implementation in operating systems:
The virtual-machine concept is useful, it is difficult to implement. Much work is required to provide an exact duplicate of the underlying machine.
The virtual-machine software can run in kernel mode, since it is the operating system. The virtual machine itself can execute in only user mode.
Consequently, we must have a virtual user mode and a virtual kernel mode, both of which run in a physical user mode.
Those actions that cause a transfer from user mode to kernel mode on a real machine (such as a system call or an attempt to execute a privileged instruction) must also cause a transfer from virtual user mode to virtual kernel mode on a virtual machine.
In addition, the CPU is being multiprogrammed among many virtual machines, further slowing down the virtual machines in unpredictable ways.
In the extreme case, it may be necessary to simulate all instructions to provide a true virtual machine.
Virtual machine works for IBM machines because normal instructions for the virtual machines can execute directly on the hardware.