Unity University
Computer Science Department
Worksheet on Operating system
i) What is the main difference between multiprogramming and multitasking
operating systems?
ii) What is the importance of inter-process communication in computers?
Discus the different models that operating systems follow.
iii) Describe input/output bound process and CPU bound process.
iv) What is process scheduling and in what condition does it is needed? And
what is the main objective of process scheduling algorithms? Distinguish
between job scheduling (long term scheduler) and CPU scheduling (short
term scheduler).
v) What is virtual memory? And what is its main advantage?
vi) Which of the following resource allocation graphs show:
A cycle?
Unsafe/safe state?
Deadlock?
And draw the corresponding wait-for graph for each.
R1 R2
R1 R2
P1 P2 P3
P1 P2 P3
R3 R4
R3 R4
Page 1 of 5
R1 R1 R1
P2 P2 P2
P1 P1 P1
R2 R2 R2
R1 P2 R2 R1 P2 R2 R1 P2 R2
P1 P3 P1 P3 P1 P3
R1 R2 R1 R2 R1 R2
P1 P2 P3 P1 P2 P3 P1 P2 P3
Page 2 of 5
vii) Based on the following information, answer the questions that follow:
Total processes: p0, p1, p2, p3, and p4
Total resource Types: A, B, and C
Freely available resources: A=3; B=3; C=2;
Snapshot of the system:
Maximum
Allocated: Need:
Amount:
A B C A B C
P0 0 1 0 7 5 3
P1 2 0 0 3 2 2
P2 3 0 2 9 0 2
P3 2 1 1 2 2 2
P4 0 0 2 4 3 3
Calculate the resource needs of all processes of each type.
Is the above system in safe state? Why?
Can request for (1, 0, 2) by P1 be granted?
Can request for (3, 3, 0) by P4 be granted?
Can request for (0, 2, 0) by P0 be granted?
viii) Based on the following information of a system, answer the questions that
come next using the banker’s algorithm:
Processes:
Allocation: Maximum: Available:
A B C D A B C D A B C D
P0 0 0 1 2 0 0 1 2 1 5 2 0
P1 1 0 0 0 1 7 5 0
P2 1 3 5 4 2 3 5 6
P3 0 6 3 2 0 6 5 2
P4 0 0 1 4 0 6 5 6
Calculate the resource needs of the processes.
Page 3 of 5
Is the system in safe state?
What if the following resource requests are made?
o P1 requests (0, 4, 2, 0)
o P2 requests (1, 4, 3, 1)
o P3 requests (0, 4, 3, 1)
ix) A system has four processes and five allocate-able resources. The current
allocation and maximum needs are as follows:
Allocated Maximum Available
Process 0 1 0 2 1 1 1 1 2 1 3 0 0 x 1 1
Process 1 2 0 1 1 0 2 2 2 1 0
Process 2 1 1 0 1 0 2 1 3 1 0
Process 3 1 1 1 1 0 1 1 2 2 1
What is the smallest value of x for which this is a safe state?
x) Write the difference between Internal and External fragmentation of
disks.
xi) Describe the following terms:
Kernel MMU page tables
System call Logical/Process address Frame
space
Context switching Contiguous file
Virtual address allocation
CPU burst time
Physical address space Chained/Linked list file
Process burst time
allocation
Symbolic address
Input/ Output burst
Indexed file allocation
time Swapping
Starvation
Memory management Pages
Base and Limit registers
Memory compaction Paging
Page 4 of 5
xii) Define memory fragmentation and explain how internal and external memory
fragmentations are created.
xiii) What are the various Page Replacement Algorithms used for Page
Replacement? And when do the system uses them?
xiv) Explain the reason why API’s need to be used rather than direct system
call?
xv) What is the advantage of multiprocessor systems over single processor
system?
xvi) Differentiate Microkernel (microlithic) and Monolithic kernel against
complexity, speed, types of services, and size.
xvii) What is multicore processor?
xviii) Define memory stall and how can it be created?
xix) Explain bootstrapping.
Page 5 of 5