Operating Systems

Unit 1: Introduction to Operating Systems

Understand the engine that runs every computer โ€” from your Android phone to ISRO's mission-critical servers.

โฑ๏ธ 5 hours theory + 3 hours lab  |  ๐Ÿ’ฐ โ‚น3,000โ€“โ‚น10,000/month  |  ๐Ÿ“ 30 MCQs (Bloom's Mapped)

๐Ÿ’ผ Jobs: Linux Admin (โ‚น4โ€“7 LPA)  |  Systems Engineer (โ‚น5โ€“8 LPA)  |  DevOps Intern (โ‚น15Kโ€“25K/month)

๐ŸŽฏ Interview Fit: TCS / Infosys / Wipro / Amazon / Google India

Section A

Opening Hook โ€” The Invisible Manager Behind Every System

๐Ÿš† When IRCTC Crashed on Tatkal Day โ€” And 12 Lakh Users Screamed

January 2023. 10:00 AM sharp. 12 lakh Indians hit the IRCTC Tatkal booking page simultaneously. Within seconds, the servers choked. Pages froze. "502 Bad Gateway" errors flooded screens. โ‚น200 crore worth of tickets โ€” stuck in limbo.

Behind the scenes, the Operating System was the first to break. Thousands of processes competed for CPU time. Memory ran out as each user session consumed RAM. File handles exceeded limits as the database opened millions of connections. The OS couldn't schedule processes fast enough, couldn't manage memory efficiently, and couldn't handle the I/O bottleneck of simultaneous disk reads.

The fix? IRCTC upgraded to a distributed system with better CPU scheduling, virtual memory tuning, and process management. The engineers who redesigned this? They all understood Operating Systems inside-out.

Could YOU have prevented this crash? After this chapter, you'll understand exactly what went wrong โ€” and how to fix it.

๐Ÿ‡ฎ๐Ÿ‡ณ IRCTC๐Ÿ‡ฎ๐Ÿ‡ณ ISRO PSLV๐Ÿ‡ฎ๐Ÿ‡ณ Aadhaar/UIDAI๐Ÿ‡ฎ๐Ÿ‡ณ Zerodha๐Ÿ‡ฎ๐Ÿ‡ณ Paytm๐Ÿ‡ฎ๐Ÿ‡ณ CoWIN
ISRO's Mars Orbiter Mission (Mangalyaan) runs on a real-time OS that manages 5 scientific instruments, communication systems, and navigation โ€” all with just 15 MB of storage. That's less memory than a single WhatsApp photo. The OS makes it possible.
Section B

Learning Outcomes โ€” Bloom's Taxonomy Mapped

Bloom's LevelLearning Outcome
๐Ÿ”ต RememberDefine an operating system and list its 5 core functions
๐Ÿ”ต RememberName and describe 7 types of operating systems with real-world examples
๐ŸŸข UnderstandExplain the difference between kernel mode and user mode with the IRCTC analogy
๐ŸŸข UnderstandDescribe monolithic, layered, microkernel, and modular OS architectures
๐ŸŸก ApplyUse Linux commands (uname, ps, top, strace) to explore OS internals
๐ŸŸก AnalyzeCompare OS architectures and evaluate which suits different Indian system needs
๐ŸŸ  EvaluateJudge why IRCTC chose Linux over Windows for their production servers
๐ŸŸ  CreateSet up and configure a Linux VPS for a small business on DigitalOcean/Hostinger
Section C

Concept Explanation โ€” OS from Scratch

1. What is an Operating System? โ€” Meaning, Need & Goals

Plain English: An operating system is the manager of your computer. Just like a railway station manager at New Delhi station manages platforms, schedules trains, handles complaints, and ensures everything runs smoothly โ€” the OS manages your CPU, memory, storage, and devices so that your apps can run without chaos.

Technical Definition: An Operating System is system software that acts as an intermediary between computer hardware and the user. It manages hardware resources and provides services for application programs.

OS = Railway Station Manager of IRCTC โ€” manages all platforms (hardware resources), schedules trains (processes), allocates waiting rooms (memory), handles complaints (error handling), and ensures no two trains collide on the same track (synchronization).

Why Do We Need an OS?

NeedWithout OSWith OS
Resource ManagementApps fight over CPU, memory, disk โ€” crashesOS fairly allocates resources to all apps
AbstractionEvery programmer must know hardware detailsOS hides hardware complexity behind APIs
SecurityAny program can access any dataOS enforces permissions and isolation
MultitaskingOnly one program runs at a timeOS lets you run Chrome, VS Code, Spotify together
Error HandlingOne crash kills everythingOS isolates crashes โ€” one app dies, rest continue

Goals of an Operating System

  1. Convenience โ€” Make the computer easy to use (GUI, file management)
  2. Efficiency โ€” Maximize CPU utilization and throughput
  3. Ability to Evolve โ€” Support new hardware and software without redesigning
Interview favourite: "What is the primary goal of an OS?" The answer depends on context. For a personal computer โ†’ convenience. For a server โ†’ efficiency. For embedded systems โ†’ reliability. Mention all three to impress.

Now YOU try it โ†’ Open your phone's Settings โ†’ About Phone. Note the OS version (Android 14? iOS 17?). That's the OS managing your calls, camera, apps, and battery.

2. Supervisor (Kernel) Mode vs User Mode

Plain English: Think of a bank. Customers (users) can deposit, withdraw, check balance โ€” limited operations. But the bank manager (kernel) can do everything: open/close accounts, access the vault, modify interest rates. If a customer tried to access the vault directly, security would stop them. Same with OS modes.

FeatureUser ModeKernel Mode (Supervisor)
Who runs here?Your applications (Chrome, VS Code, games)OS kernel, device drivers, core services
Hardware access?โŒ No direct accessโœ… Full hardware access
What happens on crash?Only that app crashesEntire system crashes (Blue Screen / Kernel Panic)
Mode bitMode bit = 1Mode bit = 0
Privileged instructions?โŒ Cannot executeโœ… Can execute (I/O, memory management, halt)

How does a user program request kernel services? Through system calls. When you call open("file.txt"), your program triggers a trap (software interrupt), the CPU switches from user mode โ†’ kernel mode, the OS executes the request, then switches back to user mode.

Students confuse "mode bit" direction. Mode bit = 0 means kernel mode (more power). Mode bit = 1 means user mode (restricted). Think: 0 = zero restrictions for kernel.
Aadhaar authentication uses kernel-mode operations to access the biometric hardware (fingerprint scanner, iris reader). The authentication app runs in user mode but makes system calls to access the secure biometric hardware through kernel mode.

Now YOU try it โ†’ On Linux, run cat /proc/cpuinfo โ€” this reads from a kernel data structure. Your terminal (user mode) makes a system call to the kernel to read this info.

3. Types of Operating Systems

TypeWhat It DoesExampleIndian Use Case
Simple BatchRuns jobs one after another, no user interactionEarly IBM mainframesSBI's overnight batch processing of crores of transactions
MultiprogrammingMultiple programs loaded in memory; CPU switches when one waits for I/OEarly UnixRailway reservation system running booking + cancellation + PNR check simultaneously
Multitasking (Time-sharing)Each user/process gets a time slice of CPU โ€” rapid switching creates illusion of parallelismLinux, Windows 10/11Your laptop running Zoom + Chrome + VS Code at the same time
MultiprocessingMultiple CPUs/cores work together on tasksModern multi-core processorsFlipkart's servers using 64-core AMD EPYC during Big Billion Days
Parallel OSTightly coupled multiple processors sharing memorySupercomputersPARAM Siddhi (India's fastest supercomputer) at C-DAC, Pune
Distributed OSMultiple independent computers work as one system over networkGoogle's Borg, KubernetesAadhaar's authentication servers spread across data centres in Bangalore, Manesar, and Hyderabad
Real-Time OS (RTOS)Guarantees response within strict time limitsVxWorks, FreeRTOS, QNXISRO's PSLV/GSLV launch control; Zerodha's trading engine
Students confuse Multiprogramming with Multitasking. Multiprogramming = multiple programs in memory, CPU switches on I/O wait (no time slicing). Multitasking = time slicing โ€” each process gets a fixed quantum of CPU time. Multitasking is a superset of multiprogramming.
RTOS is an interview goldmine. If asked "What's unique about RTOS?", say: "Hard real-time guarantees โ€” if the system doesn't respond within the deadline, it's a system failure, not just slow performance." Give the ISRO example. Instant credibility.

Now YOU try it โ†’ Run uname -a on your Linux terminal. It tells you your OS type, kernel version, and architecture. Is it a multitasking or real-time OS?

4. OS Architecture โ€” How an OS is Built

ArchitectureHow It WorksProsConsExample
MonolithicEntire OS in one big kernel binary โ€” all services in kernel spaceFast (no mode switching overhead)One bug crashes everything; hard to maintainLinux, MS-DOS
LayeredOS divided into layers (L0=hardware โ†’ LN=user). Each layer uses only the layer belowClean separation; easy debuggingSlow (multiple layer crossings); hard to define layersTHE OS (Dijkstra), early Windows NT
MicrokernelMinimal kernel (IPC, scheduling, memory). Everything else (file system, drivers) in user spaceStable โ€” driver crash doesn't kill kernel; modularSlower due to userโ†”kernel message passingMach, QNX, MINIX
Modular (Hybrid)Core kernel + loadable kernel modules (LKMs) that can be loaded/unloaded at runtimeBest of both โ€” fast + extensibleModule bugs can still crash kernelModern Linux, macOS, Windows 10+
Linux (monolithic with modules) powers 96.3% of the world's top supercomputers, including India's PARAM Siddhi at C-DAC. Its modular monolithic design lets ISRO load custom kernel modules for satellite communication hardware without modifying the core kernel.

๐Ÿ“Š Monolithic vs Microkernel โ€” ASCII Diagram

MONOLITHIC KERNEL              MICROKERNEL
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”           โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   User Programs  โ”‚           โ”‚   User Programs  โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค           โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                  โ”‚           โ”‚ File โ”‚ Net โ”‚ Drv  โ”‚  โ† User Space
โ”‚   KERNEL         โ”‚           โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  (Everything)    โ”‚           โ”‚    Microkernel    โ”‚
โ”‚  File System     โ”‚           โ”‚  (IPC, Sched,     โ”‚
โ”‚  Drivers         โ”‚           โ”‚   Basic Memory)   โ”‚
โ”‚  Networking      โ”‚           โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ”‚  Scheduling      โ”‚
โ”‚  Memory Mgmt     โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
     HARDWARE                       HARDWARE

Now YOU try it โ†’ Run lsmod on Linux. This shows loaded kernel modules. You're seeing the modular architecture in action!

5. System Calls โ€” The OS API

Plain English: System calls are the official request window between your app (user mode) and the OS (kernel mode). Just like you go to a bank counter to make a transaction (you can't just walk into the vault), your program makes a system call to request OS services.

CategorySystem CallsWhat They DoC Example
Process Controlfork(), exec(), wait(), exit()Create, replace, wait for, terminate processespid = fork();
File Managementopen(), read(), write(), close()Open/read/write/close filesfd = open("a.txt", O_RDONLY);
Device Managementioctl(), read(), write()Control and communicate with devicesioctl(fd, COMMAND, arg);
Informationgetpid(), alarm(), time()Get system/process informationpid_t id = getpid();
Communicationpipe(), shmget(), socket()IPC โ€” pipes, shared memory, networkpipe(fd);
C
// System call example: fork() creates a new process
#include <stdio.h>
#include <unistd.h>

int main() {
    int pid = fork();  // System call โ€” switches to kernel mode
    if (pid == 0) {
        printf("Child process! PID = %d\n", getpid());
    } else {
        printf("Parent process! PID = %d, Child PID = %d\n", getpid(), pid);
        wait(NULL);  // Wait for child to finish
    }
    return 0;
}
Parent process! PID = 1234, Child PID = 1235 Child process! PID = 1235
Use strace to see system calls in action. Run strace ls on Linux โ€” it shows EVERY system call ls makes (openat, read, write, close, etc.). This is how kernel developers debug performance issues at companies like Qualcomm India and Samsung R&D Bangalore.

Now YOU try it โ†’ Run strace ls 2>&1 | head -20 on Linux. Count how many system calls even a simple ls command makes. You'll be surprised!

6. Functions of an Operating System

FunctionWhat It ManagesIndian Analogy
Process ManagementCreating, scheduling, terminating processes; handling multitaskingIRCTC managing millions of simultaneous booking sessions
Memory ManagementAllocating/deallocating RAM; virtual memory; pagingHostel warden assigning rooms โ€” overflow goes to guest house (swap)
File ManagementCreating, reading, writing files; directories; permissionsGovernment file office โ€” each file has a number, location, and access level
I/O (Device) ManagementControlling printers, disks, network cards via device driversPost office managing letters (I/O requests) between sender and receiver
Security & ProtectionAuthentication, authorization, access controlBuilding security guard โ€” checks ID, controls access to floors

7. Evolution of Operating Systems

EraOSKey InnovationStill Used In India?
1950sNo OS (bare metal)Punch cards, manual operationNo
1960sBatch systems (IBM OS/360)Job batching, spoolingSBI batch processing legacy
1970sUnix (AT&T Bell Labs)Multitasking, multi-user, C languageYes โ€” Indian govt servers, BSNL
1980sMS-DOS, Mac OSPersonal computing, GUILegacy systems in some govt offices
1990sWindows 95/NT, LinuxGUI revolution + open sourceWindows: desktops. Linux: servers
2000sWindows XP, macOS XStability, USB plug-and-playStill on some ATMs (XP!)
2008+Android, iOSMobile OS โ€” touch, apps, sensors98% Indian smartphones run Android
2010s+Cloud OS (Kubernetes, containerOS)Orchestration, microservicesFlipkart, Razorpay, Jio on Kubernetes
India's first indigenous OS attempt was BharOS, developed by IIT Madras in 2023. It's an Android-based mobile OS focused on security and privacy for government use. While not widely adopted yet, it demonstrates India's push for tech self-reliance (Atmanirbhar Bharat).

Now YOU try it โ†’ Run lsb_release -a on Linux to see your exact distribution and version. Then run uname -r to see the kernel version. You're tracing OS evolution on your own machine!

Section D

Learn by Doing โ€” 3-Tier Lab Structure

๐ŸŸข Tier 1 โ€” GUIDED LAB: Explore OS Internals with Linux Commands

โฑ๏ธ 60โ€“90 minutesBeginnerWorks on Ubuntu, WSL, or repl.it

Step 1: Check Your OS Identity

bash
# What OS are you running?
uname -a
# Output: Linux hostname 5.15.0-91-generic #101-Ubuntu SMP ... x86_64 GNU/Linux

# Detailed distribution info
lsb_release -a
# Output: Ubuntu 22.04.3 LTS (Jammy Jellyfish)

# Kernel version only
uname -r
# Output: 5.15.0-91-generic

Step 2: View Running Processes

bash
# Show all running processes
ps aux | head -20

# Key columns: USER, PID, %CPU, %MEM, COMMAND
# Notice: PID 1 is always 'init' or 'systemd' โ€” the first process

Step 3: Real-time Process Monitor

bash
# Interactive process viewer (press 'q' to quit)
top

# Better version with colours (install first if needed)
sudo apt install htop
htop

What to observe in top:

  • %CPU โ€” Which process is hogging the CPU?
  • %MEM โ€” Who's eating your RAM?
  • Tasks โ€” Total running, sleeping, stopped, zombie processes
  • Load average โ€” 1-min, 5-min, 15-min CPU load

Step 4: Trace System Calls

bash
# See every system call made by the 'ls' command
strace ls 2>&1 | head -30

# Count total system calls
strace ls 2>&1 | wc -l
# You'll see 50-100+ system calls for a simple 'ls'!

Step 5: Explore System Information

bash
# CPU information
cat /proc/cpuinfo | head -20

# Memory information
cat /proc/meminfo | head -10

# Disk usage
df -h

# Uptime โ€” how long has your OS been running?
uptime

๐ŸŽ‰ Take a screenshot of your htop and strace output. This is your first OS portfolio item!

๐ŸŸก Tier 2 โ€” SEMI-GUIDED: Write a System Info Script

โฑ๏ธ 60 minutesIntermediate

Task: Write a bash script sysinfo.sh that outputs:

  1. OS name and version
  2. Kernel version
  3. CPU model and core count
  4. Total and free RAM
  5. Disk usage summary
  6. Top 5 CPU-consuming processes
  7. System uptime

Hints: Use uname, lsb_release, nproc, free -h, df -h, ps aux --sort=-%cpu | head -6

Make it executable: chmod +x sysinfo.sh

๐Ÿ”ด Tier 3 โ€” OPEN CHALLENGE: Set Up a Linux VPS

โฑ๏ธ 2โ€“3 hoursAdvanced

The Brief: Set up a Linux VPS on a free-tier cloud provider and deploy a simple web page.

  1. Create a free account on Oracle Cloud Free Tier or AWS Free Tier
  2. Launch an Ubuntu 22.04 VM (1 CPU, 1 GB RAM)
  3. SSH into the server
  4. Install Nginx web server: sudo apt install nginx
  5. Create a custom index.html
  6. Access your page via the public IP
  7. Document the setup steps in a README.md
This exact skill is worth โ‚น3,000โ€“โ‚น10,000 per project on Internshala/Fiverr. Small businesses, coaching centres, and startups need someone to set up their Linux server. You just learned how.
Section E

Industry Spotlight โ€” A Day in the Life

๐Ÿ‘จโ€๐Ÿ’ป Rajesh Kumar, 28 โ€” Systems Engineer at Amazon India, Hyderabad

Background: B.Tech (CSE) from NIT Warangal. Strong OS fundamentals. Placed through campus. Started at โ‚น12 LPA.

9:00 AM โ€” Morning standup. Review server health dashboards. Check if any EC2 instances hit CPU limits overnight.

10:00 AM โ€” A production server shows high load average (8.5 on a 4-core machine). Use top, htop, and perf to identify a runaway process consuming 95% CPU.

11:30 AM โ€” Write a shell script to auto-restart services when memory exceeds 90%. Uses /proc/meminfo and systemctl.

2:00 PM โ€” Kernel upgrade on staging servers. Test compatibility with custom kernel modules for Amazon's network drivers.

4:00 PM โ€” Interview preparation training. Rajesh mentors a junior engineer on OS concepts โ€” "Explain the difference between process and thread."

5:30 PM โ€” Document a runbook for handling out-of-memory (OOM) kills on production EC2 instances.

DetailInfo
Tools Used DailyLinux (Amazon Linux 2), bash, strace, perf, top/htop, systemd, Docker
Entry Salaryโ‚น5โ€“8 LPA (Systems Engineer)
Mid (3โ€“5 yrs)โ‚น12โ€“20 LPA (SRE / DevOps)
Senior (7+ yrs)โ‚น25โ€“50 LPA (Principal SRE / Kernel Developer)
Companies HiringAmazon, Google India, Microsoft India, Flipkart, Zerodha, Qualcomm India, Samsung R&D, TCS Research

Interview Questions This Unit Helps Answer:

  1. "What is an operating system and why is it needed?" โ€” Model: Define + 3 needs + example
  2. "Explain kernel mode vs user mode." โ€” Model: Mode bit, privileges, system call trap
  3. "Compare monolithic and microkernel architecture." โ€” Model: Table + pros/cons + examples
  4. "What are system calls? Give 5 examples." โ€” Model: Definition + 5 categories with examples
Section F

Earn With It โ€” Freelance & Income Roadmap

๐Ÿ’ฐ Your Earning Path After This Chapter

Portfolio Piece: "Linux System Info Dashboard Script" โ€” a polished bash script that generates a system health report.

Beginner Gig Ideas:

โ€ข Linux VPS setup for small businesses (DigitalOcean/Hostinger) โ€” โ‚น3,000โ€“โ‚น8,000

โ€ข Server monitoring script bundle โ€” โ‚น2,000โ€“โ‚น5,000

โ€ข Ubuntu/CentOS installation & configuration โ€” โ‚น1,500โ€“โ‚น4,000

โ€ข Basic web server setup (Nginx/Apache) โ€” โ‚น3,000โ€“โ‚น10,000

PlatformBest ForRate
InternshalaIndian student projectsโ‚น2,000โ€“โ‚น8,000/project
FiverrGlobal Linux admin gigs$20โ€“$100/gig
UpworkOngoing server management$15โ€“$40/hour
LinkedInDirect outreach to startupsโ‚น5,000โ€“โ‚น15,000/project

โฑ๏ธ Time to first earning: 6โ€“8 weeks with daily practice

Section G

MCQ Assessment Bank โ€” 30 Questions (Bloom's Mapped)

Remember (Q1โ€“Q5)

Q1

Which of the following is NOT a function of an operating system?

  1. Process Management
  2. Memory Management
  3. Compiler Design
  4. File Management
Remember
โœ… Answer: (C) โ€” Compiler design is a separate field. OS manages processes, memory, files, I/O, and security โ€” but compilers are application-level tools.
Q2

The mode bit value in kernel mode is:

  1. 1
  2. 0
  3. -1
  4. Depends on OS
Remember
โœ… Answer: (B) โ€” Mode bit = 0 indicates kernel mode (full privileges). Mode bit = 1 indicates user mode (restricted).
Q3

Which system call is used to create a new process in Unix/Linux?

  1. exec()
  2. fork()
  3. wait()
  4. kill()
Remember
โœ… Answer: (B) โ€” fork() creates a new child process by duplicating the parent. exec() replaces the process image, wait() pauses parent until child exits.
Q4

RTOS stands for:

  1. Rapid Transaction Operating System
  2. Real-Time Operating System
  3. Remote Terminal Operating System
  4. Reduced Time Operating System
Remember
โœ… Answer: (B) โ€” Real-Time Operating System guarantees response within strict time constraints. Used in ISRO rockets, Zerodha trading, pacemakers.
Q5

In a layered OS architecture, the hardware is at:

  1. The topmost layer
  2. Layer 0 (innermost)
  3. The middle layer
  4. Outside all layers
Remember
โœ… Answer: (B) โ€” Layer 0 is the hardware. Each successive layer adds abstraction. The outermost layer is the user interface.

Understand (Q6โ€“Q10)

Q6

Why does the OS need two separate modes (kernel and user)?

  1. To make the computer faster
  2. To prevent user programs from directly accessing hardware and crashing the system
  3. To support multiple languages
  4. To reduce electricity consumption
Understand
โœ… Answer: (B) โ€” Dual-mode protects the system. If a user program could directly access hardware, a bug in Chrome could crash your entire OS.
Q7

Explain why multiprogramming increases CPU utilization:

  1. It makes the CPU faster
  2. When one process waits for I/O, the CPU switches to another process instead of sitting idle
  3. It adds more CPUs
  4. It reduces the number of processes
Understand
โœ… Answer: (B) โ€” Without multiprogramming, the CPU is idle during I/O waits (which can be 90% of the time). Multiprogramming keeps the CPU busy by switching to another ready process.
Q8

How does a microkernel architecture improve system stability?

  1. By running everything in kernel mode
  2. By running device drivers and file systems in user space โ€” if they crash, the kernel survives
  3. By disabling all hardware access
  4. By removing the file system entirely
Understand
โœ… Answer: (B) โ€” In a microkernel, only essential services (IPC, scheduling) run in kernel mode. Drivers and file systems run in user space, so their crashes don't bring down the kernel.
Q9

What is the role of a system call in the OS?

  1. It directly executes hardware instructions
  2. It provides a controlled interface for user programs to request kernel services
  3. It is a programming language function
  4. It is used only by administrators
Understand
โœ… Answer: (B) โ€” System calls are the only legal way for user-mode programs to request kernel services. They trigger a trap (software interrupt) that switches to kernel mode.
Q10

Distinguish between a program and a process:

  1. They are the same thing
  2. A program is a passive entity (code on disk); a process is an active entity (program in execution with resources)
  3. A process is always smaller than a program
  4. Programs run in kernel mode, processes in user mode
Understand
โœ… Answer: (B) โ€” Program = recipe book on shelf (static). Process = cooking the dish (active โ€” has CPU state, memory, open files). One program can spawn multiple processes.

Apply (Q11โ€“Q15)

Q11

You run strace ls on a Linux system and see 87 lines of output. What does this indicate?

  1. The ls command has 87 bugs
  2. The ls command makes approximately 87 system calls to list directory contents
  3. The system has 87 files
  4. The kernel version is 87
Apply
โœ… Answer: (B) โ€” strace traces every system call. Even a simple ls involves openat(), read(), getdents64(), write(), close() and many more โ€” totalling 50โ€“100+ calls.
Q12

IRCTC's Tatkal system needs to handle 12 lakh concurrent users with guaranteed response time. Which OS type is most appropriate?

  1. Simple Batch OS
  2. Distributed + Real-Time hybrid
  3. Single-user desktop OS
  4. MS-DOS
Apply
โœ… Answer: (B) โ€” IRCTC needs distributed (multiple servers across data centres) + real-time guarantees (60-second Tatkal window). Neither a batch nor desktop OS can handle this.
Q13

A student writes a C program that calls fork(). How many processes exist after the call?

  1. 1
  2. 2
  3. 3
  4. 0
Apply
โœ… Answer: (B) โ€” fork() creates one child process. After fork(), there are 2 processes: the original parent and the new child. Both continue from the next line after fork().
Q14

You see load average: 8.5, 7.2, 6.1 in top on a 4-core server. What does this tell you?

  1. The server is healthy
  2. The server is overloaded โ€” load average should ideally be โ‰ค number of cores (4)
  3. The server has 8 CPUs
  4. The server needs more RAM
Apply
โœ… Answer: (B) โ€” Load average 8.5 on a 4-core machine means ~2ร— overloaded. Processes are queuing up waiting for CPU. This is exactly what happened to IRCTC.
Q15

Which Linux command shows the kernel version you're running?

  1. ls -version
  2. uname -r
  3. kernel --show
  4. cat /etc/os
Apply
โœ… Answer: (B) โ€” uname -r outputs only the kernel release version (e.g., 5.15.0-91-generic). uname -a shows all system info.

Analyze (Q16โ€“Q20)

Q16

Compare monolithic and microkernel architectures. Which would you recommend for ISRO's satellite OS and why?

  1. Monolithic โ€” faster performance, critical for real-time satellite operations
  2. Microkernel โ€” stability is more important; a driver crash shouldn't kill the satellite
  3. Neither โ€” satellites don't use OS
  4. Both are identical for embedded systems
Analyze
โœ… Answer: (B) โ€” For a โ‚น450 crore satellite you can't send a technician to fix, stability > speed. Microkernel (like QNX used in space systems) isolates faults โ€” if a sensor driver crashes, the OS survives.
Q17

Analyze why 96.3% of the world's supercomputers run Linux (monolithic) rather than a microkernel OS:

  1. Linux is free
  2. Supercomputers need maximum performance โ€” monolithic kernels avoid userโ†”kernel message-passing overhead critical for HPC workloads
  3. Microkernel doesn't support multitasking
  4. Linux was invented first
Analyze
โœ… Answer: (B) โ€” In HPC, every microsecond matters. Monolithic kernels have faster system call execution since all services are in kernel space. The message-passing overhead of microkernels is unacceptable at supercomputer scale.
Q18

Differentiate between multiprogramming and multitasking:

  1. They are identical
  2. Multiprogramming switches on I/O wait (no time slice); multitasking uses time slicing for rapid CPU sharing
  3. Multitasking is slower than multiprogramming
  4. Multiprogramming requires multiple CPUs
Analyze
โœ… Answer: (B) โ€” Multiprogramming: CPU switches only when current process does I/O. Multitasking: CPU forcibly switches after a time quantum (e.g., 10ms), giving an illusion of simultaneity.
Q19

Examine why Android uses a modified Linux kernel rather than building a new OS from scratch:

  1. Google was lazy
  2. Linux provides a mature, tested kernel with hardware driver support for thousands of devices, saving years of development
  3. Android doesn't use Linux
  4. Linux was the only option available
Analyze
โœ… Answer: (B) โ€” Linux's open-source nature, massive driver ecosystem, and proven stability made it the ideal foundation. Google added Android-specific features (Binder IPC, ART runtime) on top.
Q20

Compare system calls and library functions. Why is printf() not a system call but write() is?

  1. printf() doesn't produce output
  2. printf() is a C library function that internally calls write() (which is the actual system call that switches to kernel mode)
  3. write() is slower than printf()
  4. They are both system calls
Analyze
โœ… Answer: (B) โ€” printf() is a user-space function (in libc) that formats the string, then calls the write() system call to actually output bytes to the terminal via the kernel.

Evaluate (Q21โ€“Q25)

Q21

IRCTC chose Linux over Windows for production servers. Evaluate this decision:

  1. Poor decision โ€” Windows is more user-friendly
  2. Good decision โ€” Linux is free (reduces cost for govt), open-source (auditable), more stable for high-concurrency, and runs 96% of web servers globally
  3. Irrelevant โ€” OS doesn't matter for web servers
  4. Bad decision โ€” Linux has no GUI
Evaluate
โœ… Answer: (B) โ€” For a government web service handling millions of concurrent connections, Linux offers: zero licensing cost (โ‚นcrores saved), battle-tested stability, superior concurrency handling, and the ability to tune kernel parameters.
Q22

A startup CEO says: "We don't need to understand OS โ€” we just use cloud." Critique this statement:

  1. Correct โ€” cloud abstracts everything
  2. Incorrect โ€” cloud VMs still run Linux/Windows. Understanding OS helps optimize costs, debug performance issues, and configure servers properly
  3. Partially correct for frontend developers only
  4. Correct if using serverless exclusively
Evaluate
โœ… Answer: (B) โ€” Every AWS EC2 instance runs an OS. Understanding process management, memory limits, and system calls helps you right-size instances (saving โ‚นlakhs/year), debug crashes, and optimize performance.
Q23

Evaluate whether India should develop its own indigenous OS (like BharOS) or continue using Linux/Android:

  1. Build from scratch โ€” national security requires it
  2. Continue using Linux โ€” it's open-source, globally maintained, and building from scratch is prohibitively expensive. Customize Linux (like Android did) for Indian needs instead
  3. Use Windows only
  4. OS is irrelevant in the cloud era
Evaluate
โœ… Answer: (B) โ€” BharOS is actually based on Android (which uses Linux). Building a kernel from scratch would cost billions and take decades. The smart approach: customize open-source Linux for Indian security and privacy needs.
Q24

Judge the tradeoff: "A monolithic kernel is faster but less stable. A microkernel is stable but slower." Is this always true?

  1. Yes, always
  2. Generally true, but modern hybrid approaches (Linux loadable modules) combine speed with modularity, partially mitigating both downsides
  3. No โ€” microkernels are always faster
  4. No โ€” monolithic kernels never crash
Evaluate
โœ… Answer: (B) โ€” Modern Linux uses a monolithic core with loadable kernel modules (LKMs). You get monolithic speed for core operations but can load/unload modules safely. It's a pragmatic hybrid.
Q25

Assess the risk: Zerodha's trading platform MUST execute stock orders within 10 microseconds. Which OS failure would be most catastrophic?

  1. File system corruption
  2. Unpredictable scheduling latency โ€” if the OS schedules another process during a trade execution, the order may miss the price window
  3. Slow boot time
  4. Poor GUI rendering
Evaluate
โœ… Answer: (B) โ€” For a trading engine, deterministic scheduling is critical. A general-purpose OS might preempt the trading process for a log rotation task, causing a 50ms delay that loses โ‚นlakhs. Zerodha uses RTOS principles for their core engine.

Create (Q26โ€“Q30)

Q26

Design an OS architecture for India's Aadhaar authentication system (1.4 billion users, biometric data, real-time response needed). Which architecture would you propose?

  1. Single monolithic OS on one server
  2. Distributed OS with microkernel nodes โ€” biometric processing in real-time, fault-tolerant across multiple data centres, with hardware-isolated security domains
  3. MS-DOS on each terminal
  4. Any general-purpose desktop OS
Create
โœ… Answer: (B) โ€” Aadhaar needs: distributed (3 data centres), real-time (fingerprint match in <200ms), fault-tolerant (microkernel for stability), and hardware security (isolated biometric processing). A single monolithic server would be a single point of failure.
Q27

Propose a system call interface for a new Indian government document management OS. Which categories of system calls are essential?

  1. Only file management calls
  2. Process control (handle multiple users), file management (create/read/write documents), security (authentication, access control), communication (inter-department IPC), and device management (printers, scanners)
  3. Only networking calls
  4. No system calls needed โ€” user programs access hardware directly
Create
โœ… Answer: (B) โ€” A government document OS needs all 5 categories: multi-user process management, secure file operations with audit trails, strict access control, inter-department communication, and device management for scanners/printers.
Q28

Design a sysinfo monitoring script. Which system information should it collect for a production server health check?

  1. Only the hostname
  2. CPU load, memory usage (used/free/swap), disk space, running processes, network connections, uptime, kernel version, and top 5 resource consumers
  3. Only the current time
  4. The colour of the terminal
Create
โœ… Answer: (B) โ€” A comprehensive health check covers compute (CPU load), memory (RAM + swap), storage (disk), network, and process management. This is what SREs at Amazon India check daily.
Q29

Create a comparison framework for evaluating OS choices for an Indian EdTech startup building a live-streaming platform:

  1. Just pick the cheapest OS
  2. Evaluate on: licensing cost (Linux=โ‚น0 vs Windows=โ‚นโ‚นโ‚น), concurrency handling (Linux superior for I/O), community support, streaming library compatibility, cloud provider support, and DevOps tooling ecosystem
  3. Use whatever the founder's laptop runs
  4. OS doesn't matter for streaming
Create
โœ… Answer: (B) โ€” A systematic framework considers cost, performance, ecosystem, scalability, and team expertise. For an Indian startup, Linux wins on cost (โ‚น0 license) and performance (superior for concurrent connections typical in live streaming).
Q30

Build a proposal for upgrading a legacy Indian bank's OS infrastructure from Windows Server 2008 to a modern platform. What steps would you include?

  1. Just install Windows 11 on all servers
  2. Audit current workloads โ†’ evaluate Linux vs Windows Server 2022 โ†’ pilot migration on non-critical systems โ†’ train staff on new OS โ†’ phased rollout โ†’ security hardening โ†’ monitoring setup โ†’ document everything
  3. No upgrade needed โ€” if it works, don't fix it
  4. Replace all servers with mobile phones
Create
โœ… Answer: (B) โ€” Bank OS migration requires careful planning. Audit first (what runs on what), pilot test (don't migrate core banking first!), train staff, phased rollout, and post-migration monitoring. Many Indian banks are doing this right now.
Section H

Short Answer Questions (2โ€“3 marks each)

Question 1 (2 marks)

Define an Operating System and state any three of its functions.

Question 2 (3 marks)

Differentiate between kernel mode and user mode. What is the role of the mode bit?

Question 3 (2 marks)

Compare multiprogramming and multitasking with one example each.

Question 4 (3 marks)

Draw a comparison table between monolithic kernel and microkernel architectures. Give one example of each.

Question 5 (2 marks)

List 5 categories of system calls with one example system call from each category.

Section I

Long Answer & Case Studies (10 marks each)

๐Ÿ“‹ Case Study 1: IRCTC Tatkal Booking โ€” When the OS Became the Bottleneck (10 marks)

IRCTC's Tatkal booking system handles 12 lakh concurrent users at 10:00 AM. Each user session creates a process that requires CPU time, memory, file handles (database connections), and I/O operations. On multiple occasions, the system crashed due to OS-level bottlenecks.

Answer the following:

  1. (2 marks) Identify three OS-level resources that become bottlenecks during Tatkal booking. For each, explain why.
  2. (3 marks) Which type of OS architecture would you recommend for IRCTC's servers โ€” monolithic or microkernel? Justify with 3 reasons.
  3. (2 marks) Explain how the OS's process management function handles 12 lakh simultaneous booking sessions.
  4. (3 marks) Propose a complete OS-level solution architecture for IRCTC that prevents crashes. Include: OS type, kernel configuration, resource limits, and monitoring strategy.

๐Ÿ“‹ Case Study 2: ISRO's PSLV Mission Control โ€” Why RTOS Matters (10 marks)

ISRO's PSLV launch control system manages 5 scientific instruments, communication systems, and navigation โ€” all running on a Real-Time Operating System with just 15 MB of storage. The OS must respond within microseconds to sensor inputs, otherwise the rocket could veer off course.

Answer the following:

  1. (2 marks) Define RTOS and explain the difference between hard and soft real-time systems. Classify ISRO's system.
  2. (3 marks) Why can't ISRO use a general-purpose OS like Ubuntu for PSLV? List 3 specific technical reasons.
  3. (2 marks) Compare the OS requirements for ISRO's rocket (RTOS) vs IRCTC's web server (distributed). Use a table.
  4. (3 marks) Design a minimal system call interface for ISRO's satellite OS. What categories of system calls are essential and what can be omitted? Justify.
Section J

Chapter Summary โ€” Tweet-Sized Bullet Points

๐Ÿ“ Key Takeaways

  • ๐Ÿ–ฅ๏ธ OS = manager of your computer โ€” handles processes, memory, files, I/O, and security so apps can run smoothly.
  • ๐Ÿ” Two modes: Kernel (mode bit=0, full power) and User (mode bit=1, restricted). System calls bridge them.
  • ๐Ÿ“Š 7 OS types: Batch โ†’ Multiprogramming โ†’ Multitasking โ†’ Multiprocessing โ†’ Parallel โ†’ Distributed โ†’ RTOS.
  • ๐Ÿ—๏ธ 4 architectures: Monolithic (fast, less stable), Layered (clean), Microkernel (stable, slower), Modular (hybrid best).
  • ๐Ÿ“ž System calls = the ONLY legal way for apps to talk to the kernel. 5 categories: Process, File, Device, Info, Communication.
  • ๐Ÿง Linux dominates servers (96%) and supercomputers (96.3%). Android (based on Linux) powers 98% of Indian smartphones.
  • ๐Ÿ‡ฎ๐Ÿ‡ณ India context: IRCTC (distributed+RT), ISRO (RTOS), Aadhaar (distributed), Zerodha (real-time), PARAM Siddhi (parallel).
  • ๐Ÿ”ง Key Linux commands: uname, ps, top/htop, strace, cat /proc/cpuinfo, df -h, lsmod.
  • ๐Ÿ’ฐ After this chapter, you can earn by: Linux VPS setup for small businesses (โ‚น3,000โ€“โ‚น10,000/project on Internshala/Fiverr).
Section K

My Earning Checkpoint โ€” Self-Assessment

Concept MasteredLab CompletedPortfolio ItemInterview Q ReadyGig Ready?
OS Meaning & Typesuname, ps, topSystem Info Screenshotโœ… "What is an OS?"โฌœ Need more practice
Kernel vs User Modestrace lsstrace output analysisโœ… "Explain dual mode"โฌœ Conceptual only
OS ArchitecturelsmodModule list screenshotโœ… "Monolithic vs Micro"โฌœ Conceptual only
System Callsfork() C programfork() outputโœ… "Give 5 system calls"โฌœ Need coding practice
Linux Commandssysinfo.sh scriptSystem Info Scriptโœ… "Linux commands"โœ… Ready for admin gigs
VPS SetupCloud VM + NginxLive website URLโœ… "Set up a Linux server"โœ… โ‚น3Kโ€“โ‚น10K/project
Minimum Viable Earning Setup: Complete the sysinfo.sh script + VPS setup lab โ†’ Create an Internshala/Fiverr profile โ†’ Offer "Linux Server Setup" gigs โ†’ โ‚น3,000โ€“โ‚น10,000/project.

โœ… Unit 1 complete. MCQs: 30. Ready for Unit 2: Process Management!

[QR: Link to EduArtha video tutorial โ€” OS Introduction]