0% found this document useful (0 votes)
56 views59 pages

OS Instructor Lab Manual

This laboratory manual covers 6 experiments on operating system scheduling algorithms including first come first serve, shortest job first, priority, round robin, and multi-level queue scheduling. Each experiment section provides the objectives, theory, procedure, sample code, and observations to help students implement and evaluate different CPU scheduling techniques. The manual also includes rubrics to assess student performance in completing the scheduling algorithm experiments.

Uploaded by

Shahzeb Khan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
56 views59 pages

OS Instructor Lab Manual

This laboratory manual covers 6 experiments on operating system scheduling algorithms including first come first serve, shortest job first, priority, round robin, and multi-level queue scheduling. Each experiment section provides the objectives, theory, procedure, sample code, and observations to help students implement and evaluate different CPU scheduling techniques. The manual also includes rubrics to assess student performance in completing the scheduling algorithm experiments.

Uploaded by

Shahzeb Khan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 59

LABORATORY MANUAL

Computer Engineering Department

OPERATING SYSTEMS

Submitted by

STUDENT NAME | CMS ID

Lab Instructor

Engr. ARSALAN UL HAQ


Assistant Professor, Department of Computer Engineering,
Faculty of Information & Communication Technology,
BUITEMS, Quetta.

Session (Spring/Fall) – 20YY


LAB MANUAL OPERATING SYSTEMS

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

This is certified that STUDENT NAME bearing CMS ID ----- has

successfully completed the laboratory manual of Operating Systems in

his/her ___th semester of BS (DEPT.), Batch FALL/SP_20YY under the

supervision of his/her lab instructor Engr. Arsalan Ul Haq .

Lab Manual Marks Instructor Signature

vi
LAB MANUAL OPERATING SYSTEMS

CLOs PLOs MAPPING AND LIST OF EXPERIMENTS


Course Learning Outcomes (Laboratory)
Sr. Taxonomy
CLO Domain PLO
No. Level
PLO-5:
Practice and build programs in C# ( or
1 Psychomotor 2 Modern
JAVA, C++)
Tools Usage
Execute the installation of Solaris and
Psychomotor 2 PLO-5:
2 use various System Calls and apply
Modern
these commands in your field of study
Tools Usage
Observe discipline and workstation 3
Affective PLO-8:
3 ethics.
Ethics

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

DOCUMENT VERSION DETAILS

Version Date Author Rationale

1.0 First Draft


12th December, 2020 Engr. Syed Asad Ullah (Lab Format)

1.1 Lab Titles Identified.


20th January, 2021 Arsalan Ul Haq (20 Common LAB titles updated)

Attiya Shoaib,
1.2 Reviewed & Modified.
25 March, 2021
th
Sheikh Meer Ahmad (20 Common LAB titles updated)

1.3 LAB Manual Completed


27th August, 2021 Arsalan Ul Haq (According to the format for 20 LABs)

20 August, 2022 Arsalan ul Haq Updated as per PEC


1.4
recommendations

viii
LAB MANUAL OPERATING SYSTEMS

LAB NO. 1 DD/MM/YYYY

IMPLEMENTATION OF FIRST COME FIRST SERVE


SCHEDULING (FCFS)

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.

Corresponding CLO and PLO:


 CLO-1, PLO-5 (Modern Tool Usage)
 CLO-3, PLO-3 (Ethics)

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

Absent Student Student Student Student Student


failed to developed a developed a developed excelled in
develop a partially mostly a fully developing
functional functional functional functional fully
code or code and code and code and functional
complete struggled to met the lab met the lab code,
the lab accomplish objective objective exceeding
objective the lab within the within the expected
within the objective simulation simulation results
simulation within the environment environme within
environment simulation , achieving nt, simulation
. They environment satisfactory achieving environment
exhibit . They results. expected . They
inadequate demonstrate They exhibit results. demonstrate
Demonstration
understandi minimal moderate They mastery in
ng in understandi proficiency demonstrat independentl
configuring, ng in in e y
operating, configuring, configuring, proficienc configuring,
and operating, operating, y in operating
executing and and configurin and
the executing executing g, executing
simulation the the operating, the
independent simulation simulation and simulation.
ly. independent independent executing
ly. ly. the
simulation
independe
ntly.
Category Ungraded Very Poor Poor Fair Good Excellent

