• Foundation
  • About 12 min
  • 5 practice questions

Devices, drivers and how the OS handles input and output

Explain device management, drivers, plug and play, buffering and spooling in plain language and solve a simple print-queue question.

If something looks wrong, please tell us.

A computer is more than its CPU. Keyboards, mice, printers, scanners, screens and storage drives are all devices, and the operating system must manage them. This lesson explains how the OS talks to devices and why some devices wait in a queue.

Types of devices

  • Input devices send data into the computer: keyboard, mouse, scanner, microphone.
  • Output devices show results: monitor, printer, speaker.
  • Storage devices keep data: hard disk, SSD, pen drive, memory card.

Device drivers

Every device speaks in its own way, so the OS uses a small program called a driver for each type of device. The driver translates the OS's general requests into commands that the device understands. Without the right driver a new printer may not print, or a screen may look blurry. Updating a driver is a common fix for a misbehaving device.

Many devices today work as soon as they are connected. This feature is called plug and play: the OS detects the device, finds a suitable driver and sets it up by itself.

Why the CPU should not wait

Devices are far slower than the CPU. If the CPU stood still waiting for a key press or a printer, it would waste time. The OS uses three ideas to avoid this.

  • Interrupt: a signal from a device saying "I need attention". The CPU stops its current job briefly, deals with the device and goes back.
  • Buffer: a small area of memory that holds data for a short time while it moves between a fast and a slow part. A video player buffers a few seconds ahead so that the picture does not stutter.
  • Spooling: jobs for a slow device such as a printer are saved in a queue on the disk and sent one by one. The name comes from simultaneous peripheral operations on-line.

Worked example 1: a print queue

You send four documents to one printer at once, with 2, 3, 1 and 4 pages. Thanks to spooling you can carry on working while they wait in the queue. The printer prints 2 pages a minute. Total pages = 2 + 3 + 1 + 4 = 10. Time = 10 / 2 = 5 minutes. The third document (1 page) is printed after 2 + 3 = 5 pages, so it starts after 5 / 2 = 2.5 minutes. (These numbers are illustrative.)

Worked example 2: new device does not work

A student plugs in a new scanner and nothing happens. The cable is firmly connected and the port works with other devices. The most likely cause is a missing or wrong driver. The fix is to install the correct driver, usually from the maker's disc or website, or to let the OS search for it.

Worked example 3: match the idea

Which idea lets music keep playing smoothly when the internet speed changes for a moment? A buffer, which holds a little music ahead of the point being played.

Driver = translator for a device. Interrupt = a call for attention. Buffer = small waiting area. Spooling = print queue on disk.

Key takeaways

  • The OS manages devices through drivers.
  • Plug and play sets up a device automatically.
  • Interrupts, buffers and spooling stop fast parts from waiting for slow ones.

Check your understanding

  1. 1. A program that lets the OS control a particular hardware device is a

    1. Compiler
    2. Spreadsheet
    3. Driver
    4. Firewall
    Show answer

    Answer: C. A device driver translates the OS's requests into commands the device understands.

  2. 2. Jobs for a printer waiting in a queue on the disk are managed by

    1. Formatting
    2. Booting
    3. Spooling
    4. Zooming
    Show answer

    Answer: C. Spooling stores print jobs in a queue and sends them to the printer one at a time.

  3. 3. A signal from a device asking the CPU for attention is called an

    1. Extension
    2. Icon
    3. Path
    4. Interrupt
    Show answer

    Answer: D. A device sends an interrupt so the CPU can pause its task and serve the device.

  4. 4. A printer prints 4 pages a minute. How long will 18 pages take?

    1. 3.5 minutes
    2. 4.5 minutes
    3. 4 minutes
    4. 5 minutes
    Show answer

    Answer: B. 18 / 4 = 4.5 minutes.

  5. 5. A small area of memory that holds data while it moves between a fast part and a slow part is a

    1. Buffer
    2. Folder
    3. Driver
    4. Pointer
    Show answer

    Answer: A. A buffer smooths out the speed difference, for example in video streaming.

Privacy · Terms · Refunds · Delivery