0% found this document useful (0 votes)
84 views32 pages

OS Lab Manual

The document contains a laboratory index listing 15 experiments related to operating system concepts. It provides the planned date and signature fields for each experiment. It also includes sample experiments that provide the name, algorithm, program code, and output for CPU scheduling algorithms like FCFS, SJF, Priority, and Round Robin.

Uploaded by

Cheese Box
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
84 views32 pages

OS Lab Manual

The document contains a laboratory index listing 15 experiments related to operating system concepts. It provides the planned date and signature fields for each experiment. It also includes sample experiments that provide the name, algorithm, program code, and output for CPU scheduling algorithms like FCFS, SJF, Priority, and Round Robin.

Uploaded by

Cheese Box
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 32

Laboratory Index

List of Experiments
Practical Name of Experiment Planned Dates of Signature of
Number Date Actual Faculty
Conduction
1 Write a program to implement FCFS CPU
Scheduling algorithm.

2 Write a program to implement SJF CPU


Scheduling algorithm.

3 Write a program to implement Priority


CPU Scheduling algorithm.
4 Write a program to implement Round
Robin CPU Scheduling algorithm.
5 Write a program to implement producer
consumer classical inter process
communication problems.
6 Write a program to implement Reader
Writers inter process communication
problems.
7 Write a program to implement Dining
Philosophers inter process communication
problems.
8 Write a program to implement LRU page
replacement algorithm
9 Write a program to implement FIFO page
replacement algorithm
10 Write a program to implement
OPTIMAL(LFU) page replacement
algorithm
11 Write a program to implement Best fit
Algorithm
12 Write a program to implement Worst fit
Algorithm
13 Write a program to implement First fit
Algorithm
14 Write a program to implement Banker’s
algorithms.
15 Case Study: ios, Android, UNIX/LINUX

School of Advanced Computing (CS20B301-Operating System)


Experiment-01
Name of Experiment- Write a program to implement FCFS CPU scheduling
algorithms.

Algorithm:

Step 1: Start the process

Step 2: Accept the number of processes in the ready Queue

Step 3: For each process in the ready Q, assign the process id and accept the CPU burst time

Step 4: Set the waiting of the first process as ‘0’ and its burst time as its turnaround time

Step 5: for each process in the Ready Q calculate

a) Waiting time for process(n)= waiting time of process (n-1) + Burst time of process(n-1)

b) Turnaround time for Process(n)= waiting time of Process(n)+ Burst time for process(n)

Step 6: Calculate

a) Average waiting time = Total waiting Time / Number of process

b) Average Turnaround time = Total Turnaround Time / Number of process

Step 7: Stop the process

School of Advanced Computing (CS20B301-Operating System)


Program
#include<stdio.h>

int main()
{
int n,bt[20],wt[20],tat[20],avwt=0,avtat=0,i,j;
printf("Enter total number of processes(maximum 20):");
scanf("%d",&n);

printf("\nEnter Process Burst Time\n");


for(i=0;i<n;i++)
{
printf("P[%d]:",i+1);
scanf("%d",&bt[i]);
}

wt[0]=0; //waiting time for first process is 0

//calculating waiting time


for(i=1;i<n;i++)
{
wt[i]=0;
for(j=0;j<i;j++)
wt[i]+=bt[j];
}

printf("\nProcess\t\tBurst Time\tWaiting Time\tTurnaround Time");

//calculating turnaround time


for(i=0;i<n;i++)
{
tat[i]=bt[i]+wt[i];
avwt+=wt[i];
avtat+=tat[i];
printf("\nP[%d]\t\t%d\t\t%d\t\t%d",i+1,bt[i],wt[i],tat[i]);
}

avwt/=i;
avtat/=i;
printf("\n\nAverage Waiting Time:%d",avwt);
printf("\nAverage Turnaround Time:%d",avtat);

return 0;
}

School of Advanced Computing (CS20B301-Operating System)


Output

School of Advanced Computing (CS20B301-Operating System)


Experiment-02
Name of Experiment- Write a program to implement SJF CPU scheduling
algorithm.

Algorithm:

Step 1: Start the process

Step 2: Accept the number of processes in the ready Queue

Step 3: For each process in the ready Q, assign the process id and accept the CPU burst time

Step 4: Start the Ready Q according the shortest Burst time by sorting according to lowest to