Marks 0 1 2 3 4 5
Date Total Instructor’s Signature
11
LAB MANUAL OPERATING SYSTEMS

Marks

ETHICS

Category Very Poor Fair Excellent Obtained Marks

Absent 15 minutes late On Time 40% of the Total


Punctuality Assigned Marks

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

Instructor’s Signature Total Marks /10


Obtained

12
LAB MANUAL OPERATING SYSTEMS

LAB NO. 2 DD/MM/YYYY

IMPLEMENTATION OF SHORTEST JOB FIRST SCHEDULING


(SJF)

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.

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 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

Absent Student Student Student Student Student


failed to developed a developed a developed excelled in
develop a partially mostly a fully developing
functional functional functional functional fully
code or code and code and code and functional
complete struggled to met the lab met the lab code,
the lab accomplish objective objective exceeding
objective the lab within the within the expected
within the objective simulation simulation results
simulation within the environment environme within
environment simulation , achieving nt, simulation
. They environment satisfactory achieving environment
exhibit . They results. expected . They
inadequate demonstrate They exhibit results. demonstrate
Demonstration
understandi minimal moderate They mastery in
ng in understandi proficiency demonstrat independentl
configuring, ng in in e y
operating, configuring, configuring, proficienc configuring,
and operating, operating, y in operating
executing and and configurin and
the executing executing g, executing
simulation the the operating, the
independent simulation simulation and simulation.
ly. independent independent executing
ly. ly. the
simulation
independe
ntly.
Category Ungraded Very Poor Poor Fair Good Excellent

Marks 0 1 2 3 4 5

15
LAB MANUAL OPERATING SYSTEMS

Date Total Instructor’s Signature


Marks

ETHICS

Category Very Poor Fair Excellent Obtained Marks

Absent 15 minutes late On Time 40% of the Total


Punctuality Assigned Marks

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

Instructor’s Signature Total Marks /10


Obtained

16
LAB MANUAL OPERATING SYSTEMS

LAB NO. 3 DD/MM/YYYY

IMPLEMENTATION OF PRIORITY SCHEDULING

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

Absent Student Student Student Student Student


failed to developed a developed a developed excelled in
develop a partially mostly a fully developing
functional functional functional functional fully
code or code and code and code and functional
complete struggled to met the lab met the lab code,
the lab accomplish objective objective exceeding
objective the lab within the within the expected
within the objective simulation simulation results
simulation within the environment environme within
environment simulation , achieving nt, simulation
. They environment satisfactory achieving environment
exhibit . They results. expected . They
inadequate demonstrate They exhibit results. demonstrate
Demonstration
understandi minimal moderate They mastery in
ng in understandi proficiency demonstrat independentl
configuring, ng in in e y
operating, configuring, configuring, proficienc configuring,
and operating, operating, y in operating
executing and and configurin and
the executing executing g, executing
simulation the the operating, the
independent simulation simulation and simulation.
ly. independent independent executing
ly. ly. the
simulation
independe
ntly.
Category Ungraded Very Poor Poor Fair Good Excellent

Marks 0 1 2 3 4 5

19
LAB MANUAL OPERATING SYSTEMS

Date Total Instructor’s Signature


Marks

ETHICS

Category Very Poor Fair Excellent Obtained Marks

Absent 15 minutes late On Time 40% of the Total


Punctuality Assigned Marks

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

Instructor’s Signature Total Marks /10


Obtained

20
LAB MANUAL OPERATING SYSTEMS

LAB NO. 4 DD/MM/YYYY


