What is a device?

This article is not assessed by the IB but may be helpful to deepen your understanding. Plus, I think it's cool.

Big idea

In operating system terms, a device is any hardware component that the CPU does not execute instructions on directly, but instead communicates with through an interface managed by the operating system.

  1. If the operating system schedules it, it is a CPU resource.
  2. If the operating system sends requests to it, it is a device.

We get into a slightly deeper definition, below. 

The operating system’s point of view

An operating system has a CPU-centric worldview.

  • The CPU is where the OS runs.
  • The CPU executes instructions.
  • The CPU is time-sliced, context-switched, and scheduled.

Everything that does not fit this model is treated as a device, regardless of how complex or powerful it may be.

Formal definition

A device is hardware that:

  • Is accessed indirectly by the CPU
  • Is controlled via registers, command queues, or memory-mapped I/O
  • Signals completion or events using interrupts
  • Transfers data using programmed I/O or DMA
  • Requires a device driver to translate OS-level requests into hardware-specific commands

The defining feature is not what the hardware does, but how the OS interacts with it.

What a device is not

A device is not:

  • A hardware component the OS schedules as a process
  • A unit that runs OS threads
  • Something the OS can context-switch in the CPU sense

Even if the hardware:

  • Executes instructions
  • Has its own memory
  • Schedules work internally
  • Performs complex computation

…it may still be a device.

Is primary memory (RAM) a device?

 

Primary memory (RAM) is not considered a device in operating system terms.

Why?

  • The CPU directly addresses RAM

  • Instructions and data are fetched from RAM as part of normal instruction execution

  • Memory access is part of the CPU’s core fetch–decode–execute cycle

  • No driver is required to read or write RAM

  • RAM is not accessed via I/O commands, queues, or interrupts

From the OS perspective, RAM is a fundamental execution resource, not an I/O component

Why powerful hardware can still be a device

Some devices are computationally sophisticated:

  • GPUs
  • Network offload engines
  • AI accelerators
  • Storage controllers

However:

  • The OS cannot execute instructions on them directly
  • The OS submits jobs, rather than scheduling execution
  • Internal scheduling is handled by the device hardware itself
  • The OS interacts only through a driver-managed interface

From the OS perspective, these components are still devices.

 

The role of the device driver

A device driver is operating-system software that:

  • Provides a uniform interface to hardware
  • Translates OS requests into device-specific commands
  • Manages buffers and DMA transfers
  • Handles interrupts from the device
  • Arbitrates access between multiple processes

The driver does not manage how the device computes internally.
It manages communication and control, not execution.

A practical rule for students

This rule works reliably in exams and design discussions:

If the operating system schedules it, it is a CPU resource.
If the operating system submits work to it, it is a device.

Using this rule:

  • CPU → scheduled → not a device
  • Disk → read/write requests → device
  • Network card → packet queues → device
  • GPU → job submission → device

 

Summary

  • A device is defined by its relationship to the CPU, not its power
  • The operating system runs on and schedules the CPU
  • All other hardware is accessed via device drivers
  • Devices may compute, but they are not scheduled like CPUs