Operating Systems

Instructor

Dr. Janibul Bashir

Course Overview

In this course, we will understand the conceptual pieces that are fundamental to operating systems: virtualization, concurrency, and persistence. In understanding the details, you will also learn the practical, including how an operating system does things like schedule the CPU, manage memory, and store files persistently.

Course Code

ITT250

Lectures

Mon, Tue, Wed, Thur (L11)

Pre-Requisites: Knowledge of C Programming (Refer to HeadFirst C Book).

Reference Material for the course:

Text Book (TB): Operating System Concepts by A. Silberschatz, P. B. Galvin and G. Gagne (Sixth Edition)

Book For OS Programming (P1): Programming in C by A.D. Marshall [html]

Reference (R): Operating Systems (Three easy pieces) by Remzi H. Arpaci-Dusseau and Andrea C. Arpaci-Dusseau.

Video Lectures: Operating System by Prof. Sourav Bansal [Videos]

Announcements:

  1. Assignment 1 - 4 has been released. [23-04-2022]

Course Content

Introduction (TB-Chapter 1, 2, R2-Chapter 2)

(21-03-2022) -- [Lecture 1] Introduction to Operating Systems, Course Structure

(22-03-2022) -- [Lecture 2] CPU and Memory Virtualisation, Concurrency, and Persistance

(22-03-2022) -- [Lecture 3] OS Goals and evolution of an OS from a library file to a resource manager.

System Calls (TB-Chapter 3, 4, R2-Chapter 4, 5, Video: L1,L2,L3)

(23-03-2022) -- [Lecture 4] Introduction to system calls, System calls for processor manipulation.

(23-03-2022) -- [Lecture 5] System calls for file manipulation, file descriptors.

(24-03-2022) -- [Lecture 6] Interprocess communication (IPC): shared memory (system calls), message passing.

(24-03-2022) -- [Lecture 7] IPC via pipes(), signals and signal handlers.

Processes (TB-Chapter 4, R2-Chapter 6, 13, 14 Video: L4,L5,L6)

(28-03-2022) -- [Lecture 8] PC Architecture (x86) - Reference

(28-03-2022) -- [Lecture 9] Process structure in memory, Address space of a process.

(29-03-2022) -- [Lecture 10] How to run processes efficiently: Limited direct execution, Memory Management Unit

Segmentation (TB-Chapter 8, R2-Chapter 14, 15, 16 Video: L6,L7,L8,L9)

(30-03-2022) -- [Lecture 11] Segmenatation

(31-03-2022) -- [Lecture 12] Mechanism to implement system calls (User and Kernel stacks)

(31-03-2022) -- [Lecture 13] Mechanism to implement context switch

(04-04-2022) -- [Lecture 14] Free Memory management - Operating System Allocators. (H/W: Comparative analysis of different allocators)

Operating System Scheduling (TB-Chapter 5, R2-Chapter 7, 8, 9, 10 Video: L37)

(04-04-2022) -- [Lecture 15] Operating system scheduling, Scheduling policies.

(05-04-2022) -- [Lecture 16] Multi-level Feedback Queue scheduling, Multiprocessor Scheduling (H/W: O(1), CFS, and BFS schedulars)

Paging (TB-Chapter 8 - 9, R2-Chapter 18 - 23 Video: L10-L15)

(11-04-2022) -- [Lecture 17] Introduction to Paging, Page Tables.

(18-04-2022) -- [Lecture 18] Translation LookAside Buffer (TLB), Multi-Level Page Tables

(19-04-2022) -- [Lecture 19] Inverted Page Tables

(20-04-2022) -- [Lecture 20] Demand Paging, Copy-on-Write

(25-04-2022) -- [Lecture 21] Page Replacement Policies, Balady's Anamoly

(26-04-2022) -- [Lecture 22] Thrashing, Working-Set Model.

(04-05-2022) -- [Lecture 23] Understanding the xv6 structure.

Midterm Exam [9-05-2022 to 20-05-2022]

Concurrency: Threads and Synchronisation (TB-Chapter 4,6,7, R2-Chapter 26 - 33 Video: L20-L28)

(23-05-2022) -- [Lecture 24] Introduction to Threads, Pthread APIs.

(24-05-2022) -- [Lecture 25] Synchronization problem in threads: Critical Section Problem.

(25-05-2022) -- [Lecture 26] Introduction to Locks, Spin-Lock.

(26-05-2022) -- [Lecture 27] Hardware Primitives: testandset, compareandexchange, fetchandadd.

(27-05-2022) -- [Lecture 28] Condition Variables: producer-consumer problem.

(30-05-2022) -- [Lecture 29] Semaphores and Monitors

(31-05-2022) -- [Lecture 30] Concurrency Bugs: Deadlocks

Persistance: Input/Output, Hard Disk Drives, RAIDS (TB-Chapter 10, 13, R2-Chapter 36 - 38 Video: L31)

(02-06-2022) -- [Lecture 31] Interfacing Input output devices, Polling and interrupts.

(07-06-2022) -- [Lecture 32] CPU Programmed I/O vs DMA, Peripheral Mapped vs Memory Mapped I/O, Device Drivers.

(08-06-2022) -- [Lecture 33] Hard Disk Drives and their Geometry, Seek time, Rotational Delay, and Disk Scheduling.

(09-06-2022) -- [Lecture 34] Disk Management: Disk formatting, bad blocks (sector sparing or forwarding, sector spilling), boot sector.

(13-06-2022) -- [Lecture 35] RAIDs

File System and its Implementation (TB-Chapter 11, 12, R2-Chapter 39 - 42 Video: L32 - L35)

(14-06-2022) -- [Lecture 36] File System Interface - Accessing files.

(16-06-2022) -- [Lecture 37] File System Implementation: File and Directory structure.

(16-06-2022) -- [Lecture 38] File System Implementation: Disk block allocation, Free Space Management.

(20-06-2022) -- [Lecture 39] Very Simple File System and Fast File System.

(21-06-2022) -- [Lecture 40] Reliability in FS: FSCK and Journalling.

Assignments

Assignment 1: -- Create a basic shell program

Assignment 2: -- Explore the source code of Linux Kernel (or FreeBSD)

Build a kernel to create an ISO file > Install the OS on your system

Assignment 3 -- Add a new system call and a signal Handler to your OS.

Add a system call to the OS Kernel

Build and Install the Kernel

Use the system call in the user program

Assignment 4 -- Build a Basic program for finding the program status (Like top)

Assignment 5 -- Explore the source code of xv6 and analyze the paging and locking mechanisms implemented in xv6.

Assignment 6 -- Implement the ls and stat functionality in xv6.