Operating Systems
Overview
An Operating System (OS) is a critical component of any computer system, acting as a bridge between the hardware and the user. It manages hardware resources, provides a platform for running software, and offers an interface for user interaction. Without an OS, users would need to interact with computer hardware directly, which is complex and impractical. Understanding the role and functions of an operating system is essential in recognising how software applications interact with hardware and how tasks are coordinated within a computer.
Why Operating Systems Are Needed
- Hardware Control: The OS allows users and applications to access and control the hardware without needing to understand the low-level workings of each device.
- Multi-tasking: Modern computers run multiple applications at once, and the OS manages these tasks efficiently, allocating resources as needed.
- User Interface: The OS provides a user interface (e.g., graphical or command-line) that makes interaction with the computer easier and more intuitive.
Main Functions of an Operating System
Resource Management
- CPU Management: The OS schedules processes to ensure that each application receives sufficient CPU time and runs efficiently. It allocates CPU time through scheduling algorithms like round-robin or priority-based scheduling.
- Memory Management: The OS manages both the RAM and virtual memory, allocating space for applications and freeing it when no longer needed to avoid memory leaks or crashes.
- Device Management: Through device drivers, the OS manages hardware devices (e.g., printers, keyboards) and ensures they operate correctly with the rest of the system.
File Management
- The OS provides a structured way to store, retrieve, and manage data on storage devices. It organises files in a hierarchy of directories, manages file permissions, and handles operations such as creating, reading, writing, and deleting files.
Interrupt Handling
- Interrupts are signals sent to the CPU, usually from hardware or software, indicating that immediate attention is needed (e.g. when a printer finishes printing).
- The OS detects these signals and temporarily pauses the current process to address the interrupt, ensuring smooth performance and responsiveness.
Security and Access Control
- The OS enforces security through user authentication (e.g., passwords, biometrics) and access control. It restricts access to sensitive files and system settings, protecting the system from unauthorised access or malware.
- Advanced security features may include firewall management and encryption tools to safeguard data.
Providing a Platform for Software
- The OS serves as a platform where software applications can run. It offers APIs (Application Programming Interfaces) for developers to interact with system resources like memory, file storage, and networking.
- This platform simplifies software development and ensures compatibility across different hardware configurations.
User Interface (UI)
- Operating systems provide a UI to make interacting with the computer intuitive. Common types of UIs include:
- Graphical User Interface (GUI): Uses windows, icons, and menus to allow users to interact with the system visually (e.g., Windows, macOS).
- Command-Line Interface (CLI): Users type commands to perform tasks, offering direct control but requiring more knowledge of commands (e.g., Linux CLI).
Utility Programs
- An OS includes built-in utilities that help maintain and optimise the system, such as disk cleanup tools, file backup utilities, and antivirus programs. These utilities are crucial for system maintenance and performance.
Examples
- Resource Management Example:
- Suppose a user opens a web browser, a word processor, and a music player simultaneously. The OS manages CPU time to ensure all three applications get processing time, allocates separate memory spaces for each, and controls sound output to avoid conflicts.
- File Management Example:
- When saving a document, the OS organises it into the appropriate folder and assigns permissions (e.g., "read-only" or "editable") to ensure it is accessible and secure.
- Interrupt Handling Example:
- If a user presses a key, the keyboard sends an interrupt to the OS, which prioritises processing the key press and sends it to the active application (like a word processor).
Note Summary