🔒 Pro · Component 1 · 1.2 Software and Software Development
1.2.1d Device Drivers and Virtual Machines
OCR H446 · A Level Computer Science · ~11 min read
Notes
Video
Slides
Worksheet
Quiz

Device Drivers

A device driver is a piece of software that acts as an intermediary between the operating system and a specific hardware device. It translates the generic I/O requests issued by the OS into the device-specific instructions the hardware understands.

Why drivers are needed:

  • Hardware devices vary enormously — keyboards, printers, GPUs, network cards all have different internal protocols.
  • Without drivers, the OS would need to include code for every possible hardware device — impractical.
  • Drivers allow hardware manufacturers to provide software support independently of the OS developer.
  • Drivers enable the same OS to work with many different hardware configurations.

How drivers work:

  • The OS provides a standardised interface (API) for device types (e.g. "print" for all printers).
  • The driver implements this interface and translates OS requests into the specific commands the device understands.
  • The driver also handles communication in the other direction: receiving data/status from the device and passing it to the OS in a standardised form.
  • Drivers typically run in kernel mode (privileged mode) as they need direct hardware access.

Advantages of device drivers:

  • Applications can communicate with hardware without knowing hardware-specific details.
  • New hardware can be supported by installing a new driver without modifying the OS itself.
  • Faulty drivers can be updated or replaced independently.

Virtual Machines (VMs)

A virtual machine (VM) is a software emulation of a complete computer system. It runs inside a host operating system and behaves as if it were a separate physical computer with its own CPU, memory, storage, and network interfaces.

Key terminology:

  • Host machine: the physical hardware and OS running the virtualisation software.
  • Guest OS: the operating system running inside the virtual machine.
  • Hypervisor (Virtual Machine Monitor, VMM): the software that creates and manages VMs, allocating physical resources and isolating VMs from one another.

Types of hypervisor:

TypeDescriptionExamplesUse case
Type 1 (Bare-metal)Runs directly on the hardware — no host OS. The hypervisor IS the OS.VMware ESXi, Microsoft Hyper-V Server, XenEnterprise servers, cloud computing (AWS, Azure)
Type 2 (Hosted)Runs on top of a host OS as an application.VMware Workstation, VirtualBox, ParallelsDevelopment, testing, running different OS on desktop

Advantages of virtual machines:

  • Testing and development: developers can test software on different OS versions without needing multiple physical machines.
  • Isolation/sandboxing: malware can be safely executed inside a VM without affecting the host; VMs are isolated from each other.
  • Server consolidation: multiple VMs run on one physical server, reducing hardware costs, power usage, and cooling requirements.
  • Snapshots: the VM's state can be saved and restored, enabling easy rollback to a known good state.
  • Portability: a VM can be moved between physical machines as a file (e.g. migration in cloud computing).
  • Legacy software support: old applications that require outdated OS versions can run in a VM on modern hardware.

Disadvantages of virtual machines:

  • Performance overhead: virtualised hardware is slower than native hardware; the hypervisor adds a layer of abstraction.
  • Resource intensive: each VM needs its own allocated RAM, storage, and CPU cores, limiting how many can run simultaneously.
  • Complexity: managing many VMs, particularly in cloud environments, adds administrative complexity.

VMs vs Containers:

Modern systems also use containers (e.g. Docker) which share the host OS kernel rather than running a separate guest OS. Containers are lighter-weight but offer less isolation than full VMs.

FeatureVirtual MachineContainer
IsolationFull OS-level isolationProcess-level isolation
OSFull guest OS per VMShares host OS kernel
Startup timeMinutesSeconds
Resource usageHigh (separate OS per VM)Low (shared kernel)
SecurityHigher (separate kernel)Lower (shared kernel)
Exam tip: Know the two hypervisor types: Type 1 (bare-metal, runs directly on hardware, better performance) vs Type 2 (hosted, runs on host OS, easier to use). Be able to give the advantages of VMs: testing, isolation, server consolidation, snapshots, portability.
Exam tip: For driver questions: a driver translates OS generic requests into device-specific commands. Drivers allow different hardware to work with the same OS without modifying the OS itself.
⚠ Common Mistakes
  • Saying a VM IS an OS — a VM is a software emulation of a complete computer; it runs a guest OS but is not the OS itself.
  • Confusing Type 1 and Type 2 hypervisors — Type 1 runs directly on hardware (server/enterprise use); Type 2 runs on top of an existing OS (desktop/development use).
  • Saying device drivers are part of application software — they are part of system software and typically run in kernel mode.
