Chapter 1: Foundations of Operating Systems
Phase 1: Introduction, Principles, Components and Usage
1. What is an Operating System?
Definition
An Operating System (OS) is system software that acts as an intermediary between the user and computer hardware. It manages all hardware resources and provides services to application programs.
| Simple Definition |
|---|
| Operating System = Manager of the Computer |
| Without an OS, a computer is merely a collection of hardware components. |
Examples of Operating Systems
| Category | Examples |
|---|---|
| Desktop OS | Microsoft Windows, macOS, Ubuntu |
| Mobile OS | Android, iOS |
| Server OS | UNIX, Red Hat Enterprise Linux |
Why Do We Need an Operating System?
Imagine using a computer without an OS. To print a document, you would have to:
- Communicate directly with the printer hardware.
- Manage memory manually.
- Manage CPU allocation yourself.
This would be extremely difficult. The OS performs these tasks automatically.
2. Major Objectives of an Operating System
| Objective | Detail | Example |
|---|---|---|
| 1. Convenience | Makes computers easier to use | Double-clicking a file instead of manually loading it into memory |
| 2. Efficiency | Utilizes hardware resources efficiently | Running multiple applications simultaneously |
| 3. Resource Management | Manages CPU, Memory, Storage, I/O devices | Allocating RAM to different programs |
| 4. Security | Protects files, applications, user data | Password-protected accounts |
3. Functions of an Operating System
A very common PSC and university question.
1. Process Management
Manages creation, execution, scheduling, and termination of processes.
Example: Running Chrome, VS Code, and Music Player simultaneously.
2. Memory Management
Allocates memory to programs based on their requirements.
| Program | Memory Allocated |
|---|---|
| Browser | 2 GB RAM |
| Music Player | 200 MB RAM |
3. File Management
Organizes files, folders, and directories on storage devices.
| Example Directory Structure |
|---|
| Documents/ |
| Photos/ |
| Videos/ |
4. Device Management
Controls hardware devices through drivers: Keyboard, Mouse, Printer, Scanner.
5. Security and Protection
Provides login authentication, file permissions, and encryption support to protect data.
6. User Interface
Allows interaction between user and computer through:
- GUI β Graphical User Interface
- CLI β Command Line Interface
4. Components of an Operating System
Think of the OS as a house β each component has a specific role.
1. Kernel
The kernel is the core part of the operating system. It directly communicates with hardware.
| Responsibilities |
|---|
| CPU management |
| Memory management |
| Device management |
| Process management |
Important Fact: Kernel is always loaded into memory.
π Exam Point: Kernel = Heart of OS
2. Shell
Shell is the interface between user and kernel.
| Flow |
|---|
| User β Shell β Kernel β Hardware |
| OS | Shell Examples |
|---|---|
| Windows | PowerShell, Command Prompt |
| Linux | Bash, Zsh |
3. File System
Manages storage devices, directories, and files.
| File System | Used In |
|---|---|
| NTFS | Windows |
| FAT32 | USB drives, older Windows |
| ext4 | Linux |
4. Device Drivers
Software that helps the OS communicate with hardware.
| Driver Type | Controls |
|---|---|
| Printer Driver | Printer hardware |
| Graphics Driver | GPU / display hardware |
| Sound Driver | Audio hardware |
Without drivers: Hardware cannot function properly.
5. System Utilities
Provide maintenance services for the system.
| Utility | Purpose |
|---|---|
| Disk Cleanup | Frees up storage space |
| Antivirus | Protects from malicious software |
| Backup Tools | Creates copies of important data |
5. Structure of a Computer System
| Layer |
|---|
| User |
| β Application Programs |
| β Operating System |
| β Hardware |
The OS sits between hardware and application programs, managing resources for everything above it.
6. Types of Operating Systems
Very important for exams.
1. Batch Operating System
Concept: Jobs are collected and executed in batches.
| Feature | Detail |
|---|---|
| User Interaction | No user interaction during execution |
| Processing | Jobs processed one after another |
| Example | Payroll processing |
| Advantage | Efficient for repetitive jobs |
| Disadvantage | Long waiting time |
2. Multiprogramming OS
Concept: Multiple programs remain in memory simultaneously. CPU switches between them.
Goal: Increase CPU utilization.
Example: Opening Browser, Word, and Calculator together.
3. Multitasking OS
Concept: Allows multiple tasks to run apparently at the same time.
Example: Listening to music while browsing the internet and typing notes.
4. Multiuser OS
Concept: Multiple users use the same system simultaneously.
Example: UNIX servers.
5. Multiprocessing OS
Concept: Uses multiple CPUs to process tasks.
Example: Modern servers.
6. Real-Time Operating System (RTOS)
Concept: Provides immediate, guaranteed response within a specified time.
| Examples |
|---|
| Air Traffic Control |
| Medical Equipment |
| Industrial Robots |
7. Distributed Operating System
Concept: Multiple computers work together as one unified system.
| OS Type | Key Feature | Example |
|---|---|---|
| Batch OS | Jobs in batches, no user interaction | Payroll |
| Multiprogramming OS | Multiple programs in memory | Browser + Word + Calculator |
| Multitasking OS | Apparent parallel execution | Music + Browsing |
| Multiuser OS | Multiple users at once | UNIX |
| Multiprocessing OS | Multiple CPUs | Modern servers |
| RTOS | Guaranteed time response | Air Traffic Control |
| Distributed OS | Multiple computers as one | Cloud systems |
7. Evolution of Operating Systems
| Generation | Period | Characteristics |
|---|---|---|
| First Generation | 1940β1955 | No OS, manual operation |
| Second Generation | 1955β1965 | Batch systems introduced |
| Third Generation | 1965β1980 | Multiprogramming, time sharing |
| Fourth Generation | 1980βPresent | GUI, networking, internet, multiprocessing |
8. User Interface Types
CLI β Command Line Interface
User enters text commands directly.
| Example Commands |
|---|
dir β list files (Windows) |
cd β change directory |
mkdir β create directory |
Advantages: Fast, powerful. Disadvantages: Hard to learn.
GUI β Graphical User Interface
Uses windows, icons, menus, and pointer (WIMP) for interaction.
Advantages: Easy to use. Disadvantages: More resource consumption.
Quick Comparison Table
| Feature | CLI | GUI |
|---|---|---|
| Input | Commands | Mouse / Touch |
| Learning | Difficult | Easy |
| Speed | Faster | Slower |
| Resources | Less | More |
PSC / Exam One-Liners
| Term | Definition |
|---|---|
| OS | Software that acts as an interface between user and hardware |
| Kernel | Core of the operating system |
| Shell | Interface between user and kernel |
| Driver | Software enabling communication between OS and hardware |
| Multiprogramming | Multiple programs kept in memory simultaneously |
| Multitasking | Running multiple tasks apparently at the same time |
| Multiprocessing | Using multiple CPUs |
| RTOS | Operating system that guarantees response within a specified time |
Memory Tricks
| Mnemonic | Full Form |
|---|---|
| Main Functions of OS β PMFDSP |
P β Process Management M β Memory Management F β File Management D β Device Management S β Security P β Protection |
| OS Components β KSFDU |
K β Kernel S β Shell F β File System D β Drivers U β Utilities |
Practice MCQs
-
1. Which component is the heart of an operating system?
A. Shell B. Driver C. Kernel D. Utility
β Answer: C β Kernel -
2. Which OS type is used in air traffic control systems?
A. Batch OS B. Multiprogramming OS C. RTOS D. Distributed OS
β Answer: C β RTOS -
3. Which component acts as an interface between user and kernel?
A. Driver B. Shell C. CPU D. File System
β Answer: B β Shell -
4. Which OS objective focuses on efficient utilization of hardware resources?
A. Security B. Convenience C. Efficiency D. Protection
β Answer: C β Efficiency