Virtual Machines & Operating Systems

H446 · 1.2 Types of Software · A-Level Computer Science

Component 01

Virtual Machines

A virtual machine (VM) is a software emulation of a computer system. It runs on a physical host machine using a layer of software called a hypervisor. The VM behaves as if it were a real, isolated computer.

Type 1 Hypervisor (Bare-metal)

Runs directly on the physical hardware — no host OS required. More efficient.

Examples: VMware ESXi, Microsoft Hyper-V, Xen

Used for: enterprise server virtualisation, cloud computing

Type 2 Hypervisor (Hosted)

Runs on top of an existing host operating system. Easier to install and use.

Examples: VirtualBox, VMware Workstation, Parallels

Used for: development and testing on desktop machines

Uses of Virtual Machines

Safe testing environment
Run legacy software
Cross-platform development
Malware analysis
Server consolidation
Cloud computing
Snapshots / backups
Education / training

Bytecode & the Java Virtual Machine

Java compiles source code to bytecode — an intermediate, platform-neutral representation. The JVM (Java Virtual Machine) interprets the bytecode on any platform.

Java Source
→ javac →
Bytecode (.class)
→ JVM →
Machine Code (any platform)

"Write Once, Run Anywhere"

The same compiled bytecode can run on Windows, Linux, macOS, or Android — as long as a JVM is installed. Python works similarly using the CPython interpreter/VM.

Operating System Functions (A-Level Depth)

Process Scheduling

Determines which process gets CPU time. Algorithms include:

  • Round-Robin — each process gets equal time slices in turn; fair but context-switch overhead
  • Priority Scheduling — higher-priority processes run first; can cause starvation of low-priority processes
  • FIFO (First In First Out) — processes run in order of arrival; simple but long processes block others

Process states: Ready → Running → Blocked → Ready (cycle)

Memory Management

Allocates and manages RAM. Key techniques:

  • Paging — memory divided into fixed-size pages; pages can be in RAM or swapped to disk (virtual memory)
  • Page Table — maps virtual addresses to physical addresses; OS maintains one per process
  • Page Fault — referenced page not in RAM; OS loads it from disk (swap space)

File Management

Organises files in a hierarchical directory structure. Manages creation, deletion, access permissions. File systems: FAT32 (older, simpler), NTFS (Windows, journalling, permissions, large files), ext4 (Linux).

Device Drivers & I/O Management

Drivers provide an abstraction layer between the OS and hardware devices. A program calls a standard OS API; the driver translates this to device-specific commands. Interrupt-driven I/O: device signals completion via interrupt rather than the CPU polling continuously.

Round-Robin Scheduler Visualiser

Watch 4 processes share the CPU using round-robin scheduling. Each gets a time quantum. Click Run to animate.

2