COMP 3000 2012 Week 12 Notes

From Soma-notes
Revision as of 20:18, 21 November 2012 by Cdelahou (talk | contribs) (added notes)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Virtualization is an over used word. Learn it in context.

Virtual Machines:

  • exmaples include: JVM, VMware, virtual private server

Java

We'll use the JVM as an example.

JVM

  • multi threaded process(es) on system.
  • Runs Java Bytecodes
    • Java is compiled to bytocodes
    • close to machine code
    • contains more than jsut machine code mappings.
    • platform independent
    • Traditional bytecode execution: table lookup. Find machine code mappings on table
    • Modern bytocode interpreters:Uses a JIT compiler.

Just in time compiler:

  • compiles the bytecodes into machine code on the fly.
  • feedback directed optimization: run time optimization on the fly. Only compiles what's needed.
    • the longer the program runs, the more it'll be optimized adn the faster it'll get
    • startup is slow though. More overhead.
    • Experimental system: Dynamo for PA-RISC: Experimental system for JIT compilation on chips. YOu could run PA-RISC code on both the chip and a software JVM. Surprisingly, it ran faster on software due to on the fly optimizaton

JIT compilation and other such trickery allow programs written in high level languges to run almost as fast as lower lever languages. If someone says the opposite, tell them to shove it.

VPS (virtual private servers)

Traditional Virtualisation

  • many OSes working with a hypervisor. All OSes are separate. They all have their own userlands.
  • can have many different OSes on one systems. Heterogeneous OSes.

OS virtualisation (Jails (BSD), Containers (SOlaris), Vserver(Linux))

  • One kernel, many userlands.
  • Every userland is rooted at a different directory (/randomdir/), not at the root directed (/)
  • chroot environment
  • Only runs one OS
  • Much lighter weight than traditional hardware virtualisation
  • difference between this and multiple users? Every instance has it's own root user that controls that instance. Tradition *nix installations have one root.

Xen

  • Open source
  • Written before HW virtualisation
  • implemented using paravirtulisation
    • modifythe OS kernel to use hypervisor for the CPU , memory and privileged operations
    • to run Xen on an older box, you need to special version of the linux kernel that use paravirtulisaton


  • All OSes are divided in domains (Dom 0, Dom 1, Dom 2, etc). Dom 0 is an admin type dom. The rest are "user doms". Dom U's.
  • Device drivers are loaded into Dom0. Whenever they other OSes (DomU) need to use a device, they connect to the zen ssytem whicch routes the call to Dom 0 which uses the hardware.
  • All complexity is kept in Dom 0. All I/O goes there.
  • Keeps the hypervisor (xen) small.
  • DOM 0 is very closely linked to the hypervisor. When you install xen, it modifies the Dom 0's kernel to have it merge with the hypervisor