Penguin
Blame: VirtualMachine
EditPageHistoryDiffInfoLikePages
Annotated edit history of VirtualMachine version 4, including all changes. View license author blame.
Rev Author # Line
4 AristotlePagaltzis 1 A program that emulates a hardware environment and executes MachineCode inside it.
1 GlynWebster 2
4 AristotlePagaltzis 3 A well-known example is the [JVM], a VirtualMachine that allows for the execution of [Java] ByteCode: just about every WebBrowser has one. Lesser known examples include the SmallTalk and [LISP] [VirtualMachine]s.
1 GlynWebster 4
4 AristotlePagaltzis 5 While many [VirtualMachine]s are designed to provide an environment different from the hardware they run on, this doesn't necessarily have to be the case: [VMWare] emulates a PC in a PC, f.ex. This is useful for running a real version of MicrosoftWindows under [Linux] instead of using [Wine], or for testing multiple [LinuxDistribution]s on a fast machine without having to stop what you're doing.
1 GlynWebster 6
4 AristotlePagaltzis 7 Virtual machines are used for:
1 GlynWebster 8
4 AristotlePagaltzis 9 ; Compatibility : a VirtualMachine is simple, a [Compiler] is complicated. MachineCode from one [Compiler] can run on any type of machine, with any type of [CPU], providing someone's written a VirtualMachine for it.
10 ; %%% Safety : Anything the program running in a VirtualMachine does has to be done by the VirtualMachine on its behalf. The VirtualMachine could decide not to write to the harddisk because you haven't given permission for the program inside it to do so; and the VirtualMachine could even pretend to have written to disk successfully to the emulated code -- it will be none the wiser, because it exists in an isolated universe. Thus, in theory the [Java] applet your WebBrowser downloaded from a webserver in Estonia can't do any harm.
11 ; %%% Novelty : Programming languages implicitly define what a computer ''is''. If that computer is far different from a JohnVonNeumann machine (the basis of most modern [CPU] designs), then you may as well write a VirtualMachine for your imaginary computer, and have your [Compiler] create code for that machine. The result probably won't be much less efficient than a native code compiler, and will be far easier to attain.
12 ; %%% DeBugging : A VirtualMachine emulates an entire hardware environment. You can stop a running program at any point and examine ''everything'' about the machine's state -- something not possible with a regular debugger. [Bochs] was written for this purpose.
13 ; %%% Emulation : I get to play my favourite ZX Spectrum video game[1] on my PC. Whee!
2 GlynWebster 14
15 ----
3 GlynWebster 16 [1] [Ant Attack | http://sandywhite.co.uk/fun/ants/]! [http://www.wave.co.nz/~glyn/AALogo001.gif]