👁 Preview — Study, Practice and Revise are open; mock tests and the rest of the syllabus unlock on subscription. Unlock all · ₹4,999
← Back to Computer Fundamentals
Study mode

Operating Systems

Introduction to Operating Systems

Imagine you want to watch a movie on your smartphone or write a document on your laptop. Behind the scenes, a special program called the Operating System (OS) makes all this possible. It acts like a manager or a bridge that connects you, the user, with the computer hardware - the physical parts like the processor, memory, and storage.

Without an operating system, using a computer would be like trying to drive a car without a steering wheel or pedals. The OS provides the controls and instructions that allow you to interact with the machine easily and efficiently.

In this chapter, we will explore what an operating system is, its types, components, and how it manages various tasks to keep your computer running smoothly.

Definition and Purpose of Operating System

An Operating System is system software that acts as an intermediary between computer hardware and the user. It manages hardware resources and provides a user-friendly environment for running applications.

Think of the OS as a translator and traffic controller. It translates your commands into instructions the hardware can understand and controls how different programs share the hardware resources without conflict.

graph LR    User_Applications -->|Requests| Operating_System    Operating_System -->|Controls| Hardware

In the diagram above, user applications send requests to the operating system, which then manages the hardware to fulfill those requests.

Why Do We Need an Operating System?

  • Resource Management: The OS allocates the processor, memory, and input/output devices to various programs efficiently.
  • Ease of Use: It provides a graphical or command-line interface so users can interact with the computer without needing to understand hardware details.
  • Security and Stability: It protects the system from unauthorized access and ensures programs run without interfering with each other.

Types of Operating Systems

Operating systems come in different types, each designed for specific purposes and environments. Let's look at the main types:

Type of OS Features Advantages Typical Applications
Batch OS Processes batches of jobs without user interaction. Efficient for large jobs; reduces idle time. Early mainframe computers, large data processing tasks.
Time-Sharing OS Allows multiple users to share system resources simultaneously. Interactive use; fast response time. Multi-user systems, universities, research labs.
Distributed OS Manages a group of independent computers as a single system. Resource sharing; fault tolerance. Cloud computing, networked systems.
Real-Time OS Processes data and events within strict time constraints. Predictable and timely responses. Embedded systems, medical devices, industrial robots.
Mobile OS Designed for smartphones, tablets with touch interfaces. Optimized for battery life and portability. Android, iOS devices.

Components of Operating System

An operating system is made up of several key components that work together to manage the computer system effectively.

Hardware (CPU, Memory, I/O Devices) Kernel User Interface (Shell) File System
  • Kernel: The core part of the OS that directly interacts with hardware. It manages CPU, memory, and device communication.
  • User Interface (Shell): The layer that allows users to interact with the OS. It can be graphical (GUI) or command-line (CLI).
  • File System: Organizes and manages data storage on disks, allowing files and directories to be created, accessed, and managed.

Process and Memory Management

One of the most important jobs of an operating system is to manage processes and memory. Let's understand what these terms mean and how the OS handles them.

What is a Process?

A process is a program in execution. For example, when you open a web browser, the OS creates a process to run it. Multiple processes can run at the same time, and the OS ensures they share the CPU fairly.

Process Lifecycle

graph LR    New --> Ready    Ready --> Running    Running --> Waiting    Waiting --> Ready    Running --> Terminated

Explanation:

  • New: Process is created.
  • Ready: Waiting to get CPU time.
  • Running: Currently executing.
  • Waiting: Waiting for some event (like input).
  • Terminated: Process has finished execution.

Memory Management

The OS allocates memory to processes so they can run without interfering with each other. It keeps track of which parts of memory are free or occupied and manages swapping data between RAM and disk if needed.

graph TD    OS --> Allocate_Memory    Allocate_Memory --> Process    Process --> Release_Memory    Release_Memory --> OS

This flow shows how the OS allocates and releases memory as processes start and finish.

Worked Examples

Example 1: Identifying OS Types from Scenarios Easy
A hospital uses a system that must respond immediately to patient monitoring devices. Which type of operating system is most suitable and why?

Step 1: Understand the requirement - immediate response to events.

Step 2: Identify OS types - Real-Time OS is designed for strict timing constraints.

Step 3: Choose Real-Time OS because it guarantees timely processing, essential for patient safety.

Answer: Real-Time Operating System is most suitable for hospital monitoring systems.

Example 2: File Management Operations Medium
Demonstrate how to create, rename, and delete a file named notes.txt using Windows Command Prompt.

Step 1: To create a file, use the echo command:

echo This is a sample note > notes.txt

This creates notes.txt with the text inside.

Step 2: To rename the file:

rename notes.txt summary.txt

This changes the file name to summary.txt.

Step 3: To delete the file:

del summary.txt

This removes the file from the directory.

Answer: File created, renamed, and deleted using the above commands.

Example 3: Process Scheduling Example Hard
Given three processes with burst times: P1=5 ms, P2=3 ms, P3=8 ms. Using First-Come-First-Serve (FCFS) scheduling, calculate the turnaround time and waiting time for each process.

Step 1: List processes in arrival order: P1, P2, P3.

ProcessBurst Time (ms)Completion Time (ms)Turnaround Time (ms)Waiting Time (ms)
P15550
P23885
P3816168

Step 2: Calculate turnaround time = Completion time - Arrival time (assuming all arrive at 0 ms).

Step 3: Calculate waiting time = Turnaround time - Burst time.

Answer:

  • P1: Turnaround = 5 ms, Waiting = 0 ms
  • P2: Turnaround = 8 ms, Waiting = 5 ms
  • P3: Turnaround = 16 ms, Waiting = 8 ms
Example 4: Memory Allocation Problem Hard
Memory blocks available: 100 KB, 500 KB, 200 KB, 300 KB, 600 KB. Processes require: 212 KB, 417 KB, 112 KB, 426 KB. Allocate memory using First-Fit strategy.

Step 1: List memory blocks and processes:

  • Blocks: 100, 500, 200, 300, 600 KB
  • Processes: 212, 417, 112, 426 KB

Step 2: Allocate each process to the first block large enough:

  • Process 212 KB -> Block 500 KB (remaining 288 KB)
  • Process 417 KB -> Block 600 KB (remaining 183 KB)
  • Process 112 KB -> Block 200 KB (remaining 88 KB)
  • Process 426 KB -> No block large enough remaining (100 KB, 288 KB, 183 KB, 88 KB are all smaller)

Answer: First three processes allocated; the fourth process cannot be allocated due to insufficient block size.

Example 5: Booting Process Explanation Medium
Explain the steps involved in the booting process of a computer.
graph TD    Power_On --> POST    POST --> Load_Bootloader    Load_Bootloader --> Load_OS    Load_OS --> System_Ready    System_Ready --> User_Login    

Step 1: Power On: When the computer is switched on, power is supplied to all components.

Step 2: POST (Power-On Self Test): The system checks hardware components like memory, keyboard, and disk drives.

Step 3: Load Bootloader: The BIOS or UEFI loads a small program called the bootloader from the storage device.

Step 4: Load Operating System: The bootloader loads the OS kernel into memory.

Step 5: System Ready: The OS initializes system services and drivers.

Step 6: User Login: The system displays the login screen for user access.

Answer: The booting process involves power-on, hardware checks, loading the bootloader, loading the OS, and preparing the system for user interaction.

Formula Bank

Formula Bank

Turnaround Time
\[ \text{Turnaround Time} = \text{Completion Time} - \text{Arrival Time} \]
where: Completion Time = time when process finishes; Arrival Time = time when process arrives
Used to calculate total time taken by a process from arrival to completion.
Waiting Time
\[ \text{Waiting Time} = \text{Turnaround Time} - \text{Burst Time} \]
where: Burst Time = actual execution time of the process
Used to calculate time a process spends waiting in the ready queue.

Tips & Tricks

Tip: Remember the 5 main functions of OS using the acronym PUMFD: Process, User interface, Memory, File, and Device management.

When to use: While recalling OS functions during exams.

Tip: Use real-world analogies like OS as a traffic controller managing multiple vehicles (processes) to understand resource management.

When to use: To simplify complex OS concepts.

Tip: For process scheduling problems, practice calculating turnaround and waiting times systematically using tables.

When to use: While solving scheduling algorithm questions.

Tip: Visualize the booting process as a sequence of steps from power-on to OS loading to remember easily.

When to use: When answering questions on booting.

Tip: Compare OS types side-by-side in a table format to quickly distinguish features and use cases.

When to use: During revision and multiple-choice questions.

Common Mistakes to Avoid

❌ Confusing the kernel with the entire operating system.
✓ Understand that the kernel is a core component, not the whole OS.
Why: Students often generalize the OS as only the kernel due to its critical role.
❌ Mixing up types of operating systems and their characteristics.
✓ Memorize key features and typical applications of each OS type separately.
Why: Similar names and overlapping features cause confusion.
❌ Ignoring the difference between process management and memory management.
✓ Learn distinct roles: process management handles execution, memory management handles allocation.
Why: Both deal with resources, leading to misunderstanding.
❌ Skipping steps in process scheduling calculations.
✓ Follow stepwise approach and use tables to avoid errors.
Why: Rushing causes miscalculation of waiting and turnaround times.
❌ Assuming all file operations are the same across OS platforms.
✓ Recognize differences in commands and file system structures between Windows and Linux.
Why: Platform-specific commands can confuse students.

Main Functions of an Operating System

  • Process Management: Controls execution of programs and multitasking.
  • User Interface: Provides a way for users to interact with the computer.
  • Memory Management: Allocates and manages system memory.
  • File Management: Organizes data storage and access.
  • Device Management: Controls input/output devices and drivers.
Curated videos per subtopic
Top YouTube explainers, AI-ranked for your exam and language. Unlocks with subscription.
Unlock

Try Practice next.

Progress tracking is paywalled — subscribe to mark subtopics as understood and save your streak.

Go to practice →
Ask a doubt
Operating Systems · 10 free messages
Ask me anything about this subtopic. You have 10 free messages this session — chat history isn't saved in preview.