What an operating system does
The operating system is the software layer between hardware and applications. It shares the machine fairly, keeps programs apart, and gives them simple ways to use complex hardware.
Role of the operating system
An operating system (OS) manages hardware resources and provides services to programs. It decides which program runs on the processor, allocates memory, controls storage and devices, and provides a user interface. Common examples are Windows, macOS, Linux, Android (built on Linux), and iOS.
The kernel
The kernel is the core of the OS, always resident in memory and running with full hardware privileges. It handles process scheduling, memory management, device drivers, and system calls. Around it sit system utilities, libraries, and the user interface, which run with fewer privileges.
User mode and kernel mode
Processors support at least two privilege levels. Applications run in user mode, where they cannot directly touch hardware or other programs' memory. The kernel runs in kernel mode with full access. When a program needs a privileged service, such as reading a file, it makes a system call, which safely switches into kernel mode and back.
System calls
System calls are the OS's programming interface: open, read, and write a file; create a process; send network data; ask for memory. Programmers usually reach them through libraries; for example, a Python print statement eventually becomes a write system call. Limiting access to this narrow doorway is a key security feature.
Device drivers
Every kind of hardware works differently. A device driver is software that lets the OS control a specific device, such as a graphics card, printer, or Wi-Fi chip, through a standard interface. Faulty drivers were historically a major cause of crashes because they run with kernel privileges.
User interfaces
Operating systems offer command-line interfaces, where users type commands into a shell such as Bash or PowerShell, and graphical user interfaces (GUIs) with windows, icons, menus, and pointers. Mobile operating systems are built around touch. Command lines remain powerful for automation and administration.
Booting
When a computer starts, firmware (UEFI or BIOS) runs hardware checks and loads a boot loader from storage. The boot loader loads the kernel into memory, the kernel initialises hardware and drivers, and then starts the first user-mode process, which launches services and the login screen.
Worked example
When you double-click a document, the GUI asks the OS to start the word-processor program. The kernel creates a process, allocates memory, and loads the program's code from storage. The program makes system calls to open the document file; the kernel checks permissions, uses the storage driver to read the data, and returns it. The program then asks the OS to draw a window on screen.
Key takeaways
The OS manages the processor, memory, storage, and devices and provides a user interface. The kernel is its privileged core. Applications run in user mode and request services through system calls that switch into kernel mode. Device drivers let the OS control specific hardware. Users interact through command lines or GUIs. Booting moves from firmware to boot loader to kernel to user processes.
Flashcard
Software managing hardware and serving programs
Check your understanding
Why do applications use system calls instead of accessing hardware directly?