IMPLEMENTATION OF ROUND ROBIN SCHEDULING

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

Absent Student Student Student Student Student


failed to developed a developed a developed excelled in
develop a partially mostly a fully developing
functional functional functional functional fully
code or code and code and code and functional
complete struggled to met the lab met the lab code,
the lab accomplish objective objective exceeding
objective the lab within the within the expected
within the objective simulation simulation results
simulation within the environment environme within
environment simulation , achieving nt, simulation
. They environment satisfactory achieving environment
exhibit . They results. expected . They
inadequate demonstrate They exhibit results. demonstrate
Demonstration
understandi minimal moderate They mastery in
ng in understandi proficiency demonstrat independentl
configuring, ng in in e y
operating, configuring, configuring, proficienc configuring,
and operating, operating, y in operating
executing and and configurin and
the executing executing g, executing
simulation the the operating, the
independent simulation simulation and simulation.
ly. independent independent executing
ly. ly. the
simulation
independe
ntly.
Category Ungraded Very Poor Poor Fair Good Excellent

Marks 0 1 2 3 4 5

23
LAB MANUAL OPERATING SYSTEMS

Date Total Instructor’s Signature


Marks

ETHICS

Category Very Poor Fair Excellent Obtained Marks

Absent 15 minutes late On Time 40% of the Total


Punctuality Assigned Marks

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

Instructor’s Signature Total Marks /10


Obtained

24
LAB MANUAL OPERATING SYSTEMS

LAB NO. 5 DD/MM/YYYY


IMPLEMENTATION OF MULTI-LEVEL QUEUE SCHEDULING
Lab Outcomes:
After completing this lab, students will be able to:
 Understand the Basic Concept of Multi-Level Queue Scheduling.
 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 Multi-
Level Queue 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 Multi-Level Queue Scheduling.
Students are then shown a demonstration Code of Multi-Level Queue Scheduling. They are
then given the demo of inputs of process attributes and their Scheduling on the basis of
Multi- Level Queue 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. 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 any layer for Scheduling.
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. Stop the program.
Task:
Write your code and paste your output screenshot with your CMS ID and Name mentioned in
it.

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

Absent Student Student Student Student Student


failed to developed a developed a developed excelled in
develop a partially mostly a fully developing
functional functional functional functional fully
code or code and code and code and functional
complete struggled to met the lab met the lab code,
the lab accomplish objective objective exceeding
objective the lab within the within the expected
within the objective simulation simulation results
simulation within the environment environme within
environment simulation , achieving nt, simulation
. They environment satisfactory achieving environment
exhibit . They results. expected . They
inadequate demonstrate They exhibit results. demonstrate
Demonstration
understandi minimal moderate They mastery in
ng in understandi proficiency demonstrat independentl
configuring, ng in in e y
operating, configuring, configuring, proficienc configuring,
and operating, operating, y in operating
executing and and configurin and
the executing executing g, executing
simulation the the operating, the
independent simulation simulation and simulation.
ly. independent independent executing
ly. ly. the
simulation
independe
ntly.
Category Ungraded Very Poor Poor Fair Good Excellent

Marks 0 1 2 3 4 5

27
LAB MANUAL OPERATING SYSTEMS

Date Total Instructor’s Signature


Marks

ETHICS

Category Very Poor Fair Excellent Obtained Marks

Absent 15 minutes late On Time 40% of the Total


Punctuality Assigned Marks

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

Instructor’s Signature Total Marks /10


Obtained

28
LAB MANUAL OPERATING SYSTEMS

LAB NO. 6 DD/MM/YYYY


IMPLEMENTATION OF ALGORITHM EVALUATION

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

Process Arrival Time Burst Time PRIORITY Quantum=


es Requested
from User
P1 Requested Requested Requested
from from from
User User User

30
LAB MANUAL OPERATING SYSTEMS

P2 Requested Requested Requested


from from from
User User User
P3 Requested Requested Requested
from from from
User User User
P4 Requested Requested Requested
from from from
User User User

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

