Operating System (IOPS332C, 2-1-1)

 

AUTUMN 2019-2020
Lecture: Friday(11:15 AM-1:15PM); Tut: Friday(3:00 PM - 5:00PM); Lab: Wednesday (6:00PM - 8:00PM)

Venue: Room-5154/5042, CC3 Building

 

 

 

 

Course Objective:

This course is primarily meant to teach undergraduate students the design and services provided by an operating system. It will help them understand system calls, processes, synchronization and scheduling. It will discuss approaches to memory management and organization of file systems.

Course Outline:


Component Unit Topics
Component 1 Unit 1 : Introduction and System Calls OS Basics - Definition, Operating Systems as resource manager, Evolution of OS, Structural overview,Types of OS System Calls, Types of System Call, Hardware requirements: protection, context switching, privileged mode;
Process Concepts; Process Concepts : Process, Operation on Process, system calls for process operations
Threads : Overview, Multithreading Models, Threads and their Management;
Component 1 Unit 2: Process Management CPU Scheduling : Scheduling Criteria, Scheduling Algorithms, Multiple-Processor Scheduling
Interprocess Communication : Concept of shared memory, message passing, pipes
Process Synchronization : The Critical-Section Problem, Peterson's Solution, Synchronization Hardware, Monitors, Semaphores, Classic Problems of Synchronization
Deadlocks : System Model, Dynamic Resource Allocation, Deadlock Characterization, Methods for Handling Deadlocks, Deadlock Prevention, Deadlock Avoidance, Deadlock Detection, Recovery From Deadlock
Component 2 Unit 1 : Memory Management Main Memory Basics, Swapping, Contiguous Memory Allocation, Paging, Structure of the Page Table, Segmentation, Basics of Virtual Memory, Demand Paging, Page Replacement, Allocation of Frames, Thrashing
Component 2 Unit 2: File Management Storage Management : Mass-Storage Structure, Overview of Mass-Storage, Disk Scheduling, Disk Management, Design of IO systems
File Management : File Concept, Protection, Access Methods, Directory Structure, File-System Mounting, File Sharing, File-System Structure, File-System Implementation, Directory Implementation, Allocation Methods,


