Prerequisites
The student should have undergone the following courses in Computer Science and Engineering: Computer organization and architecture, Data structures and Programming in C/C++.
Course Outcomes:
At the end of the course, the student will be able to:
CO1: Understand and explore the fundamental concepts of various operating system services.
CO2: Analyze and interpret operating system concepts to acquire a detailed understanding of
the course.
CO3: Apply the operating system concepts to address related problems in computer science
domain.
CO4: Design or Develop Solutions to solve applicable problems in Operating System Domain.
Unit – I
Introduction to operating systems , Processes and Threads
Goals of Operating system; Classes of Operating System; Dual mode of operation; Approaches to OS design and implementation: Microkernel, Layered, modular Approach;
Process- Process concept, Process scheduling, Threads - Overview, Multithreading models, Pthreads, threading issues
System Calls/APIs: fork, vfork, exec, wait, getpid, getppid, Pthreads API to create and manage threads.
Linux case study : design principles (21.2), kernel modules( 21.3)
Unit – II
CPU scheduling and Process Synchronization
CPU scheduling - Basic concepts, scheduling criteria, scheduling algorithms-FCFS, SJF, RR, Priority
Process Synchronization
Background, The Critical section problem, Peterson’s Solution, Synchronization hardware, Semaphores, Classic problems of synchronization.
System Calls/APIs: POSIX APIs to create and manage semaphores: sem_init, sem_wait, sem_post and sem_destroy
Linux case study: process management(21.4), process scheduling (21.5)
Unit – III
Main Memory Management
Address binding, Logical versus physical-address space, dynamic loading, Dynamic linking and shared libraries, Swapping, Contiguous allocation, Paging, Segmentation
Virtual memory
Demand paging, Page replacement algorithms: FIFO page replacement, Optimal page replacement, LRU page replacement
Unit – IV
Virtual memory
LRU approximation page replacement, Allocation of frames, Thrashing.
Linux case study: Memory management(21.6)
Disk Scheduling and File system Interface
Disk Scheduling, Unix kernel support for files, file allocation methods, File system APIs: open, read, write, link, unlink, stat
Case study: FAT, NTFS and Ext filesystems
Unit – V
Deadlocks
System model, Deadlock characterization, Methods for handling deadlocks, deadlock prevention, Deadlock avoidance: Banker’s algorithm, Deadlock detection and recovery from deadlock
Laboratory Component
PART A
1. Implementation of basic UNIX commands using file APIs- Write a program to implement commands ls( -l option), cp, rm and mv using UNIX file APIs.
2. Process control system calls-Application to demonstrate use of fork, execve, wait, getpid, exit system calls
3. Thread creation and management using Pthread Library - Application to demonstrate use of pthread library functions to create and manage threads.
4. Process scheduling and process priority – Modify the default scheduling algorithm for MINIX or XV6 operating system.
5. Process/Thread synchronization - Application to demonstrate process/thread synchronization using semaphores and mutex. Implement Dining philosophers problem, reader-writer and producer-consumer.
6. Process/Thread synchronization for file access - Application to demonstrate process/thread synchronization using file locks.
7. Deadlock- Write a program that implements the Bankers’ algorithm for deadlock avoidance. The program should check for safe sequence and resource request algorithm.
8. Memory management: Write a program to simulate Buddy memory allocation algorithm.
Static and Shared libraries: Write a program to create and use static and shared libraries. Demonstrate the advantage of shared libraries over static libraries in terms of memory usage.
Note: The lab program 1, 2, 3, 9 must be compiled using make utility tool.
Open Ended Experiments
The students are expected to implement a mini project using operating system concepts and APIs/system calls learned in the theory. The primary emphasis of the experiment is to understand and gain knowledge of operating system concepts so as to apply these concepts in implementing solutions to real world problems.
Students are required to form a team, with constraint of maximum 3 persons in a team. Students have to select the problem/application of their choice and get confirmed with faculty handling the course. Few sample topics are listed below.
Open ended
1. To extend/modify XV6 operating system
2. To extend/modify MINIX operating system
3. XV6 System call tracing
4. Building a new userspace filesystem.
5. Implement a mini shell
6. Implement a garbage collector
7. Implement malloc and calloc using mmap and munmap system calls
Some of interesting projects as experiential learning
Implementing nice system call and changing the scheduling policy of xv6 - https://www.youtube.com/watch?v=JbdDRdindbg
Implementing ps system call in xv6 - https://www.youtube.com/watch?v=84OksVCw0AU
Minix3 : Modifications and Compilation Team Members -https://classroom.google.com/g/tg/NDAxOTY5OTgyNjQ5/NDU2NzY2OTAyMDY3#u=MjI0MDQwNTIxNzE1&t=f
Stack pointers, privilege levels and exception handlers in XV6 - https://github.com/GaneshBannur/xv6-public
gdb for multi threaded programs -shorturl.at/jnrUZ
Observe Process File Table Entries And File Objects Across Parent And Child Processes - shorturl.at/hJPST