What is an operating system? Why is an operating system required?
Definition
An operating system (OS) is a system software that acts as an intermediary between the user and the computer hardware. It is a program that manages all the resources of a computer system — CPU, memory, storage, and I/O devices — and provides an environment in which user programs can execute conveniently and efficiently.
Famous definitions: “An OS is a program that controls the execution of application programs and acts as an interface between the user and the computer hardware” and Tanenbaum's view — “the OS is the government: it provides an environment in which other programs can do useful work.”
Why is an OS required?
- Convenience — hardware is low-level and hard to use directly; the OS offers simple abstractions (files, folders, windows, processes) through a user interface (CLI/GUI).
- Process management — creates, schedules, and terminates processes; allows multiprogramming so the CPU is never idle.
- Memory management — allocates and frees main memory among programs, protecting them from each other.
- Resource allocation & sharing — fairly distributes CPU time, memory, devices and files among competing users/programs.
- File management — organises data into files and directories on storage devices and controls access to them.
- I/O handling — hides the complexity of device controllers and drivers behind uniform system calls.
- Protection & security — isolates users and processes, prevents unauthorised access to data and resources.
- Error detection & handling — constantly monitors the system for errors (CPU, memory, devices) and takes corrective action.
- Accounting & performance — keeps statistics on resource usage for billing, tuning and planning.