The entire course will be based on the xv6 operating system (a teaching operating system developed in the summer of 2006 for MIT's operating systems course)
The xv6 weblink is available at : https://pdos.csail.mit.edu/6.828/2014/xv6.html

 

 

References:

 

1.      Abraham Silberschatz Peter B. Galvin and Greg Gagne, Operating System Concepts, Wiley 8th Edition, 2008. [Slides Available Here]

2.      Garry. J. Nutt, Operating Systems: A Modern Perspective, Addison-Wesley

3.      Andrew S. Tanenbaum and Herbert Bros, Modern Operating Systems (4th Edition), Pearson

4.      William Stallings , Operating Systems: Internals and Design Principles, Prentice Hall of India

5.      D. M. Dhamdhere , Operating Systems: A Concept-Based Approach, Tata McGraw-Hill

5.      Russ Cox, Frans Kaashoek, Robert Morris , xv6: a simple, Unix-like teaching operating system [Download]

 

 

 

 

Important Instructions:

1.         Classes will be conducted using slide presentation as well as chalk-board. Official slide sets and miscellaneous study materials from some of the main text books will be uploaded on the web site on a regular basis.

2.         Every student is expected to have access to at least the book by Silberschatz-Galvin-Gagne.

3.         Attendance in the classes is mandatory. If the attendance of a student falls below 75%, he/she may will be dropped from the course after Component 2

4.         The course will consist of laboratory and take-home assignments, which has to be done very seriously. If a student does not submit the assignments, his/her grade will remain as incomplete.

5.         Grading Policy :

o   30%: Component 1 - Closed book exam (10%); Take home assignment (10%) and Lab assignment (10%)

o   30%: Component 2 - Closed book exam (10%); Take home assignment (10%) and Lab assignment (10%)

o   40%: Component 3 - Closed book written exam

6.         Take home assignments : They will be assigned at the beginning of a module (announcements will be made on the course web-site every week). These assignments will not only help you in development of an in-depth idea of each topic of the course but will also serve to prepare for your written examinations.
There will be two kinds of take home assignments :
(i) Homework assignments - To be done individually. These assignments need not be submitted but it is expected that the students complete them in order to have better understanding of the concepts covered in lecture sessions. Interact with your TAs during tutorial sessions to clear your doubts regarding the homework assignments.
(ii) Group Assignments - To be done in groups of four (max). These problems will be more harder problems involving rigorous mathematical/analytical treatment or implementation based assignments. Each Unit will have two such assignments which have to be completed within a given deadline and will be evaluated in each tutorial class.

6.         Tutorial Classes : The tutorial classes scheduled every week will have a dual role in the course. First they will serve as doubt clearing sessions where the TAs will interact with the students to clear their doubts and discuss the homework assignments. The second purpose of the tutorial classes would be to assess the understanding of the concepts though evaluation of the group assignments.

7.         The lab classes will mainly consist of implementation of operating sytsem concepts discussed in class and the assignments covered in tutorial sessions. Students will also perform hand on with the xv6 operating system Lab Page of the course website

Announcements:

1.         Group Assignments : The list of assignments (with the mentioned deadline) and the allotment for each group is available here

2.          C1 Review Test Solutions

        

        

Interesting Links

1.         The UNIX Operating System, AT&T Archives, at YouTube

2.         The UNIX Time-Sharing System, Dennis M. Ritchie and Ken L. Thompson, Bell System Technical Journal 57(6)

3.         A Narrative History of BSD, Kirk McKusick, at YouTube

 

 

 

Lecture Slides:

 

Sl. No.

Topic

Practice Problems (Homework)

Tutorial/Assignments

Helpful Resources

1.

Introduction

Homework Set 1

2.

Fundamental Concepts : Process, Interrupt, System Calls

Homework Set 2

Tut:1

open_read_write_with_linux_sys_calls

write_lines_of_text_sys_call

simulating "ls" command

Notes on Sys call

File Handling in C

3.

Process Management

HomeworkSet3

Programming Assignment

Tut:2

common.h mem.c

fork_1.c fork_2.c multiple_fork.c fork_wait.c fork_execute.c

forkn.c

orphan_process.c

zombie_process.c

modify_data_in_child.c

Operating System :Three Easy Pieces (Process)

Operating System :Three Easy Pieces (Process API)

Process Managment in xv6

4.

CPU Scheduling I

CPU Scheduling II

Programming Assignment on CPU Scheduling

Tut:3

FCFS-1 FCFS-2

SJF SJF Preemptive

Round Robin

Operating System :Three Easy Pieces (Process Scheduling)

5.

Threads

Programming Assignment on Threads

Tut:4

thread_example1

thread_example2

thread_example3

thread_example4

thread_example5

thread_example

POSIX Thread Programming : A Tutorial

6.

Inter Process Communication

Programming Assignment on IPC : Shared Memory

Reader Writer Code (read-write-1.c)

Reader Writer Code (read-write-2.c)

Shared memory usage example

Shared memory usage: server_code

Shared memory usage: client_code

Using Pipe

Using Pipe

Linux IPC Mechanism : A Tutorial

7.

Process Synchonization I : Concurrency

badcnt.c

goodcnt.c

Operating System: Three Easy Pieces (Locks)

8.

Process Synchonization II : Conditional Variables and Semaphores

Problems on Synchronization

Tut : POSIX Semaphores


Producer-Consumer Problem uisng Semaphore 1


Producer-Consumer Problem uisng Semaphore 2


Operating System: Three Easy Pieces (Conditional Variables)

Operating System: Three Easy Pieces (Semaphores)

Little Book of Semaphores (Contains many Synchronization problems)