3.1 — Operating System Introduction

What is an OS?

An Operating System is system software that acts as an intermediary between computer hardware and the user/applications. It manages hardware resources (CPU, memory, disk, I/O devices) and provides a convenient environment for programs to run.

Think of it like a restaurant manager: customers (applications) don't talk directly to the kitchen (hardware); the manager (OS) takes orders, allocates resources, and ensures things run smoothly without chaos.

Why do we need an OS?

Without an OS, every application would need to know how to directly control the CPU, memory, disk drivers, etc. That's impractical. The OS provides abstraction — you just call read file and the OS handles the messy hardware details underneath.

Key Functions of an OS

  1. Process Management – creating, scheduling, and terminating processes
  2. Memory Management – allocating/deallocating RAM to processes
  3. File System Management – organizing data into files/directories on storage
  4. I/O Management – handling input/output devices (keyboard, disk, network)
  5. Security & Access Control – user authentication, permissions
  6. Resource Allocation – deciding which process gets CPU/memory when

How it fits in the system

[ User Applications ]
        ↓
[ Operating System ]  ← manages & abstracts
        ↓
[ Hardware: CPU, RAM, Disk, I/O ]

Common Interview Angle

Q: Why is OS called a "resource manager"? A: Because it decides which process gets what resource, when, and for how long — CPU time, memory space, disk access — ensuring fairness and preventing conflicts (like two processes writing to the same memory location).

Q: What's the difference between OS and Kernel?