✓ Notes completed!
Video coming soon
Click to advance · Arrow keys also work
Click slide or press arrow keys to navigate

Worksheet — 1.2.1d Device Drivers and Virtual Machines

8 questions · 20 marks · instantly marked

Q1Explain what a device driver is and why it is necessary for hardware to function with an operating system.[3 marks]
✓ Mark scheme
A device driver is software that acts as an intermediary between the OS and a specific hardware device [1]; it translates the generic I/O requests made by the OS into the device-specific commands the hardware understands [1]; it is necessary because hardware devices vary greatly in their internal protocols and the OS cannot contain specific code for every possible device; drivers allow new hardware to be supported without modifying the OS itself [1].
Q2Explain why device drivers typically run in kernel mode rather than user mode.[2 marks]
✓ Mark scheme
Device drivers need direct access to hardware registers, memory-mapped I/O, and interrupt handling mechanisms [1]; these operations require privileged access which is only available in kernel mode; user mode processes are restricted from direct hardware access to maintain system stability and security [1].
Q3Explain what a virtual machine is and distinguish between the 'host' and 'guest' in a VM environment.[3 marks]
✓ Mark scheme
A virtual machine is a software emulation of a complete computer system that runs inside another system, providing an isolated environment with its own virtual CPU, memory, storage, and OS [1]; the host machine is the physical hardware and underlying OS that provides the real resources and runs the hypervisor [1]; the guest OS is the operating system running inside the VM, unaware it is sharing hardware with other VMs or a host OS [1].
Q4Compare Type 1 and Type 2 hypervisors. Give one example of each and state one scenario where each is preferred.[4 marks]
✓ Mark scheme
Type 1 (bare-metal): runs directly on the physical hardware without a host OS; example: VMware ESXi / Microsoft Hyper-V Server / Xen [1]; preferred for enterprise server consolidation and cloud computing where performance is critical [1]; Type 2 (hosted): runs on top of a conventional host OS as an application; example: VirtualBox / VMware Workstation / Parallels [1]; preferred for development, testing, and educational use on desktop machines where ease of use is more important than raw performance [1].
Q5A company runs its website on a cloud hosting service that uses virtual machines. Give three advantages of using VMs in this scenario.[3 marks]
✓ Mark scheme
Any three from: server consolidation — multiple VMs share one physical server, reducing hardware costs [1]; isolation — each VM is isolated so one customer's VM crashing does not affect others [1]; scalability/portability — VMs can be quickly provisioned, scaled, or migrated between physical servers [1]; snapshots — the state of a VM can be saved and quickly restored in case of failure [1]; resource flexibility — CPU/RAM resources can be dynamically allocated to VMs based on demand [1].
Q6Explain why a cybersecurity researcher might run malware samples inside a virtual machine rather than on a physical computer.[2 marks]
✓ Mark scheme
A VM provides an isolated sandbox environment; malware executing inside the VM cannot affect the host machine or other VMs [1]; the researcher can safely observe the malware's behaviour, and if the VM is compromised, it can be quickly restored to a clean state using a snapshot [1].
Q7State two disadvantages of virtual machines compared to running software directly on the host hardware.[2 marks]
✓ Mark scheme
Any two: performance overhead — the hypervisor adds a layer of abstraction, making virtualised hardware slower than native hardware [1]; resource intensive — each VM requires its own allocated RAM, storage, and CPU, limiting how many can run simultaneously on one physical machine [1]; management complexity — managing large numbers of VMs adds administrative overhead [1].
Q8Briefly explain one difference between a virtual machine and a container (e.g. Docker) in terms of how they use operating system resources.[2 marks]
✓ Mark scheme
A virtual machine includes a complete guest OS for each VM, resulting in higher resource usage but stronger isolation [1]; a container shares the host OS kernel between all containers, making them more lightweight and faster to start, but with less isolation since all containers share the same kernel [1].
Topic Quiz
1 of 15
You scored
out of 15
🎯

Mini Test — 1.2.1d Drivers & VMs

  • 10 questions · 10 marks · 10 minutes
  • 5 MCQ + 5 short answer
Card 1 of 15
Click to reveal
🎉
Complete!
TermDefinition
← 1.2.1c Interrupts & Scheduling 1.2.1 Systems Software Next: 1.2.2a Types of Software →
🔒
Pro Content
Subscribe to access all 69 OCR H446 A Level lessons.
£7.99/month
or £59/year
Subscribe now →