
Explore how the operating system governs a digital metropolis by managing processes, memory, and files, using system calls and the kernel to allocate resources and ensure integrity.
This lecture examines the fundamental components and architecture of modern operating systems. It defines a process as an active instance of a program and details its various execution states, such as running, ready, or blocked. The text outlines essential system abstractions, including memory management, file systems, and the protection mechanisms that safeguard resources from errors or malicious actors. Furthermore, it compares different structural designs, such as monolithic kernels, layered approaches, and microkernels, while weighing their relative performance and reliability. Finally, the source highlights the role of hardware abstraction layers and virtual machine monitors in ensuring software portability across diverse physical platforms.
This lecture examines the fundamental components and architecture of operating systems, illustrating how they act as a vital bridge between software applications and physical hardware. Key internal systems are explored, including process management, memory allocation, file systems, and I/O device handling, which collectively ensure efficient resource use and data persistence. The sources compare different structural design philosophies, such as monolithic kernels, layered approaches, and microkernels, highlighting the trade-offs between system performance and modular reliability. Additionally, the text clarifies the distinction between passive programs and active processes, detailing how the OS manages various execution states and inter-process communication. Through the use of hardware abstraction layers and virtual machines, modern systems achieve greater portability and security across diverse computing environments. These modules emphasize that while no single "perfect" design exists, the continuous evolution of operating system structure remains a critical challenge in software engineering.
This lecture explores the fundamental process abstraction in operating systems, defining a process as a dynamic program in execution. To manage these tasks, the kernel utilizes a Process Control Block (PCB), which stores critical execution data such as CPU registers, memory addresses, and identification numbers like the PID. The text examines the complexities of process creation, specifically detailing the mechanics of the fork() and exec() system calls used in Unix environments. Efficiency is prioritised through modern techniques like copy-on-write, which defers memory duplication until it is strictly necessary for operation. Beyond basic execution, the sources cover inter-process communication methods, including pipes and signals, which allow isolated tasks to collaborate or respond to external events. Finally, it addresses system management concepts such as user privileges, shell operations, and the grouping of processes into jobs for collective control.
This lecture explores the fundamental distinction between processes and threads in modern operating systems, emphasizing how they facilitate concurrency and parallelism. While a process serves as a container for address spaces and resources, threads act as the actual units of execution that share those resources to improve efficiency. The text compares kernel-level threads, which the operating system manages directly, against user-level threads that operate via libraries for even greater speed. It highlights that while user-level threads offer superior performance, they face challenges like blocking I/O and lack of kernel awareness. To bridge these gaps, advanced concepts like scheduler activations are introduced to coordinate communication between the system and the application. Ultimately, the source illustrates how separating execution state from resource ownership allows for faster, more responsive software.
This lecture offers a detailed look at the evolution of concurrency management in operating systems, focusing on the trade-offs between processes and threads. Initially, the document establishes that the heavyweight nature of processes—due to high creation and context-switching costs—led to the development of threads as a lighter unit of execution. It then contrasts kernel-level threads, which offer robust control but suffer from performance-draining system call overhead, with user-level threads, which are fast but can cause the entire process to stall if one thread makes a blocking system call. Ultimately, the text introduces Scheduler Activations as a more sophisticated solution, proposing a cooperative communication model between the kernel and the user-level thread library to balance the need for performance, control, and complexity.
Explore how operating systems achieve lighter concurrency by balancing parallelism and concurrency, moving from heavy processes to threads, kernel and user level threading, and scheduler activations with upcalls.
This lecture explores the fundamental differences between kernel threads and user-level threads within modern operating systems. While kernel-managed threads allow for better hardware utilisation, they are often slower due to the overhead of frequent system calls. Conversely, user-level threads offer superior performance for basic operations like creation and switching, yet they struggle when a single thread blocks the entire process during I/O tasks. To bridge this gap, the text introduces scheduler activations, a mechanism that enables the operating system and application to communicate via upcalls. This coordination allows the system to maintain the high speed of user-space management while effectively handling blocking operations and multiprocessor environments. Ultimately, the source highlights that while hybrid approaches provide significant efficiency, many modern systems are returning to refined kernel-level models for simplicity.
Explore how fork creates two processes from one, where the parent gets a pid and the child returns zero, then copy on write and waitpid tame non-deterministic execution.
This lecture provides a practical guide to Inter-Process Communication (IPC), detailing the mechanisms operating systems use to allow isolated processes to coordinate and exchange data. The material is divided into two main parts, first explaining Pipes, which are presented as unidirectional data streams for chaining commands using concepts like I/O Redirection and File Descriptors. The second part addresses Signals, which are asynchronous notifications used as Urgent Alerts for events like user interrupts or a child process terminating. The slides illustrate how signals rely on Signal Handlers to override default behaviors and also warn about the critical pitfall that signals are not queued, requiring handlers to drain all pending events at once.
This lecture explores operating system scheduling, which is the policy-driven process of deciding which kernel threads or processes should access the CPU next. It categorizes schedulers into types like batch, interactive, and real-time, while defining key performance metrics such as throughput, utilization, and response time. The material examines foundational algorithms, including First-Come First-Served, Shortest Job First, and Round Robin, highlighting the trade-offs between efficiency and fairness. It further explains how modern systems like UNIX use Multi-Level Feedback Queues to dynamically adjust priorities based on a thread's execution history. Ultimately, the source emphasizes that scheduling is a complex balance of mathematical laws and heuristic-based art aimed at optimizing hardware resources.
This lecture introduces synchronization as a vital method for managing temporal relationships between threads in an operating system. It highlights the dangers of race conditions, where interleaved execution of code can lead to unpredictable or incorrect results, particularly when multiple threads access shared variables. To maintain system integrity, the text defines critical sections and explains the necessity of mutual exclusion, which ensures that only one thread can execute sensitive logic at a time. The source explores various implementation strategies, ranging from hardware-level atomic instructions like "compare and exchange" to software mechanisms like spinlocks and disabling interrupts. While these low-level tools are functional, the material notes their potential for wastefulness, setting the stage for more advanced, efficient synchronization constructs such as semaphores and monitors.
This lecture introduces synchronization within operating systems, focusing on how to manage temporal relations between concurrent threads. When multiple threads access shared variables, they can create race conditions that lead to unpredictable or incorrect results. To prevent this, developers define critical sections and enforce mutual exclusion, often through the use of locks. While low-level mechanisms like spinlocks and disabling interrupts rely on hardware support, they can be inefficient or restricted to the kernel. Consequently, the text suggests transitioning toward more sophisticated constructs like semaphores and monitors to ensure progress and performance. These tools establish a strict "happens-before" relationship to maintain data integrity across complex, multi-threaded environments.
This lecture examines essential synchronisation primitives used in operating systems to manage concurrent threads and shared resources. It explores semaphores, which utilise atomic P and V operations to block or signal threads, and distinguishes between binary and counting versions. The text also explains condition variables and their role in solving complex coordination challenges like the bounded buffer and readers-writers problems. Furthermore, it introduces monitors as a high-level language construct that automates mutual exclusion through compiler-inserted logic. Finally, the source compares different synchronisation models, such as Hoare and Mesa monitors, while providing real-world context through Java's implementation of intrinsic locks.
Explore how interprocess communication and synchronization prevent race conditions, using semaphores and mutexes to manage critical sections and solve dining philosophers deadlock.
This lecture outlines the concept of system deadlocks, which occur when processes become blocked while holding resources and waiting for others to be released. The materials explain the four simultaneous conditions required for a deadlock to happen and introduce Resource Allocation Graphs as a visual tool for diagnosing the problem, noting that cycles within these graphs indicate a potential or actual deadlock. Furthermore, the source details three primary strategic solutions for managing deadlocks: Prevention, which aims to architect a system where deadlocks are structurally impossible; Avoidance, which uses algorithms like the Banker's Algorithm to maintain a "safe state" during resource allocation; and Detection & Recovery, which involves identifying and then resolving deadlocks, often by terminating processes or preempting resources, acknowledging that most modern systems like UNIX often simply ignore the problem due to performance costs.
This presentation provides a technical overview of deadlock, a state in which threads are permanently stalled because they are waiting for events that cannot occur. It identifies four essential conditions—mutual exclusion, hold and wait, no preemption, and circular wait—that must coexist for such a failure to happen. To manage these risks, the material outlines strategies for prevention, avoidance, and detection, including the use of resource allocation graphs and the Banker’s Algorithm. Beyond theoretical models, the text explores real-world complexities within the Windows kernel, noting that strict lock ordering is often difficult to maintain in integrated systems. Ultimately, the sources emphasize that while deadlocks are persistent once they occur, they can be resolved by identifying ownership cycles and carefully restructuring resource requests.
The lecture is a strategic guide to system deadlocks, explaining this phenomenon where processes are stuck in a circular wait for resources. It formally defines a deadlock and identifies the four required conditions for one to occur, including mutual exclusion and circular wait. The text also introduces Resource Allocation Graphs as a visual tool to diagnose potential deadlocks by looking for cycles. Finally, the guide outlines three major strategies for managing deadlocks—Prevention, Avoidance (using algorithms like the Banker's), and Detection & Recovery—while acknowledging that many modern systems like UNIX often ignore the problem due to performance overhead.
The safety algorithm example demonstrates calculating the need matrix and allocating A, B, and C to P1, P3, P4, P0, and P2 to achieve a safe state.
Deadlock detection algorithm demonstrates monitoring available, allocation, and request matrices to determine a safe sequence, similar to the banker's algorithm. Recovery options include aborting, rollback, preemption, and avoiding starvation.
Explore how hardware interrupts and software exceptions drive an event-driven operating system, coordinating asynchronous signals with the CPU using vectors and the interrupt descriptor table for multitasking, protection, and stability.
Explore how keystrokes become letters via scan codes and interrupts, translated by a character map, and how video RAM and raster scanning render a seamless screen with CPU and GPU.
Operating systems manage a complex I/O subsystem designed to bridge the gap between various hardware devices and user applications. Because hardware ranges from human-readable tools like keyboards to machine-readable disks, the system categorizes them into block, character, and network devices to standardize interactions. Communication is handled through polling, where the CPU checks device status, or interrupts, which notify the processor when a task is finished to increase efficiency. To maintain high performance, the kernel utilizes buffering, caching, and scheduling to manage data flow and resolve speed discrepancies. Programmers interact with these systems using blocking, non-blocking, or asynchronous calls, depending on whether the process needs to wait for data. Ultimately, the goal is to minimize CPU overhead and data copying to ensure the computer remains responsive despite the high demands of input and output operations.
This text explores the fundamental architecture and management of Input/Output (I/O) hardware within an operating system. Because devices vary greatly in data rates and transfer methods, the OS uses a layered subsystem to provide virtualized interfaces and categorize hardware into classes like block, character, and network devices. The documentation details different communication strategies, contrasting the CPU-intensive nature of polled mode I/O with the more efficient, signal-based interrupt-driven I/O. It further examines how buffering and caching mitigate performance mismatches between the processor and external hardware. Finally, the source outlines various programming interfaces, such as blocking and asynchronous calls, while highlighting that minimizing data copying and context switches remains a primary challenge for system efficiency.
The lecture focuses on the I/O System and Secondary Storage components of a computer. It outlines the structure and role of the I/O system, which serves as the "glue" connecting various hardware components like block and character devices through device controllers and different bus architectures. A significant portion of the text discusses secondary storage, specifically comparing and contrasting Hard Disk Drives (HDD) and Solid-State Drives (SSD), highlighting their characteristics, performance issues, and evolution within the computing ecosystem. The text also illustrates the memory hierarchy and storage latency using analogies to physical distance, emphasizing the performance differences between storage levels, and concludes by setting up the transition to discussing the File System.
The lecture discusses spinning hard disk drives and the disruptive technology of solid state drives (SSDs). The text first breaks down the physical structure and performance characteristics of traditional magnetic disks, including how the operating system minimizes expensive operations like seek time and rotation latency through layout, caching, and various disk scheduling algorithms such as FCFS, SSTF, and C-SCAN. It then shifts focus to SSDs, highlighting their structure based on NAND flash memory and their superior performance metrics for reads compared to hard drives. Finally, the text explains the complexities of SSD writes, which involve erasures and impact the drive's lifespan, and discusses strategies like wear-leveling and log-structured filesystems used to manage these issues.
Explore memory management concepts, including fixed and variable partitioning, swapping, paging, segmentation, and virtual memory, and compare first, best, and worst fit strategies.
This lecture examines the complexities of Windows memory management, specifically focusing on how the operating system handles paging and kernel heap allocations. Through a series of detailed diagrams, the text illustrates the state transitions of page frames, including various categories like free, standby, and modified pages. A significant portion of the module presents a computational experiment that uses varying access patterns to demonstrate how hardware and software interact to impact performance. By analyzing how different memory strides affect execution time, the source explores the limitations of CPU caches and the role of Translation Lookaside Buffers (TLB). Finally, the material introduces page coloring as a strategy used by the memory manager to prevent different virtual addresses from competing for the same physical cache lines.
Explore how virtual memory uses pages, frames, and a page table to map program memory, handle page faults, and provide isolation across programs in modern systems.
This lecture introduces the concept of virtual memory and its critical role in modern computing. It explains how this system simplifies programming by giving each process its own private address space while optimizing physical RAM as a high-speed cache for data stored on disk. The sources detail the process of address translation, where a Memory Management Unit uses page tables to convert virtual locations into physical ones. Key operational scenarios are explored, including page hits and page faults, the latter of which requires the operating system to swap data between memory and disk. Furthermore, the text highlights how virtual memory ensures system security by isolating different processes and enforcing specific access permissions. Finally, it addresses performance issues like thrashing, which occurs when insufficient RAM causes continuous, inefficient data swapping.
The lecture details the technical mechanisms behind virtual memory address translation, specifically focusing on how systems convert virtual addresses into physical ones. To mitigate the latency of accessing page tables in main memory, the text introduces the Translation Lookaside Buffer (TLB), a specialized hardware cache that accelerates this mapping process. The sources outline the step-by-step procedures for TLB hits and misses, explaining how the system handles page faults by retrieving data from a disk. Additionally, the materials address context switching, noting that while CPU registers and TLB entries must be updated or invalidated, physical memory and general caches can often remain unchanged. Finally, the slides define the mathematical parameters of address spaces and briefly mention hardware-level security vulnerabilities like the DRAMMER attack.
This lecture overview explores virtual memory, a mechanism that creates the illusion of a massive address space by leveraging the principle of locality. By partitioning memory into pages, the system can efficiently manage data transfers between fast physical RAM and larger, slower secondary storage. Key hardware components like the Page Table and Translation Lookaside Buffer (TLB) are detailed as essential tools for mapping virtual addresses to physical locations while minimizing latency. The text also examines critical design challenges, including page replacement algorithms, protection protocols, and the trade-offs involved in selecting an optimal page size. Ultimately, these systems ensure that expensive physical memory is fully utilized while simplifying memory management for programmers.
Explore dynamic memory allocation, fragmentation, and the trade-offs of allocation strategies like first fit, best fit, and slab allocation, plus garbage collection techniques.
The lecture offers a detailed overview of file systems in operating systems, explaining their fundamental mission to abstract secondary storage into organized files and directories. It explores the relationship between applications, the operating system, and hardware devices, noting that file systems handle block I/O for storage. The majority of the material compares and contrasts three major file systems: the simplicity and limitations of Microsoft's FAT (File Allocation Table), the historical structure and consistency checks of Unix's file system using i-nodes, and the advanced features of NTFS (New Technology File System). A significant section is dedicated to journaling file systems, emphasizing their role in providing fast crash recovery by using a transaction log to maintain data consistency. Finally, the text details the design constraints, on-disk structures, access methods, and various directory organizations used by these different systems.
The provided documents offer a comprehensive technical overview of ZFS, a modern file system designed to simplify storage administration while enhancing data integrity. Unlike traditional systems constrained by physical disk boundaries, ZFS utilizes pooled storage, allowing file systems to share a common resource and scale dynamically as hardware is added. The sources highlight advanced features such as RAID-Z, which prevents data corruption through a copy-on-write mechanism, and disk scrubbing, which proactively identifies latent errors. Additionally, the text explains the efficiency of snapshots and clones, which provide near-instantaneous, space-saving methods for capturing and replicating data states. Performance is further optimized through pipelined I/O and dynamic striping, ensuring that data is distributed effectively across all available devices. Overall, ZFS is presented as a robust solution that merges the roles of a file system and a logical volume manager.
Explore how the file system abstracts hardware, manages inodes, and protects data with journaling, ACLs, and capabilities for reliable storage.
This presentation explores the architecture and evolution of distributed systems, which range from loosely-coupled independent networks to tightly-coupled multiprocessors. It highlights critical design challenges such as scalability, reliability, and transparency while providing historical and modern implementation examples. The text details the Grapevine mail service and Google’s search infrastructure, explaining how the latter utilizes MapReduce and massive parallelism to handle enormous data volumes. Furthermore, it examines volunteer computing initiatives like BOINC and the concept of human computation, where human cognitive strengths are integrated with machine processing. Ultimately, the source emphasizes that robust software frameworks are essential for making complex, distributed hardware appear as a single, dependable unit to the user.
This lecture provides a comprehensive overview of Distributed File Systems (DFS), which allow users to access remote data as if it were stored on a local machine. The text examines fundamental design challenges, including naming conventions, replication for reliability, and the critical trade-off between system performance and data consistency. It compares several historical and modern implementations, such as NFS for general Unix sharing, AFS for scalability through local disk caching, and the Sprite system for diskless workstations. Finally, the material highlights the Google File System (GFS), explaining how it manages massive datasets by optimizing for append-only operations and high-bandwidth sequential reads. These sources demonstrate that there is no single ideal architecture, as different systems prioritize different workloads and environmental needs.
This course contains the use of artificial intelligence. Some of the videos in this course were created using AI-assisted tools. These tools were used to professionally produce high-quality visuals and narration in order to make the learning process clearer, more engaging, and more efficient. All learning materials were carefully selected, organized, and updated by the instructor to reflect current knowledge and best practices. AI was used as a supportive technology, not as a substitute for subject-matter expertise, instructional design, or academic responsibility.
Updates:Tens of New lecture videos and resources are uploaded (December 2025)
This comprehensive Operating Systems course is designed to take learners from fundamental concepts to advanced, real-world mechanisms used in modern operating systems. The course combines strong theoretical foundations with practical intuition, visual explanations, and step-by-step examples to ensure deep and lasting understanding.
Starting with the role and structure of operating systems, the course introduces how software, hardware, and users interact within a computer system. Learners then explore core components such as system architecture, computer system structures, and operating system design models, building a solid conceptual base.
A major focus of the course is process management and concurrency. You will learn how processes and threads are created, scheduled, synchronized, and terminated, including detailed coverage of inter-process communication (IPC), message queues, pipes, signals, and the internal behavior of system calls such as fork(). The evolution of concurrency models, lightweight threads, and multicore programming is explained in a clear and structured manner.
CPU scheduling is covered extensively through intuitive explanations, animated lecture slides, and numerous solved examples. Scheduling algorithms such as FCFS, SJF, SRTF, Round Robin, and Priority Scheduling are analyzed in depth, with performance comparisons and hands-on assignments that walk through each algorithm step by step.
The course provides a strong treatment of synchronization and deadlocks, including classical algorithms (Peterson, Bakery), hardware synchronization mechanisms, semaphores, and classical synchronization problems. Deadlock detection, avoidance, and recovery strategies are explained using resource allocation graphs, safety algorithms, and practical examples.
Learners will also gain a deep understanding of low-level operating system mechanisms such as interrupts, exceptions, and the I/O subsystem, followed by an in-depth exploration of memory management. Topics include paging, virtual memory, page replacement algorithms, address translation, fragmentation, garbage collection, and dynamic memory allocation, supported by technical explanations and visual aids.
The final sections focus on file systems, mass storage, disk scheduling, protection, and security. You will learn how modern file systems are designed, how operating systems enforce protection and access control, and how trust and security mechanisms are implemented at the OS level.
This course is ideal for computer science and computer engineering students, software developers, and anyone seeking a deep, structured understanding of how operating systems work internally. By the end of the course, learners will be able to analyze operating system behavior, understand design trade-offs, and confidently approach advanced topics in systems programming and computer architecture.
After completing this course, the student
Be able to explain what an operating system and the role is it different parts of the system play.
Be able to explain the structure of operating systems, applications, and the relationship between them.
Be able to explain and make use of the services provided by operating systems
Exposure to details of major OS concepts
Write programs (Implement) various parts of operating systems.
Section 1:Introduction
Lecture 1:Introduction to Operating Systems+ Slides + Summarized Lecture note
Lecture 2:Operating System Structures: The Digital Metropolis
Lecture 3:Operating System Architecture and Component Structure
Section 2:Fundamental of Computers and Operating Systems
Lecture 4:Operating System Structures and Components
Lecture 5:Operating System Structures and Components part 2
Lecture 6:Computer System Structures
Lecture 7:Operating System Structures
Section 3:Processes and Threads - Create a Process and Inter-processes Communication
Lecture 8:Processes + Lecture Slides
Lecture 9:The Process Abstraction and Lifecycle + Slide
Lecture 10:Operating System Threads and Multicore Programming
Lecture 11:the Evolution of Concurrency Management in Operating Systems
Lecture 12:Lighter Concurrency
Lecture 13:User-Level Threads and Scheduler Activations
Lecture 14:The case of the Cloning Program
Lecture 15:Unpacking the fork() Mystery
Lecture 16:How computers run commands?
Lecture 17:Understanding Message Queues
Lecture 18:Mastering IPC: Pipes and Signals
Section 4:CPU Scheduling + Lecture Slides
Lecture 19:CPU Scheduling: Perfect Lecture Slides
Lecture 20:Introduction to Operating System CPU Scheduling Algorithms and Performance
Lecture 21:Processes - long and short schedulers, context switch, process creation and term
Lecture 22:Round Robin Algorithm with Examples
(Preview enabled)
Lecture 23:Cooperative Processes
Lecture 24:CPU Scheduling + Lecture Slides
Lecture 25:First Come First Served (FCFS) and Shortest Job First (SJF)
Lecture 26:Round Robin CPU Scheduling + Animated Slide Example
Lecture 27:Round Robin Examples
Lecture 28:Priority Scheduling
Lecture 29:Priority Scheduling Examples
Assignment 1:First-Come-First-Served Example with Step-by-step Animated Solution
Assignment 2:Round-Robin Scheduling Example with Step-by-step Animated Solution
Assignment 3:Shortest Job First Example with Step-by-step Animated Solution
Assignment 4:Shortest-Remaining-Time-First Example with Step-by-step Animated Solution
Section 5:Process Synchronization
Lecture 30:Introduction to Interprocess Communication and Synchronization
Lecture 31:Process Synchronization - Peterson and Bakery Algorithms
Lecture 32:Synchronization Hardware + easy to understand example in lecture note!
Lecture 33:Semaphores + Animated Lecture Slides
Lecture 34:Classical problems of synchronization + Slides
Lecture 35:Concurrency and Synchronization in Operating Systems
Section 6:Deadlocks
Lecture 36:Introduction to Deadlocks
Lecture 37:System Deadlocks: Diagnosis, Strategy, and Resolution
Lecture 38:Deadlocks - Resource Allocation Graph + Lecture Slides with Animated Examples
Lecture 39:Deadlocks Avoidance Algorithms + the dining philosophers problem solution slides
Lecture 40:Safety Algorithm Example
Lecture 41:Deadlock Detection Algorithm Example
Lecture 42:Deadlock-Quiz-solution
Section 7:CPU Interrupts and Exception Handling Mechanisms
Lecture 43:Operating System Input/Output Subsystem Architecture and Performance
Lecture 44:Interrupts & Exceptions
Lecture 45:Computer Input / Output
Lecture 46:Input-Output Interfaces and Data Transmission
Section 8:Memory Managment
Lecture 47:Introduction to Memory Management Methods
Lecture 48:Memory Management + Lecture Slides
Lecture 49:Swappig
Lecture 50:Memory Management - Paging
Lecture 51:Page Replacement Algorithms
Lecture 52:Introduction to Virtual Memory
Lecture 53:Virtual Memory Systems and Address Translation Mechanism
Lecture 54:Dynamic Memory Allocation, Fragmentation, and Garbage Collection
Lecture 55:Virtual Memory: Paging and Fast Address Translation + Lecture Slides + TechPaper
Section 9:Operating System File System Fundamentals and Design
Lecture 56:Architecting the Modern File System
Lecture 57:Mass-Storage Structures and Disk Scheduling
Lecture 58:Operating System Protection Mechanisms and Policies
Lecture 59:File Systems
Section 10:Protection and Security
Lecture 60:Operating System Security and Access Control Mechanisms
Lecture 61:Operating Systems: File-System Interface and Structure
Lecture 62:The Architecture of Trust: Operating System Protection