1.5.1

Operating systems

GCSE Computer Science 1.5.1: the purpose and functionality of an operating system — the user interface, memory management and multitasking, peripheral management and drivers, user management and file management.

About 14 minutes to read

What an operating system does

An operating system is the software that manages the hardware and provides an environment in which other programs can run. Without one, every program would have to control the hardware itself.

The specification names five functions, and asks what each one does.

Figure: The five functions

Features of a user interface worth naming: windows that can be resized and moved, icons representing files and programs, menus of available options, and a pointer for selecting. A graphical interface is easier for most people to learn; a command line interface uses typed commands, needs more knowledge, but can be faster for an expert and easier to automate.

Operating system
the software that manages the hardware and provides an environment in which other programs can run

Memory management and multitasking

This is the function examined in most detail, and the specification breaks it into three parts.

The transfer of data between memory. The operating system moves programs and data from secondary storage into RAM when they are needed, and back out again when they are not — which is the virtual memory mechanism from 1.2.1.

The allocation of memory to applications. Each running program is given its own area of memory. Keeping them separate matters: one program cannot then read or overwrite another's data, so a crash in one does not corrupt the others.

How it allows for multitasking. A single processor core can only execute one instruction at a time. The operating system switches rapidly between programs, giving each a small slice of processor time in turn. Because the switching happens thousands of times a second, the programs appear to run simultaneously even though they are taking turns.

Peripheral management and drivers. Data is transferred between devices and the processor, and that process needs to be managed — otherwise two devices might try to communicate at once.

A driver is software that translates between the operating system and a specific piece of hardware. Every printer and graphics card works slightly differently, so each needs its own driver. The operating system sends a general instruction such as "print this", and the driver converts it into the exact signals that particular device understands. That is why a new device often requires a driver to be installed before it will work.

Understanding of paging or segmentation is not required.

User and file management

User management covers everything to do with who is using the machine:

• Allocation of an account, with a username and password • Access rights, controlling which files and settings each user can reach — the same idea as the user access levels in 1.4.2 • Security, including log-in, and keeping each user's files separate and private from other users of the same computer

File management covers the organisation of stored data:

• Naming files, and enforcing the rules about what a name may contain • Allocating files to folders, and creating a directory structure • Moving, copying, renaming and deleting files • Saving, opening and setting permissions • Keeping track of where each file physically sits on the storage device, so the user never has to know

Worked example

A user has a music player, a browser and a word processor open at once on a single-core computer. Explain how the operating system allows this.

  1. State the constraint: a single core can only execute one instruction at a time, so genuine simultaneous execution is impossible.
  2. The operating system allocates each program its own separate area of memory.
  3. It then switches rapidly between the three, giving each a small slice of processor time in turn.
  4. The switching happens so quickly that the user perceives them as running together.
  5. Add the memory point, since the specification asks for it: if RAM fills, data not currently in use is moved to secondary storage.

Answer: The operating system allocates each program its own area of memory and then switches between them rapidly, giving each a slice of processor time. Because the switching happens thousands of times a second, the programs appear to run at the same time even though only one instruction is executing at any instant. If RAM fills up, data not currently needed is transferred out to secondary storage.

Common mistake

Multitasking on a single core is programs taking turns very quickly, not running simultaneously. Saying they run at the same time misses exactly the idea the question is testing.

Before you practise

  • The five functions: user interface, memory management and multitasking, peripheral management and drivers, user management, file management.
  • Memory management transfers data between memory, allocates memory to each application, and enables multitasking.
  • Separate memory areas stop one program reading or corrupting another's data.
  • Multitasking on one core is rapid switching between programs, not simultaneous execution.
  • A driver translates between the operating system and one specific device.
  • User management covers accounts, access rights and security.
  • File management covers naming, folders, moving, saving and tracking where files physically sit.
  • Paging and segmentation are not required.

Now practise it

Reading is the easy half. Answer questions on 1.5.1 Operating systems and find out which parts you actually know.