DEV Community

King coder
King coder

Posted on

OPERATING SYSTEM β€” DETAILED EXAM NOTES (UNIT-WISE, CIITM Dhanbad)

🟦 UNIT – I : OS Basics, Types, Services, Structure, System Calls


⭐ 1. Operating System – Definition

An Operating System (OS) is system software that manages computer hardware, executes programs, and provides a user-friendly environment for running applications.

It acts as an intermediary between user and hardware.


⭐ 2. Functions of Operating System

  1. Process Management
  • Creates, schedules, and terminates processes.
  1. Memory Management
  • Allocates memory to programs.
  • Performs deallocation when program ends.
  1. File Management
  • Creates, deletes, and organizes files.
  1. Device Management
  • Controls hardware devices (printers, disks, keyboard).
  1. Security & Protection
  • Prevents unauthorized access.
  1. Error Detection
  • Detects and handles system errors.
  1. Resource Allocation
  • Manages CPU, memory, disk, I/O.
  1. User Interface
  • Command-line (CLI)
  • Graphical (GUI)

⭐ 3. Types of Operating Systems

βœ” 1. Batch Operating System

  • Jobs grouped into batches.
  • No user interaction during execution.
  • Example: Banking batch jobs.

βœ” 2. Multiprogramming Operating System

  • Multiple programs kept in memory at same time.
  • CPU switches between them.
  • Increases CPU utilization.

βœ” 3. Time Sharing Operating System

  • CPU time divided into time slices.
  • Many users use computer simultaneously.
  • Example: UNIX, Linux.

βœ” 4. Single-User Operating System

  • Only one user at a time.
  • Simple, low-security.
  • Example: Windows 98.

βœ” 5. Multiuser Operating System

  • Multiple users logged in at same time.
  • Strong protection.
  • Example: Linux, Unix server.

⭐ 4. Components of an Operating System

  • Process Manager – handles processes
  • Memory Manager – allocates memory
  • File Manager – manages files/folders
  • I/O Manager – controls devices
  • Security Manager – permissions & protection
  • Kernel – core of the OS
  • Shell – command interpreter

⭐ 5. Operating System Services

  • Program execution
  • File system access
  • Device access
  • Communication
  • Error handling
  • Resource allocation
  • I/O operations
  • Authentication & security

⭐ 6. System Calls

System calls allow user-level programs to interact with OS.

Types of System Calls:

  1. Process Control – create, terminate process
  2. File Management – open, read, write files
  3. Device Management – request or release device
  4. Information Maintenance – get system info
  5. Communication – send/receive messages

⭐ 7. System Programs

Useful programs included with OS:

  • Text editors
  • Compilers & Assemblers
  • File management tools
  • Command interpreters (shell)
  • Utilities (backup, compression)

⭐ 8. System Structure

1. Monolithic Structure

  • Entire OS is one large program.

2. Layered Structure

  • OS divided into multiple layers.

3. Microkernel

  • Minimal kernel; rest runs in user mode.

4. Modules

  • OS built in modular form.

5. Virtual Machines

  • Hardware is virtualized.

🟦 UNIT – II : Processes, Scheduling, Threads


⭐ 1. Process Concept

A process is a program in execution.
It includes:

  • Program counter
  • Stack
  • Data section
  • CPU registers

⭐ 2. Process States

  1. New – process created
  2. Ready – waiting for CPU
  3. Running – executing
  4. Waiting – waiting for I/O
  5. Terminated – finished execution

⭐ 3. Process Control Block (PCB)

A data structure used by OS to store information about a process.

Contains:

  • Process ID
  • CPU registers
  • Process state
  • Program counter
  • Scheduling info
  • Memory allocation info

⭐ 4. Process Scheduling

Decides which process runs next.


⭐ 5. Scheduling Criteria

  • CPU utilization
  • Throughput
  • Turnaround time
  • Waiting time
  • Response time

⭐ 6. Scheduling Algorithms

βœ” 1. FCFS (First Come First Serve)

  • Simple
  • Non-preemptive
  • Process served in arrival order

βœ” 2. SJF (Shortest Job First)

  • Selects shortest process first
  • Preemptive version β†’ SRTF

βœ” 3. Priority Scheduling

  • Highest priority runs first
  • Can cause starvation

βœ” 4. Round Robin

  • Time-sharing
  • Each process gets fixed time quantum

βœ” 5. Multilevel Queue Scheduling

  • Different queues for different process types

⭐ 7. Multiple Processor Scheduling

  • Used in multicore CPUs
  • Load balancing between processors
  • Two types:

    • Asymmetric multiprocessing
    • Symmetric multiprocessing (SMP)

⭐ 8. Real-Time Scheduling

  • Hard real-time β†’ deadlines must be met
  • Soft real-time β†’ occasional misses allowed

⭐ 9. Threads

A thread is a lightweight process.

Types:

  • User-level threads
  • Kernel-level threads

