SLIDE 1 / 10
CSZone.co.uk
OCR H446 · Component 1 · 1.2.1

Device Drivers and
Virtual Machines

OCR A Level Computer Science · cszone.co.uk
H446 SpecA Level
Learning Objectives

By the end of this topic you will be able to:

Explain what a device driver is and why it is needed
Describe the concept of a virtual machine
Distinguish between Type 1 (bare metal) and Type 2 (hosted) hypervisors
Evaluate use cases and advantages of virtualisation
Device Drivers

What is a Device Driver?

A device driver is software that allows the OS to communicate with and control a hardware device. Each device (printer, GPU, NIC, USB device) requires a specific driver.
Why needed: hardware devices vary enormously in design. Drivers provide a uniform interface to the OS, abstracting hardware-specific details.
OS interaction: the OS calls generic I/O functions; the driver translates these into hardware-specific commands sent to the device registers.
Kernel mode vs user mode: most drivers run in kernel mode with direct hardware access. Buggy drivers can cause system crashes (BSoD).
When you install a new device, the OS looks for and installs a driver. Without it, the OS cannot communicate with the device.
Virtual Machines

What is a Virtual Machine?

A virtual machine (VM) is a software emulation of a complete computer system. A single physical host can run multiple VMs simultaneously, each with its own OS, applications and virtual hardware.
Each VM believes it has exclusive access to physical hardware, but it is actually sharing resources with other VMs and the host.
VMs are isolated from each other — a crash or security breach in one VM does not affect others.
The hypervisor (Virtual Machine Monitor/VMM) manages VM creation, resource allocation and isolation.
Hypervisors

Type 1 vs Type 2 Hypervisors

Type 1 — Bare Metal
Runs directly on the hardware, without a host OS underneath. Examples: VMware ESXi, Microsoft Hyper-V, Xen. Used in enterprise data centres and cloud infrastructure (AWS, Azure). Faster, more secure, lower overhead.
Type 2 — Hosted
Runs on top of a host OS. The host OS manages hardware; the hypervisor runs as an application. Examples: VirtualBox, VMware Workstation. Easier to set up; used on personal computers for testing/development. Slower due to extra OS layer.
Key difference: Type 1 has the hypervisor as the lowest software layer (direct hardware access). Type 2 has Host OS → Hypervisor → Guest OS.
Uses of VMs

Advantages and Use Cases

Server consolidation: run multiple server VMs on one physical server, reducing hardware costs and power consumption
Testing and development: test software on different OS configurations without buying separate hardware; snapshot and rollback features
Security (sandboxing): run untrusted software in an isolated VM; malware cannot escape to the host
Disaster recovery: VMs can be rapidly deployed on new hardware if a physical server fails; VMs stored as files that can be backed up
VMs form the foundation of modern cloud computing — AWS EC2, Azure VMs, and GCP Compute Engine are all VM-based IaaS services.
Exam Practice
OCR H446 Style · 4 marks
Explain why a device driver is required when connecting a new printer to a computer. Describe two stages in the process from the OS receiving a print request to the printer receiving the data.
[4 marks]
1
Each printer model has unique hardware registers and communication protocols. The driver abstracts these details, presenting a standard interface to the OS.
1
Without the driver, the OS cannot communicate with the printer’s hardware registers to control its operation.
1
Stage 1: OS receives print request → passes it to the printer driver using a standard OS API call.
1
Stage 2: Driver translates the request into printer-specific commands (e.g. PCL or PostScript) and sends them to the device via the appropriate bus (USB/network), using DMA or interrupt-driven I/O.
Common Mistakes

Don’t Lose Marks

!
Saying a VM is “just another computer” — a VM is a software emulation that shares the physical hardware of the host. Always mention the hypervisor managing resource allocation and isolation.
!
Confusing Type 1 and Type 2 hypervisors: Type 1 runs directly on hardware (no host OS). Type 2 runs on top of a host OS. In exams, state which layer the hypervisor sits at.
!
Saying device drivers are hardware — they are software. The OS uses them to talk to hardware. A driver is loaded into memory and runs as code, typically in kernel mode.
1.2.1d Complete
Well done! ✓
Device Drivers and Virtual Machines
Return to lesson to continue