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

CategoryExamples
Desktop OSMicrosoft Windows, macOS, Ubuntu
Mobile OSAndroid, iOS
Server OSUNIX, 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

ObjectiveDetailExample
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.

ProgramMemory Allocated
Browser2 GB RAM
Music Player200 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
OSShell Examples
WindowsPowerShell, Command Prompt
LinuxBash, Zsh

3. File System

Manages storage devices, directories, and files.

File SystemUsed In
NTFSWindows
FAT32USB drives, older Windows
ext4Linux

4. Device Drivers

Software that helps the OS communicate with hardware.

Driver TypeControls
Printer DriverPrinter hardware
Graphics DriverGPU / display hardware
Sound DriverAudio hardware

Without drivers: Hardware cannot function properly.

5. System Utilities

Provide maintenance services for the system.

UtilityPurpose
Disk CleanupFrees up storage space
AntivirusProtects from malicious software
Backup ToolsCreates 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.

FeatureDetail
User InteractionNo user interaction during execution
ProcessingJobs processed one after another
ExamplePayroll processing
AdvantageEfficient for repetitive jobs
DisadvantageLong 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 TypeKey FeatureExample
Batch OSJobs in batches, no user interactionPayroll
Multiprogramming OSMultiple programs in memoryBrowser + Word + Calculator
Multitasking OSApparent parallel executionMusic + Browsing
Multiuser OSMultiple users at onceUNIX
Multiprocessing OSMultiple CPUsModern servers
RTOSGuaranteed time responseAir Traffic Control
Distributed OSMultiple computers as oneCloud systems

7. Evolution of Operating Systems

GenerationPeriodCharacteristics
First Generation1940–1955No OS, manual operation
Second Generation1955–1965Batch systems introduced
Third Generation1965–1980Multiprogramming, time sharing
Fourth Generation1980–PresentGUI, 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

FeatureCLIGUI
InputCommandsMouse / Touch
LearningDifficultEasy
SpeedFasterSlower
ResourcesLessMore

PSC / Exam One-Liners

TermDefinition
OSSoftware that acts as an interface between user and hardware
KernelCore of the operating system
ShellInterface between user and kernel
DriverSoftware enabling communication between OS and hardware
MultiprogrammingMultiple programs kept in memory simultaneously
MultitaskingRunning multiple tasks apparently at the same time
MultiprocessingUsing multiple CPUs
RTOSOperating system that guarantees response within a specified time

Memory Tricks

MnemonicFull 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