Advantages:

  • Faster context switching
  • Efficient resource usage
  • Useful in web servers, games, browsers

🟦 UNIT – III : Critical Section, Synchronization, Deadlocks


⭐ 1. Critical Section Problem

Section of code where shared resources are accessed.

Requirements

  • Mutual Exclusion – only one process
  • Progress – no unnecessary waiting
  • Bounded Waiting – limit on wait time

⭐ 2. Semaphores

Used for synchronization.

Types

  • Binary semaphore
  • Counting semaphore

Operations

wait(S); // decrements S
signal(S); // increments S
Enter fullscreen mode Exit fullscreen mode

⭐ 3. Classical Problems of Synchronization

  1. Producer–Consumer Problem
  2. Readers–Writers Problem
  3. Dining Philosophers Problem
  4. Sleeping Barber Problem

⭐ 4. Deadlock

Occurs when a set of processes are waiting for each other forever.

Deadlock Conditions (Necessary & Sufficient):

  1. Mutual exclusion
  2. Hold & wait
  3. No preemption
  4. Circular wait

⭐ 5. Methods for Handling Deadlock

βœ” 1. Deadlock Prevention

Break one of the 4 conditions.

βœ” 2. Deadlock Avoidance

  • Use extra information
  • Banker’s algorithm

βœ” 3. Deadlock Detection

  • Resource allocation graph
  • Periodic checking

βœ” 4. Deadlock Recovery

  • Kill process
  • Rollback process
  • Resource preemption

🟦 UNIT – IV : Memory Management, Paging, Segmentation, Virtual Memory


⭐ 1. Logical vs Physical Address

  • Logical address β†’ generated by CPU
  • Physical address β†’ actual location in RAM
  • MMU translates logical β†’ physical

⭐ 2. Contiguous Allocation

Two methods:

βœ” Fixed Partitioning

  • Memory divided into fixed-sized blocks
  • Internal fragmentation

βœ” Variable Partitioning

  • Dynamic partitions
  • External fragmentation

⭐ 3. Swapping

Entire process swapped between RAM and disk.


⭐ 4. Paging

  • Memory divided into pages and frames
  • Removes external fragmentation

⭐ 5. Segmentation

Memory divided into variable-sized segments:

  • Code
  • Data
  • Stack

More user-friendly than paging.


⭐ 6. Virtual Memory

Allows running programs larger than actual physical memory.

Techniques:

  • Demand paging
  • Page replacement

⭐ 7. Demand Paging

Loads page into memory only when needed.

Page Fault:

Occurs when page is not in memory.


⭐ 8. Page Replacement Algorithms

βœ” FIFO

Replace oldest page.

βœ” LRU (Least Recently Used)

Replace page not used for longest time.

βœ” Optimal

Replace page that will not be used in future.


🟦 UNIT – V : Disk Scheduling, File Systems, Directories, Protection


⭐ 1. Disk Scheduling Algorithms

βœ” FCFS

Serve in arrival order.

βœ” SSTF

Serve request closest to current head position.

βœ” SCAN

Arm moves like elevator.

βœ” C-SCAN

Circular version of SCAN.

βœ” LOOK / C-LOOK

SCAN/C-SCAN with smart stopping.


⭐ 2. Disk Management

Includes:

  • Partitioning
  • Formatting
  • Boot block
  • Bad block management

⭐ 3. Swap Space Management

Used to store swapped-out pages.
Located on fast disk space.


⭐ 4. Disk Reliability

Techniques:

  • Mirroring
  • RAID
  • Backups

⭐ 5. Stable Storage

Data stored safely using redundant devices.


⭐ 6. File Concepts

A file is a named collection of related information.

Attributes:

  • Name
  • Type
  • Size
  • Location
  • Permissions
  • Owner

⭐ 7. Directory Structure

  • Single-level
  • Two-level
  • Tree-structured
  • Acyclic graph
  • General graph

⭐ 8. File Protection

  • Access control lists
  • Read/Write/Execute permissions
  • Password protection
  • Encryption

πŸ“ IMPORTANT EXAM QUESTIONS (DETAILED)


⭐ UNIT – I

  1. Explain functions of operating system.
  2. Describe different types of operating systems.
  3. What are system calls? Explain types.
  4. Explain OS services.

⭐ UNIT – II

  1. Explain process states and PCB with diagram.
  2. Explain scheduling algorithms.
  3. What are threads? Explain their advantages.

⭐ UNIT – III

  1. What is critical section? Explain its requirements.
  2. Explain semaphores with examples.
  3. Explain deadlock detection, prevention & avoidance.

⭐ UNIT – IV

  1. Explain paging & segmentation.
  2. Explain page replacement algorithms.
  3. What is demand paging? Explain page faults.

⭐ UNIT – V

  1. Explain disk scheduling algorithms.
  2. Explain directory structures.
  3. Explain file protection techniques.

Top comments (0)