Edexcel International Advanced Level Computer Science, point 1.2.1
Definition
The operating system (OS) is system software that manages the computer's hardware and resources, and provides services to application programs and users. Examples are Windows, macOS, Linux, Android and iOS.
Function
It sits between the hardware and the user (and applications), hiding the complexity of the hardware and sharing the resources fairly and safely.
Why it is needed
Without an OS, every program would have to control the hardware itself, programs could overwrite each other's memory, only one program could run at a time, and users would have to talk to the machine in binary. The OS makes the computer usable, efficient and secure.
Characteristics and jobs
a. User interface
- Function: lets the user communicate with the computer.
- Types:
- Command-line interface (CLI): the user types commands. It's powerful and uses little memory, but needs commands to be learnt.
- Graphical user interface (GUI): windows, icons, menus and a pointer. It's easy to learn, but uses more memory and processing power.
- Touch, voice and menu-driven interfaces on phones, tablets and appliances.
b. User management
- Function: controls who can use the system and what they may do.
- Features: user accounts, passwords and authentication, access rights and permissions on files and resources, separate user spaces, and logging of activity.
- Why: it protects data and privacy, and lets several people share one computer safely.
c. Peripheral management
- Function: controls the input, output and storage devices connected to the computer.
- Features:
- Device drivers: small programs that let the OS communicate with a particular device.
- Sharing devices: when several programs want the same device (such as a printer), the OS manages their requests so they don't interfere with each other.
- Sending and receiving data at the right time, using buffers (temporary memory that smooths the difference in speed between the fast CPU and slow devices; more in 11.2.1).
- Spooling: jobs (such as print jobs) are saved on disk and queued, so the CPU needn't wait for a slow printer.
- Interrupt handling: devices signal the CPU when they need attention (1.2.2).
- Plug and play: detecting new devices and loading the right driver.
d. Process management
- Function: decides which programs (processes) run, when and for how long, so that several can appear to run at once (multitasking, 1.2.2).
- Features:
- Starting and stopping processes: creating a process when a program is opened, and ending it when it is closed.
- Scheduling them (1.2.3), so that they share the CPU fairly, with context switches between them.
- Prioritising: more important tasks get more processor time (for example, an anti-malware scan that has found a threat).
- Allocating resources: giving each process the memory and devices it needs to finish its task, and resolving conflicts over shared resources.
- Keeping processes separate, so that if one fails or crashes, it doesn't bring down the others or the whole system.
e. Memory management
- Function: allocates main memory (RAM) to programs, and keeps each program's memory separate and protected.
- Features: tracking which memory is in use, paging, segmentation and virtual memory (1.2.4), and freeing memory when a program ends.
Other roles
These aren't among the five roles in the specification, but an exam question asking for the purposes of an OS will usually accept them as well.
- File management: organising files in folders, with names, locations, permissions and free-space tracking.
- Security: protecting against unauthorised access and malware, often with a firewall and updates.
- Utilities: tools such as disk clean-up, backup and anti-malware.
- Providing an interface for programs (system calls and an API) so that programmers needn't write code for each device.
Worked example
Task: a user plays music while printing a report and browsing the web on a shared family computer. State which OS roles are involved.
| Activity | OS role |
|---|---|
| Logging in to their own account, with their files private | User management |
| Clicking icons and windows to start each program | User interface (GUI) |
| Sending the report to the printer, which is slow, so the OS queues it (spooling) and uses the printer driver | Peripheral management |
| Running the music player, browser and word processor apparently at once, giving each a share of CPU time | Process management |
| Giving each program its own area of RAM so that a crash in the browser doesn't corrupt the document | Memory management |
Exam tip: a question may name some purposes of an OS and ask for others, for example "memory management and multitasking are two purposes; give two more". Don't repeat the ones in the question: give roles such as user interface, user management, peripheral management or process management. When asked to describe a role, say what it does and give a feature, tied to the example in the question.
Check yourself
What is an operating system?
System software that manages the computer's hardware and resources, and provides services for application programs and users.
Name the five roles of the OS in the specification
User interface, user management, peripheral management, process management and memory management.
What is the job of a device driver?
It lets the operating system communicate with, and control, a particular hardware device.
Give one advantage and one disadvantage of a GUI compared with a CLI
Advantage: easy to learn and use. Disadvantage: uses more memory and processing power (and is slower to use for experts doing repeated tasks).
Why does the OS use spooling for printing?
Print jobs are saved to disk and queued, so the CPU and the user's program don't have to wait for the slow printer.