Lab 1 OSG
Lab 1 OSG
Using First Come First Serve (FCFS) and Shortest Remaining Time First (SRTF) Algorithm and Round
Robin (quantum time is 3 in Pre Emptive Approach to schedule the processes as given below. Which
one is better?
- FCFS non-preemptive:
Process ID Arrival Time Burst Time Completion Turn Around Waiting Response
Time Time Time Time
1 1 8 11 10 2 2
2 0 3 3 3 0 0
3 3 2 14 11 9 9
4 2 1 12 10 9 9
5 6 6 24 18 12 12
6 5 4 18 13 9 9
7 11 5 29 18 13 13
- FCFS Preemptive:
Process ID Arrival Time Burst Time Completion Turn Around Waiting Response
Time Time Time Time
1 1 8 29 28 20 20
2 0 3 3 3 1 0
3 3 2 6 3 1 1
4 2 1 4 2 0 1
5 6 6 16 10 4 4
6 5 4 10 5 1 1
7 11 5 21 10 5 5
- SRTF :
Process ID Arrival Time Burst Time Completion Turn Around Waiting Response
Time Time Time Time
1 1 8 29 28 20 20
2 0 3 3 3 1 0
3 3 2 6 3 1 1
4 2 1 4 2 0 1
5 6 6 16 10 4 4
6 5 4 10 5 1 1
7 11 5 21 10 5 5
3. Write a shell script to calculate the sum, difference, product, and quotient of 2 integers entered
from the keyboard.
echo -n “Enter a = ”
read a
echo -n “Enter b = “
read b
sum=$(($a+$b))
different=$(($a-$b))
product=$(($a*$b))
quotient=$(($a/$b))
echo “The sum $a + $b = $sum”
echo “The different $a - $b = $different”
echo “The product $a * $b = $product”
echo “The quotient $a / $b = $quotient”