Absent Student Student Student Student Student


failed to developed a developed a developed excelled in
develop a partially mostly a fully developing
functional functional functional functional fully
code or code and code and code and functional
complete struggled to met the lab met the lab code,
the lab accomplish objective objective exceeding
objective the lab within the within the expected
within the objective simulation simulation results
simulation within the environment environme within
environment simulation , achieving nt, simulation
. They environment satisfactory achieving environment
exhibit . They results. expected . They
inadequate demonstrate They exhibit results. demonstrate
Demonstration
understandi minimal moderate They mastery in
ng in understandi proficiency demonstrat independentl
configuring, ng in in e y
operating, configuring, configuring, proficienc configuring,
and operating, operating, y in operating
executing and and configurin and
the executing executing g, executing
simulation the the operating, the
independent simulation simulation and simulation.
ly. independent independent executing
ly. ly. the
simulation
independe
ntly.
Category Ungraded Very Poor Poor Fair Good Excellent

Marks 0 1 2 3 4 5

33
LAB MANUAL OPERATING SYSTEMS

Date Total Instructor’s Signature


Marks

ETHICS

Category Very Poor Fair Excellent Obtained Marks

Absent 15 minutes late On Time 40% of the Total


Punctuality Assigned Marks

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

Instructor’s Signature Total Marks /10


Obtained

34
LAB MANUAL OPERATING SYSTEMS

LAB NO. 7 DD/MM/YYYY


IMPLEMENTATION OF RATE MONOTONIC SCHEDULING
(RMS)
Lab Outcomes:
After completing this lab, students will be able to:
 Understand the Basic Concept of Rate Monotonic Scheduling.
 Generate a Corresponding Gantt Chart of the list of Processes entered for Rate
Monotonic 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 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

Absent Student Student Student Student Student


failed to developed a developed a developed excelled in
develop a partially mostly a fully developing
functional functional functional functional fully
code or code and code and code and functional
complete struggled to met the lab met the lab code,
the lab accomplish objective objective exceeding
objective the lab within the within the expected
within the objective simulation simulation results
simulation within the environment environme within
environment simulation , achieving nt, simulation
. They environment satisfactory achieving environment
exhibit . They results. expected . They
inadequate demonstrate They exhibit results. demonstrate
Demonstration
understandi minimal moderate They mastery in
ng in understandi proficiency demonstrat independentl
configuring, ng in in e y
operating, configuring, configuring, proficienc configuring,
and operating, operating, y in operating
executing and and configurin and
the executing executing g, executing
simulation the the operating, the
independent simulation simulation and simulation.
ly. independent independent executing
ly. ly. the
simulation
independe
ntly.
Category Ungraded Very Poor Poor Fair Good Excellent

Marks 0 1 2 3 4 5

37
LAB MANUAL OPERATING SYSTEMS

Date Total Instructor’s Signature


Marks

ETHICS

Category Very Poor Fair Excellent Obtained Marks

Absent 15 minutes late On Time 40% of the Total


Punctuality Assigned Marks

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

Instructor’s Signature Total Marks /10


Obtained

38
LAB MANUAL OPERATING SYSTEMS

LAB NO. 8 DD/MM/YYYY


IMPLEMENTATION OF EARLIEST DEADLINE FIRST
(Open-Ended Lab)

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.

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 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

Absent Student Student Student Student Student


failed to developed a developed a developed excelled in
develop a partially mostly a fully developing
functional functional functional functional fully
code or code and code and code and functional
complete struggled to met the lab met the lab code,
the lab accomplish objective objective exceeding
objective the lab within the within the expected
within the objective simulation simulation results
simulation within the environment environme within
environment simulation , achieving nt, simulation
. They environment satisfactory achieving environment
exhibit . They results. expected . They
inadequate demonstrate They exhibit results. demonstrate
Demonstration
understandi minimal moderate They mastery in
ng in understandi proficiency demonstrat independentl
configuring, ng in in e y
operating, configuring, configuring, proficienc configuring,
and operating, operating, y in operating
executing and and configurin and
the executing executing g, executing
simulation the the operating, the
independent simulation simulation and simulation.
ly. independent independent executing
ly. ly. the
simulation
independe
ntly.
Category Ungraded Very Poor Poor Fair Good Excellent