Highest burst time.

Step 5: Set the waiting time of the first process as ‘0’ and its turnaround time as its burst time.

Step 6: For each process in the ready queue, calculate

a) Waiting time for process(n)= waiting time of process (n-1) + Burst time of process(n-1)

b) Turnaround time for Process(n)= waiting time of Process(n)+ Burst time for process(n)

Step 6: Calculate

a) Average waiting time = Total waiting Time / Number of process

b) Average Turnaround time = Total Turnaround Time / Number of process

Step 7: Stop the process

School of Advanced Computing (CS20B301-Operating System)


Program
#include<stdio.h>

void main()
{
int bt[20],p[20],wt[20],tat[20],i,j,n,total=0,pos,temp;
float avg_wt,avg_tat;
printf("Enter number of process:");
scanf("%d",&n);

printf("\nEnter Burst Time:\n");


for(i=0;i<n;i++)
{
printf("p%d:",i+1);
scanf("%d",&bt[i]);
p[i]=i+1; //contains process number
}

//sorting burst time in ascending order using selection sort


for(i=0;i<n;i++)
{
pos=i;
for(j=i+1;j<n;j++)
{
if(bt[j]<bt[pos])
pos=j;
}

temp=bt[i];
bt[i]=bt[pos];
bt[pos]=temp;

temp=p[i];
p[i]=p[pos];
p[pos]=temp;
}

wt[0]=0; //waiting time for first process will be zero

//calculate waiting time


for(i=1;i<n;i++)
{
wt[i]=0;
for(j=0;j<i;j++)
wt[i]+=bt[j];

School of Advanced Computing (CS20B301-Operating System)


total+=wt[i];
}

avg_wt=(float)total/n; //average waiting time


total=0;

printf("\nProcess\t Burst Time \tWaiting Time\tTurnaround Time");


for(i=0;i<n;i++)
{
tat[i]=bt[i]+wt[i]; //calculate turnaround time
total+=tat[i];
printf("\np%d\t\t %d\t\t %d\t\t\t%d",p[i],bt[i],wt[i],tat[i]);
}

avg_tat=(float)total/n; //average turnaround time


printf("\n\nAverage Waiting Time=%f",avg_wt);
printf("\nAverage Turnaround Time=%f\n",avg_tat);
}

OUTPUT

School of Advanced Computing (CS20B301-Operating System)


Experiment-03
Name of Experiment- Write a program to implement Priority CPU scheduling
algorithm.

Algorithm:

Step 1: Start the process

Step 2: Accept the number of processes in the ready Queue

Step 3: For each process in the ready Q, assign the process id and accept the CPU burst time

Step 4: Sort the ready queue according to the priority number.

Step 5: Set the waiting of the first process as ‘0’ and its burst time as its turnaround time

Step 6: For each process in the Ready Q calculate

a) Waiting time for process(n)= waiting time of process (n-1) + Burst time of process(n-1)

b) Turnaround time for Process(n)= waiting time of Process(n)+ Burst time for process(n)

Step 7: Calculate

a) Average waiting time = Total waiting Time / Number of process

b) Average Turnaround time = Total Turnaround Time / Number of process

Step 8: Stop the process

School of Advanced Computing (CS20B301-Operating System)


PROGRAM
#include<stdio.h>

int main()
{
int bt[20],p[20],wt[20],tat[20],pr[20],i,j,n,total=0,pos,temp,avg_wt,avg_tat;
printf("Enter Total Number of Process:");
scanf("%d",&n);

printf("\nEnter Burst Time and Priority\n");


for(i=0;i<n;i++)
{
printf("\nP[%d]\n",i+1);
printf("Burst Time:");
scanf("%d",&bt[i]);
printf("Priority:");
scanf("%d",&pr[i]);
p[i]=i+1; //contains process number
}

//sorting burst time, priority and process number in ascending order using selection sort
for(i=0;i<n;i++)
{
pos=i;
for(j=i+1;j<n;j++)
{
if(pr[j]<pr[pos])
pos=j;
}

temp=pr[i];
pr[i]=pr[pos];
pr[pos]=temp;

temp=bt[i];
bt[i]=bt[pos];
bt[pos]=temp;

temp=p[i];
p[i]=p[pos];
p[pos]=temp;
}

wt[0]=0; //waiting time for first process is zero

//calculate waiting time

School of Advanced Computing (CS20B301-Operating System)


for(i=1;i<n;i++)
{
wt[i]=0;
for(j=0;j<i;j++)
wt[i]+=bt[j];

total+=wt[i];
}

avg_wt=total/n; //average waiting time


total=0;

printf("\nProcess\t Burst Time \tWaiting Time\tTurnaround Time");


for(i=0;i<n;i++)
{
tat[i]=bt[i]+wt[i]; //calculate turnaround time
total+=tat[i];
printf("\nP[%d]\t\t %d\t\t %d\t\t\t%d",p[i],bt[i],wt[i],tat[i]);
}

avg_tat=total/n; //average turnaround time


printf("\n\nAverage Waiting Time=%d",avg_wt);
printf("\nAverage Turnaround Time=%d\n",avg_tat);

return 0;
}

