OS Instructor Lab Manual
OS Instructor Lab Manual
OPERATING SYSTEMS
Submitted by
Lab Instructor
TABLE OF CONTENTS
CERTIFICATE...............................................................................................................................vi
CLOs PLOs MAPPING AND LIST OF EXPERIMENTS...........................................................vii
DOCUMENT VERSION DETAILS...........................................................................................viii
LAB NO. 1 30/09/2022..............................................9
IMPLEMENTATION OF FIRST COME FIRST SERVE SCHEDULING (FCFS)......................9
Lab Outcomes:.............................................................................................................................9
Corresponding CLO and PLO......................................................................................................9
Theory:.........................................................................................................................................9
Equipment:...................................................................................................................................9
Procedure.....................................................................................................................................9
Task:.............................................................................................................................................9
Code.................................................................................................................................................9
Output:...........................................................................................................................................12
Observations:.............................................................................................................................12
Rubrics.......................................................................................................................................13
LAB NO. 2 06/10/2022......................................................................................14
IMPLEMENTATION OF SHORTEST JOB FIRST SCHEDULING (SJF)................................14
Lab Outcomes:...........................................................................................................................14
Corresponding CLO and PLO....................................................................................................14
Theory:.......................................................................................................................................14
Equipment:.................................................................................................................................14
Procedure...................................................................................................................................14
Task:...........................................................................................................................................14
Code...........................................................................................................................................14
Observations:.............................................................................................................................17
Rubrics.......................................................................................................................................18
LAB NO. 3 21/10/2022.....................................................................................19
IMPLEMENTATION OF PRIORITY SCHEDULING...............................................................19
Lab Outcomes:...........................................................................................................................19
Corresponding CLO and PLO....................................................................................................19
Theory:.......................................................................................................................................19
ii
LAB MANUAL OPERATING SYSTEMS
Equipment:.................................................................................................................................19
Procedure...................................................................................................................................19
Task:...........................................................................................................................................19
Observations:.............................................................................................................................22
Rubrics.......................................................................................................................................23
LAB NO. 4 27/10/2022.....................................................................................24
IMPLEMENTATION OF ROUND ROBIN SCHEDULING......................................................24
Lab Outcomes:...........................................................................................................................24
Corresponding CLO and PLO....................................................................................................24
Theory:.......................................................................................................................................24
Equipment:.................................................................................................................................24
Procedure...................................................................................................................................24
Task:...........................................................................................................................................24
Observations:.............................................................................................................................27
Rubrics.......................................................................................................................................28
LAB NO. 5 03/11/2022.....................................................................................29
IMPLEMENTATION OF MULTI-LEVEL QUEUE SCHEDULING.........................................29
Lab Outcomes:.........................................................................................................................29
Corresponding CLO and PLO................................................................................................29
Theory:......................................................................................................................................29
Equipment:...............................................................................................................................29
Procedure..................................................................................................................................29
Task...........................................................................................................................................29
Observations:............................................................................................................................39
Rubrics......................................................................................................................................40
LAB NO. 6 23/11/2022.....................................................................................41
IMPLEMENTATION OF ALGORITHM EVALUATION.........................................................41
Lab Outcomes:...........................................................................................................................41
Corresponding CLO and PLO....................................................................................................41
Theory:.......................................................................................................................................41
Equipment:.................................................................................................................................41
Procedure...................................................................................................................................41
iii
LAB MANUAL OPERATING SYSTEMS
Task:...........................................................................................................................................42
Observations:.............................................................................................................................47
Rubrics.......................................................................................................................................48
LAB NO. 7 31/11/2022.....................................................................................49
IMPLEMENTATION OF RATE MONOTONIC SCHEDULING (RMS)..................................49
Lab Outcomes:...........................................................................................................................49
Corresponding CLO and PLO....................................................................................................49
Theory:.......................................................................................................................................49
Equipment:.................................................................................................................................49
Procedure...................................................................................................................................49
Task:...........................................................................................................................................49
Observations:.............................................................................................................................53
Rubrics.......................................................................................................................................54
LAB NO. 8 08/12/2022.....................................................................................55
IMPLEMENTATION OF EARLIEST DEADLINE FIRST........................................................55
Lab Outcomes:...........................................................................................................................55
Corresponding CLO and PLO....................................................................................................55
Theory:.......................................................................................................................................55
Equipment:.................................................................................................................................55
Procedure...................................................................................................................................55
Task:...........................................................................................................................................56
OUTPUT....................................................................................................................................62
Observations:.............................................................................................................................62
Rubrics.......................................................................................................................................63
LAB NO. 9 USING LINUX OS 15/12/2022...........................................................................64
1)WRITE A SHELL SCRIPT TO LIST ALL THE DIRECTORY FILES IN A DIRECTORY
2) WRITE A SHELL SCRIPT TO FIND FACTORIAL OF A GIVEN NUMBER
3) WRITE AN AWK SCRIPT TO COUNT NUMBER OF LINES IN A FILE THAT DOES NOT
CONTAIN VOWELS
4) WRITE AN AWK SCRIPT TO COUNT NUMBER OF CHARACTERS, WORDS AND LINES
IN A FILE
Lab Outcomes:...........................................................................................................................64
Corresponding CLO and PLO....................................................................................................64
iv
LAB MANUAL OPERATING SYSTEMS
Theory:.......................................................................................................................................64
Equipment:.................................................................................................................................64
Procedure...................................................................................................................................64
Conclusion:................................................................................................................................67
Rubrics.......................................................................................................................................68
LAB NO. 10 22/12/2022........................................................................69
USING LINUX OS
IMPLEMENT IN C LANGUAGE THE FOLLOWING UNIX COMMANDS USING SYSTEM
CALLS A) CAT, B) LS, C) MV
Lab Outcomes:...........................................................................................................................69
Corresponding CLO and PLO....................................................................................................69
Theory:.......................................................................................................................................69
Equipment:.................................................................................................................................69
Procedure...................................................................................................................................69
Conclusion:................................................................................................................................72
Rubrics.......................................................................................................................................73
LAB NO. 11 29/12/2022........................................................................74
USING LINUX OS
A) WRITE A C PROGRAM TO LIST EVERY FILE IN DIRECTORY, ITS INODE NUMBER
AND FILE NAME
B) WRITE A C PROGRAM TO CREATE CHILD PROCESS AND ALLOW PARENT
PROCESS TO DISPLAY “PARENT” AND “CHILD”
Lab Outcomes:...........................................................................................................................74
Corresponding CLO and PLO....................................................................................................74
Theory:.......................................................................................................................................74
Equipment:.................................................................................................................................74
Procedure...................................................................................................................................74
Conclusion:................................................................................................................................76
Rubrics.......................................................................................................................................77
v
LAB MANUAL OPERATING SYSTEMS
CERTIFICATE
vi
LAB MANUAL OPERATING SYSTEMS
List of Experiments
Sr. Experiments
No
1 Implementation of First come First Serve Scheduling (FCFS) Algorithm.
2 Implementation of Shortest Job First Scheduling (SJF).
3 Implementation of Priority Scheduling.
4 Implementation of Round Robin Scheduling.
5 Implementation Of Multi-Level Queue Scheduling
6 Implementation Of Algorithm Evaluation
7 Implementation Of Rate Monotonic Scheduling (Rms)
8 Implementation Of Earliest Deadline First (Open-Ended Lab).
9 Using Linux Operating System Part(1)
10 Using Linux Operating System Part(2)
11 Using Linux Operating System Part(2)
Note: The above list of experiments is common for this subject in all concerned departments of FICT,
however, the subject instructor shall choose the relevant experiments among this list according to the
program requirements.
vii
LAB MANUAL OPERATING SYSTEMS
Attiya Shoaib,
1.2 Reviewed & Modified.
25 March, 2021
th
Sheikh Meer Ahmad (20 Common LAB titles updated)
viii
LAB MANUAL OPERATING SYSTEMS
Lab Outcomes:
After completing this lab, students will be able to:
Understand the Concept of Process attributes, such Process Id’s, Arrival Time & Burst
Time.
Understanding and Calculating Average Waiting and Turn Around Times.
Generate a Gantt Chart of FCFS Scheduling.
Theory:
In this lab students are given a revisit of Different Sorting Algorithms and introduced to
Process Attributes, such as process Id’s, Arrival Times, Burst Times, Waiting times, Average
Waiting Time, Turnaround time and Average Turn Around Time. Students are given the
concept of FCFS and then shown a demonstrator Code of FCFS. They are then given the
demo of inputs of process attributes and their Scheduling on the basis of FCFS. Further a
Gantt Chart is shown, which is produced by the inputs given by the instructor.
Equipment:
Personal Computer
Internet Connection
Visual Studio
Procedure:
1. Start the program.
2. Get the number of processes and their burst time.
3.Initialize the waiting time for process 1 and 0.
4.Process for(i=2;i<=n;i++),wt.p[i]=p[i-1]+bt.p[i-1].
4.The waiting time of all the processes is summed then average value time is calculated.
5.The waiting time of each process and average times are displayed
6.Stop the program
Task:
Write your code and paste your output screenshot with your CMS ID and Name mentioned in
it.
9
LAB MANUAL OPERATING SYSTEMS
Output:
Observations:
In this Lab I have learned about FCFS CPU scheduling that how it works in CPU. In is the
process that requests the services of CPU first, get the CPU first. It means first come first
serve.
10
LAB MANUAL OPERATING SYSTEMS
Rubrics
Report not Plagiarized Requiremen Observation Appropriat Correctly
submitted content ts are listed s are e drawn
presented or and recorded computatio conclusion
incomplete experimenta along with ns or with
Laboratory
submission l procedure detailed numerical exact results
Reports
or late is presented procedure analysis is and
performed complete
report in all
respects
Category Ungraded Very Poor Poor Fair Good Excellent
Marks 0 1 2 3 4 5
Date Total Instructor’s Signature
Marks
Marks 0 1 2 3 4 5
Date Total Instructor’s Signature
11
LAB MANUAL OPERATING SYSTEMS
Marks
ETHICS
Assigned Marks 0 2 4
Obtained Marks /4
Disrespectful behavior Loud and disturbing Good and 30% of the Total
with instructor and / or behavior cooperating behavior Assigned Marks
Behavior with class fellows
OR
Absent
Assigned Marks 0 1.5 3
Obtained Marks /3
Leaves chairs in unorderly Put chair in proper 30% of the Total
manner, doesn’t turn off place, turns off tool / Assigned Marks
tool / software / equipment software / equipment
Regard of Equipment
after lab after lab
OR
Absent
Assigned Marks 0 3
Obtained Marks /3
12
LAB MANUAL OPERATING SYSTEMS
Lab Outcomes:
After completing this lab, students will be able to:
Understand the Basic Concept of Shortest Job First (SJF).
Understanding and Calculating Average Waiting and Turn Around Times.
Generate a Gantt Chart of SJF Scheduling.
Theory:
In this lab students are given an introduction and concept of Shortest Job First (SJF).
Students are then shown a demonstration Code of SJF. They are then given the demo of
inputs of process attributes and their Scheduling on the basis of SJF. Further a Gantt Chart is
shown, which is produced by the inputs given by the instructor.
Equipment:
Personal Computer
Internet Connection
Visual Studio
Procedure:
1. Start the program. Get the number of processes and their burst time.
2. Initialize the waiting time for process 1 as 0.
3. The processes are stored according to their burst time.
4. The waiting time for the processes are calculated a follows:
for(i=2;i<=n;i++).wt.p[i]=p[i=1]+bt.p[i-1].
5. The waiting time of all the processes summed and then the average time is calculate
6. The waiting time of each processes and average time are displayed.
7. Stop the program
Task:
Write your code and paste your output screenshot with your CMS ID and Name mentioned in
it.
13
LAB MANUAL OPERATING SYSTEMS
Observations:
The lab was about SJF that the task which has small burst time or the shortest time will be given
priority for the CPU.
14
LAB MANUAL OPERATING SYSTEMS
Rubrics
Report not Plagiarized Requiremen Observation Appropriat Correctly
submitted content ts are listed s are e drawn
presented or and recorded computatio conclusion
incomplete experimenta along with ns or with
Laboratory
submission l procedure detailed numerical exact results
Reports
or late is presented procedure analysis is and
performed complete
report in all
respects
Category Ungraded Very Poor Poor Fair Good Excellent
Marks 0 1 2 3 4 5
Date Total Instructor’s Signature
Marks
Marks 0 1 2 3 4 5
15
LAB MANUAL OPERATING SYSTEMS
ETHICS
Assigned Marks 0 2 4
Obtained Marks /4
Disrespectful behavior Loud and disturbing Good and 30% of the Total
with instructor and / or behavior cooperating behavior Assigned Marks
Behavior with class fellows
OR
Absent
Assigned Marks 0 1.5 3
Obtained Marks /3
Leaves chairs in unorderly Put chair in proper 30% of the Total
manner, doesn’t turn off place, turns off tool / Assigned Marks
tool / software / equipment software / equipment
Regard of Equipment
after lab after lab
OR
Absent
Assigned Marks 0 3
Obtained Marks /3
16
LAB MANUAL OPERATING SYSTEMS
Lab Outcomes:
After completing this lab, students will be able to:
Understand the Basic Concept of Priority Scheduling algorithm.
Understanding and Calculating Average Waiting and Turn Around Times for the list of
Processes/tasks.
Generate a Corresponding Gantt Chart of the list of Processes/tasks entered for Priority
Scheduling..
Corresponding CLO and PLO:
CLO-1, PLO-5 (Modern Tool Usage)
CLO-3, PLO-3 (Ethics)
Theory:
In this lab students are given an introduction and concept of Priority Scheduling along with
the concept of Quantum. Students are then shown a demonstration Code of Priority
Scheduling. They are then given the demo of inputs of process attributes and their Scheduling
on the basis of Priority Scheduling. Further a Gantt Chart hence produced by the given inputs
is shown.
Equipment:
Personal Computer
Internet Connection
Visual Studio
Procedure:
1. Start the program.
2. Read burst time, waiting time, turn the around time and priority.
3. Initialize the waiting time for process 1 and 0.
4. Based up on the priority process are arranged
5. The waiting time of all the processes is summed and then the average waiting time
6. The waiting time of each process and average waiting time are displayed based on
the priority.
7. Stop the program.
Task:
Write your code and paste your output screenshot with your CMS ID and Name mentioned in
it.
17
LAB MANUAL OPERATING SYSTEMS
Output:
Observations:
The lab is about priority, process with more priority will be serve first.
18
LAB MANUAL OPERATING SYSTEMS
Rubrics
Report not Plagiarized Requiremen Observation Appropriat Correctly
submitted content ts are listed s are e drawn
presented or and recorded computatio conclusion
incomplete experimenta along with ns or with
Laboratory
submission l procedure detailed numerical exact results
Reports
or late is presented procedure analysis is and
performed complete
report in all
respects
Category Ungraded Very Poor Poor Fair Good Excellent
Marks 0 1 2 3 4 5
Date Total Instructor’s Signature
Marks
Marks 0 1 2 3 4 5
19
LAB MANUAL OPERATING SYSTEMS
ETHICS
Assigned Marks 0 2 4
Obtained Marks /4
Disrespectful behavior Loud and disturbing Good and 30% of the Total
with instructor and / or behavior cooperating behavior Assigned Marks
Behavior with class fellows
OR
Absent
Assigned Marks 0 1.5 3
Obtained Marks /3
Leaves chairs in unorderly Put chair in proper 30% of the Total
manner, doesn’t turn off place, turns off tool / Assigned Marks
tool / software / equipment software / equipment
Regard of Equipment
after lab after lab
OR
Absent
Assigned Marks 0 3
Obtained Marks /3
20
LAB MANUAL OPERATING SYSTEMS
Lab Outcomes:
After completing this lab, students will be able to:
Understand the Basic Concept of Round Robin Scheduling algorithm.
Understanding and Calculating Average Waiting and Turn Around Times for the list of
Processes/tasks.
Generate a Corresponding Gantt Chart of the list of Processes/tasks entered for
Round Robin Scheduling.
Corresponding CLO and PLO:
CLO-1, PLO-5 (Modern Tool Usage)
CLO-3, PLO-3 (Ethics)
Theory:
In this lab students are given an introduction and concept of Round Robin Scheduling (RR)
along with the concept of Quantum. Students are then shown a demonstration Code of Round
Robin Scheduling (RR). They are then given the demo of inputs of process attributes and
their Scheduling on the basis of RR. Further a Gantt Chart hence produced by the given
inputs is shown.
Equipment:
Personal Computer
Internet Connection
Visual Studio
Procedure:
1. Get the number of process and their burst time.
2. Initialize the array for Round Robin circular queue as ‘0’.
3. The burst time of each process is divided and the quotients are stored on the round Robin
array.
4. According to the array value the waiting time for each process and the average time are
calculated as line the other scheduling.
5. The waiting time for each process and average times are displayed.
6. Stop the program.
Task:
Write your code and paste your output screenshot with your CMS ID and Name mentioned in
it.
21
LAB MANUAL OPERATING SYSTEMS
OUTPUT:
Observations:
Round Robin (RR) is a better algorithm which gives all the processes to get an access but the
average waiting time under the RR policy is often long for the context switches
22
LAB MANUAL OPERATING SYSTEMS
Rubrics
Report not Plagiarized Requiremen Observation Appropriat Correctly
submitted content ts are listed s are e drawn
presented or and recorded computatio conclusion
incomplete experimenta along with ns or with
Laboratory
submission l procedure detailed numerical exact results
Reports
or late is presented procedure analysis is and
performed complete
report in all
respects
Category Ungraded Very Poor Poor Fair Good Excellent
Marks 0 1 2 3 4 5
Date Total Instructor’s Signature
Marks
Marks 0 1 2 3 4 5
23
LAB MANUAL OPERATING SYSTEMS
ETHICS
Assigned Marks 0 2 4
Obtained Marks /4
Disrespectful behavior Loud and disturbing Good and 30% of the Total
with instructor and / or behavior cooperating behavior Assigned Marks
Behavior with class fellows
OR
Absent
Assigned Marks 0 1.5 3
Obtained Marks /3
Leaves chairs in unorderly Put chair in proper 30% of the Total
manner, doesn’t turn off place, turns off tool / Assigned Marks
tool / software / equipment software / equipment
Regard of Equipment
after lab after lab
OR
Absent
Assigned Marks 0 3
Obtained Marks /3
24
LAB MANUAL OPERATING SYSTEMS
25
LAB MANUAL OPERATING SYSTEMS
OUTPUT:
Observations:
In this lab we have created all process together that how system works on this different situations.
26
LAB MANUAL OPERATING SYSTEMS
Rubrics
Report not Plagiarized Requiremen Observation Appropriat Correctly
submitted content ts are listed s are e drawn
presented or and recorded computatio conclusion
incomplete experimenta along with ns or with
Laboratory
submission l procedure detailed numerical exact results
Reports
or late is presented procedure analysis is and
performed complete
report in all
respects
Category Ungraded Very Poor Poor Fair Good Excellent
Marks 0 1 2 3 4 5
Date Total Instructor’s Signature
Marks
Marks 0 1 2 3 4 5
27
LAB MANUAL OPERATING SYSTEMS
ETHICS
Assigned Marks 0 2 4
Obtained Marks /4
Disrespectful behavior Loud and disturbing Good and 30% of the Total
with instructor and / or behavior cooperating behavior Assigned Marks
Behavior with class fellows
OR
Absent
Assigned Marks 0 1.5 3
Obtained Marks /3
Leaves chairs in unorderly Put chair in proper 30% of the Total
manner, doesn’t turn off place, turns off tool / Assigned Marks
tool / software / equipment software / equipment
Regard of Equipment
after lab after lab
OR
Absent
Assigned Marks 0 3
Obtained Marks /3
28
LAB MANUAL OPERATING SYSTEMS
Lab Outcomes:
After completing this lab, students will be able to:
Understand the Basic Concept of Algorithm Evaluation.
Understanding and Calculating Average Waiting and Turn Around Times for the list of
Processes/tasks.
Generate a Corresponding Gantt Chart of the list of Processes/tasks entered for
Algorithm Evaluation.
Corresponding CLO and PLO:
CLO-1, PLO-5 (Modern Tool Usage)
CLO-3, PLO-3 (Ethics)
Theory:
In this lab students are given an introduction and concept of Algorithm Evaluation. Students
are then shown a demonstration Code of Algorithm Evaluation. They are then given the
demo of inputs of process attributes and their Scheduling on the basis of Algorithm
Evaluation. Further a Gantt Chart hence produced by the given inputs is shown.
Equipment:
Personal Computer
Internet Connection
Visual Studio
Procedure:
1. Start the program.
2. Input Arrival Time, burst time, Quantum/Time Slice and priority.
3. Initialize the waiting time for process 1 and 0.
4. Designate every layer with different Scheduling Algorithm.
5. Select every layer for Scheduling and save the data for Comparative evaluation in
the last step.
6. The waiting time of all the processes is summed and then the average waiting time
7. The waiting time of each process and average waiting time are displayed based.
8. Compare AWT’s and ATAT’s and display the result.
9. Stop the program.
Task:
Write your code and paste your output screenshot with your CMS ID and Name mentioned in
it.
29
LAB MANUAL OPERATING SYSTEMS
30
LAB MANUAL OPERATING SYSTEMS
31
LAB MANUAL OPERATING SYSTEMS
OUTPUT:
Observations:
In this lab we come to know that how system react to processes on different conditions
depending upon their time periods burst time arrival time.
32
LAB MANUAL OPERATING SYSTEMS
Rubrics
Report not Plagiarized Requiremen Observation Appropriat Correctly
submitted content ts are listed s are e drawn
presented or and recorded computatio conclusion
incomplete experimenta along with ns or with
Laboratory
submission l procedure detailed numerical exact results
Reports
or late is presented procedure analysis is and
performed complete
report in all
respects
Category Ungraded Very Poor Poor Fair Good Excellent
Marks 0 1 2 3 4 5
Date Total Instructor’s Signature
Marks
Marks 0 1 2 3 4 5
33
LAB MANUAL OPERATING SYSTEMS
ETHICS
Assigned Marks 0 2 4
Obtained Marks /4
Disrespectful behavior Loud and disturbing Good and 30% of the Total
with instructor and / or behavior cooperating behavior Assigned Marks
Behavior with class fellows
OR
Absent
Assigned Marks 0 1.5 3
Obtained Marks /3
Leaves chairs in unorderly Put chair in proper 30% of the Total
manner, doesn’t turn off place, turns off tool / Assigned Marks
tool / software / equipment software / equipment
Regard of Equipment
after lab after lab
OR
Absent
Assigned Marks 0 3
Obtained Marks /3
34
LAB MANUAL OPERATING SYSTEMS
Theory:
In this lab students are given an introduction and concept of Rate Monotonic Scheduling.
Students are then shown a demonstration Code of Rate Monotonic Scheduling (RMS). They
are then given the demo of inputs of process attributes and their Scheduling on the basis of
RMS. Further a Gantt Chart hence produced by the given inputs is shown.
Equipment:
Personal Computer
Internet Connection
Visual Studio
Procedure:
Take inputs of Processes with their respective Burst Time, Time Periods.
Calculate U and V to check if RMS is possible or not. If possible, proceed to Step 3.
Use RMS Logic to create and display the Gantt Chart.
From the Gantt Chart, calculate the total number of idle cycles.
Task:
Write your code and paste your output screenshot with your CMS ID and Name mentioned in
it.
35
LAB MANUAL OPERATING SYSTEMS
OUTPUT:
Observations:
In this lab I have learned how RMS work.
36
LAB MANUAL OPERATING SYSTEMS
Rubrics
Report not Plagiarized Requiremen Observation Appropriat Correctly
submitted content ts are listed s are e drawn
presented or and recorded computatio conclusion
incomplete experimenta along with ns or with
Laboratory
submission l procedure detailed numerical exact results
Reports
or late is presented procedure analysis is and
performed complete
report in all
respects
Category Ungraded Very Poor Poor Fair Good Excellent
Marks 0 1 2 3 4 5
Date Total Instructor’s Signature
Marks
Marks 0 1 2 3 4 5
37
LAB MANUAL OPERATING SYSTEMS
ETHICS
Assigned Marks 0 2 4
Obtained Marks /4
Disrespectful behavior Loud and disturbing Good and 30% of the Total
with instructor and / or behavior cooperating behavior Assigned Marks
Behavior with class fellows
OR
Absent
Assigned Marks 0 1.5 3
Obtained Marks /3
Leaves chairs in unorderly Put chair in proper 30% of the Total
manner, doesn’t turn off place, turns off tool / Assigned Marks
tool / software / equipment software / equipment
Regard of Equipment
after lab after lab
OR
Absent
Assigned Marks 0 3
Obtained Marks /3
38
LAB MANUAL OPERATING SYSTEMS
Lab Outcomes:
After completing this lab, students will be able to:
Understand the Basic Concept of Earliest Deadline First.
Understanding and Calculating Average Waiting and Turn Around Times for the list of
Processes/tasks.
Generate a Corresponding Gantt Chart of the list of Processes/tasks entered for
Earliest Deadline First.
Theory:
In this lab students are given an introduction and concept of Earliest Deadline First. Students
are then shown a demonstration Code of Earliest Deadline First (EDF). They are then given
the demo of inputs of process attributes and their Scheduling on the basis of EDF. Further a
Gantt Chart hence produced by the given inputs is shown.
Equipment:
Personal Computer
Internet Connection
Visual Studio
Procedure:
1. Enter processes with Id’s, Burst times, Time Periods and their respective Deadlines.
2. Schedule for EDF.
Processe
s Arrival Time Burst Time Time Period Deadline
Requested from Requested from Requested from Requested from
P1 User User User User
Requested from Requested from Requested from Requested from
P2 User User User User
Requested from Requested from Requested from Requested from
P3 User User User User
Requested from Requested from Requested from Requested from
P4 User User User User
Task:
Write your code and paste your output screenshot with your CMS ID and Name mentioned in
it.
39
LAB MANUAL OPERATING SYSTEMS
OUTPUT:
Observations:
In this lab I have learned about how EDF works.
40
LAB MANUAL OPERATING SYSTEMS
Rubrics
Report not Plagiarized Requiremen Observation Appropriat Correctly
submitted content ts are listed s are e drawn
presented or and recorded computatio conclusion
incomplete experimenta along with ns or with
Laboratory
submission l procedure detailed numerical exact results
Reports
or late is presented procedure analysis is and
performed complete
report in all
respects
Category Ungraded Very Poor Poor Fair Good Excellent
Marks 0 1 2 3 4 5
Date Total Instructor’s Signature
Marks
Marks 0 1 2 3 4 5
41
LAB MANUAL OPERATING SYSTEMS
ETHICS
Assigned Marks 0 2 4
Obtained Marks /4
Disrespectful behavior Loud and disturbing Good and 30% of the Total
with instructor and / or behavior cooperating behavior Assigned Marks
Behavior with class fellows
OR
Absent
Assigned Marks 0 1.5 3
Obtained Marks /3
Leaves chairs in unorderly Put chair in proper 30% of the Total
manner, doesn’t turn off place, turns off tool / Assigned Marks
tool / software / equipment software / equipment
Regard of Equipment
after lab after lab
OR
Absent
Assigned Marks 0 3
Obtained Marks /3
42
LAB MANUAL OPERATING SYSTEMS
Theory:
In this lab students are given an introduction and concept of Linux operating system.
Students are then shown a demonstration Code of Linux command prompt. They are then
given the demo of inputs of process attributes and. Further code will be done in linux
platform.
Equipment:
Personal Computer
Linux OS
Command prompt
Procedure:
1. Write a shell script to list all of the directory files in a directory.
Algorithm:
Step1: Enter the name of the directory Read dir
Step2: If it is a directory. Then list the files present in that directory. By using ls command with
–p option to list all directory files in a given directory
Step 3: Else enter the directory name
Step 4: Stop
Task:
Write your code and paste your output screenshot with your CMS ID and Name mentioned in
it.
43
LAB MANUAL OPERATING SYSTEMS
Output
zahoorAhmed@ubuntu:~$sh
lprg6.sh enter directory name
dir1
list of files in the directory
Zahoor Ahmed-files-3 2023-01-04 14:40 dir1
store it in NR
step5: print chrcnt,NRwordcount
step6: stop
Task:
Write your code and paste your output screenshot with your CMS ID and Name mentioned in it.
Output:
zahoorAhmed@ubuntu:~$sh lprg7.sh
Recordwords
1: 5: 1hello
Total
Characters:5
Lines:1
Observations:
In this lab I have learn about how to use linux operating system. And also perform different
task in linux operating system and write the corresponding results and their outputs.
45
LAB MANUAL OPERATING SYSTEMS
46
LAB MANUAL OPERATING SYSTEMS
Rubrics
Report not Plagiarized Requiremen Observation Appropriat Correctly
submitted content ts are listed s are e drawn
presented or and recorded computatio conclusion
incomplete experimenta along with ns or with
Laboratory
submission l procedure detailed numerical exact results
Reports
or late is presented procedure analysis is and
performed complete
report in all
respects
Category Ungraded Very Poor Poor Fair Good Excellent
Marks 0 1 2 3 4 5
Date Total Instructor’s Signature
Marks
Marks 0 1 2 3 4 5
47
LAB MANUAL OPERATING SYSTEMS
ETHICS
Assigned Marks 0 2 4
Obtained Marks /4
Disrespectful behavior Loud and disturbing Good and 30% of the Total
with instructor and / or behavior cooperating behavior Assigned Marks
Behavior with class fellows
OR
Absent
Assigned Marks 0 1.5 3
Obtained Marks /3
Leaves chairs in unorderly Put chair in proper 30% of the Total
manner, doesn’t turn off place, turns off tool / Assigned Marks
tool / software / equipment software / equipment
Regard of Equipment
after lab after lab
OR
Absent
Assigned Marks 0 3
Obtained Marks /3
48
LAB MANUAL OPERATING SYSTEMS
Theory:
In this lab students are given an introduction and concept of Linux operating system.
Students are then shown a demonstration Code of Linux command prompt. They are then
given the demo of inputs of process attributes and. Further code will be done in linux
platform.
Equipment:
Personal Computer
Linux OS
Command prompt
Procedure:
Implement in c language the following Unix commands using system calls
a)cat b)ls c)mv
Algorithm:
Step 1:Start
Step 2:read arguments from keyboard at command line
Step 3:if no of arguments are less than two print ENTER CORRECT
ARGUMENTS Else goto step 4
Step4:read the date from specified file and write it to
destination file
Step 5 :stop
Task:
Write your code and paste your output screenshot with your CMS ID and Name mentioned in
it.
49
LAB MANUAL OPERATING SYSTEMS
Output:
zahoorAhmed@ubuntu:~$gcc –o prgcat.out prgcat.c
zahoorAhmed@ubuntu:~$cat > ff
hello
hai
zahoorAhmed@ubuntu:~$./prgcat.out ff
hello
hai
50
LAB MANUAL OPERATING SYSTEMS
Output:
zahoorAhmed@ubuntu:~$ gcc list.c
zahoorAhmed@ubuntu:~$ ./a.out
Current working directory=/home/zahoor Ahmed/
Number of files=3
Output:
zahoorAhmed@ubuntu:~$gcc –o mvp.out mvp.c
zahoorAhmed@ubuntu:~$cat > ff
hello
hai
zahoorAhmed@ubuntu:~$./mvp.out ff ff1
zahoorAhmed@ubuntu:~$cat ff
cat:ff:No such file or directory
zahoorAhmed@ubuntu:~$cat ff1
51
LAB MANUAL OPERATING SYSTEMS
Observations:
Please write your observation after conducting this lab, you must write in few lines, what did you learn in
this lab
52
LAB MANUAL OPERATING SYSTEMS
Rubrics
Report not Plagiarized Requiremen Observation Appropriat Correctly
submitted content ts are listed s are e drawn
presented or and recorded computatio conclusion
incomplete experimenta along with ns or with
Laboratory
submission l procedure detailed numerical exact results
Reports
or late is presented procedure analysis is and
performed complete
report in all
respects
Category Ungraded Very Poor Poor Fair Good Excellent
Marks 0 1 2 3 4 5
Date Total Instructor’s Signature
Marks
Marks 0 1 2 3 4 5
53
LAB MANUAL OPERATING SYSTEMS
ETHICS
Assigned Marks 0 2 4
Obtained Marks /4
Disrespectful behavior Loud and disturbing Good and 30% of the Total
with instructor and / or behavior cooperating behavior Assigned Marks
Behavior with class fellows
OR
Absent
Assigned Marks 0 1.5 3
Obtained Marks /3
Leaves chairs in unorderly Put chair in proper 30% of the Total
manner, doesn’t turn off place, turns off tool / Assigned Marks
tool / software / equipment software / equipment
Regard of Equipment
after lab after lab
OR
Absent
Assigned Marks 0 3
Obtained Marks /3
54
LAB MANUAL OPERATING SYSTEMS
Theory:
In this lab students are given an introduction and concept of Linux operating system.
Students are then shown a demonstration Code of Linux command prompt. They are then
given the demo of inputs of process attributes and. Further code will be done in linux
platform.
Equipment:
Personal Computer
Linux OS
Command prompt
Procedure:
A. Write a C program to list every file in directory, its inode number and
file name.
Algorithm:
Step 1:Start
Step 2:Read Directory name
Step 3:open the directory
Step 4: print file name and Inode number of each file in the directory
Step 5:Stop
Task:
Write your code and paste your output screenshot with your CMS ID and Name mentioned in
it.
55
LAB MANUAL OPERATING SYSTEMS
Output:
zahoorAhmed@ubuntu:~$ mkdir dd
zahoorAhmed@ubuntu:~$ cd dd
zahoorAhmed@ubuntu:~/dd$ cat >f1
hello
^z zahoorAhmed@ubuntu:~/dd$
cd
zahoorAhmed@ubuntu:~$gcc –o flist.out flist.c
zahoorAhmed@ubuntu:~$./flist.out dd
hello
46490 f1
Task:
Write your code and paste your output screenshot with your CMS ID and Name mentioned in it.
56
LAB MANUAL OPERATING SYSTEMS
Output:
Observations:
Please write your observation after conducting this lab, you must write in few lines, what did you learn in
this lab
57
LAB MANUAL OPERATING SYSTEMS
Rubrics
Report not Plagiarized Requiremen Observation Appropriat Correctly
submitted content ts are listed s are e drawn
presented or and recorded computatio conclusion
incomplete experimenta along with ns or with
Laboratory
submission l procedure detailed numerical exact results
Reports
or late is presented procedure analysis is and
performed complete
report in all
respects
Category Ungraded Very Poor Poor Fair Good Excellent
Marks 0 1 2 3 4 5
Date Total Instructor’s Signature
Marks
Marks 0 1 2 3 4 5
58
LAB MANUAL OPERATING SYSTEMS
ETHICS
Assigned Marks 0 2 4
Obtained Marks /4
Disrespectful behavior Loud and disturbing Good and 30% of the Total
with instructor and / or behavior cooperating behavior Assigned Marks
Behavior with class fellows
OR
Absent
Assigned Marks 0 1.5 3
Obtained Marks /3
Leaves chairs in unorderly Put chair in proper 30% of the Total
manner, doesn’t turn off place, turns off tool / Assigned Marks
tool / software / equipment software / equipment
Regard of Equipment
after lab after lab
OR
Absent
Assigned Marks 0 3
Obtained Marks /3
59