100% found this document useful (3 votes)
18K views

Os Lab Viva Questions

Uploaded by

Sego
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (3 votes)
18K views

Os Lab Viva Questions

Uploaded by

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

Operating System Lab Manual

VIVA QUESTIONS

1. What is CPU Scheduler?


Selects from among the processes in memory that are ready to execute, and allocates the CPU

to one of them.

CPU scheduling decisions may take place when a procesS


a. Switches from running to waiting state.
b. Switches from running to ready state. c
c. Switches from waiting to ready.
d. Terminates.

Scheduling under a. and d. is non-pre-emptive.


All other scheduling is pre-emptive

2. What are all the scheduling algorithms?


a. FCFS(First Come First Serve)
b. SJF(Shortest Job First)
c. Roun d robin

d. Priority Scheduling algorithms


3. Explain FCFS(First Come First Served)?
a. The process that requests the CPU first is allocated the CPU first. The code for
b. FCFS scheduling is simple to write and understand.

4. Explain SJF(Shortest Job First)?


first. If both process have same burst time
The process which has the less burst time execute

then FCFS will be used.

5. Explain Round Robin?


The round-robin (RR) scheduling algorithm is designed especially for timesharing systems.
small unit of time called time slice.
CPU switch between the processes based on a

6.Explain Priority Scheduling algorithm?


CPU is allocated to the process with the highest priority.

7.Which algorithm gives minimum average waiting time?


SJF(Shortest Job First)

8.What is CPU utilization?


as possible. Conceptually, CPU
utilization can range from
We want to keep the CPU as busy
it should range from 40 percent (for a lightly loaded
0 to 100 percent. In a real system,
system) to 90 percent.

9.What is Throughput?
CPU. One unit of work is the number of processes
The amount of work is being done by the
called throughput.
that are completed per unit time,

10. What is Turnaround time.


submission of a process to the time of completion is the
The interval from the time of
turnaround time

Page 74 of 79
Department of Computer Science, STIST
Oering ysem tah Munnd

11. What is waiting time?


WHlng time is the sum of the periods spent waiting in the ready queue

12. What is Response time?


The time lrom the submission of a request until the first response is produced.

13. What are short, long and medium-term scheduling?


. Long term scheduler determines which programs are admitted to the system for processing.
It controls the degree of multiprogramming. Once ndmitted, a job becomes a process.
that are
swapping function. This relates processes
to
term scheduling is part of the
.n aMedium are swapped out of real-memory
until they are ready to
blocked or
Cxecute, The
state.
suspended They
swapping-in decision is based on memory-management criteria.

most and makes the


frequently,
C. Short term scheduler, also known as a dispatcher executes invoked
next. This scheduler is
finest-grained decision of which process should execute
whenever an event occurs, It may lead to interruption of one process by pre-emption.

14. What are turnaround time and response time?


Turnaround time is the interval between the submission of a job and its completion.

15. What is pre-cmptive and non-pre-emptive scheduling?


is prioritized. The highest priority
a. Pre-emptive scheduling: The pre-emptive scheduling
that is currently utilized.
process slhould always be the process
When a process enters the state of running,
the state of that
b. scheduling:
Non-Pre-emptive
from the scheduler until it finishes its service time.
process is not deleted

16. What is deadlock?


Deadlock is a situntion that when two or more process waiting for each other and holding the
resource which is required by another process.

17. What are the conditions to occur deadlock?


Mutual necessary
exclusion: At least one resource must be held in a non-sharable mode, that is, only
resource. If another process requests that resource,
the
one process at a time can use the
until the resource has been released.
requesting process must be delayed
Hold and wait: A process must be holding at least one resource and waiting to acquire
other processes.
additional resources that are currently being held by
No pre-emption: Resources cannot be pre-empted.;
that is, a resource can be released only
voluntarily by Athesetprocess holding it, after that process has completed its task.
Circular wait: {P$, Pi, ..., Pn} of waiting processes must exist such that P-0 is waiting
a resource held by P?, ***, P.,-i is waiting
for a
for a resource held by P\, P\ is waiting for
r e s o u r c e held by Pn, and P, is waiting
for a resource held by Pn.

18. Explain about resource allocation graph?


Deadlocks can be described more precisely in terms of a directed graph called a system
resource-allocation graph. If the graph contains no cycles, then no process in the system is
contain cycle, then a deadlock may exist.
deadlocked. If the graph does a

19. What are the methods to handle the dead locks?


