BCS401 Operating System Semester IV · AY 2025-26 onward
Unit 1 · Introduction & OS Structure

Lecture 1: OS basics: definition, goals, functions

Learning outcomes

  • Explain the basic definition of an operating system and its primary goals and functions.

Prerequisites

Basic understanding of computer organization (CPU, memory, I/O devices), ability to write and run simple programs in a high‑level language, and familiarity with compiling/executing programs.

Lecture Notes

Main content

BCS401 — Operating System (Semester IV)

Unit 1 — Introduction & OS Structure

Lecture 1: Course Overview + “Why Operating Systems?”

Today’s Goal

By the end of this lecture, you should clearly understand what an Operating System does, why it matters for every software developer, and how this course will run (units, labs, assignments, and evaluation).


1) Warm-up: When you double-click an application, what actually happens?

Think about these questions:

  • Where does the program load from?
  • Who gives it memory?
  • Who schedules CPU time so it runs smoothly with other applications?
  • Who controls files, keyboard, screen, printer, and network?
Answer:

The Operating System is the “manager” that makes all this possible.


2) What is an Operating System?

An Operating System is system software that manages computer hardware resources and provides a common foundation and environment for application programs. It acts as an intermediary between users/applications and the hardware.

2.1 Abstract view of a computer system

A computer system can be viewed as four main components:

  • Hardware (CPU, memory, input/output devices)
  • Operating System
  • Application Programs (editors, browsers, compilers, etc.)
  • User
User Application Programs Operating System Computer Hardware (CPU, Memory, I/O Devices)
Fig 1.1: Abstract view of a computer system (User → Applications → OS → Hardware).

3) Two core roles of an Operating System

Role A: Resource Manager

A computer has limited resources (CPU time, memory space, storage space, and input/output devices). The Operating System decides how to allocate these resources among programs and users.

  • CPU scheduling: who runs next and for how long?
  • Memory allocation: which program gets how much RAM?
  • Device management: keyboard, disk, display, network, printer
  • File management: storing and protecting data on disk

Role B: Service Provider

The Operating System provides standard services and convenient abstractions so that programs can run safely and efficiently. Instead of dealing with hardware details, programs use Operating System services through well-defined interfaces.

  • Process and thread support
  • Security and protection
  • Networking and inter-process communication support
  • Convenient abstractions (files, sockets, virtual memory)
Simple one-line definition:

The Operating System is both a Resource Manager (allocates CPU, memory, devices) and a Service Provider (offers standard services/abstractions to users and programs).


4) Why you should care (real developer reasons)

  • Performance: faster software often requires understanding scheduling and memory behavior.
  • Debugging: deadlocks, race conditions, and crashes are often Operating System-level stories.
  • Backend & Cloud: containers, virtualization, servers, and resource limits depend on Operating System concepts.
  • Security: permissions, isolation, and protection start with Operating System fundamentals.

5) Course Outcomes and Roadmap

5.1 Course Outcomes (CO)

  • CO1: Explain Operating System structure and functions.
  • CO2: Explain processes/threads and scheduling algorithms.
  • CO3: Explain concurrency, synchronization, and deadlocks.
  • CO4: Explain memory management and virtual memory.
  • CO5: Explain input/output management and file systems.

5.2 Roadmap (5 Units)

  1. Unit 1: Operating System basics, types, structure, services.
  2. Unit 2: Concurrency and synchronization (semaphores, classic problems).
  3. Unit 3: CPU scheduling, threads, and deadlocks.
  4. Unit 4: Memory management, paging/segmentation, virtual memory.
  5. Unit 5: Input/output management, disk scheduling, file systems, security.

6) Operating System goals and objectives

Goal Meaning Simple Example
Performance Do more work in less time; reduce waiting; increase utilization. CPU scheduling keeps the CPU busy and reduces turnaround time.
Fairness No single program should hog the CPU forever. Time slice gives each runnable process a turn.
Reliability Stable system; handle errors without crashing frequently. Log errors, retry input/output, isolate faulty processes.
Security Prevent unauthorized access; protect data and services. Login + file permissions + encryption support.
Throughput Maximize work done per unit time. Number of completed jobs per minute.

7) Core functions of an Operating System (mapped to resources)

7.1 Process Management (CPU)

  • Create and terminate processes
  • CPU scheduling: decide which process gets the CPU
  • Inter-process communication (pipes, message passing)
  • Synchronization: prevent data corruption for shared data

7.2 Memory Management (RAM)

  • Track used/free memory
  • Allocate and deallocate memory
  • Virtual memory (paging concepts)
  • Protection/isolation between processes

7.3 File & Storage Management (Disk)

  • Create and manage files and directories
  • Permissions, backup and security
  • Free-space management
  • Map files to physical blocks on disk

7.4 Input/Output & Device Management (Devices)

  • Device drivers
  • Buffering, caching, spooling
  • Interrupt handling

7.5 Protection & Security (Safety)

  • User authentication (passwords/biometrics)
  • Protection: one application cannot crash another
  • Defense against malware and intruders

7.6 User Interface (User Experience)

  • Shell / Graphical User Interface
  • System utilities
  • Application programming interfaces for applications

8) Key terms (must know)

  • Kernel: core part of the Operating System running in privileged mode.
  • System call: programming interface through which a user program requests a service from the Operating System kernel.
  • Interrupt: signal to the CPU that needs immediate attention.
  • Protection: preventing incorrect/unauthorized access to resources.
  • Scheduling: deciding which process gets the CPU next.

9) Short example: what the Operating System does when you run a program

  1. You click an application (or run a command).
  2. The Operating System loads the executable from disk into memory.
  3. The Operating System creates a process, sets up stack/heap, assigns a process identifier.
  4. The scheduler gives it CPU time and the Operating System handles input/output requests.
  5. On completion, the Operating System frees memory and closes files/resources.

10) Check Yourself

  1. Why is the Operating System called a Resource Manager?
  2. Name any four Operating System functions and map them to CPU/RAM/Disk/Devices.
  3. What is a system call? Give one example of a service it requests.
  4. What is protection? Why is it important in multiuser systems?
  5. What can happen if the Operating System does not schedule the CPU fairly?

Worked Example

Worked Example: Running a Program (Resource Manager + Service Provider)

Scenario: You run a program (for example, calculator.exe or a.out).

As a Resource Manager

  • Allocates CPU time using the scheduler.
  • Allocates memory for code, stack, and heap.
  • Controls disk access when the program loads libraries or reads files.
  • Manages I/O devices (keyboard/screen) safely via drivers.

As a Service Provider

  • Provides system calls like create process, read file, write output.
  • Provides standard abstractions like files and processes.
  • Provides protection so one program cannot overwrite another program’s memory.
  • Returns clear error codes/messages if something fails (file not found, permission denied, etc.).

One-Page Summary

One-Page Summary — Lecture 1

  • An Operating System manages computer hardware and provides a foundation/environment for application programs.
  • In an abstract system view: User → Applications → Operating System → Hardware.
  • Two core roles:
    • Resource Manager: allocates CPU time, memory, storage, and devices among programs/users.
    • Service Provider: provides standard services/abstractions (processes, files, networking) through system calls.
  • Why we need an Operating System: convenience, efficiency, sharing, and protection.
  • Goals: performance, fairness, reliability, security, throughput.
  • Core functions: process management, memory management, file/storage management, device/I/O management, protection/security, user interface.
  • Running a program: load → create process → schedule → handle I/O → terminate and clean up.