User Interfaces and Device Management

UNIT 2 • MODULE 3 • LESSON 07

A bank teller, a network technician and a six-year-old with a tablet all use an operating system, but they talk to it in very different ways. Behind the scenes the same OS is also juggling a keyboard, a printer, a disk and a network card, each much slower than the CPU. This lesson looks at both sides: the user interface the OS presents, and how it manages devices.

What you will learn

  • The features of command-line, menu-driven and graphical user interfaces, and who each suits.
  • What a device driver does.
  • Why polling wastes CPU time and how interrupt-driven I/O avoids it.
  • What buffering and spooling are, and the problems they solve.

Part 1: User interfaces

The user interface is the part of the OS (or of a program) that lets a person give commands and see results. The syllabus names three kinds.

Command line (prompt)Menu-drivenGraphical (GUI)
How you use itType commands at a prompt, such as rm work/old.txtChoose from a list of numbered or highlighted options, one level at a timePoint at and click or tap windows, icons, menus and buttons (WIMP)
StrengthsFast for experts; powerful; commands can be combined and scripted; needs little memory or processingEasy to learn; only valid options can be chosen; works on small screens and keypadsIntuitive; little to memorise; visual feedback; easy multitasking
WeaknessesMust remember exact commands and syntax; unforgiving of typing errorsSlow when the option is deep in the menus; limited to what the menus offerNeeds more memory, processing and a good display; slower for repetitive tasks
Typical usersNetwork administrators, programmersATMs, kiosks, phone systems, appliancesMost home and office users

Try the same small job, deleting old.txt from the folder work, in all three:

Try it 1One task, three interfaces

Choose an interface and delete old.txt from the folder work. Then try the other two and compare.

A menu-driven program in C

Many of your own C programs already have a menu-driven interface. This one controls a volume setting; the user can only pick from the options listed, and anything else is rejected.

#include <stdio.h>

int main(void)
{
    int choice = 0;
    int vol = 5;
    while (choice != 3) {
        printf("1 Up 2 Down 3 Quit\n");
        printf("Choice: ");
        if (scanf("%d", &choice) != 1)
            break;
        printf("%d\n", choice);
        switch (choice) {
        case 1:
            if (vol < 10) vol++;
            break;
        case 2:
            if (vol > 0) vol--;
            break;
        case 3:
            break;
        default:
            printf("No such option\n");
        }
        printf("Volume: %d\n", vol);
    }
    return 0;
}

Sample input: 1 9 3

Output:

1 Up 2 Down 3 Quit
Choice: 1
Volume: 6
1 Up 2 Down 3 Quit
Choice: 9
No such option
Volume: 6
1 Up 2 Down 3 Quit
Choice: 3
Volume: 6

Compare this with a command-line version, where the user would have to know to type something like volume up, and with a GUI version, which would show a slider.

Part 2: Device management

Devices are far slower than the CPU and each one works differently. The device manager in the OS hides those differences and keeps the CPU from wasting time. In Input and Output Devices you met the devices themselves; here is how the OS handles them.

Device drivers

A device driver is a small program that translates the OS’s general requests (“print this page”, “read block 52”) into the exact commands one particular device understands. A new printer only needs a new driver, not a new OS. The OS also keeps track of which devices are present, which process is using each one, and shares or allocates them.

Polling versus interrupts

The CPU must know when a device has data or has finished a job. There are two ways to find out:

  • Polling: the CPU repeatedly checks the device’s status. Simple, but most checks find nothing, so CPU time is wasted.
  • Interrupt-driven I/O: the CPU gets on with other work, and the device sends an interrupt signal when it needs attention. The CPU saves its place, runs the interrupt service routine, then carries on (Lesson 03).

Try it 2Polling or interrupts?

Over 20 ticks, a key is pressed at ticks 6 and 15. Key: c = check, nothing there; K = check, key found; w = CPU does other work; I = interrupt handled.

Buffering

A buffer is an area of memory that holds data temporarily while it moves between a fast device and a slow one, or between a device and a process. The CPU fills the printer’s buffer in a burst and goes back to other work while the printer empties it slowly. Keystrokes wait in the keyboard buffer until the program is ready. A video player buffers a few seconds ahead so that a short network delay does not stop the picture. When a buffer is full, the sender must wait; when it is empty, the receiver must wait.

Spooling

A printer can only print one document at a time. Spooling (simultaneous peripheral operations on-line) solves this by writing each output job to a file on disk, in a spool queue, and letting the printer take jobs from the queue in turn. The program that printed is free as soon as its job is saved. The spool queue is a FIFO queue, exactly the structure from Unit 2 • Module 1 • Lesson 04 – Queues: FIFO, Enqueue, Dequeue and Linear Queues in C. A print manager can also let users reorder, pause or cancel queued jobs, and give jobs priorities.

Try it 3Print spooler

