3140702_Operating System_Lab_Manual
3140702_Operating System_Lab_Manual
Operating Systems
(3140702)
Enrolment No
Name
Branch
Academic Term
Institute Name
CERTIFICATE
completed the Practical / Tutorial work for the subject Operating System
Place:
Date:
Main motto of any laboratory/practical/field work is for enhancing required skills as well as
creating ability amongst students to solve real time problem by developing relevant competencies
in psychomotor domain. By keeping in view, GTU has designed competency focused
outcome-based curriculum for engineering degree programs where sufficient weightage is given
to practical work. It shows importance of enhancement of skills amongst the students and it pays
attention to utilize every second of time allotted for practical amongst students, instructors and
faculty members to achieve relevant outcomes by performing the experiments rather than having
merely study type experiments. It is must for effective implementation of competency focused
outcome-based curriculum that every practical is keenly designed to serve as a tool to develop and
enhance relevant competency required by the various industry among every student. These
psychomotor skills are very difficult to develop through traditional chalk and board content
delivery method in the classroom. Accordingly, this lab manual is designed to focus on the
industry defined relevant outcomes, rather than old practice of conducting practical to prove
concept and theory.
By using this lab manual students can go through the relevant theory and procedure in advance
before the actual performance which creates an interest and students can have basic idea prior to
performance. This in turn enhances pre-determined outcomes amongst students. Each experiment
in this manual begins with competency, industry relevant skills, course outcomes as well as
practical outcomes (objectives). The students will also achieve safety and necessary precautions
to be taken while performing practical.
This manual also provides guidelines to faculty members to facilitate student centric lab activities
through each experiment by arranging and managing necessary resources in order that the
students follow the procedures with required safety and necessary precautions to achieve the
outcomes. It also gives an idea that how students will be assessed by providing rubrics.
Operating System is one of the core courses in Computer Engineering discipline. It includes basic
working and application of Operating System. Process and Thread management with different
Process scheduling Algorithms like FCFS, SJF, RR, Priority, etc. Concurrency control
mechanisms of processes. To understand Inter Process Communication: Race Conditions, Critical
Section, And Mutual Exclusion concepts are needed. Deadlock and its solutions for uninterrupted
execution of processes. Memory management in Operating system. Input output and Disk
scheduling algorithms. Virtualization concepts, Development of basic code of operating system
using Shell Scripts.
Utmost care has been taken while preparing this lab manual however always there is chances of
improvement. Therefore, we welcome constructive suggestions for improvement and removal of
errors if any.
DTE’s Vision
Institute’s Vision
Institute’s Mission
● To upgrade and enhance learning resources for delivering quality technical education.
● To improve pedagogical skills and subject knowledge of the faculty members.
● To fortify industry interaction for up gradation of the skills of students for meeting upcoming
professional challenges.
● To nurture innovative thinking and experimentation for addressing real life problems.
● To take cognizance of social, ethical and environmental issues.
Department’s Vision
Department’s Mission
● To bring out graduates who can solve challenges of industry and society by applying computing
techniques.
● To develop partnership with industries, government agencies and Research and Development
organizations for knowledge and resource sharing.
● To encourage faculties and students to participate in reputed conferences, workshops, seminars
and other such technical activities.
● To motivate students/graduates to be entrepreneurs.
● To impart human and ethical values among students in the service of society.
Programme Outcomes (POs)
C C C C C
Sr.
Practical Outcome/Title of experiment O O O O O
No.
1 2 3 4 5
Study of Linux/Windows system Architecture ,
1 √ √
Installation and MS DOS Commands.
Study and execute Basic and directory manipulation
2 √
commands of LINUX/UNIX.
Study and execute Basic File manipulation
3 √
commands.
1. Teacher should provide the guideline with demonstration of practical to the students
with all features.
2. Teacher shall explain basic concepts/theory related to the experiment to the students
before starting of each practical
3. Involve all the students in performance of each experiment.
4. Teacher is expected to share the skills and competencies to be developed in the
students and ensure that the respective skills and competencies are developed in the
students after the completion of the experimentation.
5. Teachers should give opportunity to students for hands-on experience after the
demonstration.
6. Teacher may provide additional knowledge and skills to the students even though not
covered in the manual but are expected from the students by concerned industry.
7. Give practical assignment and assess the performance of students based on task
assigned to check whether it is as per the instructions or not.
8. Teacher is expected to refer complete curriculum of the course and follow the
guidelines for implementation.
1. Students are expected to carefully listen to all the theory classes delivered by the faculty
members and understand the COs, content of the course, teaching and examination
scheme, skill set to be developed etc.
2. Students will have to perform experiments on computer system on which UNIX/Linux is
installed to execute programs of Operating System.
3. Students should develop programs and execute all the programs using UNIX/Linux OS.
Students have to show output of each program in their practical file.
4. Students are instructed to submit practical list as per given sample list shown on next page.
5. Student should develop a habit of submitting the experimentation work as per the schedule
and she/he should be well prepared for the same.
Sign.
Date Date Assess of
Sr. Pg. of of ment Teac Rem
Objective(s) of Experiment
No. No. perfor subm Mark her arks
mance i s with
ssion date
1.1 Study of LINUX/UNIX Architecture AND Installation of Ubuntu using Virtual Box.
Objectives:
Theory:
Computer system can be divided roughly into four components: the hardware, the
operating system, the application programs, and the users).The hardware like the central
processing unit (CPU), the memory, and the input/output (I/O) devices provides the basic
computing resources for the system. The application programs such as word processors,
spreadsheets, compilers, and Web browsers—define the ways in which these resources are used to
solve users’ computing problems. The operating system controls the hardware and coordinates its
use among the various application programs for the various users. In short, operating system
provides the means for proper use of these resources in the operation of the computer system. It
also provides an environment within which other programs can do useful wor
1.1 Study of LINUX/UNIX Architecture AND Installation of Ubuntu using Virtual Box.
//Student has to draw Linux/Unix Architecture and also Write the Working/Significance
about each Component of it.
Steps are Given for the Installation of Ubuntu on Virtual Machine. Students need to
Follow steps to Install Linux OS on the System.
This is a popular method to install a Linux operating system. The virtual installation offers you
the freedom of running Linux on an existing OS already installed on your computer. This means if
you have Windows running, then you can just run Linux with a click of a button.
Download Virtual box depending on your processor and OS, select the appropriate package. In
our case, we have selected Windows with AMD. Once Download Complete open the source and
run it and install VirtualBox on your System.Once it installed Open Virtualbox for further
process.(snapshots are given below)
Fig.1.1 Downloading Installing Virtual Box
Fig.1.2 Steps to follow while installing Virtual Box
Step-4 Create a Machine in Virtual Box. Open Virtual box and click on new button
Fig.1.5 instant starting of virtual box for ubuntu installation virtual Box
Step-5 In next window, give the name of your OS which you are installing in virtual box. And
select OS like Linux and version as Ubuntu 32 bit. And click on next
Step-7 Now To run OS in virtual box we have to create virtual hard disk, click on create a virtual
hard drive now and click on create button. The virtual hard disk is where the OS installation files
and data/applications you create/install in this Ubuntu machine will reside
Fig.1.8 creating virtual disk drive for ubuntu installation
Step-8 select VHD (virtual hard disk) option and click on next.
Step-9 Click on dynamic allocated and click on next. This means that the size of the disk will
increase dynamically as per requirement.
Step-11 Now you can see the machine name in left panel
Step-16 You have an option to Run Ubuntu WITHOUT installing. In this tutorial will
install Ubuntu
Step-18 Select option to erase the disk and install Ubuntu and click on install now. This option
installs Ubuntu into our virtual hard drive which is we made earlier. It will not harm your PC
or Windows installation
Step-21 Select your username and password for your Ubuntu admin account. This information
has been needed for installing any software package into Ubuntu and also for login to your OS.
Fill up your details and tick on login automatically to ignore login attempt and click on
continue.
Fig.1.22 setting up User credentials
Step-22 Installation process starts. May take up to 30 minutes. Please wait until installation
process completes. After finishing the installation, you will see Ubuntu Desktop.
Fig.1.23 Installation in Progess
● Faculty Member can Assign task to write Installation steps of Windows OS System.
Student has to perform above mentioned command on DOS Prompt. And also need to write
each command as per given example.
1. ATTRIB: - Using the ATTRIB command, you can change a file`s read/write attribute or
set the archive attribute.
Syntax:
ATTRIB [d:][path]filename [/S]
ATTRIB [+ R|-R] [+A|-A] [+ H|-H] [+ S|-S] [d:][path]filename [/S]
+A - option to set the ARCHIVE attribute of a file. When the +A option is used, this
flags the file as available for archiving when using the BACKUP or XCOPY commands.
-A - Use the -A option to turn off the ARCHIVE attribute.
+H - to set the HIDDEN attribute of a file so that it will not appear in a directory listing.
-H - Use the -H option to turn off the HIDDEN attribute.
+S - With to set the SYSTEM attribute of a file. When the +S option is used, this flags the
file as a command file used only by DOS. The file will not appear in a directory listing.
This attribute is generally reserved for programmers.
/S - Use the /S switch to set attributes on subdirectories found within the specified path.
Execution of Command:
Conclusion:
Quiz:
Ans.
Ans.
Ans.
Suggested Reference:
1. Operating Systems: Internals & Design Principles, 9th Edition, William Stallings,
Pearson Education India
2. Operating System Concepts, 9th edition Peter B. Galvin, Greg Gagne, Abraham
Silberschatz, John Wiley & Sons, Inc.
5. https://ubuntu.com/tutorials/how-to-run-ubuntu-desktop-on-a-virtual-machine-using-virtualb
o x#1-overview
Marks
Experiment No: 2
AIM : Study and execute Basic and directory manipulation commands of LINUX/UNIX.
2.3. Using commands : pwd, mkdir, cd, rmdir ,ls generate given tree.
Competency and Practical Skills: Basic Skills to work with Computer System/ Linux Terminal
Objectives:
A Unix shell is a command-line interpreter or shell that provides a command line user interface
for Unix-like operating systems. The shell is both an interactive command language and a
scripting language, and is used by the operating system to control the execution of the system
using shell scripts.
Environment variables basically define the behavior of the environment. They can affect
the running processes or programs executed in the environment. Every Linux process has an
associated set of environment environment variables are typically accessed through the shell.
The shell is a command-line interface that interprets and executes commands entered by the user.
It provides a way to set, modify, and retrieve environment variables.just like programming
language variables The scope of any variable is the region from which it can be accessed or over
which it is defined. An environment variable in Linux can have global or local scope.
There are Large set of Commands supported by Linux/Unix. In this Practical we will study Basic
System Command and Directory Commands.
who It prints information about users who are currently logged in.
For any command, help manual is available in Linux System. We can use man Command
to open help manual for any command using following command:
● Based on Questions asked, student has to execute command and need to write the
answer.
● Before using the command to solve the questions, student has to write name of the
command, Syntax, options available to use the command and description(as per
requirement).
Example:
Command Name: date (print or set the system date and time)
OPTIONS
%C century; like %Y, except omit last two digits (e.g., 20)
%G year of ISO week number (see %V); normally useful only with %V
%h same as %b
%H hour (00..23)
Note: There are number of option available to work with specific command student can
write description of any option as per requirement of practical.
Example.
Syntax: $Shell
Output:
2.2.2. Display the Calendar of given month and year value provided by user.
2.2.8. Display current year number in two digit form using DATE command.
2.2.9. Display the day of current date in short as well as full name using DATE
command.
2.2.10. Display the month of current date in short as well as full name using DATE
command.
2.3. Using pwd, mkdir, cd, rmdir,ls commands generate given tree.
1.1.1. Display the path from root directory to the last level directory of the tree.(Consider
Root directory of given tree as root)
1.1.2. Remove Directory Enrollment_12.
Observations:
Conclusion:
Quiz:
Suggested Reference:
1. Operating Systems: Internals & Design Principles, 9th Edition, William Stallings,
Pearson Education India
2. Operating System Concepts, 9th edition Peter B. Galvin, Greg Gagne, Abraham
Silberschatz, John Wiley & Sons, Inc.
Marks
Experiment No: 3
Competency and Practical Skills: Basic Skills to work with Computer System/ Linux Terminal
Objectives:
a. To understand the importance of Shell/Envirnment Variable
b. To work with basic File Operations.
c. To work/Access the Directory commands.
diff Find the difference between two files and give way to make them identical.
3.1.
Create 4 Files using cat Command.
● Create 4 Files F1.txt ,F2.txt ,F3.txt ,F4.txt with some content.
● Preferable to put paragraph in one file.
● In File F2 and F3 write content in form of words in alphabetical sorted order
Also put some common value in both file (like student name or engineering branch
names, fruits, vegetables, etc)
● In fourth File write decimal numbers separated by newline.
3.2. Copy Content of File F1 to F1_c.
Observations:
// Write your observation for comm., cmp, diff, sort, chmod command.
Conclusion:
Quiz:
Suggested Reference:
1. Operating Systems: Internals & Design Principles, 9th Edition, William Stallings,
Pearson Education India
2. Operating System Concepts, 9th edition Peter B. Galvin, Greg Gagne, Abraham
Silberschatz, John Wiley & Sons, Inc.
Competency and Practical Skills: Basic Skills to work with Computer System/ Linux Terminal
Objectives:
Filter commands accept input data from standard input and produce output standard
output. It transforms plain-text data into a meaningful way and can be used merge with other
output or file. These filters are very small programs that are designed for a specific function
which can be used as building blocks.There are number of commands we already have covered I
n previous practicals like sort,comm.,cat and others are cut , paste, head,tail, grep, tee ,uniq, grep.
Using these commands one can search and display specif content from file also filter some
specific data.
For more description about the command we can read a Linux Help manual using
command :
$man Commandname.
grep Search the line with specified pattern present in the file(s).
grep command searches the simple pattern as well pattern specified using Regular
expression.To create a pattern which matches different types of string we can use different
wildcard characters to create a new pattern. The basic set of wildcards in are:
* – This wildcard represents all the characters. Also represent one or more occurrence of
preceded character.
To solve the question given student has to create a text file with Student details like:
Enrollment number, Student name, Birth-date, Semester, Gender , Email Address, SPI
,where each field is separated by delimiter character “|” or any character as per wish.
4.3. Cut the file column wise and display Student Enrollment number, Gender, Email Address.
4.4. Cut the file column wise and display Student name , Branch,semester.
4.5. Merge the result of Question 4.3 and 4.4 using delimiter $ and store it File named result1
using tee command.
4.6. Cut the File Fieldwise (vertically) to display second, third and fourth field of the file.
4.7. Display the First three student details having highest SPI in decreasing order.
4.10. Display student details studying in same branch and same semester.
4.12. Display student details studying Whose surname starts will “p” and ends with “l”.
4.13. Display the name of student whose surname is agarwal (surname may be in any form).
4.14. Display details of all girls students.
Observations:
Conclusion:
Quiz:
2. By default, how many lines are displayed using the head command? which option used to
display specific lines from the file?
Suggested Reference:
1. Operating Systems: Internals & Design Principles, 9th Edition, William Stallings,
Pearson Education India
2. Operating System Concepts, 9th edition Peter B. Galvin, Greg Gagne, Abraham
Silberschatz, John Wiley & Sons, Inc.
a. To understand and use the loop and control structure to sove problem using shell script.
Linux/Unix shells are interactive, by means they accept commands as input from users
and execute them and display the output accordingly. Normally we are executing command
independently one by one. Sometimes it is require to execute same no.of commands repeatedly
which is time consuming task but linux system also has solution for that called shell
programming. For that we can put all commands together in single file and execute them in shell
to avoid repetitive work. These files are called Shell Scripts or Shell Programs. Shell scripts are
similar to the batch file in MS-DOS. The shell script file is saved with “.sh” extension e.g.,
First_program.sh.
A shell script has syntax like other programming language. If you have any prior
experience of programming language like Python, C/C++ etc. It would be very easy to understand
shell programming. It has it’s Shell Keywords, Control flow statements, Loop statements, Shell
(linux command we had used in previous experiments)and Functions.
To run the shell script program, file must be executable. To set execute permission of file
we can use chmod command.e.g. chmod 777 file.sh command allows file.sh to execute.to run the
file one can write the command ./file.sh.
● There are 3 types loop statements supported by shell programming:
1. while statement
Syntax:
while
<condition> do
<command statement 1>
<command statement 2>
.
.
<command statement n>
done
2. for statement
The for loop operates on lists . It repeats a set of commands for every item as per list
value. var is the variablename and var takes value from the list value1, value2, … value n
on each iteration, respectively,
Syntax:
3. do…until statement
The do… until loop is executed as many times as th condition/command evaluates too false. The
loop terminates when the condition/command becomes true.
Syntax:
until
<condition> do
<command statement 1>
<command statement 2>
.
.
done
To change the flow of loop statements, two commands are used they are,
1. break
2. continue
i. Simple if
statement Syntax:
if [ expression
] then
fi
ii. if-else
statement
Syntax:
if [ expression
] then
else
fi
Syntax:
if [ expression1
] then
elif [ expression2 ]
then
else
fi
Syntax:
2. switch statement
Syntax:
case “expression” in
Pattern 1) < command Statement 1> ;;
Pattern 2) < command Statement 2> ;;
.
.
.
Pattern n) < command Statement n> ;;
esac
else
fi
OUTPUT:
Example 2: “shell script to Display branchcode of respective branch using case
control statement”
Program:
Output:
Program:
Observations:
Conclusion:
Quiz:
Suggested Reference:
1. Operating Systems: Internals & Design Principles, 9th Edition, William Stallings,
Pearson Education India
2. Operating System Concepts, 9th edition Peter B. Galvin, Greg Gagne, Abraham
Silberschatz, John Wiley & Sons, Inc.
6.1 Write a shell script to read n numbers as command arguments and sort them in descending
order.
6.2 Write a shell script to generate mark sheet of a student. Take 3 subjects, calculate and display
total marks, percentage and Class obtained by the student.
6.1 Write a shell script to read n numbers as command arguments and sort them in
descending order.
Program:
Output:
6.2 Write a shell script to generate mark sheet of a student. Take 3 subjects, calculate and
display total marks, percentage and Class obtained by the student.
Output:
Observations:
Conclusion:
Suggested Reference:
https://www.tutorialspoint.com/
https://www.geeksforgeeks.org/
https://www.javatpoint.com/
https://www.tutorialspoint.com/unix/unix-loop-control.htm
Objectives: explore usage of various searching and date - time related commands.
Theory:
find command
The find command in UNIX is a command line utility for walking a file hierarchy. It can be used
to find files and directories and perform subsequent operations on them. It supports searching by
file, folder, name, creation date, modification date, owner and permissions. By using the ‘-exec’
other UNIX commands can be executed on files or folders found.
Options:
● -exec CMD: The file being searched which meets the above criteria and returns 0
for as its exit status for successful command execution.
● -ok CMD : It works same as -exec except the user is prompted first.
● -inum N : Search for files with inode number ‘N’.
● -links N : Search for files with ‘N’ links.
● -name demo : Search for files that are specified by ‘demo’.
● -newer file : Search for files that were modified/created after ‘file’.
● -perm octal : Search for the file if permission is ‘octal’.
● -print : Display the path name of the files found by using the rest of the criteria.
● -empty : Search for empty files and directories.
● -size +N/-N : Search for files of ‘N’ blocks; ‘N’ followed by ‘c’can be used to
measure the size in characters; ‘+N’ means size > ‘N’ blocks and ‘-N’ means size <
‘N’ blocks.
● -user name : Search for files owned by username or ID ‘name’.
● \(expr \) : True if ‘expr’ is true; used for grouping criteria combined with OR or AND.
● ! expr : True if ‘expr’ is false.
Program:
Output:
7.2 Write a menu driven shell script which will print the following menu and execute the
given task.
MENU
● Display calendar of current month
● Display today’s date and time
● Display usernames those are currently logged in the system
● Display your name at given x, y position
● Display your terminal number
● Exit
Theory:
Case Statement
A case statement in bash scripts is used when a decision has to be made against multiple choices.
In other words, it is useful when an expression has the possibility to have multiple values. This
methodology can be seen as a replacement for multiple if-statements in a script. Case statements
have an edge over if-statements because it improves the readability of our code and they are
easier to maintain. Case statements in a Bash script are quite similar to Case statements in C
language.
But unlike C, the Bash Case statement stops continuing the search as soon as the match occurs.
In simple words, they don’t require any break statement that is mandatory to be used in C to stop
searching for a pattern further.
The basic syntax of a case statement is given
below, Syntax:
case EXPRESSION
in Pattern_Case_1)
STATEMENTS
;;
Pattern_Case_1)
STATEMENT
S
;;
Pattern_Case_N)
STATEMENTS
;;
*)
STATEMENTS
;;
esac
cal command
By default, the cal command shows the current month calendar as output.
cal command is a calendar command in Linux which is used to see the calendar of a specific
month or a whole year.
Syntax:
cal [ [ month ] year]
who command
The who command is used to get information about currently logged in user on to
Examples :
1. The who command displays the following information for each user currently logged in to the
system if no option is provided :
Program:
Output:
Observations:
Suggested Reference:
https://www.tutorialspoint.com/
https://www.geeksforgeeks.org/
https://www.javatpoint.com/
First Come First Serve (FCFS) is an operating system scheduling algorithm that automatically
executes queued requests and processes in order of their arrival. It is the easiest and simplest
CPU scheduling algorithm. In this type of algorithm, processes which request the CPU first get
the CPU allocation first. This is managed with a FIFO queue. The full form of FCFS is First
Come First Serve.
Round Robin is a CPU scheduling algorithm where each process is assigned a fixed time slot in a
cyclic way. It is basically the preemptive version of First come First Serve CPU Scheduling
algorithm. Round Robin CPU Algorithm generally focuses on Time Sharing technique.
The period of time for which a process or job is allowed to run in a pre-emptive method is called
time quantum.
Each process or job present in the ready queue is assigned the CPU for that time quantum, if the
execution of the process is completed during that time then the process will end else the process
will go back to the waiting table and wait for its next turn to complete the execution.
Characteristics of Round Robin CPU Scheduling Algorithm
It is simple, easy to implement, and starvation-free as all processes get fair share of CPU.
One of the most commonly used technique in CPU scheduling as a core.
It is preemptive as processes are assigned CPU only for a fixed slice of time at most.
The disadvantage of it is more overhead of context switching.
Program:
Output:
Observations:
Conclusion:
Suggested Reference:
https://www.tutorialspoint.com
/
https://www.geeksforgeeks.org
/ https://www.javatpoint.com/
The producer’s job is to generate data, put it into the buffer, and start again. At the same time, the
consumer is consuming the data (i.e. removing it from the buffer), one piece at a time.
Problem:
To make sure that the producer won’t try to add data into the buffer if it’s full and that the
consumer won’t try to remove data from an empty buffer.
Solution:
The producer is to either go to sleep or discard data if the buffer is full. The next time the
consumer removes an item from the buffer, it notifies the producer, who starts to fill the buffer
again. In the same way, the consumer can go to sleep if it finds the buffer to be empty. The next
time the producer puts data into the buffer, it wakes up the sleeping consumer.
An inadequate solution could result in a deadlock where both processes are waiting to be
awakened.
Multithreading is a Java feature that allows concurrent execution of two or more parts of a
program for maximum utilization of CPU. Each part of such program is called a thread. So,
threads are light-weight processes within a process.
The Fork system call is used for creating a new process in Linux, and Unix systems, which is
called the child process, which runs concurrently with the process that makes the fork() call
(parent process). After a new child process is created, both processes will execute the next
instruction following the fork() system call.
The child process uses the same pc(program counter), same CPU registers, and same open files
which use in the parent process. It takes no parameters and returns an integer value.
#include <stdio.h>
#include
<sys/types.h>
#include <unistd.h>
int main()
{
9.1 Implement Producer consumer problem using thread using C/JAVA programming
Language.
Program:
Output:
9.2 Create new thread using fork() system call using C programming Language.
Program:
Output:
Observations:
Conclusion:
Suggested Reference:
https://www.tutorialspoint.com
/
https://www.geeksforgeeks.org
/ https://www.javatpoint.com/
https://www.geeksforgeeks.org/producer-consumer-solution-using-threads-java
/ https://www.geeksforgeeks.org/thread-functions-in-c-c/
In an operating system that uses paging for memory management, a page replacement algorithm
is needed to decide which page needs to be replaced when a new page comes in.
Page Fault: A page fault happens when a running program accesses a memory page that is
mapped into the virtual address space but not loaded in physical memory. Since actual physical
memory is much smaller than virtual memory, page faults happen. In case of a page fault,
Operating System might have to replace one of the existing pages with the newly needed page.
Different page replacement algorithms suggest different ways to decide which page to replace.
The target for all algorithms is to reduce the number of page faults.
First In First Out (FIFO): This is the simplest page replacement algorithm. In this algorithm,
the operating system keeps track of all pages in the memory in a queue, the oldest page is in the
front of the queue. When a page needs to be replaced page in the front of the queue is selected for
removal.
A Process makes the I/O requests to the operating system to access the disk. Disk Scheduling
Algorithm manages those requests and decides the order of the disk access given to the requests.
Important Terms related to Disk Scheduling Algorithms
Seek Time - It is the time taken by the disk arm to locate the desired track.
Rotational Latency - The time taken by a desired sector of the disk to rotate itself to the position
where it can access the Read/Write heads is called Rotational Latency.
Transfer Time - It is the time taken to transfer the data requested by the processes.
Disk Access Time - Disk Access time is the sum of the Seek Time, Rotational Latency, and
Transfer Time.
C-SCAN
This algorithm is the same as the SCAN algorithm. The only difference between SCAN and
C-SCAN is, it moves in a particular direction till the last and serves the requests in its path. Then,
it returns in the opposite direction till the end and doesn't serve the request while returning. Then,
again reverses the direction and serves the requests found in the path. It moves circularly.
Output:
Output:
Observations:
Conclusion:
Suggested Reference:
https://www.tutorialspoint.com/
https://www.geeksforgeeks.org/
https://www.javatpoint.com/
https://www.baeldung.com/cs/fifo-page-replacemen
t