314454: OPERATING SYSTEM LABORATORY
Teaching Scheme: Examination Scheme:
Practical : 4 Hours/Week Termwork : 50 Marks Practical : 50 Marks
Prerequisites :
Data Structures
Course Objectives :
To familiarize the students with the Operating System.
To demonstrate the process, memory, file and directory management issues under the UNIX/ LINUX operating system
To introduce LINUX basic commands
To make students how to make simple programs in LINUX and administrative task of LINUX
Course Outcomes :
Describe OS support for processes and threads
Recognize CPU Scheduling, synchronization, and deadlock.
Use C / C++ and Unix commands, and develop various system programs under Linux to make use of OS concepts related to process synchronization, shared memory, file systems, etc.
Laboratory Assignments
Process control system calls: The demonstration of fork, execve and wait system calls along with zombie and orphan states.
Implement the C program in which main program accepts the integers to be sorted. Main program uses the fork system call to create a new process called a child process. Parent process sorts the integers using merge sort and waits for child process using wait system call to sort the integers using quick sort. Also demonstrate zombie and orphan states.
Implement the C program in which main program accepts an integer array. Main program uses the fork system call to create a new process called a child process. Parent process sorts an integer array and passes the sorted array to child process through the command line arguments of execve system call. The child process uses execve system call to load new program that uses this sorted array for performing the binary search to search the particular item in the array.
Thread management using pthread library.
Implement matrix multiplication using multithreading. Application should have pthread_create, pthread_join, pthread_exit. In the program, every thread must return the value and must be collected in pthread_join in the main function. Final sum of row-column multiplication must be done by main thread (main function).
Thread synchronization using counting semaphores and mutual exclusion using mutex. Application to demonstrate: producerconsumer problem with counting semaphores and mutex.
Deadlock Avoidance Using Semaphores:
Implement the deadlockfree solution to Dining Philosophers problem to illustrate the problem of deadlock and/or starvation that can occur when many synchronized threads are competing for limited resources.
Inter process communication in Linux using following.
Pipes : Full duplex communication between parent and child processes. Parent process writes a pathname of a file (the contents of the file are desired) on one pipe to be read by child process and child process writes the contents of the file on second pipe to be read by parent process and displays on standard output.
FIFOs: Full duplex communication between two independent processes. First process accepts sentences and writes on one pipe to be read by second process and second process counts number of characters, number of words and number of lines in accepted sentences, writes this output in a text file and writes the contents of the file on second pipe to be read by first process and displays on standard output.
Signals : Detecting the termination of multiple child processes :
Implement the C program to demonstrate the use of SIGCHLD signal. A parent process Creates multiple child process (minimum three child processes). Parent process should be Sleeping until it creates the number of child processes. Child processes send SIGCHLD signal to parent process to interrupt from the sleep and force the parent to call wait for the Collection of status of terminated child processes.
Linux Kernel configuration, compilation and rebooting from the newly compiled kernel.
Requirements:
a. Get a Linux kernel source code from www.kernel.org
b. Menu based configuration of Linux kernel using menuconfig/xconfig/gconfig
c. Creating a monolithic compressed image of a kernel
d. Compilation of kernel modules
e. Installation of kernel modules
f. Finalize installation
Kernel space programming: Implement and add a loadable kernel module to Linux kernel, demonstrate using insmod, lsmod and rmmod commands. A sample kernel space program should print the "Hello World" while loading the kernel module and "Goodbye World" while unloading the kernel module.
Implement a new system call, add this new system call in the Linux kernel (any kernel source, any architecture and any Linux kernel distribution) and demonstrate the use of same.
Implementing a CPU scheduling policy in a Linux OS.
OR
Implementing a memory management policy in a Linux OS.
OR
Implementing a file system in a Linux OS.
All the assignments should be conducted on Latest version of Open Source Operating Systems, tools and Multicore CPU supporting Virtualization and MultiThreading.
Links for Laboratory Assignments:
http://homes.cs.washington.edu/~tom/nachos/
http://web.cecs.pdx.edu/~walpole/class/cse513/project/syscall.html
http://web.cecs.pdx.edu/~walpole/class/cse513/project/syscall.html
This site is managed by,
Contact: Tushar B Kute (tushar@tusharkute.com)
Visit: http://www.tusharkute.com