============================================================= |||||||| CS471 NEWSLETTER - 2/16/00 |||||||| ============================================================= VIRTUAL MACHINES In its broadest sense, "virtual machine" refers to the universality of the computer: any computer can simulate any other. We can make any computer assume the identity of any other machine simply by loading it with the software simulator of the other. No other machine has this capability. Within the computing field, "virtual machine" has been used in several related, but different senses. You need to learn them and distinguish among them. (1) IBM's operating systems all offer virtual machines. In this case the virtual machine offered is an exact replica of the actual hardware, except that it has less memory than the real machine and that sensitive instructions are not part of its instruction set. The IBM Virtual Machine Monitor partitions the real memory and allocates each part to one virtual machine. It runs each virtual machine in the "user" mode so that the sensitive instructions are not executable; an attempt by a program to execute a sensitive instruction causes an interrupt, allowing the VMM to simulate that instruction in a way that does not disturb the computing environments of any other virtual machine. IBM uses the virtual machine system to obtain perfect partitioning -- applications in different virtual machines cannot interfere with one another. OS developers can test new versions of an OS without fear of crashing the system or losing anyone's data -- the worst effect is to crash the virtual machine. IBM spent a great deal of time designing the archtecture to achieve these properties. The system is even recursive: you can run the VMM inside one of the virtual machines and partition it. Note that these virtual machines run at nearly the same speed at the real machine because most of the instructions are directly executable; only the sensitive instructions trap to the VMM. (2) Many PCs run software that simulates the instruction set of another computer, allowing programs for the other computer to be run on the PC. An example is the program "Virtual PC" that runs on MacIntosh computers. It allows you to run Windows on the Mac and run all applications that run on Windows. Unlike the IBM simulation, the OS traps every instruction of the virtual machine and simulates it with instructions from the PC instruction set. These virtual machines run much slower than their real counterparts. (3) Many components of operating systems are formulated as "abstract machines". An abstraction machine encapuslates the implementation knowledge about a set of operations applicable to a class of objects. The user of the abstract machine gets to use the objects through a high-level (usable) interface and does not have to be concerned with inner details of implementation. The functions of an abstract machine are software routines contained inside the machine's perimeter; to the user, these functions look like extensions to the instruction set of the machine. Abstract machines can be nested, and the outer machine may hide some of the instructions of the inner one. The principle of abstraction as used here was formally defined in the 1960s, when it was a widely practiced method; it was called "data abstraction". It eventually matured into object oriented programming and design. Some authors refer to these abstract machines also as virtual machines. (4) The user-level process in Unix is defined as a "program running on a simulated computer". Thus this process is actually a virtual machine. Unix defines a standard form for the user process. Invoking any program is simply a matter of loading the program into a user process and starting it. Since the user processes all have the same external interface, it's easy to connect them to a variety of input or output sources and to pipelines. This is the type of virtual machine that your course project examines. In our course project, we will be implementing the Unix-style virtual machine as objects managed by a VMM; thus the VMM is an abstract machine. Be wary of the different uses of "virtual machine" and don't allow yourself to be confused by them.