Marks 0 1 2 3 4 5

41
LAB MANUAL OPERATING SYSTEMS

Date Total Instructor’s Signature


Marks

ETHICS

Category Very Poor Fair Excellent Obtained Marks

Absent 15 minutes late On Time 40% of the Total


Punctuality Assigned Marks

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

Instructor’s Signature Total Marks /10


Obtained

42
LAB MANUAL OPERATING SYSTEMS

LAB NO. 9 DD/MM/YYYY


Using Linux Operating System Part(1)
Lab Outcomes:
After completing this lab, students will be able to:
 Understand the Basic Concept of LINUX operating system.

Corresponding CLO and PLO:


 CLO-2, PLO-5 (Modern Tool Usage)
 CLO-3, PLO-3 (Ethics)

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

2. Write a shell script to find factorial of a given number.


ALGORITHM:
1. Start program.
2. Ask the user to enter an integer to find the factorial.
3. Read the integer and assign it to a variable.
4. From the value of the integer up to 1, multiply each digit and update the final value.
5. The final value at the end of all the multiplication till 1 is the factorial.
Task:
Write your code and paste your output screenshot with your CMS ID and Name mentioned in
it.
Output
zahoorAhmed@ubuntu:~$sh
lprg7.sh enter a number
5
Factorial of 5 is 120
3. Write an awk script to count number of lines in a file that does not contain vowels
ALGORITHM:
Step 1: Create a file with 5-10 lines of data
Step 2: Write an awk script by using grep command to
filter the lines that do not contain vowels awk ‘ $0
~/aeiou/ {print
$0}’ file1
Step3:
Count=count+1
Step4:Print count
Step5: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 Enter file name
zahoor Ahmed
The number of lines that does contain vowels are: 3
4. Write an awk script to find the no of characters ,words and lines in a file
ALGORITHM:
Step 1: create a file with 5 to10 lines of data
Step 2: write an awk script find the length of file store it in chrcnt
step3: count the no of fields (NF), store it in wordcount step4: count the no of records (NR),
44
LAB MANUAL OPERATING SYSTEMS

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

Absent Student Student Student Student Student


failed to developed a developed a developed excelled in
develop a partially mostly a fully developing
functional functional functional functional fully
code or code and code and code and functional
complete struggled to met the lab met the lab code,
the lab accomplish objective objective exceeding
objective the lab within the within the expected
within the objective simulation simulation results
simulation within the environment environme within
environment simulation , achieving nt, simulation
. They environment satisfactory achieving environment
exhibit . They results. expected . They
inadequate demonstrate They exhibit results. demonstrate
Demonstration
understandi minimal moderate They mastery in
ng in understandi proficiency demonstrat independentl
configuring, ng in in e y
operating, configuring, configuring, proficienc configuring,
and operating, operating, y in operating
executing and and configurin and
the executing executing g, executing
simulation the the operating, the
independent simulation simulation and simulation.
ly. independent independent executing
ly. ly. the
simulation
independe
ntly.
Category Ungraded Very Poor Poor Fair Good Excellent

Marks 0 1 2 3 4 5

47
LAB MANUAL OPERATING SYSTEMS

Date Total Instructor’s Signature


Marks

ETHICS

Category Very Poor Fair Excellent Obtained Marks

Absent 15 minutes late On Time 40% of the Total


Punctuality Assigned Marks

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

Instructor’s Signature Total Marks /10


Obtained

48
LAB MANUAL OPERATING SYSTEMS

LAB NO. 10 DD/MM/YYYY


