Vir tual Machinescse.unl.edu/~witty/class/embedded/material/note/vm_basics.pdf · CSCE496/896:...

18
Virtual Machines Witawas Srisa-an CSCE496/896: Embedded Systems Design and Implementation

Transcript of Vir tual Machinescse.unl.edu/~witty/class/embedded/material/note/vm_basics.pdf · CSCE496/896:...

Page 1: Vir tual Machinescse.unl.edu/~witty/class/embedded/material/note/vm_basics.pdf · CSCE496/896: Embedded Systems Design and Implementation. The Basics • Process view • bare machine

Virtual Machines

Witawas Srisa-anCSCE496/896: Embedded Systems Design

and Implementation

Page 2: Vir tual Machinescse.unl.edu/~witty/class/embedded/material/note/vm_basics.pdf · CSCE496/896: Embedded Systems Design and Implementation. The Basics • Process view • bare machine

The Basics

• Process view

• bare machine with memories, registers, system calls for I/O

• OS + hardware

• OS view

• hardware alone

Page 3: Vir tual Machinescse.unl.edu/~witty/class/embedded/material/note/vm_basics.pdf · CSCE496/896: Embedded Systems Design and Implementation. The Basics • Process view • bare machine

Basics

• Virtual machines execute software in the same manner as the machine for which the software was developed.

• real-machine

• virtualization software

• different resources than the real machines

Page 4: Vir tual Machinescse.unl.edu/~witty/class/embedded/material/note/vm_basics.pdf · CSCE496/896: Embedded Systems Design and Implementation. The Basics • Process view • bare machine

Basics

• Virtualization has two parts

• mapping of virtual resources or states to real resources

• the use of real machine instructions and/or system calls

Page 5: Vir tual Machinescse.unl.edu/~witty/class/embedded/material/note/vm_basics.pdf · CSCE496/896: Embedded Systems Design and Implementation. The Basics • Process view • bare machine

Basics

• Process level VMs

• support an individual process

• System level VMs

• provide complete system environments (e.g. OSs and multiple processes)

Page 6: Vir tual Machinescse.unl.edu/~witty/class/embedded/material/note/vm_basics.pdf · CSCE496/896: Embedded Systems Design and Implementation. The Basics • Process view • bare machine

Basics

Hardware

OS

Virtualizingsoftware• Process VMs

• host, runtime, guest

• e.g. Rosetta

Application

Page 7: Vir tual Machinescse.unl.edu/~witty/class/embedded/material/note/vm_basics.pdf · CSCE496/896: Embedded Systems Design and Implementation. The Basics • Process view • bare machine

Basics

Hardware

Virtualizingsoftware

• System VMs

• host, VMM, guest

• e.g. Parallel, virtual PC, Xen

Application

OS

Page 8: Vir tual Machinescse.unl.edu/~witty/class/embedded/material/note/vm_basics.pdf · CSCE496/896: Embedded Systems Design and Implementation. The Basics • Process view • bare machine

Basics

IA32

VMM

Linux Apps

Linux

Windows Apps

Windows

Page 9: Vir tual Machinescse.unl.edu/~witty/class/embedded/material/note/vm_basics.pdf · CSCE496/896: Embedded Systems Design and Implementation. The Basics • Process view • bare machine

Process VMs

• Multiprogramming

• Emulators and dynamic binary translators

• Binary optimizers

• Language VMs

Page 10: Vir tual Machinescse.unl.edu/~witty/class/embedded/material/note/vm_basics.pdf · CSCE496/896: Embedded Systems Design and Implementation. The Basics • Process view • bare machine

Process VMs

• Digital FX!32: Emulator used in Windows NT to support Alpha processors

Alpha ISA

WindowsNT

IA32 WindowsApplications

Runtime

Page 11: Vir tual Machinescse.unl.edu/~witty/class/embedded/material/note/vm_basics.pdf · CSCE496/896: Embedded Systems Design and Implementation. The Basics • Process view • bare machine

Process VMs

• High-level language VMs

• compilation

• loader

• interpreter/compiler

HLL Program

Portable Code

VM

Host ISA

Distribution

Page 12: Vir tual Machinescse.unl.edu/~witty/class/embedded/material/note/vm_basics.pdf · CSCE496/896: Embedded Systems Design and Implementation. The Basics • Process view • bare machine

System VMs

• VM Architecture (Popek and Goldberg, 1974)

• VMM is placed on bare hardware with administrative privilege

• transparently intercepts and implements OS’s actions

• Guest systems run with lesser privileges

Page 13: Vir tual Machinescse.unl.edu/~witty/class/embedded/material/note/vm_basics.pdf · CSCE496/896: Embedded Systems Design and Implementation. The Basics • Process view • bare machine

System VMs

• Hosted VMs

• virtualizing software on top of an existing host OS

• typically rely on the same ISA

• can use drivers and low level services provided by the host system

• VMware

Page 14: Vir tual Machinescse.unl.edu/~witty/class/embedded/material/note/vm_basics.pdf · CSCE496/896: Embedded Systems Design and Implementation. The Basics • Process view • bare machine

Systems VM

• Whole system VMs

• host and guest systems do not share ISA

• virtualize all software through binary translation

• guest system ISA operations -> OS calls made to the host OS

Page 15: Vir tual Machinescse.unl.edu/~witty/class/embedded/material/note/vm_basics.pdf · CSCE496/896: Embedded Systems Design and Implementation. The Basics • Process view • bare machine

Windows Apps

System VMs

Power PC ISA

Mac OS

Mac AppsWindows

Virtual PC

Page 16: Vir tual Machinescse.unl.edu/~witty/class/embedded/material/note/vm_basics.pdf · CSCE496/896: Embedded Systems Design and Implementation. The Basics • Process view • bare machine

System VMs

• Codesigned VMs

• hardware or software translations

• hardware: microOps

• software: Transmeta Crusoe

Page 17: Vir tual Machinescse.unl.edu/~witty/class/embedded/material/note/vm_basics.pdf · CSCE496/896: Embedded Systems Design and Implementation. The Basics • Process view • bare machine

System VMs• Software translation

• special “invisible” memory set at boot time

• code in this memory execute in supervisor mode

• translate and optimize guest instructions

• cache these translated instructions

IA32 Code

Binary Translator

VLIW ISA

Transmeta Crusoe

Page 18: Vir tual Machinescse.unl.edu/~witty/class/embedded/material/note/vm_basics.pdf · CSCE496/896: Embedded Systems Design and Implementation. The Basics • Process view • bare machine

Summary

• Versatility of VMs

• portability

• high-performance

• energy efficiency

Java Apps

Windows XP

Mac OS-X

X86-64