Unformatted text preview:

11/17/20101Virtual MachinesVirtual MachinesCOMP755What is a VM?• An efficient, isolated duplicate of a real himachine• Current use includes virtual machines which have no direct correspondence to any real hardwareCategories of Virtual Machines• Process virtual machine –Runs a program• System virtual machine – Provides a complete system platform which supports the execution of a complete operating systemProcess Virtual Machine• Provides a platform‐independent programming itth t bt t dtil f thenvironment that abstracts away details of the underlying hardware or operating system• Allows a program to execute in the same way on any platform.•Runs as a normal application inside an OSRuns as a normal application inside an OS• Generally starts and terminates with an application program11/17/20102Java Virtual Machine• The Ja va Virtual Machine (JVM) provides an hit t id d t itfarchitecture independent environment for executing Java programs.• There are JVM available for many different platforms.•Java was originally created by SunJava was originally created by Sun Microsystems. There are now many sources for a JVM.Traditional Program CreationSource CodeCompilerCompilerObject FileLinkerLibrariesExecutableOS Program LoadTraditional Java ProgramsSource CodeCompilerBytecodesJava Virtual Bytecode LibrariesMachineModern Virtual MachinesSource CodeCompilerVirtual MachineBytecodesBytecode LibrariesJITmachine language11/17/20103Virtual Machine Advantages• Architecture independent bytecodes can be executed in a Virtual Machine on anybe executed in a Virtual Machine on any architecture• Bytecodes can be compiled into machine language for any machine•Compilers can generate code that can be pgsent over the network to be executed anywhere• Virtual Machines provide additional servicesJava Virtual Machine Services• Program safety verification• Garbage collection• Array bounds checking• Enforce security restrictionsJava Security• Java applications can do just about thianything• Java applets (which usually run in a browser)– cannot access client files –cannot execute many of the System functionscannot execute many of the System functions, such as exit– cannot connect to sites other than the one from which it was downloaded Java Policies• The basic responsibility of a Policy object itdt i hth tis to determine whether access to a protected resource is permitted• Java encapsulates a security policy in the java.security.Policy class•Policies are kept in a policy file either the•Policies are kept in a .policy file, either the default or a user created .policy file• Policy files can be created using the GUI policytool utility11/17/20104JVM Disadvantages• There are differences in how the dli t kunderlying systems work• Performance might not be as good as native codeDalvik - Android Virtual Machine• Creates environment to execute phone li tiapplications• Interpretively executes Java programs• After the Java program is compiled, the Java jar file is converted to a new format calledDex(DalvikEXecutable)called Dex(DalvikEXecutable)• Android applications are written in Java, but they call libraries written in CFramework• Common Language Runtime• Programming language independent– C, C++, C#, J#, Visual Basic• Cross‐language integration, especially cross‐language inheritanceGb ll ti•Garbage collection• Microsoft Visual Studio will generate CLR code that is executed in the .NET environment.Microsoft Intermediate Language• Microsoft intermediate language (MSIL) is generated byNetcompilersgenerated by .Netcompilers• CPU‐independent set of instructions that can be efficiently converted to native code• Converted to CPU‐specific code, by a just‐in‐time (JIT) compiler or by the Native Imagetime (JIT) compiler or by the Native Image Generator before ex ecution• Code verification determines if the code is type safe11/17/20105Java Lawsuits• Sun/Oracle have sued to keep Java to their ifi tispecifications• In 1997 Microsoft released a JVM with IE that had sever al changes; some improvements and some to avoid competition with MS software•In 2010 Oracle sued Google claiming theIn 2010 Oracle sued Google claiming the Dalvik virtual machine violated Oracle Java patentsSystem Virtual Machines• A system virtual machine provides a simulated environment that supports guest OS• The VM simulates the bare hardware• The guest OS might not know it is running in a simulated environmentAdvantages of System VMs• Multiple OS environments can co‐exist on the t i t ilti f hsame computer, in strong isolation from each other • The virtual machine can provide an instruction set architecture that is somewhat different from that of the real machine Fewer Computers• Many servers often have low utilization• One computer may have sufficient recourses to run multiple servers• It is often possible to run multiple server applications on one computer•Running server applications in different virtual•Running server applications in different virtual machines provides isolation should one of them fail11/17/20106Being GreenFewer computers saves• Money• Space• Maintenance•Electricity•Electricity• CoolingDisadvantages of System VMs• A virtual machine is less efficient than a real hi b it th hdmachine because it accesses the hardware indirectly • Page faults can be challenging to supportTypes of System VM• The virtual machine system is often called the hihypervisor• The hypervisor can be booted onto the native hardware or it can run as an application under a host OS•The hypervisor can provide the guest OSThe hypervisor can provide the guest OS access to real devices or simulated devices.VM Isolation• VMs are commonly used to simultaneously t t thrun two or more server systems on the same computer• While it may be possible to run the two server applications under the same OS on the same computer, the failure of one server may p, yimpact the other.• With VM the failure of one guest system will not impact the others.11/17/20107How VM does it• The guest OS runs at user level• User level instructions of the guest OS are executed on the hardware as usual• When the guest OS executes a privileged instruction, the hardware interrupts. The hypervisor then simulates the action of thehypervisor then simulates the action of the privileged instruction.VM challenges• Virtual memory can be a challenge for virtual


View Full Document

NCA&T COMP 755 - Virtual Machines

Documents in this Course
Load more
Download Virtual Machines
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Virtual Machines and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Virtual Machines 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?