All subjects · Computer Science · WCP03 Advanced Principles of Computer Science

Input/output management in the operating system

Edexcel IAL Computer Science · WCP03 Advanced Principles of Computer Science

Devices like keyboards, disks and printers are slow and varied. The operating system manages them using device drivers, the BIOS, buffering, caching and interrupts, so programs never need to know the details of each device.

Practise this in the app: instant marking and a fix for every mistake. Free, no email needed to start.

Practise this lesson

Device drivers and the BIOS

Buffering and caching

Interrupts

An interrupt is a signal from a device or program telling the processor that something needs attention (key pressed, printer out of paper, data transfer complete, timer).

1. At the end of each fetch-decode-execute cycle the CPU checks for interrupts.

2. If one has higher priority than the current task, the CPU saves the contents of its registers (including the program counter) on the stack.

3. It runs the interrupt service routine (ISR) for that device.

4. It restores the saved registers and carries on where it left off.

Interrupts are better than polling (repeatedly asking each device) because the CPU does useful work until a device actually needs it.

Why I/O management matters

Benefits: programs are device-independent; slow devices do not hold up the CPU; many devices can share the system safely. Drawbacks: drivers add a layer that can contain bugs or security holes and must be updated; buffering and caching use memory; badly prioritised interrupts can delay important tasks.

A typical diagram: user -> application -> operating system -> device driver -> device.

Worked example

A user prints a 50-page document and keeps typing. Explain how the operating system makes this possible.

  1. The application passes the print job to the OS, which uses the printer driver to convert it into the printer's commands.
  2. The data is placed in a buffer, so the CPU can return to the word processor straight away.
  3. When the printer has used up a chunk of the buffer it sends an interrupt; the CPU saves its state, runs the ISR to send more data, then resumes the user's typing.

Answer: Driver translation, buffering and interrupts let printing happen in the background.

Key idea: Device driver: translates OS requests for a specific device. BIOS: start-up firmware. Buffer: temporary store between different-speed devices. Cache: keeps reused data in faster memory. Interrupt: save registers, run ISR, restore.

Check yourself

  1. What is the role of a device driver?
    • It stores frequently used data in fast memory
    • It checks the hardware when the computer starts
    • It translates operating system requests into commands a specific device understands
    • It decides which program uses the CPU next
    Show answer

    It translates operating system requests into commands a specific device understands. Each device type needs a driver so the OS can control it.

  2. What does the BIOS do when a computer is switched on?
    • Tests and initialises the hardware, then loads the operating system's boot loader
    • Runs the user's applications
    • Deletes temporary files
    • Encrypts the hard disk
    Show answer

    Tests and initialises the hardware, then loads the operating system's boot loader. POST, then hand over to the boot loader.

  3. Why is a buffer used when sending data to a printer?
    • It permanently stores every document printed
    • It makes the printer print faster
    • The CPU can transfer data quickly into memory and continue other work while the slow printer empties it
    • It converts data into the printer's language
    Show answer

    The CPU can transfer data quickly into memory and continue other work while the slow printer empties it. A buffer bridges the speed gap.

  4. How does a cache differ from a buffer?
    • A cache is slower than the storage it serves
    • A cache keeps copies of data likely to be reused; a buffer temporarily holds data in transit
    • A buffer is only used for the processor's registers
    • A cache is only used by printers
    Show answer

    A cache keeps copies of data likely to be reused; a buffer temporarily holds data in transit. Caching is about reuse; buffering is about speed matching.

  5. What does the processor do first when it accepts an interrupt?
    • Deletes the current program
    • Restarts the computer
    • Runs the BIOS
    • Saves the contents of its registers, including the program counter
    Show answer

    Saves the contents of its registers, including the program counter. Saving state lets it resume the interrupted task afterwards.

  6. Why are interrupts usually better than polling?
    • Interrupts never need any processor time
    • The CPU does useful work instead of repeatedly checking devices that do not need attention
    • Polling cannot be used with keyboards
    • Interrupts stop all other programs
    Show answer

    The CPU does useful work instead of repeatedly checking devices that do not need attention. Polling wastes cycles asking 'are you ready?'.

  7. In an I/O diagram, which order shows a print request travelling from the user to the printer?
    • User, printer, device driver, application, operating system
    • User, device driver, application, printer, operating system
    • User, operating system, printer, application, device driver
    • User, application, operating system, device driver, printer
    Show answer

    User, application, operating system, device driver, printer. The request passes down through the layers.

Practise with instant feedback

Sources

Last updated 8 November 2026. Spotted a mistake? Tell us.