Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

Instruction – Write the register number, name, Problem number, Problem code in the answer

paper. Take a snap shot. Along with it attach the output snapshot and submit it in the vtop
assignment4 today on or before 5.45 pm

1) I) Write a shell script to a) display the date and time b) Display only the first field of the
output of (a). Also display the date in mmddyyyy format.
ii) Use C programming to create parent and child processes. A) In the parent process, display
its parent process id and the child process id B) In the child process, read an existing file
and display the content.

2) I) Write a shell script to perform the following tasks Create 3 nested directories. Create a file
inside the third directory. Display only the default access permissions of the directories and
the file. Change the access permission to rwe to the file and display the modified access
permission of the file.
II) Write a c program to implement priority queues. Each element should consist of pid and
priority. Initially 5 processes are there in the queue. Display the queue. After some time 3
processes arrives. Add these processes to the queue and display the output of the queue
from front to rear.

3) I) Write a shell script to create 3 files, write content to the files. Display top 10 lines from
file1 and bottom 10 lines from file2. Search for presence of a word in file3.
II) Write a C program to create a parent and child process. Display the pid of the parent
process. In the child process, display the pid and compute the Fibonacci series for 10
numbers.
4) I) Write a C program to create nested processes. All these processes share a variable. In first
child process, write data to the shared variable every 10 seconds infinitely. In the second
child process, read the data from the shared variable indefinitely every 2 seconds. Display
the output of the read data along with pid.
II ) Write a shell script to display the details of current processes in the system. Also display
the current status, cpu and memory usage of only the created processes in (i).
5) I) Write a shell script to display an addition table or a multiplication table based on the
input from the user.
II) Write a C program and implement bankers safety algorithm. Consider 7 processes and
assume allocation and max demand based on the available rearources: R1-10 instances R2-
7 instances and R3 – 5. Find whether a safety sequence exists for the current allocation using
the implemented safety algorithm. Display the safety sequence, if exists.

6) I) Write a shell script to create file, write 10 line of content to the file. Display the file. Using
string replacement comment, change space to – in each line. Display the modified file.
II) Write a C Program to show the page table entries for two processes with 3 shared pages.
Process 1 size 16 MB. Process 2 size 8 MB. Frame size 256 KB. Total memory size 1 GB
Assume the free frame list before allocation. Display the page tables and free frame list after
allocation.

You might also like