OUTPUT

School of Advanced Computing (CS20B301-Operating System)


Experiment-04
Name of Experiment- Write a program to implement Round Robin CPU
scheduling algorithm.

Algorithm:

Step 1: Start the process

Step 2: Accept the number of processes in the ready Queue and time quantum (or) time slice

Step 3: For each process in the ready Q, assign the process id and accept the CPU burst time

Step 4: Calculate the no. of time slices for each process where

No. of time slice for process (n) = burst time process (n)/time slice

Step 5: If the burst time is less than the time slice then the no. of time slices =1.

Step 6: Consider the ready queue is a circular Q, calculate

a) Waiting time for process(n) = waiting time of process(n-1)+ burst time of process(n-1 ) +

the time difference in getting the CPU from process(n-1)

b) Turnaround time for process(n) = waiting time of process(n) + burst time of process(n)+

the time difference in getting CPU from process(n).

Step 7: Calculate

a) Average waiting time = Total waiting Time / Number of process

b) Average Turnaround time = Total Turnaround Time / Number of process

Step 8: Stop the process

School of Advanced Computing (CS20B301-Operating System)


PROGRAM
#include<stdio.h>
struct process
{
int id,AT,BT,WT,TAT;
};

struct process a[10];

// declaration of the ready queue


int queue[100];
int front=-1;
int rear=-1;

// function for insert the element


// into queue
void insert(int n)
{
if(front==-1)
front=0;
rear=rear+1;
queue[rear]=n;
}

// function for delete the


// element from queue
int delete()
{
int n;
n=queue[front];
front=front+1;
return n;
}
int main()
{
int n,TQ,p,TIME=0;
int temp[10],exist[10]={0};
float total_wt=0,total_tat=0,Avg_WT,Avg_TAT;
printf("Enter the number of the process\n");
scanf("%d",&n);
printf("Enter the arrival time and burst time of the process\n");
printf("AT BT\n");
for(int i=0;i<n;i++)
{
scanf("%d%d",&a[i].AT,&a[i].BT);
a[i].id=i;

School of Advanced Computing (CS20B301-Operating System)


temp[i]=a[i].BT;
}
printf("Enter the time quantum\n");
scanf("%d",&TQ);
// logic for round robin scheduling

// insert first process


// into ready queue
insert(0);
exist[0]=1;
// until ready queue is empty
while(front<=rear)
{
p=delete();
if(a[p].BT>=TQ)
{
a[p].BT=a[p].BT-TQ;
TIME=TIME+TQ;
}
else
{
TIME=TIME+a[p].BT;
a[p].BT=0;
}

//if process is not exist


// in the ready queue even a single
// time then insert it if it arrive
// at time 'TIME'
for(int i=0;i<n;i++)
{
if(exist[i]==0 && a[i].AT<=TIME)
{
insert(i);
exist[i]=1;
}
}
// if process is completed
if(a[p].BT==0)
{
a[p].TAT=TIME-a[p].AT;
a[p].WT=a[p].TAT-temp[p];
total_tat=total_tat+a[p].TAT;
total_wt=total_wt+a[p].WT;
}

School of Advanced Computing (CS20B301-Operating System)


else
{
insert(p);
}
}

Avg_TAT=total_tat/n;
Avg_WT=total_wt/n;

// printing of the answer


printf("ID WT TAT\n");
for(int i=0;i<n;i++)
{
printf("%d %d %d\n",a[i].id,a[i].WT,a[i].TAT);
}
printf("Average waiting time of the processes is : %f\n",Avg_WT);
printf("Average turn around time of the processes is : %f\n",Avg_TAT);
return 0;
}

