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

 L1

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:

Course Content

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

(22-02-2024) -- [Lecture 1] Introduction to Computers, Course Structure.

(23-02-2024) -- [Lecture 2] PC Architecture (x86), Physical Address Space, Compilation Flow -  Reference

(26-02-2024) -- [Lecture 3] Compilation Flow, Concept of CPU and Memory Virtualization.

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

(27-02-2024) -- [Lecture 4] Introduction to system calls, System calls for processor manipulation, System calls for file manipulation.

(28-02-2024) -- [Lecture 5] Interprocess communication (IPC): shared memory (system calls), message passing.

(29-02-2024) -- [Lecture 6] IPC via pipes(), signals and signal handlers.

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

(04-03-2024) -- [Lecture 7] Process structure in memory, Address space of a process, Use of Stack, Stack pointer, and Frame Pointer 

(05-03-2024) -- [Lecture 8] Address space of a process: Virtualizing Memory - Single process vs multiple processes. 

(05-03-2024) -- [Lecture 9] How to run processes efficiently: Limited direct execution, Implementation of a system call

(06-03-2024) -- [Lecture 10] Context Switch Implementation, Kernel Stacks

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

(07-03-2024) -- [Lecture 11] Virtual Memory Implementation using Process Approach.

(11-03-2024) -- [Lecture 12] Virtual memory implementation using Segmentation

(12-03-2024) -- [Lecture 13] Segment registers, GDT, IDT, Implementation of system call and Context Switch 

(13-03-2024) -- [Lecture 14] Free Space Management, Segmentation Issues

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

(14-03-2024) -- [Lecture 15] Virtual Memory implementation using Paging, Page Tables

(18-03-2024) -- [Lecture 16] Paging Implementation in Real Systems

(19-03-2024) -- [Lecture 17] Paging Issues: Translation Lookaside Buffer

(20-03-2024) -- [Lecture 18] Paging Issues: MultiLevel Page Table, Inverted Page Tables

(21-03-2024) -- [Lecture 19] Beyond Physical Memory - Swap Space, Page Replacement Policies

(27-03-2024) -- [Lecture 20] Thrashing, Prepaging, Copy-on-write, Demand Paging, TLB reach

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

(28-03-2024) -- [Lecture 21] Operating system scheduling, Scheduling policies.

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

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

(02-04-2024) -- [Lecture 23] Introduction to Threads, PThread APIs.

(08-04-2024) -- [Lecture 24] Synchronization problem in threads: Critical Section Problem, Atomiticity and Use of Locks

(29-04-2024) -- [Lecture 25] Hardware Primitives: testandset, compareandexchange, fetchandadd.

(01-05-2024) -- [Lecture 26] Condition Variables: producer-consumer problem.

(02-05-2024) -- [Lecture 27] Semaphores, Reader Writer Lock

(03-05-2024) -- [Lecture 28] Concurrency Bugs: Deadlocks and their prevention

(06-05-2024) -- [Lecture 29] Deadlock Avoidance using Safe State Mechanism (Bankers Algorithm)

(08-05-2024) -- [Lecture 30] Practice questions related to locks, semaphores and Bankers Algorithm

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

(09-05-2024) -- [Lecture 31] Interfacing Input output devices, Polling and interrupts.

(15-05-2024) -- [Lecture 32] CPU Programmed I/O vs DMA, Peripheral Mapped vs Memory Mapped I/O, Device Drivers. 

(16-05-2024) -- [Lecture 33] Hard Disk Drives and their Geometry, Seek time, Rotational Delay, and Disk Scheduling.

(17-05-2024) -- [Lecture 34] Disk Management: Disk formatting, bad blocks (sector sparing or forwarding, sector spilling), boot sector, RAIDs

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

(20-05-2024) -- [Lecture 35] File System Interface - Accessing files, File and Directory structure.

(22-05-2024) -- [Lecture 36] File System Implementation: Disk block allocation, Free Space Management.

(23-05-2024) -- [Lecture 37] Very Simple File System and Fast File System.

(28-05-2024) -- [Lecture 38] Reliability in FS: FSCK and Journalling.

Tutorial and Remedial Classes Schedule

(03-06-2024) -- [Lecture 39] Midterm Discussion.

(05-06-2024) -- [Lecture 40] Remedial Class for Process Virtualization.

(06-06-2024) -- [Lecture 41] Remedial Class for Memory Virtualization.

(07-06-2024) -- [Lecture 42] Tutorial on process and memory virtualization.

(10-06-2024) -- [Lecture 43] Remedial class for process synchronization.

(11-06-2024) -- [Lecture 44] Tutorial on process synchronization.

(12-06-2024) -- [Lecture 45] Remedial class on File System.

Assignments

Assignment 1: [will be evaluated in a lab session]

Part 1: -- Explore the source code of Linux Kernel (or FreeBSD)

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

Part 2: --  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 

Part 3: -- Run the xv6 system on top of QEMU and explore its source code. Understand the shell program of xv6.

HomeWorks

Homework 1: Study about linux utilities such as TOP, free, pmap etc. 

Homework 2: Design 4-5 slide ppt for describing the events that happen during the process context switch.

Homework 3: Design 4-5 slide ppt for describing the segmentation.