workbook in operating system
TRANSCRIPT
-
7/31/2019 Workbook in Operating System
1/42
LABORATORY MANUAL
IN
OPERATING SYSTEM 1
Prepared by:
Committee in Operating System
-
7/31/2019 Workbook in Operating System
2/42
Name ____________________________________________ Date _________
Instructor _________________________________________ Rating _________
RESEARCH ACTIVITY 1
1. Research on at least three other definitions of Operating Systems that were not
used in this module. Include the reference of source of the material.
2. Enumerate at least three (3) operating systems available in the market or still
under research using the format below.
Operating
System Name Developer
Description / Fea-
tures Sources
1.
2.
3.
Note: You may use additional sheets for this activity.
-
7/31/2019 Workbook in Operating System
3/42
Name ____________________________________________ Date _________
Instructor _________________________________________ Rating _________
EXERCISE 1
1. Define Operating Systems in your own words.
2. What are the two main functions of an operating system? Discuss.
3. Differentiate Off-line processing with Spooling. Discuss
4. What are the advantages of a multiprogramming system? Discuss.
-
7/31/2019 Workbook in Operating System
4/42
Directions: Find the following in the crossword puzzle:
1. Offline processing 6. Interface 11. Asymmetric
2. Operating Systems 7. Time Sharing 12. Symmetric
3. Spooling 8. Embedded 13. Job Pool4. Software 9. Smart Card 14. Throughput
5. Hardware 10. Mainframe 15. Multitasking
Note: Words make come in Horizontal, vertical or diagonal up and down manner.
Words may also be spelled backwards. Let SMILEY help you!
O F F L I N E P R O C E S S I N G M S
P S R T E R R M E O S O S X S P IH A E E H A R R Y M P H S I M Y J O U L
S M A R T C A R D B A T T E G O F F Y
T G A S Y M M E T R I C A L B T F I
I H A P E T S E G D P D Z O I P W C N
M E R X A E I E K D I W O N C Y O A H T
E M I O G N K N Z E N A G S I K O R O E
S A N Y U M G T G D R F D U Q L E O R
H R E S Y G A E A S V E A G Y W R P K F
A F L M S O H X L O Y X D H T E S T A A
R N L O E I M P S Y S S Y M M E T R I C
I I I S O M U O U O M T K R A T Z E
N A O K S K I K T T E T J E N L L A K I
G M U L T I T A S K I N G M A N U T E
-
7/31/2019 Workbook in Operating System
5/42
Name ____________________________________________ Date _________
Instructor _________________________________________ Rating _________
EXERCISE 2
I. Answer the following questions in your own words.
1. Describe the difference between symmetric and asymmetric multiprocessing.
2. What are the advantages of a multiprocessor system? Discuss.
3. Under what circumstances would a user be better off using time-sharing?System rather than a personal or a single-user system?
4. Why are distributed systems desirable?
-
7/31/2019 Workbook in Operating System
6/42
5. Differentiate the Hard Real Time OS and Soft Real Time OS.
II. Create a crossword puzzle using terminologies used in Chapter 1.
Lightly shade the unused boxes. Minimum of 10 words.
O P E R A T I N G S Y S T E M S
-
7/31/2019 Workbook in Operating System
7/42
Name ____________________________________________ Date _________
Instructor _________________________________________ Rating _________
RESEARCE ACTIVITY 2
1. Make a compilation of a least 5 different secondary storage devices in the mar-
ket using the format below:
Storage
Device
Name
Developer /
Company
Description /
Features Capacity Sources
1.
2.
2. Give at least 3 different commercial types of primary memory using the format
below:
Storage
Device
Name
Developer /
Company
Description /
Features Capacity Sources
1.
2.
Note: You may use additional sheets for this activity.
-
7/31/2019 Workbook in Operating System
8/42
Name ____________________________________________ Date _________
Instructor _________________________________________ Rating _________
EXERCISE 3
1. Define Interrupt in your own words. Provide an analogy of your own.
2. What is the difference of trap and Interrupt? Discuss.
3. What are the criteria in selecting storage devices? Discuss.
4. Enumerate the differences of the primary and secondary storage devices. Dis-
cuss.
-
7/31/2019 Workbook in Operating System
9/42
5. What is cache? What problem does it solve?
6. What are the methods of implementing I/O operations? Discuss.
7. How is hardware protection implemented in different devices? Discuss.
-
7/31/2019 Workbook in Operating System
10/42
Name ____________________________________________ Date _________
Instructor _________________________________________ Rating _________
EXERCISE 4
1. What are the different process models? Discuss.
2. What is concurrent process? Discuss.
3. What is a thread? Discuss.
4. Differentiate threads and processes. Discuss.
5. How are process created and terminated? Discuss.
-
7/31/2019 Workbook in Operating System
11/42
Find the hidden terminologies discussed in this chapter.
1. Background 6. Concurrent
2. Threads 7. User Space
3. Running 8. Terminated4. Process State 9. Cooperating Process
5. Blocked 10. Kernel
B U S R A L O V E T H Y P E S O H O P E
R A S N E I G H B O R S R C A N E C R R
T A C O J O R O S S M E O O N L R P O A
E T C K A T H R E A D S C N D Y O R C D
D Y O J G I Y E A R N S R C A B B O U F
H M K U P R U N N I N G E U R L A C R G
U S U R G R O L H O N S A R A O G E E H
T E S A R E S U A S M Y T R H C U S M U
F D E T A K E R N E L M E E S K I S E Y
U S R E L O V E S D I I S N E E O S N I
I E S A S T T E R M I N A T E D A T T O
S W P R E K P S O O M N S A R T U A S K
A Q A N A B L A Y A M A L E S I G T O Y
S P C O O P E R A T I N G P R O C E S S
O R E S A N A R T S A P O T I L E G N A
-
7/31/2019 Workbook in Operating System
12/42
Name ____________________________________________ Date _________
Instructor _________________________________________ Rating _________
EXERCISE 5
1. Draw the Gantt Chart illustrating the execution of these processes using FCFS
and SJF.
Job Arrival Time Burst Time Priority
J1 1 15 3
J2 11 5 4
J3 16 12 5
J4 21 8 1
J5 30 7 2
FCFS
SJF
2. What is the individual turnaround time of each process for each scheduling al-
gorithm in #1?
FCFS SJF
tt1 = tt1 =
tt2 = tt2 =
tt3 = tt3 =
tt4 = tt4 =
tt5 = tt5 =
Ttave = Ttave =
-
7/31/2019 Workbook in Operating System
13/42
3. What is the individual waiting time of each process for each scheduling algo-
rithm in #1?
FCFS SJF
wt1 = wt1 =wt2 = wt2 =
wt3 = wt3 =
wt4 = wt4 =
wt5 = wt5 =
wtave = wtave =
4. Given the same data in #1 draw the Gantt Chart using the SRTF algorithm.
SRTF
5. Compute for the individual waiting time and turnaround time using the SRTF
Gantt Chart in #4.
FCFS SJF
tt1 = wt1 =
tt2 = wt2 =
tt3 = wt3 =
tt4 = wt4 =
tt5 = wt5 =
ttave = wtave =
6. Is there a difference between the non-preemptive SJF and its preemptive ver-
sion (SRTF) in terms of:
a. Gantt Chart?
b. Average Waiting Time?
c. Average Turnaround Time?
-
7/31/2019 Workbook in Operating System
14/42
Name ____________________________________________ Date _________
Instructor _________________________________________ Rating _________
EXERCISE 6
1. Given the following job stream data:
Job Arrival Time Burst Time Priority
P1 1 4 6
P2 5 12 2
P3 5 9 4
P4 11 2 3
P5 16 10 1
P6 20 11 5
Provide the Gantt Chart using SRTF and Priority Scheduling
SRTF
Priority
2. What is the individual turnaround time each process for each scheduling algo-
rithm in #1
SRTF Priority
tt1 = tt1 =
tt2 = tt2 =
tt3 = tt3 =
tt4 = tt4 =tt5 = tt5 =
Ttave = Ttave =
-
7/31/2019 Workbook in Operating System
15/42
3. What is the individual waiting time each process for each scheduling algorithm
in #1?
SRTF Prioritywt1 = Wt1 =
wt2 = Wt2 =
wt3 = Wt3 =
wt4 = Wt4 =
wt5 = Wt5 =
wtave = Wtave =
4. Given the same data in #1 draw the Gantt Chart using the preemptive priority
algorithm.
P-Prio
5. Compute for the individual waiting time and turnaround time using the P-
Priority Gantt Chart in #4.
SRTF Priority
tt1 = wt1 =
tt2 = wt2 =
tt3 = wt3 =
tt4 = wt4 =
t5 = wt5 =
ttave = wtave =
6. Is there a difference between the preemptive and non-preemptive priority
scheduling algorithms in terms of:
a. Average Waiting Time?
b. average turnaround Time?
7. In the two priority algorithms which algorithm was able to complete processing
first?
-
7/31/2019 Workbook in Operating System
16/42
Name ____________________________________________ Date _________
Instructor _________________________________________ Rating _________
EXERCISE 7
1. Using the given data below draw the SRTF and Round Robin Gantt Chart:
Job Arrival Time Burst Time Priority
P1 1 4 6
P2 5 12 2
P3 5 9 4
P4 11 2 3
P5 16 10 1
P6 20 11 5
q = 4
SRTF
RR
2. What is the individual turnaround time each process for each scheduling algo-
rithm in #1?
SRTF RR
tt1 = tt1 =
tt2 = tt2 =
tt3 = tt3 =tt4 = tt4 =
t5 = tt5 =
ttave = ttave =
-
7/31/2019 Workbook in Operating System
17/42
3. What is the individual waiting time of each process for each scheduling algo-
rithm in #1?
SRTF RR
wt1 = Wt1 =
wt2 = Wt2 =wt3 = Wt3 =
wt4 = Wt4 =
w5 = Wt5 =
wtave = Wtave =
4. Given the same data in #1 draw the Gantt Chart using the Round Robin algo-
rithm with a time quantum of 3.
RR
5. Compute for the individual waiting time and turnaround time using the P-
Priority Gantt Chart in #4
P-Prio
tt1 = wt1 =
tt2 = wt2 =
tt3 = wt3 =
tt4 = wt4 =
t5 = wt5 =
ttave = wtave =
-
7/31/2019 Workbook in Operating System
18/42
Name ____________________________________________ Date _________
Instructor _________________________________________ Rating _________
RESEARCH ACTIVITY 3
Make a research based on the following questions:
1. What is a Bernoulli Disk Drive?
2. What is Disk Array?
3. What is Redundant Array of Inexpensive Disk or R.A.I.D?
4. How is Disk Formatting done?
5. What is a Cylinder Skew?
6. What is a Constant Angular Velocity?
7. What is a Constant Linear Velocity?
8. What is Disk Interleaving?
-
7/31/2019 Workbook in Operating System
19/42
Name ____________________________________________ Date _________
Instructor _________________________________________ Rating _________
EXERCISE 8
1. Suppose that a disk drive has 5,000 cylinders, numbered 0 to 4,999. The drive is
currently serving a request at cylinder 160 and has previously serviced cylinder
80. The queue of pending requests in First In First Out order is:
94 1445 915 1787 955 1505 1030 1753 1905
Starting from the current head position, what is the total distance traversed by
the disk arm in satisfying all the request using the following disk scheduling algo-
rithms?Draw the diagram on the box provided. Assume that the is negligible.
a. FCFS
b. SCAS
c. SSTF
-
7/31/2019 Workbook in Operating System
20/42
d. LOOK
e. C-SCAN
f. C-LOOK
-
7/31/2019 Workbook in Operating System
21/42
Name ____________________________________________ Date _________
Instructor _________________________________________ Rating _________
EXERCISE 9
1. The head of the moving disk, with 200 tracks number 0 to 199, is currently serv-
ing request at track 133 and had just finished a request at track 123. If the rate of
movement form one track to another is 6 millisecond/track. What is the seek time
of each scheduling algorithm with the following requests which is kept in FIFO or-
der:
89 150 94 180 97 153 105 178 133
Assume that the is equal to 25.
a. FCFS
b. SCAN
c. SSTF
-
7/31/2019 Workbook in Operating System
22/42
d. LOOK
e. C-SCAN
f. C-LOOK
-
7/31/2019 Workbook in Operating System
23/42
Name ____________________________________________ Date _________
Instructor _________________________________________ Rating _________
RESEARCH ACTIVITY 4
1. Make a research how memory management is done in the following:
a. Mobile Phones
b. Multimedia Systems
c. Calculators
2. Make a research how the human memory functions. Draw possible similarities
with the computers memory and its management.
-
7/31/2019 Workbook in Operating System
24/42
Name ____________________________________________ Date _________
Instructor _________________________________________ Rating _________
EXERCISE 10
1. What are the important considerations in the different memory management
schemes?
2. Explain the difference between Internal and External Fragmentation.
Provide your own analogy.
3. What is the difference between MVP and MFP. Provide your own analogy.
-
7/31/2019 Workbook in Operating System
25/42
4. Given the following memory partitions 15k, 9k, 25k, 23k, 12k, 14k, 17k, and
20k, respectively. Also the following processes, J1, J2 and J3 have the correspond-
ing memory requirements of 17k, 15k and 14k respectively. Which hole will betaken by these processes using the following memory partitions allocation algo-
rithm:
a.) First Fit
b.) Best Fit
c.) Next Fit
5. A 28k memory is used to enter a job stream as follows:
Job At Size Bt1 0 9K 7
2 1 5K 12
3 2 8K 5
4 3 8K 5
Assume: CPU Scheduling = FCFS Find LFs, EFs and %MUs
Job Scheduling = First Fit
a.) Using MFP with a partitions of 12K, 6K, 5K and 5K respectively.
b.) Using MVP with a user memory of 25K.
Use a separate sheet for the solutions.
-
7/31/2019 Workbook in Operating System
26/42
Name ____________________________________________ Date _________
Instructor _________________________________________ Rating _________
EXERCISE 11
1. Explain the Following:
a) Internal Fragmentation. How does it occur?______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
b) External Fragmentation. How does it occur?______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
_____________________________________________________________________________
c) Compaction. Why is needed?______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
_____________________________________________________________________________
d) Relocation. How often should it be performed?______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
_____________________________________________________________________________
-
7/31/2019 Workbook in Operating System
27/42
2. Describe the major disadvantages for each of the four memory allocation schemes.
a) Single User Configuration______________________________________________________________________________
______________________________________________________________________________
____________________________________________________________________________________________________________________________________________________________
_____________________________________________________________________________
b) Fixed Partitions______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
_____________________________________________________________________________
c) Dynamic Partitions______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
_____________________________________________________________________________
d) Re-locatable Dynamic Partitions______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
_____________________________________________________________________________
3. Describe the major advantage for each memory allocation schemes presented.
a) Single User Configuration______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
_____________________________________________________________________________
-
7/31/2019 Workbook in Operating System
28/42
b) Fixed Partitions______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
_____________________________________________________________________________
c) Dynamic Partitions______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
_____________________________________________________________________________
d) Re-locatable Dynamic Partitions______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
_____________________________________________________________________________
4. Given the following information:
Job list
Job Stream
Job 1
Memory Requested
740K
Job 2 500K
Job 3 700K
-
7/31/2019 Workbook in Operating System
29/42
Memory List
Memory Blocks Size
Block 1 610K
Block 2 850K
Block 3 700K
a) Use the best-fit algorithm to allocate the memory blocks to the three arriving jobs.
b) Use the first-fit algorithm to allocate the memory blocks to the three arriving jobs.
5. Given the following information:
Job Steam
Job list
Memory Requested
Job 1 800K
Job 2 650K
Job 3 700K
Job 4 600K
Job 5 1000
-
7/31/2019 Workbook in Operating System
30/42
Memory List
Memory blocks Size
Block 1 600K
Block 2 850K
Block 3 700K
Block 4 650K
Block 5 1500K
c) Use the best-fit algorithm to allocate the memory blocks to the three arriving jobs.
d) Use the first-fit algorithm to allocate the memory blocks to the three arriving jobs.
6. Worst-fit is an allocation algorithm that is the opposite of the best fit. It allocates free to a new job.
a)
What might be an advantage of the algorithm?______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
-
7/31/2019 Workbook in Operating System
31/42
b) How would it compare to best-fit and first-fit for the conditions given in exercise 4?______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
c) How would it compare are to best-fit and first-fit for the conditions given in exercise 5?______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
7. The relocation implies that compaction is done entirely in memory, without secondary storage. Can all
free sections of memory be merged into one contiguous block using this approach? Why or why not?
8. One way to compact memory would be to copy all existing jobs to a secondary storage device and
then reload them contiguously into main memory, thus, creating one free block after all jobs have been
recopied (and relocated) into memory. Is this viable? Could you advice a better way to compact
memory? Write your algorithm and explain why it is better.
-
7/31/2019 Workbook in Operating System
32/42
9. Given the following memory configuration:
At this point, job 4 arrives requesting a block of 100K. Answer the following:
a) Can Job 4 be accommodated? Why or Why not?______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
b) If relocation is used, what are the contents of the relocation register for Job 1, Job 2,and Job 3 after compaction?
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
____________________________________________________________________________________________________________________________________________________________
Operating
System
Job 1 (10K)
Job 2 (15K)
Job 3 (45K)
-
7/31/2019 Workbook in Operating System
33/42
c) What are the contents of the relocation register for job 4 after it has been loaded intomemory?
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
10. You have been given the job of determining whether the current fixed partition memory
configuration in your computer system should be changed.
a) What information do you need to help you make the decision?______________________________________________________________________________
____________________________________________________________________________________________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
b) How would you go about collecting this information?______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
c) Once you had the information, how would you determine the best configuration foryour system?
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
____________________________________________________________________________________________________________________________________________________________
-
7/31/2019 Workbook in Operating System
34/42
Name ____________________________________________ Date _________
Instructor _________________________________________ Rating _________
EXERCISE 12
1. Explain in your own words the following terms:
a.) Deadlock
b.) Preemptable Resource
c.) Circular Wait
2. What are the necessary conditions for deadlock?
-
7/31/2019 Workbook in Operating System
35/42
3. Discuss the Bankers Algorithm.
4. Consider the following system:
Allocation Max Available
A B C D A B C D A B C D
P0
P1
0 0 1 2 0 0 0 0 1 5 2 0
1 0 0 0 0 7 5 3
P2 1 3 2 0 1 0 0 2
P3 0 2 1 0 0 0 2 0
P4 0 0 1 4 2 6 4 2
Use Bankers Algorithm to determine if this system is in a safe state?
Is it safe to grant0, a request for (0, 4, 2, 0) resources? What is the safe sequence?
-
7/31/2019 Workbook in Operating System
36/42
Name ____________________________________________ Date _________
Instructor _________________________________________ Rating _________
EXERCISE 13
1. What are the major differences between deadlock, starvation, and race?
2. Give some real life examples (not related to a computer system environment) of deadlock, starva-
tion and race.
3. Select one example of deadlock from question no. 2 and list the four necessary conditions needed for
the deadlock.
-
7/31/2019 Workbook in Operating System
37/42
4. Consider the following directed resource graph:
a) Is this system a deadlock? Are there any block process?
b) What is the resulting graph after reduction by P1?
c) What is the resulting graph reduction by P2?
-
7/31/2019 Workbook in Operating System
38/42
d) Both P1 and P2 have requested R2?
1.What is the status of the system if P2s request is granted before P1s?
2.What is the status of the system if P1s request is granted before P2s?
5. Consider the following directed resource graph:
-
7/31/2019 Workbook in Operating System
39/42
a.Is the system, as a whole, deadlocked?
b.Are there any deadlocked processes?
c.Three processes P1, P2, and P3 are requesting resources from R2.
1.Which requests would you satisfy to minimize the number of processes involved in the
deadlock?
2.Which requests would you satisfy to maximize the number of processes involved in
the deadlock?
d.Can the graph be reduced, partially or totally?
e.Can the deadlock be resolved without selecting a victim?
-
7/31/2019 Workbook in Operating System
40/42
Name ____________________________________________ Date _________
Instructor _________________________________________ Rating _________
RESEARCH ACTIVITY 5
1. Make a research in the following types of File Systems. Make a detailed discus-
sion on its implementation and compare it with one another.
Unix V7 File System Windows File System CO/M File System MS/DOS File System Elephant File System ISO 9660 File System
2. What is a Log Structured File System?
3. How is File Backup done?
-
7/31/2019 Workbook in Operating System
41/42
Name ____________________________________________ Date _________
Instructor _________________________________________ Rating _________
EXERCISE 14
1. Discuss the importance of a File Manager.
2. Differentiate the absolute path name and relative path name method in speci-
fying Files.
3. Discuss the importance of File Directories.
4. Differentiate the different file organizations.
5. Discuss the physical and logical accesses to a file.
-
7/31/2019 Workbook in Operating System
42/42
Direction: Find the following in the crossword puzzle:
1. File System 6. Graphical User 11. Append
2. Directory 7. Command Line 12. Record3. Tree 8. Subfolder 13. Field
4. Relative Path 9. Hierarchical 14. Contiguous
5. Attribute 10. Absolute Path 15. Seek
G R A P H I C A L U S E R A B C D E F G
C R H T I I J K B L M D I R E C T O R Y
O N E O T R E E P S Q R S T U V W X Y ZM N W L E R I R V R O S U N G M Y A B C
M N E X A T I T A F I L E S Y S T E M I
A M E W O T F B N R T S U B F O L D E R
N P Y O U S I I U N C G W T I T H M E E
D A P B C D E V E T F H G H E I J K L C
L M N E O P L Q E R E S I T U P V W X O
I Y Z A N B D K D P E G H C I L A M N R
N N G O P D R S T U A W Y A A A N T G D
E C O N T I G U O U S T M A G L A R H A
L A Y G I N T U N G T E H U N A Y B A G
A Y N A D A P A T P A G E S I K A P A N
K A R U N U N G A N Y M A K H A L A G A