OUTPUT

School of Advanced Computing (CS20B301-Operating System)


Experiment-05
Name of Experiment- Write a program to implement Producer Consumer
classical inter process communication problems using Semaphore.

Algorithm:

1. Start the program.

2. Declare three semaphore variables.

 Mutex initialized to 0 which allows only one process to execute at any time.

 Two variables to indicate the limit of buffer.

3. Wait and signal are two functions to implement the semaphore.

Wait-waits until semaphore variable reach 1 and then decrements it.

Signal – increments the semaphore variable by 1.

4. The reader process, checks if any process is writing. If so it waits else it reads the content

of shared variable and then signals.

5. The Writer process checks if any other process is accessing the shared variable. If not it

changes the value of shared variable and then signals.

6. End the program.

PROGRAM

OUTPUT

School of Advanced Computing (CS20B301-Operating System)


Experiment-06
Name of Experiment- Write a program to implement Reader Writers inter
process communication problems using Semaphore.

Algorithm:

1. Start the program.

2. Declare three semaphore variable mutex and a shared variable which is used by reader

and writer processes.

3. Wait and signal are two functions to implement the semaphore.

Wait-waits until semaphore variable reach 1 and then decrements it.

Signal – increments the semaphore variable by 1.

4. The reader process, checks if any process is writing. If so it waits else it reads the content

of shared variable and then signals.

5. The Writer process checks if any other process is accessing the shared variable. If not it

changes the value of shared variable and then signals.

6. Pthreads is used to execute two processes simultaneously.

7. End the program.

PROGRAM

OUTPUT

School of Advanced Computing (CS20B301-Operating System)


Experiment-07
Name of Experiment- Write a program to implement Dining Philosphers inter
process communication problems using Semaphore.

Algorithm:

PROGRAM

OUTPUT

School of Advanced Computing (CS20B301-Operating System)


Experiment-08
Name of Experiment- Write a program to implement LRU Page replacement
algorithm.

Algorithm:

Step 1: Create a queue to hold all pages in memory

Step 2: When the page is required replace the page at the head of the queue

Step 3: Now the new page is inserted at the tail of the queue

Step 4: Create a stack

Step 5: When the page fault occurs replace page present at the bottom of the stack

PROGRAM

OUTPUT

School of Advanced Computing (CS20B301-Operating System)


Experiment-09
Name of Experiment- Write a program to implement FIFO Page replacement
algorithm.

Algorithm:

Step 1: Create a queue to hold all pages in memory

Step 2: When the page is required replace the page at the head of the queue

Step 3: Now the new page is inserted at the tail of the queue

PROGRAM

OUTPUT

School of Advanced Computing (CS20B301-Operating System)


Experiment-10
Name of Experiment- Write a program to implement OPTIMAL (LFU) Page
replacement algorithm.

AIM: To implement page replacement algorithms Optimal (The page which is not used for
longest time).

Algorithm:

Step 1: Create a array

Step 2: When the page fault occurs replace page that will not be used for the longest

Period of time

PROGRAM

OUTPUT

School of Advanced Computing (CS20B301-Operating System)


Experiment-11
Name of Experiment- Write a program to implement BEST FIT algorithm.

AIM: To implement Best fit Algorithm for Memory Management.

Algorithm:

Step 1: Start the program.

Step 2: Get the number of holes and size of holes.

Step 3: Enter the number of processes and their sizes for process creation.

Step 4: Compare the process and size then the process is successfully to allocate given hole.

Step 5: In best-fit memory management scheme allocates the smallest hole that is big enough.

School of Advanced Computing (CS20B301-Operating System)


PROGRAM

OUTPUT

School of Advanced Computing (CS20B301-Operating System)


Experiment-12
Name of Experiment- Write a program to implement WORST FIT algorithm.

AIM: To implement Worst Fit Algorithm for Memory Management.

Algorithm:

Step 1: Start the program.

Step 2: Get the number of holes and size of holes.

Step 3: Enter the number of processes and their sizes for process creation.

Step 4: Compare the process and size then the process is successfully to allocate given hole.

Step 5: In worst fit memory management scheme the biggest hole is allocated.

