An Operating System is the main software of a computer that controls all its activities and enables users to interact with the hardware.
Examples of Operating Systems
- Microsoft Windows
- Linux
- macOS
- Android
- iOS
2. Purpose of an Operating System
The main purpose of an Operating System is to make the computer system convenient, efficient, and secure.
Objectives of an Operating System
- Resource Management – Manages CPU, memory, storage, and I/O devices.
- User Interface – Provides Graphical User Interface (GUI) or Command Line Interface (CLI).
- Program Execution – Loads and executes application programs.
- File Management – Organizes files and directories.
- Memory Management – Allocates and deallocates memory.
- Device Management – Controls peripheral devices like printers and keyboards.
- Security – Protects the system from unauthorized access.
- Error Handling – Detects and handles system errors.
3. Operating System Structure
The Operating System is organized into different layers that interact with users, applications, and hardware.
Structure Diagram
+-----------------------------+
| Users |
+-----------------------------+
|
v
+-----------------------------+
| Application Programs |
| (Browser, MS Word, Games) |
+-----------------------------+
|
v
+-----------------------------+
| Operating System |
| • Process Management |
| • Memory Management |
| • File Management |
| • Device Management |
| • Security |
+-----------------------------+
|
v
+-----------------------------+
| Computer Hardware |
| CPU, RAM, Disk, I/O Devices |
+-----------------------------+
Components of OS Structure
- Kernel – Core part of the operating system that manages hardware resources.
- Shell – Interface between the user and the kernel.
- File System – Manages files and directories.
- Device Drivers – Enable communication with hardware devices.
- System Libraries – Provide services to application programs.
4. Operating System Operations
An Operating System performs several important operations to manage system resources efficiently.
A. Process Management
- Creates and terminates processes.
- Schedules CPU time.
- Supports multitasking.
B. Memory Management
- Allocates memory to programs.
- Frees memory after program execution.
- Supports virtual memory.
C. File Management
- Creates, deletes, and organizes files.
- Controls file access permissions.
D. Device Management
- Controls input/output devices.
- Uses device drivers for communication.
E. Security Management
- User authentication
- Password protection
- Access control
5. Dual-Mode Operation
Modern operating systems use Dual Mode to protect the computer system.
There are two execution modes:
1. User Mode
- Used for application programs.
- Has limited privileges.
- Cannot directly access hardware.
- Safer because it prevents accidental damage to the system.
2. Kernel Mode (Supervisor Mode)
- Used by the operating system.
- Has full access to hardware and memory.
- Executes privileged instructions.
Diagram
+----------------------+
| User Mode |
| (Applications) |
+----------+-----------+
|
System Call
|
v
+----------------------+
| Kernel Mode |
| (Operating System) |
+----------------------+
Advantages of Dual Mode
- Protects the operating system.
- Prevents unauthorized hardware access.
- Improves system security.
- Enhances system stability.
6. Multi-Mode Operation
Some modern processors support multiple privilege levels instead of only two modes.
Example Privilege Levels
- User Mode
- Supervisor Mode
- Hypervisor Mode (used in virtualization)
- Machine/Firmware Mode
Advantages
- Better security.
- Fine-grained access control.
- Supports virtualization technologies.
- Efficient management of different system components.
7. Operating System as a Resource Manager
The Operating System acts as a Resource Manager because it controls and allocates all computer resources among multiple users and programs.
Resources Managed by the OS
| Resource | Function |
|---|---|
| CPU | Schedules processes for execution |
| Memory | Allocates and frees RAM |
| Storage | Manages files and disks |
| Input/Output Devices | Controls keyboards, printers, monitors, etc. |
| Network | Manages communication and data transfer |
Responsibilities
- Allocates resources efficiently.
- Prevents resource conflicts.
- Maximizes system performance.
- Ensures fair resource sharing.
- Protects resources from unauthorized access.
Resource Management Diagram
Operating System
|
-------------------------------------------------
| | | | |
CPU Memory Files Devices Network
| | | | |
Users and Application Programs Access Resources
Advantages of an Operating System
- Easy interaction between users and hardware.
- Efficient utilization of system resources.
- Supports multitasking and multiprocessing.
- Provides security and protection.
- Improves system performance and reliability.
- Simplifies application development.
