Introduction to Information TechnologyUnit 48 min read
Operating Systems: Core Functions, Types & Real-World Roles
Unit 4 of Introduction to Information Technology covers the definition, objectives, and core functions (process, memory, file management) of operating systems, compares system vs. application software, classifies OS types (batch, time-sharing, distributed, etc.), and explores real-world applications in Nepalese tech (e
1. What is an Operating System (OS)?
An operating system (OS) is the system software that acts as an interface between hardware and user applications. It manages hardware resources (CPU, memory, I/O devices) and provides services like process scheduling, memory allocation, and file management.
Key Functions of an OS
mindmap
root((Operating System Functions))
Process Management
CPU Scheduling
Process Creation/Termination
Inter-Process Communication
Memory Management
Allocation (Partitioning, Paging)
Protection (Segments, Swapping)
File Management
File System Organization
Directory Structure
Access Control
Device Management
I/O Scheduling
Buffering/Caching
Security & Protection
Authentication
Access ControlWhy Do We Need an OS?
- Resource Allocation: Ensures fair sharing of CPU, memory, and storage.
- Abstraction: Hides hardware complexity (e.g., users don’t need to know how a hard disk works).
- Security: Prevents unauthorized access (e.g., user permissions in Windows/Linux).
- Convenience: Provides a user-friendly interface (GUI or CLI).
2. System Software vs. Application Software
| Feature | System Software | Application Software |
|---|---|---|
| Purpose | Manages hardware/software resources | Performs specific tasks for users |
| Examples | Windows, Linux, macOS, Device Drivers | Microsoft Word, Chrome, Photoshop |
| Dependency | Runs without user intervention | Requires OS to function |
| Classification | OS, Utilities, Language Processors | Productivity, Entertainment, Utilities |
Real-World Example:
- eSewa (Nepal’s digital payment app) relies on system software (Linux servers, database managers) to process transactions securely, while its mobile app is application software for users.
3. Types of Operating Systems
Classification by Function
classDiagram
class OS {
<<abstract>>
+manageResources()
}
class BatchOS {
+executeJobsInBatches()
}
class TimeSharingOS {
+shareCPUAmongUsers()
}
class DistributedOS {
+manageMultipleComputersAsOne()
}
class RealTimeOS {
+guaranteeResponseTime()
}
class MobileOS {
+optimizedForPortability()
}
OS <|-- BatchOS
OS <|-- TimeSharingOS
OS <|-- DistributedOS
OS <|-- RealTimeOS
OS <|-- MobileOSExamples in Nepal
| OS Type | Example | Use Case |
|---|---|---|
| Batch OS | Old NTC billing systems | Process invoices in bulk overnight |
| Time-Sharing | Linux servers at Ncell | Handle thousands of mobile data requests |
| Distributed | Daraz’s cloud infrastructure | Balance load across global servers |
| Real-Time | Traffic signal controllers | Ensure split-second response for safety |
| Mobile | Android/iOS in Pathao app | Manage rides, payments, and GPS in real time |
4. Core OS Functions Explained
A. Process Management
Process: A program in execution (e.g., a user running Excel while Chrome plays a video). Key Concepts:
- Process States: New → Ready → Running → Waiting → Terminated.
- CPU Scheduling Algorithms:
- FCFS (First-Come-First-Served): Simple but causes convoy effect (long jobs delay short ones).
- SJF (Shortest Job First): Optimal but requires knowing job lengths.
- Round Robin: Fair time-slicing (used in Linux).
Worked Example: Bank Loan Processing Scenario: A bank’s OS schedules loan approval processes. If 3 loans arrive with CPU bursts of 5, 3, and 8 units:
- FCFS Order: Total waiting time = (3+8) + (8) = 19 units.
- SJF Order: Total waiting time = (5) + (5) = 10 units (better efficiency).
B. Memory Management
Memory Hierarchy:
CPU Registers → Cache → RAM → Secondary Storage (HDD/SSD)
Techniques:
- Partitioning: Divides memory into fixed/variable-sized blocks (prone to fragmentation).
- Paging: Splits memory into fixed-size pages (reduces external fragmentation).
- Swapping: Moves inactive pages to disk (slow but saves RAM).
Real-World Example: Daraz’s Server Load Daraz uses paging to allocate memory dynamically for thousands of simultaneous orders. If a user’s cart crashes, the OS swaps out inactive pages to prioritize active transactions.
C. File Management
File System Structure:
Root Directory
├── User Files
├── System Files
└── Applications
Key Operations:
- File Allocation Table (FAT): Tracks clusters used by files (used in older USB drives).
- Inode (Linux/Unix): Stores file metadata (permissions, size, location).
5. Input/Output (I/O) System
I/O Ports: Hardware interfaces (e.g., USB, Ethernet) managed by OS drivers. I/O Scheduling:
- Elevator Algorithm: Minimizes disk head movement (like a subway train stopping at stations in order).
- Interrupts: Signals CPU when I/O completes (e.g., pressing "Enter" triggers a keyboard interrupt).
Example: NTC’s Billing System When you pay an electricity bill via eSewa, the OS schedules I/O operations:
- Your payment request → Network I/O (sent to NTC’s server).
- Server processes request → Disk I/O (reads/writes your bill data).
- Response sent back → Display I/O (shows "Payment Successful").
6. Security and Protection
Mechanisms:
- User Authentication: Passwords, biometrics (e.g., Ncell’s fingerprint login).
- Access Control Lists (ACLs): Define who can read/write files (e.g., bank employees accessing loan data).
- Firewalls: Block unauthorized network access (used in NEPSE’s trading servers).
Real-World Example: Kathmandu Traffic Management Smart traffic lights use a real-time OS to prioritize emergency vehicles. The OS:
- Detects police/fire trucks via sensors (I/O).
- Adjusts signal timings (process scheduling).
- Logs data for future optimization (file management).
In the Real World
eSewa’s Transaction Queue
- Idea Used: Process Scheduling (Round Robin)
- How: When thousands of users pay bills simultaneously, eSewa’s OS uses time-slicing to ensure no transaction is starved. Each payment gets a short CPU burst before the next, preventing crashes during peak hours (e.g., 6–9 PM).
Daraz’s Server Load Balancing
- Idea Used: Distributed OS + Memory Management (Paging)
- How: Daraz’s cloud servers (AWS/Azure) run a distributed OS to split user requests across multiple machines. If one server runs out of RAM, the OS pages out inactive order data to disk and loads it back when needed, keeping checkout pages fast.
Ncell’s Mobile Data Routing
- Idea Used: Real-Time OS + I/O Scheduling
- How: Ncell’s core network uses a real-time OS to prioritize voice calls over data downloads during network congestion. The OS’s elevator algorithm minimizes delays for critical I/O (e.g., emergency calls) while buffering less urgent data (e.g., YouTube videos).
Exam Tip
Definitions Matter: Memorize key terms like:
- Process: A program in execution.
- Thread: Lightweight process sharing memory.
- Fragmentation: Wasted memory due to uneven allocation.
Compare OS Types: Always link examples to Nepalese tech:
- Batch OS: "Like NTC’s old billing system processing invoices overnight."
- Time-Sharing: "Like Linux servers handling Ncell’s mobile data requests."
Worked Examples Are Gold:
- For CPU scheduling, calculate waiting times for FCFS/SJF.
- For memory management, sketch a paging table with page numbers and frames.
Diagrams Save Marks:
- Draw process states (New → Ready → Running → Waiting → Terminated).
- Sketch memory partitioning vs. paging with labeled blocks.
Real-World Tie-Ins:
- If asked about security, mention eSewa’s two-factor authentication (OTP + password).
- For I/O, describe Pathao’s GPS data being read/written by the OS during ride matching.
Visual Summary:
flowchart TD
A["User Request"] --> B["OS Kernel"]
B --> C["Process Scheduler"]
B --> D["Memory Manager"]
B --> E["File System"]
B --> F["Device Driver"]
C --> G["CPU Allocation"]
D --> H["RAM/HDD Allocation"]
E --> I["File Access Control"]
F --> J["I/O Operations"]
G --> K["User Application"]
H --> K
I --> K
J --> KBased on the TU BSc CSIT syllabus for Introduction to Information Technology (CSC114), unit 4.
Discussion
Loading…