. We can use a protocol to prevent or avoid deadlocks, ensuring that the system will never
enter a dendlock state.
b. We can allow the system to enter a deadlock state, detect it, and recover.
c.We can ignore the problem altogether and pretend that deadlocks never occur in the system.
d. The third solution is the one used by most operating systems

Department of Computer Seience, STIST1 Page 75 of 79


Operating Syslem Labh Manual

20. What are the deadlock avoidance


algorithms?
uc loCK avoidance algorithm dynamically examines their source-allocation stae
to ensure that circular wait condition can
a
delined by the number of
never exist. The resource allocation state 1s
process,
available and allocated resources, and the maximum demand or ine

21. What is Bankers


t
Algorithm.
1s an
algorithm which used in
available cash in such a
a
banking system to ensure that the bank never allocated ns
way that it could no longer
satisfy the needs of all ils
custOms
22. What is Safe State and what
a
is its use in
When a process requests an available deadlock avoidance?
resource,
safe state. System is in system must decide if immediate allocaion
leaves the system in a
processes. Deadlock Avoidance: ensure safe state if there exists a safe
that a system will never enter an unsafesequence of al
state.
23. What is starvation and
aging?
Starvation is Resource
needs fora long time management problem where a process does not get the resources it
because the resources are
being allocated to other processes.
24. What is Safe State and its' use in
a

When a process
deadlock avoidance?
requests an available
leaves the system in a safe state resource, system must decide if immediate
allocation
System in safe state if there exists a safe
is
sequence of all
Sequene is safe if for each Pi, the resources that Pi can stillprocesses.
currently available resources + resources held by all the request can be satisfied by
Pj, withj If Pi resource needs are not
immediately available, then Pi can wait until all Pj have finished. When
obtain needed resources, execute, return Pj is finished, Pi can
allocated resources, and terminate. When Pi
terminates, Pit1 can obtain its needed resources, and so on.
Deadlock Avoidance b ensure that a
system will never enter an unsafe state.
25. Recovery from Deadlock?
Process Termination:
->Abort all deadlocked processes.
->Abort one process at a time until the deadlock
->In which order should we choose to abort?
cycle iseliminated.
o Priority of the process.
o How long process has computed, and how much
longer to completion.
o Resources the process has used.
o Resources process needs to complete.
How many processes will need to be terminated?
Is process interactive or batch?
Resource Preemption:
->Selecting a victim - minimize cost.
ack - return to some safe state, restart pro for thatstate.
->Starvation - same process may always be picked as victim,include number of rollback in
cost factor.

26. What is semaphore?


Semaphore is a variable whose status reports common resource, semaphore is of two types
one is Binary semaphore and other is Counting semaphore.

27. What is difference between binary semaphore and mutex?

76 oi 79
Page
Depaitment of Computer Science, S TIST
Operating System Lab Manual

exclusion.
Mutex is used exclusively for mutual by binary.
can be used
synchronization
Both mutual exclusion and mutex.
task which takes
Mutex is given only through the DELETE_SAFE are
provided by
takes as
the task which when holding
the mutex.
OOptions for making is not possible
Mutex, which m e a n s the task deletion

the logical address


28. Why paging is used? which is to permit
external fragmentation
problem physical
to be allocating
aging is solution to thus allowing a process
non-contiguous,
space of a process to be
wherever the latter is available.
memory

the process
29. What is virtual memory? is used to execute
management technique which
memory is memory
Virtual actual memory size.
than
which has more

that page will not load


into
30. What is Demand Paging? virtual memory such
lt is memory management
technique used in
needed.
the memory until it is

31. What are all page replacement


algorithms?
1. FIFO(First in First out)
2. Optimal Page Replacement
3. LRULeast-Recently-used)

fault rate?
algorithm will have less page
32. Which page replacement
Optimal Page Replacement

33. What is thrashing? than executing.


spends more time on paging
lt is situation that CPU

34. What is swapping executed. A process, however,


can swapped be
A process must be in memory to be into for
store and then brought back memory
backing
to a
temporarily out of memory
is called swapping
continued execution. This process

35. What is fragmentation? used inefficiently, reducing


in which storage space is
Fragmentation is a phenomenon
capacity or performance.

36. Explain External fragmentation? is broken into


the free memory space
As processes are loaded and removed from memory,
when there is enough total memory space
to satisfy
little pieces. External fragmentation exists
are not contiguous.
a request, but the available spaces

37. Explain Internal fragmentation?