PROGRAM

OUTPUT

School of Advanced Computing (CS20B301-Operating System)


Experiment-13
Name of Experiment- Write a program to implement FIRST FIT algorithm.

AIM: To implement first fit Algorithm for Memory Management.

Algorithm:

Step 1: Start the program.

Step 3: Get the number of holes and size of holes.

Step 4: Enter the number of processes and their sizes for process creation.

Step 5: Compare the process and size then the process is successfully to allocate given hole.

Step 6: In first fit memory management scheme the first biggest hole is allocated first.

PROGRAM

OUTPUT

School of Advanced Computing (CS20B301-Operating System)


Experiment-14
Name of Experiment- Write a program to implement Banker’s algorithm.

AIM: To implement deadlock avoidance & Prevention by using Banker’s Algorithm.

Banker’s Algorithm- When a new process enters a system, it must declare the maximum
number of instances of each resource type it needed. This number may exceed the total number
of resources in the system. When the user requests a set of resources, the system must determine,
whether the allocation of each resources will leave the system in safe state or not. Either the
resources will be allocated; otherwise the process must wait until some other process release the
resources.
Data structures

 n-Number of process, m-number of resource types.

 Available: Available[j]=k, k – instance of resource type Rj is available.

 Max: If max[i, j]=k, Pi may request at most k instances resource Rj.

 Allocation: If Allocation [i, j]=k, Pi allocated to k instances of resource Rj

 Need: If Need[I, j]=k, Pi may need k more instances of resource type Rj,

 Need[I, j]=Max[I, j]-Allocation[I, j];

Safety Algorithm

1. Work and Finish be the vector of length m and n respectively, Work=Available and
Finish[i] =False.
2. Find an i such that both

3. Finish[i] =False

4. Need<=Work

5. If no such I exists go to step 4.

6. work=work+Allocation, Finish[i] =True;

School of Advanced Computing (CS20B301-Operating System)


7. if Finish[1]=True for all I, then the system is in safe state.

Resource request algorithm


Let Request i be request vector for the process Pi, If request i=[j]=k, then process Pi wants k
instances of resource type Rj.
1. if Request<=Need I go to step 2. Otherwise raise an error condition.

2. if Request<=Available go to step 3. Otherwise Pi must since the resources are available.

3. Have the system pretend to have allocated the requested resources to process Pi by
modifying the state as follows;
Available=Available-Request I;

Allocation I =Allocation+Request I;

Need i=Need i-Request I;

If the resulting resource allocation state is safe, the transaction is completed and process Pi is
allocated its resources. However, if the state is unsafe, the Pi must wait for Request (i) and the
old resource-allocation state will be restored.
Algorithm:

1. Start the program.

2. Get the values of resources and processes.

3. Get the avail value.

4. After allocation find the need value.

5. Check whether its possible to allocate.

6. If it is possible then the system is in safe state.

7. Else system is not in safety state.

8. If the new request comes then check that the system is in safety.

9. or not if we allow the request.

10. stop the program.

School of Advanced Computing (CS20B301-Operating System)


PROGRAM

OUTPUT

Experiment-15
Name of Experiment- Write a program to implement various Disk Scheduling
Algorithms.

Introduction- In operating systems, seek time is very important. Since all device requests are
linked in queues, the seek time is increased causing the system to slow down. Disk Scheduling
Algorithms are used to reduce the total seek time of any request.

Types of Disk Scheduling Algorithms

Although there are other algorithms that reduce the seek time of all requests, I will only
concentrate on the following disk scheduling algorithms:

a) First Come-First Serve (FCFS)


b) Shortest Seek Time First (SSTF)
c) Elevator (SCAN)
d) Circular SCAN (C-SCAN)
e) LOOK
f) C-LOOK
These algorithms are not hard to understand, but they can confuse someone because they are so
similar. What we are striving for by using these algorithms is keeping Head Movements (#
tracks) to the least amount as possible. The less the head has to move the faster the seek time will
be. I will show you and explain to you why C-LOOK is the best algorithm to use in trying to
establish less seek time.
Given the following queue – (95, 180, 34, 119, 11, 123, 62, and 64) with the Read-write head
initially at the track 50 and the tail track being at 199 let us now discuss the different algorithms.

School of Advanced Computing (CS20B301-Operating System)


