You are on page 1of 2

MOUDLE-1(PRATICES)

1. Use the cat command to create a file containing the following data. Call it mytable.txt
use tabs to separate the fields.

1425 ravi 15.65

4320 ramu 26.27

6830 sita 36.15

1450 raju 21.86

a. Use the cat command to display the file, mytable.txt.


b. Use the vicomm and to correct any errors in the file, mytable.txt.
c. Use the sort command to sort the file mytable.txt according to the first field.
d. Call thesortedfilemytable.txt (same name)
e. Printthefilemytable.txt.
f. Use the cut &paste commands to swap fields 2and 3mytable.Call itmytable.txt
(same name)

2. Write a shell script that displays a list of all the files in the current directory to which
the user has read, write and execute permissions.

3. Write a shell script that computes the total and average marks of a student according
to the following;

● Ifaveragemarks≥69thenresultis-Distinction‖

● Ifaveragemarks≥59and≤70thenresultis-FirstClass‖.
● Ifaveragemarks≥49and≤60thenresultis-SecondClass‖If average marks ≤50 then
result is -Pass‖.
● Note that any subject marks ≤ 40then result is-Fail‖.

Accept student name and six subject marks through the keyboard

4. Simulate the following non-pre-emptive CPU scheduling algorithms to find


turnaround time and waiting time. a. FCFS b. SJF c. Round Robin (pre-emptive).

5. Simulate multi-level queue scheduling algorithm considering the following scenario.


All the processes in the system are divided into two categories - system processes and
user processes. system processes are to be given higher priority than user processes.
Use FCFS scheduling for the processes in each queue.

6. Simulate the following file allocation strategies.


a. Sequential
b. Indexed
c. Linked
7. Implementation of producer consumer problem.

8. Implementation of Banker’s algorithm for Deadlock avoidance.

MOUDLE-2(PRATICES)
1) Consider the following page-replacement algorithms. Rank these algorithms on a
five-point scale from “bad” to “perfect” according to their page-fault rate. Separate
those algorithms that suffer from Belady’s anomaly from those that do not.
a) LRU replacement.
b) FIFO replacement.
c) Optimal replacement.
d) Second-chance replacement.

2) Consider the page reference string: 1, 2, 3, 4,2, 1, 5, 6, 2, 1, 2, 3,7, 6, 3, 2, 1, 2, 3, 6.


How many page faults would occur for the following replacement algorithms,
assuming one, two, three, four, five, six, and seven frames? Remember that all frames
are initially empty, so your first unique pages will cost one fault each.
a) LRU replacement.
b) FIFO replacement.
c)Optimal replacement

3) How many page faults occur for your algorithm for the following reference string
with four page frames? 1, 2, 3,4, 5, 3, 4, 1, 6,7, 8, 7, 8, 9, 7, 8,9, 5, 4, 5,4, 2. What is
the minimum number of page faults for an optimal page replacement strategy for the
reference string above with four page frames?

4) Consider a demand-paged computer system where the degree of multiprogramming is


currently fixed at four. The system was recently measured to determine utilization of
the CPU and the paging disk. Three alternative results are shown below. For each
case, what is happening?
a) Can the degree of multiprogramming be increased to increase the CPU utilization? Is
the paging helping?
b) CPU utilization 13 percent; disk utilization 97 percent.
c) CPU utilization 87percent; disk utilization 3 percent.
d) CPU utilization 13 percent; disk utilization 3 percent.

5) Implementation of Disk scheduling algorithm–FCFS.

6) Implementation of Disk scheduling algorithm–SSTF and SCAN.

You might also like