0% found this document useful (0 votes)
24 views3 pages

PCC CS592 LAB Assignments 2024

The document outlines a series of assignments for an Operating System lab course, focusing on various programming tasks including shell scripting, process scheduling, synchronization, deadlock avoidance, memory management, page replacement algorithms, and disk scheduling. Each assignment requires students to implement specific algorithms or functionalities using C or shell scripts, with detailed examples and expected outcomes. The assignments aim to enhance students' understanding of operating system concepts through practical coding exercises.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views3 pages

PCC CS592 LAB Assignments 2024

The document outlines a series of assignments for an Operating System lab course, focusing on various programming tasks including shell scripting, process scheduling, synchronization, deadlock avoidance, memory management, page replacement algorithms, and disk scheduling. Each assignment requires students to implement specific algorithms or functionalities using C or shell scripts, with detailed examples and expected outcomes. The assignments aim to enhance students' understanding of operating system concepts through practical coding exercises.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

OPERATING SYSTEM LAB (PCC CS592) ASSIGNMENTS

1. Let us consider several students write a shell program of GCD of two


number i.e.gcd(a,b) using command line arguments. All the programs are
stored in directory. You have to check which programs are correct and
which are not. You have to prepare a list of test cases and stored it in a file.
Execute each program one by one and check which one passes all test
cases and which are not passes all test cases. Test cases format is
a b Output
2 5 1
0 3 0
5 0 Not possible
abc 5 Not possible
abc xyz Not possible

2. Write a shell script to find out the Zombie processes then check which
processes are in sleeping state. After 60ms checks which of previous
sleeping process change its states.

3. Write a C program to create a child process. Parent process send a string


to child process using PIPE then child process will calculate how many,
alphabet, numeric and special characters (#, &) are there?

4. Simulate the following Process scheduling algorithm using c program


a)FCFS b)SJF c)SRTF and d) RR e) Priority. Take the input according to
algorithm. Display process information along with waiting time and
turnaround time. Calculate Average waiting time and turnaround time.
Sample Input:

Process Arrival Time Burst Time Priority


P0 0 4 2
P1 1 3 3
P2 2 1 4
P3 3 5 5
P4 4 2 5

5. Create a number of threads as required for classical synchronization


problem as Producer consumer, reader writer and dining philosopher
problems and synchronize them using semaphore.

6. Simulate Deadlock avoidance with Banker’s Algorithm find out the safe
sequence also report it if deadlock cannot be avoided.
Example:
Total resources in system:-
ABCD
6576
Available system resources are:-
ABCD
3112
Processes (currently allocated resources):-
A B C D
P1 1 2 2 1
P2 1 0 3 3
P3 1 2 1 0
Processes (maximum resources):-
A B C D
P1 3 3 2 2
P2 1 2 3 4
P3 1 3 5 0
7. Write a C/C++ program to implement Memory Management concept
using the following algorithms.
a) Best fit
b) Worst fit
c) First fit
Sample: Consider the requests from processes in given order 300K, 25K,
125K, and 50K. Let there be two blocks of memory available of size
150K followed by a block size 350K.

8. Simulate the following page replacement algorithm: (i) FIFO, (ii) LRU and
(iii) Optimal
Example-1 Consider page reference string 1, 3, 0, 3, 5, 6 and 3, with 3 page
frames. Find number of page faults for above Algorithm.

9. Write a C/C++ program to simulate following disk scheduling algorithm


a)FCFS b)SSTF c) SCAN and d)C-SCAN.
Consider a disk queue with requests for I/O to blocks on cylinders 98, 183,
41, 122, 14, 124, 65, 67. The head is initially at cylinder number 53 and
moving towards higher cylinder number.

10. Write a C program to create a child process. The child process execute an
infinite loop so parent first suspend and resume processes using SIGSTOP ,
SIGCONT signals then kill the child process.

You might also like