OCR H446, section 1.2.1 (a)
What is an operating system?
An operating system (OS) is the main piece of system software. It sits between the hardware and the user and application programs, managing the computer's resources and making it usable. Windows, macOS, Linux, Android and iOS are operating systems.
The need for an operating system
Without an OS, every program would have to:
- know how to control every kind of hardware (every disk, printer and screen);
- share the processor and memory with other programs without a clash;
- look after its own files and security.
That would make programs huge, hard to write, and unable to run together. The OS provides these services once, for every program.
The purpose of the OS
- Hide the complexity of the hardware. Programs ask the OS to "save a file" or "print this", and the OS works out how, using the right device drivers (see 1.2.1 (g)). This is abstraction.
- Manage the computer's resources (processor, memory, storage and devices), and share them fairly between programs and users.
- Provide a platform on which application software can run, through a standard set of services (an application programming interface, API).
- Provide an interface so that people can use the computer.
The functions of an operating system
| Function | What it does |
|---|---|
| Processor management | Decides which process uses the processor, and for how long, using scheduling (1.2.1 (d)). Lets several programs run (multitasking) |
| Memory management | Allocates RAM to programs, keeps programs apart, and uses virtual memory when RAM is full (1.2.1 (b)) |
| Input and output management | Controls devices through drivers, queues print jobs, and uses buffers for slow devices |
| File management | Organises files and folders, keeps track of where data is on the disk, and controls how it is opened, copied, moved and deleted |
| Security | User accounts and passwords, permissions on files, and protecting one program from another |
| User interface | A graphical interface (windows, icons, menus), a command line, or a touch interface |
| Interrupt handling | Responds to interrupts from devices and programs (1.2.1 (c)) |
| Error handling and logging | Deals with faults and keeps records of what happened |
| Running utilities | Provides and runs tools such as a file manager and a task manager |
The kernel
The kernel is the core of the OS. It is always in memory, and it carries out the most important functions: managing the processor, memory and devices, and handling interrupts. Other parts of the OS, and applications, use the kernel's services.
Worked example
Task: two programs are running, and both want to save a file and print a document at the same time. Describe how the OS handles it.
- Processor: the OS schedules both programs, giving each short turns on the processor, so they appear to run together.
- Memory: each program is given its own area of RAM, and the OS stops one from overwriting the other.
- Files: the OS asks the disk driver to write each file, and records where each one is stored. It uses file permissions to control who can open them.
- Printing: the print jobs are put in a queue, so that they are printed one at a time and don't get mixed up, using the printer driver to convert the data into the form that this printer understands.
The programs themselves never need to know how the disk or printer works.
Exam tip: name the function and say what the OS does for it, with a short example. Remember the two big ideas: it hides the complexity of the hardware, and it manages and shares resources between programs.
Check yourself
Why does a computer need an operating system?
It manages the hardware and shares resources between programs, so that every program doesn't have to control the hardware itself, and so that several programs can run together safely.
Give three functions of an operating system
Any three of: processor management; memory management; input and output (device) management; file management; security; providing a user interface.
How does the OS hide the complexity of the hardware?
It gives programs a simple, standard way to ask for services, and uses device drivers to turn those requests into the instructions that each particular device needs.
What is the kernel?
The central part of the operating system, always in memory, that manages the processor, memory and devices and handles interrupts.