Question 1) Describe three main purposes of the operating system? What is layered approach to OS design? Also, explain its advantages and disadvantages.
Question 2) Write a shell program to generate first 25 prime numbers.
Question 3) What is ‘Mutual Exclusion’? Write pseudo code to implement mutual exclusion using:
(i) Test and Set instruction and
(ii) Swap instruction
Question 4: Consider the following set of processes:
Process Burst time (ms)
P1 10
P2 29
P3 3
P4 7
P5 12
Evaluate the performance of FCFS, SJF and RR (Quantum = 10 ms) algorithms for scheduling the above processes.
Question 5) Write the shell program to cipher all text/content in any text document in present working directory and also utilize another shell program to decipher it to read. Use any scheme for ciphering.
Question 6) Write UNIX commands for the following tasks:
• find lines common to two or more files
• compare files but stops at first occurrence of a difference
• show differences of two files
• list all jobs in the waiting queue.