1. First Come -First Serve (FCFS)
All incoming requests are placed at the end of the queue. Whatever number that is next in the
queue will be the next number served. Using this algorithm doesn't provide the best results. To
determine the number of head movements you would simply find the number of tracks it took to
move from one request to the next. For this case it went from 50 to 95 to 180 and so on. From 50
to 95 it moved 45 tracks. If you tally up the total number of tracks you will find how many tracks
it had to go through before finishing the entire request. In this example, it had a total head
movement of 640 tracks. The disadvantage of this algorithm is noted by the oscillation from
track 50 to track 180 and then back to track 11 to 123 then to 64. As you will soon see, this is the
worse algorithm that one can use.

2. Shortest Seek Time First (SSTF)


In this case request is serviced according to next shortest distance. Starting at 50, the next
shortest distance would be 62 instead of 34 since it is only 12 tracks away from 62 and 16 tracks
away from 34. The process would continue until all the process is taken care of. For example the
next case would be to move from 62 to 64 instead of 34 since there are only 2 tracks between
them and not 18 if it were to go the other way. Although this seems to be a better service being
that it moved a total of 236 tracks, this is not an optimal one. There is a great chance that
starvation would take place. The reason for this is if there were a lot of requests close to each
other the other requests will never be handled since the distance will always be greater.

School of Advanced Computing (CS20B301-Operating System)


3. Elevator (SCAN)
This approach works like an elevator does. It scans down towards the nearest end and then when
it hits the bottom it scans up servicing the requests that it didn't get going down. If a request
comes in after it has been scanned it will not be serviced until the process comes back down or
moves back up. This process moved a total of 230 tracks. Once again this is more optimal than
the previous algorithm, but it is not the best.

4. Circular Scan (C-SCAN)


Circular scanning works just like the elevator to some extent. It begins its scan toward the
nearest end and works it way all the way to the end of the system. Once it hits the bottom or top
it jumps to the other end and moves in the same direction. Keep in mind that the huge jump
doesn't count as a head movement. The total head movement for this algorithm is only 187 track,
but still this isn't the most sufficient.

School of Advanced Computing (CS20B301-Operating System)


5. C-LOOK
This is just an enhanced version of C-SCAN. In this the scanning doesn't go past the last request
in the direction that it is moving. It too jumps to the other end but not all the way to the end. Just
to the furthest request. C-SCAN had a total movement of 187 but this scan (C-LOOK) reduced it
down to 157 tracks.

AIM: To write a ‘C’ program to implement the Disk Scheduling algorithm for First Come First
Served (FCFS), Shortest Seek Time First (SSTF), and SCAN.

PROBLEM DESCRIPTION:

School of Advanced Computing (CS20B301-Operating System)


Disk Scheduling is the process of deciding which of the cylinder request is in the ready queue is
to be accessed next. The access time and the bandwidth can be improved by scheduling the
servicing of disk I/O requests in good order.
Access Time- The access time has two major components: Seek time and Rotational
Latency.
Seek Time- Seek time is the time for disk arm to move the heads to the cylinder containing the
desired sector.
Rotational Latency- Rotational latency is the additional time waiting for the disk to rotate the
desired sector to the disk head.
Bandwidth- The disk bandwidth is the total number of bytes transferred, divided by the total
time between the first request for service and the completion of the last transfer.

Algorithm:
Input the maximum number of cylinders and work queue and its head starting position.
First Come First Serve Scheduling (FCFS) algorithm – The operations are performed in order
requested. There is no reordering of work queue. Every request is serviced, so there is
no starvation. The seek time is calculated.
Shortest Seek Time First Scheduling (SSTF) algorithm – This algorithm selects the request
with the minimum seek time from the current head position. Since seek time increases with the
number of cylinders traversed by the head, SSTF chooses the pending request closest to the
current head position. The seek time is calculated.
SCAN Scheduling algorithm – The disk arm starts at one end of the disk, and moves toward the
other end, servicing requests as it reaches each cylinder, until it gets to the other end of the disk.
At the other end, the direction of head movement is reversed, and servicing continues. The head
continuously scans back and forth across the disk. The seek time is calculated. Display the seek
time and terminate the program

PROGRAM

OUTPUT

School of Advanced Computing (CS20B301-Operating System)


School of Advanced Computing (CS20B301-Operating System)

You might also like