scheme with a hole of 18,464 bytes. Suppose that thee
Consider a multiple-partition allocation
with
next process requests 18,462 bytes.
If we allocate exactly the requested block, we are left
track of this hole will be substantially larger than the
a overhead to
hole of 2 bytes. The keep
hole itself. The general approach to avoiding this problem is to break the physical memory
into fixed-sized blocks and allocate memory in units based on block size. With this approach,
the memory allocated to a process may be slightly larger than the requested memory. The
difference between these two numbers is internal fragmentation.

Departmernt of Computer Science, STIST Page 77 of 79


Lab Manual
Operating System

38.What is paging?
Paging is a
memory-nmanagement scheme that permits the
to be physical address space ot
process a
non-Contiguous. Paging avoids the considerable problem of fitting memory chunks
varying si7es onto the backing store.

39.What is frame?
Breaking main memory into fixed number of
blocks called frames.
40. What is page?
Breaking logical memory into blocks of
size is page.
same

41. What is the best page size when


The best paging size varies designing operating system?
an
from system to
system, so there is no single best when it
page size. There are different factors to comes to
consider in order to come up with a suitable page
such as page table, s1Ze,
paging time, and its effect on the overall
system. efficiency of the operating
42. What is virtual memory?
Virtual memory is hardware
actually does. This is done by
technique where the system appears to have more memory that it
memory one
time-sharing, the physical memory and storage parts of the
disk when they are not
actively being used.
43. What is Throughput, Turnaround time, waiting time and
Throughput number of processes that
-
Response time?
time amount of time to execute a comnplete their execution per time unit. Turnaround
particular process. Waiting time amount of time a-

process has been waiting in the ready queue.


when a request was submitted until Response time amount of time it takes from
-

the first response is


environment). produced, not output (for time-sharing
44. Explain Belady's Anomaly?
Also called FIFO anomaly.
Usually, on increasing the number of frames allocated to a
process virtual memory, the process execution is faster, because fewer faults occur.
Sometimes, the reverse happens, i.e., the execution time increases evenpage
when more frames are
allocated to the process. This is Belady's
Anomaly. This is true for certain page reference
patterns.
45. What is fragmentation? Different types of fragmentation?
Fragmentation occurs in a dynamic memory allocation system when many of the free blocks
are too small to
satisfy any request.
o External Fragmentation: External Fragmentation
happens when a dynamic memory
allocation algorithm allocates some memory and a small piece is left over that cannot
be effectively used. If too much external fragmentation occurs, the amount of usable
memory is drastically reduced. Total memory space exists to satisfy a request, but it
is not contiguous
oInternal Fragmentation: Internal fragmentation is the space wasted inside ofallocated
memory blocks because of restriction on the allowed sizes of allocated blocks.
Allocated memory may be slightly larger than requested memory; this size difference
is memory internal to a partition, but not being used Reduce external fragmentation
by compaction
>Shuffle memory contents to place all free memory together in one large block.
>Compaction is possible only if relocation is dynamic, and is done at execution unc.

Page 78 of 79
Department of Computer Science, STIST
Manuad
Operating ystem Lab
segment
in memory
for a
find a place but we
h a r d e r to virtual memory
with paging? it is of
Segmentation so benefits
this, it is
get the
lengths, avoid
46. Explain different we o r d e r to
can be of virtual memory, In Each
Segments memory. system.
of physical
segmented memory
virtual
page.
With allocation
two-level advantages of
a o f the
Than to do
dynamic
storage
and paging
into a
This give
some
of the
still
have segmentation
that segment. (logical
division

table for
combine
possible
to of segments
t o page
descriptor
points of the
advantages
some
segment with
placement)
(easy system
paging operating
actions
taken by the
programn). Describe the
occur? takes
faults memory
do page into main
brought invalid. If
circumstances

Under what been if it is


47. occurs? that has not the p r o g r a m
fault access to a page aborting into the free
when a page when an access, needed page
fault occurs
the memory the
to read
verifies instruction
a n d the
A p a g eThe operating systeml o c a t e d and I/O is requested table are updated
place. a free frame is table and page
it is valid, the process

completion
of I/O,
frame. Upon
is restarted controls and
hardware. It
computer various
System? manages
the for the
Operating that programs
What is an program application
System is
48. a various
the
An Operating hardware among
the use of the
coordinates

users.

the different
states ofcar eprocess?
ated
What a r e
49. is being
New: The
process executed
a r e being
Instructions occur
event to
Running: for s o m e
process
is waiting
The to a process
Waiting: be assigned
is waiting to
The process execution
Ready: finished
has
The process
Terminated:

process? process.
is a known as a
$0. What execution is
in
A program

******************* **
**************************
**
*********

* * * * * * * * * *
k

Pa

me a e s S o e . SIIST

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy