Sitemap

Why we need Operating System(OS)?

3 min readFeb 25, 2026

--

What is an Operating System (OS)?

An Operating System (OS) is a system software that acts as a bridge between the user and the computer hardware.

Structure of a computer system

Real-life Analogy

Think of OS like a manager in a factory:

  • Workers = Applications (Chrome, VS Code, games)
  • Machines = Hardware (CPU, RAM, disk)
  • Manager (OS) = Controls everything and assigns tasks

Without the manager → chaos

Example:

When you open a browser:

  1. You click Chrome (Application)
  2. OS allocates memory + CPU
  3. Hardware executes instructions
  4. Output shown to you

Why Do We Need an OS?

Without OS,

  • You must manually control hardware
  • Write code to access CPU, memory, disk
  • No interface (no GUI, no mouse)
  • Very slow and complex

Reasons We Need OS (with Examples):

  1. Process Management (Running Programs)
Press enter or click to view image in full size

OS manages multiple programs (processes) at once.

Example:
You are:

  • Watching YouTube
  • Downloading a file
  • Writing code

👉 OS decides:

  • Which program uses CPU
  • For how long (time-sharing)

2. Memory Management

OS controls RAM (memory).

Get Mayesha Mariza’s stories in your inbox

Join Medium for free to get updates from this writer.

Example:

  • Chrome → 500MB
  • VS Code → 300MB
  • Game → 1GB

👉 OS ensures:

  • No program overwrites another
  • Efficient use of RAM

3. File System Management

Press enter or click to view image in full size

OS organizes data into files and folders.

Example:

  • You save a file → C:/Users/mayesha/Documents/file.txt

👉 OS handles:

  • Create / delete files
  • Store data on disk
  • Retrieve files quickly

4. Device Management

OS manages hardware devices using drivers.

Example:

  • Keyboard input → OS → Application
  • Print command → OS → Printer

👉 OS responsibilities:

  • Control I/O devices
  • Handle device communication

5. Security & Protection

Press enter or click to view image in full size

OS protects system and data.

Example:

  • Password login
  • File permissions (read/write)

👉 Prevents:

  • Unauthorized access
  • Data loss

6. User Interface (UI)

Press enter or click to view image in full size

OS provides ways to interact

Types:

  • GUI → Mouse + icons (Windows, macOS)
  • CLI → Commands (ls, cd in Linux)

let’s You open a game:

  1. OS loads game into memory
  2. Allocates CPU time
  3. Uses GPU for graphics
  4. Takes input from keyboard/mouse
  5. Saves game progress to disk

Without OS → You must manually control all these 😵

--

--

Mayesha Mariza
Mayesha Mariza

Written by Mayesha Mariza

A Computer Science student with expertise in Flutter and Java development. Committed to continuous learning and innovation in the field of technology.