Asha sends 4 pages at 0 s, Ben 2 pages at 10 s and Chen 3 pages at 20 s to one shared printer. Run it without spooling, then with spooling, and compare how long each person is stuck.

    Try it 4Interfaces and devices

    Choose the best answer for each situation. Ten items.

    Part 3: Common mistakes

    • Spooling makes printing faster. The printer is no faster. Spooling frees the user and the CPU, and lets jobs queue.
    • Buffer and spool are the same. A buffer is a small area of memory for data in transit. A spool is a queue of whole jobs on disk.
    • "GUI is always best". For experts, repetitive tasks, remote servers or low-resource machines, a command line is often better.
    • Naming an interface without a reason. In a "which interface?" question, give the feature that makes it suitable for that user.

    Try it 5Interfaces and devices drill

    Pick a mode. "Interface" names the best interface. "Device" names the device-management idea.

    Summary

    IdeaRemember
    Command lineTyped commands: fast, powerful, scriptable; must remember syntax.
    Menu-drivenPick from options: easy, safe, limited, can be slow.
    GUIWindows, icons, menus, pointer: intuitive; needs more resources.
    Device driverTranslates OS requests for one particular device.
    Polling vs interruptPolling wastes CPU checking; interrupts let the device signal.
    BufferTemporary memory between fast and slow parts.
    SpoolingJobs saved to a disk queue so a shared device can take them in turn.

    Review questions

    1. Describe how a user interacts with a command-line interface.

    Show answer

    The user types a command, with any options and file names, at a prompt and presses Enter; the OS interprets it, carries it out and prints any result or error message as text.

    2. Give one advantage of a menu-driven interface over a command line, and one disadvantage.

    Show answer

    Advantage: the user does not need to remember commands, and only valid options can be chosen. Disadvantage: it is slower, especially when an option is several levels deep, and only offers what the menus include.

    3. Explain why a GUI needs more system resources than a command line.

    Show answer

    It must draw and update windows, icons and a pointer on a high-resolution display, and handle mouse or touch events, which uses more memory, processing and graphics capability.

    4. What is a device driver?

    Show answer

    A program that lets the OS communicate with a specific hardware device by translating general requests into that device’s commands.

    5. Explain why interrupt-driven I/O is more efficient than polling.

    Show answer

    With polling the CPU wastes time repeatedly checking a device that is usually not ready. With interrupts the CPU does other work and responds only when the device signals.

    6. Explain how spooling helps when several users share one printer.

    Show answer

    Each job is written to a queue on disk, so users can carry on working immediately; the printer then prints the jobs one at a time in order, and jobs are not mixed up.

    7. Distinguish between a buffer and a spool.

    Show answer

    A buffer is a temporary area of memory that holds data moving between devices of different speeds. A spool is a queue of complete jobs held on disk for a device that can serve only one job at a time.

    8. In Try it 3, what was the total time users were blocked without spooling?

    Show answer

    160 s: Asha 40 s, Ben 50 s and Chen 70 s.

    Homework

    1. List four devices you have used today that have a menu-driven interface.
    2. Extend the C menu program with a fourth option, Mute, that sets the volume to 0.
    3. Draw the print spool queue after five jobs arrive and two are printed. Which queue operation removes a job?
    4. Write a paragraph explaining to a new teacher why the school printer uses spooling.

    Mastery quiz: User Interfaces and Device Management

    This 10-question quiz is separate from the short Quick quiz at the end of the lesson. Score 8/10 or higher to earn this lesson’s badge. Your best score is saved in this browser on this device.

    Mastery quiz: User Interfaces and Device Management

    Your course badges: loading saved progress…

    View badges

      No course badges earned yet. Score 8/10 in a lesson quiz to earn its badge.

      Saved in this browser on this device. Clearing browser data may remove your badges.

      Answer all 10 questions. Earn this lesson’s badge at 8/10 or higher. Read the explanations, revisit the Try it activities and retry as often as you need. These are self-study badges, not formal grades.

      1. Which interface is most suitable for automating repeated system tasks?
      2. WIMP stands for windows, icons, menus and...
      3. An ATM most likely uses which interface?
      4. A disadvantage of a command-line interface is that...
      5. Software that lets the OS control a specific printer model is a...
      6. Repeatedly checking whether a device is ready is called...
      7. Temporary memory that smooths out speed differences is a...
      8. Print jobs held on disk waiting for the printer form a...
      9. The main benefit of spooling to the user is that...
      10. Interrupt-driven I/O is efficient because...

      Exam tips

      Specimen Unit 2 Paper 01 (2021), Item 39. This item is about the user interface. The method: identify the feature in the stem (typed commands, a list of options, or pointing at icons) and match it to the interface type. Distractors often swap a strength of one interface for another, so check each option against the table in Part 1.

      Structured questions on device management. When asked to explain spooling or buffering, say what is stored, where it is stored (memory or disk), and what problem it solves. A sentence on each part usually earns the marks.

      More worked answers are on the CS Solutions page.

      Previous: Unit 2 • Module 3 • Lesson 06 – Files, Folders, Compression and File Security. Next: Unit 2 • Module 3 • Lesson 08 – Network Types, Topologies and Devices.

      Syllabus link: CAPE Computer Science (CXC A19/U2/21), Operating Systems and Computer Networks (Unit 2, Module 3). Specific Objective 3: describe the functions of operating systems (user interface: command prompt, menu-driven, graphical; device management: drivers, interrupts and polling, buffering, spooling).

      Video search terms

      Search YouTube for: "command line vs GUI vs menu driven interface", "polling vs interrupts", "print spooling and buffering explained".

      Try it 6Quick quiz

      Tap an answer. All eight questions are self-checks on this lesson.

      Updates

      2026/12/01

      - First version of the lesson.

      © 2026 islandclass.org

      Leave a Reply