Using Linux Operating System Part(2)
Lab Outcomes:
After completing this lab, students will be able to:
 Understand the Basic Concept of LINUX operating system.

Corresponding CLO and PLO:


 CLO-2, PLO-5 (Modern Tool Usage)
 CLO-3, PLO-3 (Ethics)

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

Absent Student Student Student Student Student


failed to developed a developed a developed excelled in
develop a partially mostly a fully developing
functional functional functional functional fully
code or code and code and code and functional
complete struggled to met the lab met the lab code,
the lab accomplish objective objective exceeding
objective the lab within the within the expected
within the objective simulation simulation results
simulation within the environment environme within
environment simulation , achieving nt, simulation
. They environment satisfactory achieving environment
exhibit . They results. expected . They
inadequate demonstrate They exhibit results. demonstrate
Demonstration
understandi minimal moderate They mastery in
ng in understandi proficiency demonstrat independentl
configuring, ng in in e y
operating, configuring, configuring, proficienc configuring,
and operating, operating, y in operating
executing and and configurin and
the executing executing g, executing
simulation the the operating, the
independent simulation simulation and simulation.
ly. independent independent executing
ly. ly. the
simulation
independe
ntly.
Category Ungraded Very Poor Poor Fair Good Excellent

Marks 0 1 2 3 4 5

53
LAB MANUAL OPERATING SYSTEMS

Date Total Instructor’s Signature


Marks

ETHICS

Category Very Poor Fair Excellent Obtained Marks

Absent 15 minutes late On Time 40% of the Total


Punctuality Assigned Marks

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

Instructor’s Signature Total Marks /10


Obtained

54
LAB MANUAL OPERATING SYSTEMS

LAB NO. 11 DD/MM/YYYY


Using Linux Operating System Part(3)
Lab Outcomes:
After completing this lab, students will be able to:
 Understand the Basic Concept of LINUX operating system.

Corresponding CLO and PLO:


 CLO-2, PLO-5 (Modern Tool Usage)
 CLO-3, PLO-3 (Ethics)

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

B. Write a C program to create child process and allow parent process to


display “parent” and the child to display “child” on the screen
Algorithm:
Step 1: start
Step2: call the fork() function to create a child process
fork function returns 2 values
step 3: which returns 0 to child process
step 4:which returns process id to the parent process
step 5:stop

Task:
Write your code and paste your output screenshot with your CMS ID and Name mentioned in it.

56
LAB MANUAL OPERATING SYSTEMS

Output:

zahoorAhmed@ubuntu:$gcc –o child.out child.c


zahoorAhmed@ubuntu: ./child.out
Hello World!
I am the child process.
I am the parent
process

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

Absent Student Student Student Student Student


failed to developed a developed a developed excelled in
develop a partially mostly a fully developing
functional functional functional functional fully
code or code and code and code and functional
complete struggled to met the lab met the lab code,
the lab accomplish objective objective exceeding
objective the lab within the within the expected
within the objective simulation simulation results
simulation within the environment environme within
environment simulation , achieving nt, simulation
. They environment satisfactory achieving environment
exhibit . They results. expected . They
inadequate demonstrate They exhibit results. demonstrate
Demonstration
understandi minimal moderate They mastery in
ng in understandi proficiency demonstrat independentl
configuring, ng in in e y
operating, configuring, configuring, proficienc configuring,
and operating, operating, y in operating
executing and and configurin and
the executing executing g, executing
simulation the the operating, the
independent simulation simulation and simulation.
ly. independent independent executing
ly. ly. the
simulation
independe
ntly.
Category Ungraded Very Poor Poor Fair Good Excellent

Marks 0 1 2 3 4 5

58
LAB MANUAL OPERATING SYSTEMS

Date Total Instructor’s Signature


Marks

ETHICS

Category Very Poor Fair Excellent Obtained Marks

Absent 15 minutes late On Time 40% of the Total


Punctuality Assigned Marks

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

Instructor’s Signature Total Marks /10


Obtained

59

You might also like