0% found this document useful (0 votes)
228 views97 pages

OS Merged

An operating system acts as an intermediary between the user and computer hardware. It controls and coordinates the use of hardware resources like the CPU, memory, and I/O devices among various application programs and users. The operating system manages these shared resources and allocates them to specific programs and processes as needed. Common operating system functions include multiprogramming to increase CPU utilization, time-sharing to enable interactive use, and personal computer systems dedicated to single users.

Uploaded by

Shubham Jain
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
0% found this document useful (0 votes)
228 views97 pages

OS Merged

An operating system acts as an intermediary between the user and computer hardware. It controls and coordinates the use of hardware resources like the CPU, memory, and I/O devices among various application programs and users. The operating system manages these shared resources and allocates them to specific programs and processes as needed. Common operating system functions include multiprogramming to increase CPU utilization, time-sharing to enable interactive use, and personal computer systems dedicated to single users.

Uploaded by

Shubham Jain
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/ 97

INTRODUCTION

1.------------is a program that acts as an intermediary between a user of a computer


and the computer hardware.
A. An operating system

B.An Overview System

C.A Computer Organization

D.A Computer Graphics

2.The operating system -----------and--------- the use of the hardware among the
various applications programs for the various users.

A. Controls , Coordinates
B.Control and Radiates
C.Use and Coordinate
D.Use and Radiate

3.The operating system acts as the --------------of these resources and allocates them
to specific programs and users as necessary for tasks.

A.Manager
B.Conductor

C.Router

D.Orientor
4.To speed up processing, jobs with similar needs were ------------together and were
run through the computer as a group.

A. batched
B.seperated

C.Connected
D.All
5.------------, in essence, uses the disk as a huge buffer, for reading as far ahead as
possible on input devices and for storing output files until the output devices are able
to accept them.
A. Spooling

B.Pooling

C.Scheduling

D.Dispatching

6.----------increases CPU utilization by organizing jobs such that the CPU always has
one to execute.

A. Multiprogramming
B.Singleprogramming

C.Object Oriented Programming


D.Structural Programming

7.Time sharing, or multitasking, is a logical extension of------------.

A. Multiprogramming
B.Singleprogramming
C.Object Oriented Programming

D.Structural Programming

8.-----------systems were developed to provide interactive use of a computer system at


a reasonable cost.

A. Time-sharing
B.Multiprogramming

C.Object Oriented

D.Batch
9.A program that is loaded into memory and is executing is commonly referred to as
a----------------.

A. process
B.program
C.Primary Program

D.Secondary Program
10.----------operating system allows the many users to share the computer
simultaneously.

A. A time-shared
B. A Multiprogrammed

C.A Batch System

D.A Real Time

11.Time-sharing operating systems are even more------ than are multiprogrammed


operating systems.

A.complex
B.Simple
C.Compatible

D.Easy

12.As hardware costs have decreased, it has once again become feasible to have a
computer system dedicated to a single user. These types of computer systems are
usually referred to as ---------------.

A.personal computers (Pcs)


B.Mainframe Computers (Mcs)
C.Super Computers(SCs)

D.Babbage
13.Personal computers appeared in the --------s.

A.1970
B.1971
C.1972

D.1980
14.The goals of the personal Computer operating systems have changed with time;
instead of maximizing CPU and peripheral utilization, the systems opt for
maximizing user-------------------.

A. convenience and responsiveness


B. convenience and Scheduling

C. Maximizing resource utilization and responsiveness

D.Robustness and utilization

15.Multiprocessor systems have more than one processor in close communication,


sharing the computer bus, the clock, and sometimes memory and peripheral devices.
These systems are referred to as----------- systems.

A.tightly coupled
B.loosely Coupled
C.Rightly coupled

D.wrongly coupled

16.Systems that are designed for graceful degradation are also called------------.

A. fault-tolerant
B.fault-intolerant

C.default-tolerant

D.tolerant
17.In multiple-processor systems ,------------- model is used , in which each processor
runs an identical copy of the operating system, and these copies communicate with
one another as needed.

A. symmetricmultiprocessing

B. asymmetricmultiprocessing
18.Some systems use---------------, in which each processor is assigned a specific
task.

A. asymmetric multiprocessing
B. symmetric multiprocessing
19.A---------- operating system has well-defined, fixed time constraints.

A. real-time
B. Half real-time
C.Full real-time

D.Null real-time

20.A---------------- system guarantees that critical tasks complete on time.

A. hard real-time
B. soft real-time

C. firm real-time

D. all real-time
21.-----------------is an achievable goal that is amenable to mixing with other types of
systems.

A. Soft real time


B. Hard real time

C. Firm real time

D. Null real time

Ch 2 Process
1.----------------: The process is being created
A.New
B.Running
C.Waiting
D.Ready

2.---------------: Instructions are being executed.


A.New
B.Running
C.Waiting
D.Ready

3.----------------: The process is waiting for some event to occur (such as an I/O
completion or reception of a signal).
A.New
B.Running
C.Waiting
D.Ready

4.----------: The process is waiting to be assigned to a processor.


A.New
B.Running
C.Waiting
D.Ready

5.-----------------: The process has finished execution.


A.Terminated
B.Running
C.Waiting
D.Ready

6.Each process is represented in the operating system by a ---------------- - also called


a task control block.
A.Process control block (PCB)
B.Process control Boot (PCB)
C.Process Control (PB)
D.Task control Boot(TCB)

7.------------: The counter indicates the address of the next instruction to be executed
for this process.
A. Program counter
B.Program conector
C.Process counter
D.Process Connector
8. ---------------include accumulators, index registers, stack pointers, and general-
purpose registers, plus any condition-code information
A.CPU Registers
B.Program Counter
C.CPU Block Control
D. Register CPU
9.As processes enter the system, they are put into a ------queue.
A.job
B.Device
C.Memory
D.CPU
10.A----------- will contain pointers to the first and last PCBs in the list.
A. ready-queue header
B. device-queue header
C. program
D. job-queue header
11.A----------- migrates between the various scheduling queues throughout its
lifetime.
A. process
B. program Queue
C.Device
D.Memory
12.If it takes 10 milliseconds to decide to execute a process for 100 milliseconds,
then 10/(100 + 10) = 9 percent of the CPU is being used (wasted) simply for-----------
-- the work.
A. scheduling
B. Memory Management
C.Dispataching
D. I/O operation
13.The-------- controls the degree of multiprogramming (the number of processes in
memory).
A. long-term scheduler
B. short-term scheduler
C. Medium-term scheduler
D.Semi Short-term scheduler
14.An ---------is one that spends more of its time doing I/0 than it spends doing
computations.
A.I/O-bound process
B.CPU-bound process
C.Memory-bound process
D.Storage-bound process

15.A, ------------- is one that generates I/O requests infrequently, using more of its
time doing computation than an I/O-bound process uses.
A.CPU-bound process
B.I/O-bound process
C.Memory-bound process
D.Storage-bound process
16.Switching the CPU to another process requires saving the state of the old process
and loading the saved state for the new process. This task is known as a -------.
A.context switch
B.cortext switch
C.context match
D.memory switch
17.----------time is pure overhead, because the system does no useful work while
switching.
A.context switch
B.cortext switch
C.context match
D.memory switch
18.When a process------------- a new process, two possibilities exist in terms of
execution:
1. The parent continues to execute concurrently with its children.
2. The parent waits until some or all of its children have terminated.
There are also two possibilities in terms of the address space of the new
process:
3. The child process is a duplicate of the parent process.
4. The child process has a program loaded into it.

A. creates
B.deletes
C.Terminates
D.sends

19.A parent may----------- the execution of one of its children for a variety of reasons,
such as:
1. The child has exceeded its usage of some of the resources it has been
allocated.
2. The task assigned to the child is no longer required.
3. The parent is exiting, and the operating system does not allow a child to
continue if its parent terminates.
A. terminate
B.create
C.Send
D.pause

20.If a process terminates (either normally or abnormally), then all its children must
also be terminated. This phenomenon is referred to as------------ and is normally
initiated by the operating system.
A. cascading termination
B. regular termination
C. irregular termination
D. faulty termination
21.A process is -------if it cannot affect or be affected by the other processes
executing in the system.
A.independent
B.cooperating
C.inner
D.Outer
22.a process is cooperating if it can affect or be affected by the other processes
executing in the system.
A.cooperating
B. independent
C.inner
D.Outer
23.A producer process produces information that is consumed by a consumer
process.
A.producer,consumer
B.producer,producer
C.consumer,producer
D.consumer,consumer
24.A, ---------sometimes called a lightweight process (LWP), is a basic unit of CPU
utilization, and consists of a program counter, a register set, and a stack space.
A. thread
B.thorn
C.Server
D.Memory
25.The---------- are scheduled by the kernel's scheduler and execute on the CPU or
CPUs in the system.
A. kernel threads
B. User threads
C. Device threads
D. kernel
Chapter 3
PROCESS SCHEDULING
1.An I/O-bound program would typically have many very-------- CPU bursts.
A. short
B.Long
C.Medium
D.Perfect

2.A CPU-bound program might have a few very -------- CPU bursts.
A. Long
B.short
C.Medium
D.Perfect

3.The---------- selects from among the processes in memory that are ready to execute,
and allocates the CPU to one of them.
A. scheduler
B. Dispatcher
C.Allocator
D.Priotiser

4.----------may be implemented as a FIFO queue, a priority queue, a tree, or simply an


unordered linked list.
A.A ready queue
B. A device queue
C.A member queue
D.No queue

5.Under----------- scheduling, once the CPU has been allocated to a process, the
process keeps the CPU until it releases the CPU either by terminating or by switching
to the waiting state.
A. nonpreemptive
B.preemptive
C.nonproductive
D.productive
6.The-------- is the module that gives control of the CPU to the process selected by
the short-term scheduler.
A. dispatcher
B.scheduler
C.mover
D.deadlock
7.The time it takes for the dispatcher to stop one process and start another running is
known as the--------------.
A. dispatch latency
B.shecule latency
C. Memory access latency
D.context swtich Latency

8.One measure of work is the number of processes that are completed per time unit,
called--------------.
A. throughput
B.cpu utilization
C.Dispatch Latency
D.thoughput
9.The interval from the time of submission of a process to the time of completion is
the ----------------------.
A.turnaround time
B.Waiting Time
C.Avg waiting Time
D.Avg. Turn around Time
10.------------is the sum of the periods spent waiting in the ready queue.
A. Waiting time
B. Turn around Time
C.Dispatch Time
D.throughpu Time
11.-------------, is the amount of time it takes to start responding, but not the time that
it takes to output that response.
A. response time
B. Waiting Time
C.Turn around Time
D.execution Time
12.With ------------- scheme, the process that requests the CPU first is allocated the
CPU first.
A.FCFS
B.SJF
C.SRTF
D.RR
13.The FCFS scheduling algorithm is------------. Once the CPU has been allocated to
a process, that process keeps the CPU until it releases the CPU, either by terminating
or by requesting I/O.
A. nonpreemptive
B.Preemptive
C.Productive
D.Recursive
14.The FCFS algorithm is particularly troublesome for------ systems, where it is
important that each user get a share of the CPU at regular intervals.
A. time-sharing
B.multiprogramming
C.time-reducing
D.time spending
15.In------- ,When the CPU is available, it is assigned to the process that has the
smallest next CPU burst.
A. SJF
B.FCFS
C.Priority
D.RR

16.In SJF, if two processes have the same length next CPU burst,---- scheduling is
used to break the tie.
A. FCFS
B.SJF
C.Priority
D.RR
17.The SJF scheduling algorithm is provably optimal, in that it gives the--------
average waiting time for a given set of processes.
A. minimum
B.Maximum
C.50-50
D.Largest
18.SJF scheduling is used frequently in--------- scheduling.
A. long-term
B.Medium
C.Right term
D.Wrong turn
19.A-------- algorithm will preempt the currently executing process, whereas a---------
-- algorithm will allow the currently running process to finish its CPU burst.
A. preemptive SJF, nonpreemptive SJF
B.nonpreemptive SJF, preemptive SJF
C.preemptive SJF, preemptive SJF
D.nonpreemptive SJF, nonpreemptive SJF

20.----------scheduling is sometimes called shortest-remaining-time-first scheduling.


A. Preemptive SJF
B. nonpreemptive SJF
C. Preemptive Priority
D.Round Robin
Chapter 4

INTER –PROCESS SYNCHRONIZATION


1. Which process can be affected by other processes executing in the system?
a) cooperating process
b) child process
c) parent process
d) init process

2. When several processes access the same data concurrently and the outcome of the
execution depends on the particular order in which the access takes place, is called
a) dynamic condition
b) race condition
c) essential condition
d) critical condition

3. If a process is executing in its critical section, then no other processes can be


executing in their critical section. This condition is called
a) mutual exclusion
b) critical exclusion
c) synchronous exclusion
d) asynchronous exclusion

4. Which one of the following is a synchronization tool?


a) thread
b) pipe
c) semaphore
d) socket

5. A semaphore is a shared integer variable


a) that can not drop below zero
b) that can not be more than zero
c) that can not drop below one
d) that can not be more than one
6. Mutual exclusion can be provided by the
a) mutex locks
b) binary semaphores
c) both (a) and (b)
d) none of the mentioned

7. When high priority task is indirectly preempted by medium priority task effectively
inverting the relative priority of the two tasks, the scenario is called
a) priority inversion
b) priority removal
c) priority exchange
d) priority modification

8. Process synchronization can be done on


a) hardware level
b) software level
c) both (a) and (b)
d) none of the mentioned

9. A monitor is a module that encapsulates


a) shared data structures
b) procedures that operate on shared data structure
c) synchronization between concurrent procedure invocation
d) all of the mentioned

10. To enable a process to wait within the monitor,


a) a condition variable must be declared as condition
b) condition variables must be used as boolean objects
c) semaphore must be used
d) all of the mentioned

11. Inter process communication :


a) allows processes to communicate and synchronize their actions when using the
same address space.
b) allows processes to communicate and synchronize their actions without using
the same address space.
c) allows the processes to only synchronize their actions without communication.
d) None of these

12.Message passing system allows processes to :


a) communicate with one another without resorting to shared data.
b) communicate with one another by resorting to shared data.
c) share data
d) name the recipient or sender of the message

13.An IPC facility provides atleast two operations : (choose two)


a) write message
b) delete message
c) send message
d) receive message

14.Messages sent by a process :


a) have to be of a fixed size
b) have to be a variable size
c) can be fixed or variable sized
d) None of these

15.The link between two processes P and Q to send and receive messages is called :
a) communication link
b) message-passing link
c) synchronization link
d) All of these

16. Which of the following are TRUE for direct communication :(choose two)
a) A communication link can be associated with N number of process(N = max.
number of processes supported by system)
b) A communication link can be associated with exactly two processes
c) Exactly N/2 links exist between each pair of processes(N = max. number of
processes supported by system)
d) Exactly one link exists between each pair of processes

17.In indirect communication between processes P and Q :


a) there is another process R to handle and pass on the messages between P and Q
b) there is another machine between the two processes to help communication
c) there is a mailbox to help communication between P and Q
d) None of these

18.In the non blocking send :


a) the sending process keeps sending until the message is received
b) the sending process sends the message and resumes operation
c) the sending process keeps sending until it receives a message
d) None of these

19. In the Zero capacity queue : (choose two)


a) the queue has zero capacity
b) the sender blocks until the receiver receives the message
c) the sender keeps sending and the messages dont wait in the queue
d) the queue can store atleast one message

20. The Zero Capacity queue :


a) is referred to as a message system with buffering
b) is referred to as a message system with no buffering
c) is referred to as a link
d) None of these

21. Bounded capacity and Unbounded capacity queues are referred to as :


a) Programmed buffering
b) Automatic buffering
c) User defined buffering
d) No buffering
Chapter 5
DEADLOCK
1. What is the reusable resource?
a) that can be used by one process at a time and is not depleted by that use
b) that can be used by more than one process at a time
c) that can be shared between various threads
d) none of the mentioned

2. Which of the following condition is required for deadlock to be possible?


a) mutual exclusion
b) a process may hold allocated resources while awaiting assignment of other
resources
c) no resource can be forcibly removed from a process holding it
d) all of the mentioned

3. A system is in the safe state if


a) the system can allocate resources to each process in some order and still avoid a
deadlock
b) there exist a safe sequence
c) both (a) and (b)
d) none of the mentioned

4. The circular wait condition can be prevented by


a) defining a linear ordering of resource types
b) using thread
c) using pipes
d) all of the mentioned

5. Which one of the following is the deadlock avoidance algorithm?


a) banker’s algorithm
b) round-robin algorithm
c) elevator algorithm
d) karn’s algorithm

6. What is the drawback of banker’s algorithm?


a) in advance processes rarely know that how much resource they will need
b) the number of processes changes as time progresses
c) resource once available can disappear
d) all of the mentioned

7. For effective operating system, when to check for deadlock?


a) every time a resource request is made
b) at fixed time intervals
c) both (a) and (b)
d) none of the mentioned

8. A problem encountered in multitasking when a process is perpetually denied


necessary resources is called
a) deadlock
b) starvation
c) inversion
d) aging

9. Which one of the following is a visual ( mathematical ) way to determine the


deadlock occurrence?
a) resource allocation graph
b) starvation graph
c) inversion graph
d) none of the mentioned

10. To avoid deadlock


a) there must be a fixed number of resources to allocate
b) resource allocation must be done only once
c) all deadlocked processes must be aborted
d) inversion technique can be used

11) The number of resources requested by a process :


a) must always be less than the total number of resources available in the system
b) must always be equal to the total number of resources available in the system
c) must not exceed the total number of resources available in the system
d) must exceed the total number of resources available in the system

12) The request and release of resources are ___________.


a) command line statements
b) interrupts
c) system calls
d) special programs

13) Multithreaded programs are :


a) lesser prone to deadlocks
b) more prone to deadlocks
c) not at all prone to deadlocks
d) None of these

14) For a deadlock to arise, which of the following conditions must hold
simultaneously ? ( choose all that apply )
a) Mutual exclusion
b) Starvation
c) Hold and wait
d) No preemption
e) Circular wait

15) For Mutual exclusion to prevail in the system :


a) at least one resource must be held in a non sharable mode
b) the processor must be a uniprocessor rather than a multiprocessor
c) there must be at least one resource in a sharable mode
d) All of these

16) For a Hold and wait condition to prevail :


a) A process must be not be holding a resource, but waiting for one to be freed, and
then request to acquire it
b) A process must be holding at least one resource and waiting to acquire
additional resources that are being held by other processes
c) A process must hold at least one resource and not be waiting to acquire additional
resources
d) None of these

17) Deadlock prevention is a set of methods :


a) to ensure that at least one of the necessary conditions cannot hold
b) to ensure that all of the necessary conditions do not hold
c) to decide if the requested resources for a process have to be given or not
d) to recover from a deadlock

18) For non sharable resources like a printer, mutual exclusion :


a) must exist
b) must not exist
c) may exist
d) None of these

19) For sharable resources, mutual exclusion :


a) is required
b) is not required
c) None of these

20) To ensure that the hold and wait condition never occurs in the system, it must be
ensured that :
a) whenever a resource is requested by a process, it is not holding any other resources
b) each process must request and be allocated all its resources before it begins its
execution
c) a process can request resources only when it has none
d) All of these

21) The disadvantage of a process being allocated all its resources before beginning
its execution is :
a) Low CPU utilization
b) Low resource utilization
c) Very high resource utilization
d) None of these
22) To ensure no preemption, if a process is holding some resources and requests
another resource that cannot be immediately allocated to it :
a) then the process waits for the resources be allocated to it
b) the process keeps sending requests until the resource is allocated to it
c) the process resumes execution without the resource being allocated to it
d) then all resources currently being held are preempted

23) One way to ensure that the circular wait condition never holds is to :
a) impose a total ordering of all resource types and to determine whether one
precedes another in the ordering
b) to never let a process acquire resources that are held by other processes
c) to let a process wait for only one resource at a time
d) All of these

24) Each request requires that the system consider the __________, _____________,
____________ to decide whether the current request can be satisfied or must wait to
avoid a future possible deadlock. (choose three)
a) resources currently available
b) processes that have previously been in the system
c) resources currently allocated to each process
d) future requests and releases of each process

25) Given a priori information about the ________ number of resources of each type
that maybe requested for each process, it is possible to construct an algorithm that
ensures that the system will never enter a deadlock state.
a) minimum
b) average
c) maximum
d) approximate

26) A deadlock avoidance algorithm dynamically examines the __________, to


ensure that a circular wait condition can never exist.
a) resource allocation state
b) system storage state
c) operating system
d) resources
27) A state is safe, if :
a) the system does not crash due to deadlock occurrence
b) the system can allocate resources to each process in some order and still avoid
a deadlock
c) the state keeps the system protected and safe
d) All of these

28) A system is in a safe state only if there exists a :


a) safe allocation
b) safe resource
c) safe sequence
d) All of these

29) All unsafe states are :


a) deadlocks
b) not deadlocks
c) fatal
d) None of these

30) A system has 12 magnetic tape drives and 3 processes : P0, P1, and P2. Process
P0 requires 10 tape drives, P1 requires 4 and P2 requires 9 tape drives.
Process
P0
P1
P2
Maximum needs (process-wise : P0 through P2 top to bottom)
10
4
9
Currently allocated (process-wise)
5
2
2
Which of the following sequence is a safe sequence ?
a) P0, P1, P2
b) P1, P2, P0
c) P2, P0, P1
d) P1, P0, P2

31) If no cycle exists in the resource allocation graph :


a) then the system will not be in a safe state
b) then the system will be in a safe state
c) either a or b
d) None of these

32) The resource allocation graph is not applicable to a resource allocation system :
a) with multiple instances of each resource type
b) with a single instance of each resource type
c) Both a and b

33) The Banker’s algorithm is _____________ than the resource allocation graph
algorithm.
a) less efficient
b) more efficient
c) None of these

34) The data structures available in the Banker’s algorithm are : (choose all that
apply)
a) Available
b) Need
c) Allocation
d) Maximum
e) Minimum
f) All of these

35) The content of the matrix Need is :


a) Allocation – Available
b) Max – Available
c) Max – Allocation
d) Allocation – Max
36) A system with 5 processes P0 through P4 and three resource types A, B, C has A
with 10 instances, B with 5 instances, and C with 7 instances. At time t0, the
following snapshot has been taken :
Process
P0
P1
P2
P3
P4
Allocation (process-wise : P0 through P4 top to bottom)
ABC
010
200
302
211
002
Max (process-wise : P0 through P4 top to bottom)
ABC
753
322
902
222
433
Available
ABC
332
The sequence
a) an unsafe state
b) a safe state
c) a protected state
d) a deadlock

37) The wait-for graph is a deadlock detection algorithm that is applicable when :
a) all resources have a single instance
b) all resources have multiple instances
c) both a and b

38) An edge from process Pi to Pj in a wait for graph indicates that :


a) Pi is waiting for Pj to release a resource that Pi needs
b) Pj is waiting for Pi to release a resource that Pj needs
c) Pi is waiting for Pj to leave the system
d) Pj is waiting for Pi to leave the system

39) If the wait for graph contains a cycle :


a) then a deadlock does not exist
b) then a deadlock exists
c) then the system is in a safe state
d) either b or c

40) If deadlocks occur frequently, the detection algorithm must be invoked


________.
a) rarely
b) frequently
c) None of these

41) The disadvantage of invoking the detection algorithm for every request is :
a) overhead of the detection algorithm due to consumption of memory
b) excessive time consumed in the request to be allocated memory
c) considerable overhead in computation time
d) All of these

42) A deadlock eventually cripples system throughput and will cause the CPU
utilization to ______.
a) increase
b) drop
c) stay still
d) None of these

43) Every time a request for allocation cannot be granted immediately, the detection
algorithm is invoked. This will help identify : (choose all that apply)
a) the set of processes that have been deadlocked
b) the set of processes in the deadlock queue
c) the specific process that caused the deadlock
d) All of these

44) A computer system has 6 tape drives, with ‘n’ processes competing for them.
Each process may need 3 tape drives. The maximum value of ‘n’ for which the
system is guaranteed to be deadlock free is :
a) 2
b) 3
c) 4
d) 1

45) A system has 3 processes sharing 4 resources. If each process needs a maximum
of 2 units then, deadlock :
a) can never occur
b) may occur
c) has to occur
d) None of these

46) ‘m’ processes share ‘n’ resources of the same type. The maximum need of each
process doesn’t exceed ‘n’ and the sum of all their maximum needs is always less
than m+n. In this setup, deadlock :
a) can never occur
b) may occur
c) has to occur
d) None of these
47) A deadlock can be broken by : (choose all that apply)
a) abort one or more processes to break the circular wait
b) abort all the process in the system
c) preempt all resources from all processes
d) to preempt some resources from one or more of the deadlocked processes

48) The two ways of aborting processes and eliminating deadlocks are : (choose all
that apply)
a) Abort all deadlocked processes
b) Abort all processes
c) Abort one process at a time until the deadlock cycle is eliminated
d) All of these

49) Those processes should be aborted on occurrence of a deadlock, the termination


of which :
a) is more time consuming
b) incurs minimum cost
c) safety is not hampered
d) All of these

50) The process to be aborted is chosen on the basis of the following factors : (choose
all that apply)
a) priority of the process
b) process is interactive or batch
c) how long the process has computed
d) how much more long before its completion
e) how many more resources the process needs before its completion
f) how many and what type of resources the process has used
g) how many resources are available in the system
h) All of these

51) Cost factors of process termination include : (choose all that apply)
a) number of resources the deadlock process is holding
b) CPU utilization at the time of deadlock
c) amount of time a deadlocked process has thus far consumed during its
execution
d) All of the above

52) If we preempt a resource from a process, the process cannot continue with its
normal execution and it must be :
a) aborted
b) rolled back
c) terminated
d) queued

53) To _______ to a safe state, the system needs to keep more information about the
states of processes.
a) abort the process
b) roll back the process
c) queue the process
d) None of these

54) If the resources are always preempted from the same process, __________ can
occur.
a) deadlock
b) system crash
c) aging
d) starvation

55) The solution to starvation is :


a) the number of rollbacks must be included in the cost factor
b) the number of resources must be included in resource preemption
c) resource preemption be done instead
d) All of these
Chapter 6
MEMORY MANAGEMENT
1) Address Binding is :
a) going to an address in memory
b) locating an address with the help of another address
c) binding two addresses together to form a new address in a different memory space
d) a mapping from one address space to another

2) Binding of instructions and data to memory addresses can be done at :


a) Compile time
b) Load time
c) Execution time
d) All of these

3) If the process can be moved during its execution from one memory segment to
another, then binding must be :
a) delayed until run time
b) preponed to compile time
c) preponed to load time
d) None of these

4) Dynamic loading is :
a) loading multiple routines dynamically
b) loading a routine only when it is called
c) loading multiple routines randomly
d) None of these

5) The advantage of dynamic loading is that :


a) a used routine is used multiple times
b) an unused routine is never loaded
c) CPU utilization increases
d) All of these
6) The idea of overlays is to : (choose all that apply)
a) enable multiple processes execute at once
b) enable a process to be larger than the amount of memory allocated to it
c) keep in memory only those instructions and data that are needed at any given
time
d) All of these

7) The ___________ must design and program the overlay structure.


a) programmer
b) system architect
c) system designer
d) None of these

8) The ___________ swaps processes in and out of the memory.


a) memory manager
b) CPU
c) CPU manager
d) user

9) If a higher priority process arrives and wants service, the memory manager can
swap out the lower priority process to execute the higher priority process. When the
higher priority process finishes, the lower priority process is swapped back in and
continues execution. This variant of swapping is sometimes called :
a) priority swapping
b) pull out, push in
c) roll out, roll in
d) None of these

10) If binding is done at assembly or load time, then the process _____ be moved to
different locations after being swapped out and in again.
a) can
b) must
c) can never
d) may
11) In a system that does not support swapping,
a) the compiler normally binds symbolic addresses (variables) to relocatable
addresses
b) the compiler normally binds symbolic addresses to physical addresses
c) the loader binds relocatable addresses to physical addresses
d) binding of symbolic addresses to physical addresses normally takes place during
execution

12) Which of the following is TRUE ?


a) Overlays are used to increase the size of physical memory
b) Overlays are used to increase the logical address space
c) When overlays are used, the size of a process is not limited to the size of the
physical memory
d) Overlays are used whenever the physical address space is smaller than the logical
address space
13) The address generated by the CPU is referred to as :
a) physical address
b) logical address
c) Neither a nor b

14) The address loaded into the memory address register of the memory is referred to
as :
a) physical address
b) logical address
c) Neither a nor b

15) The run time mapping from virtual to physical addresses is done by a hardware
device called the :
a) Virtual to physical mapper
b) memory management unit
c) memory mapping unit
d) None of these

16) The base register is also known as the :


a) basic register
b) regular register
c) relocation register
d) delocation register

17) The size of a process is limited to the size of :


a) physical memory
b) external storage
c) secondary storage
d) None of these

18) If execution time binding is being used, then a process ______ be swapped to a
different memory space.
a) has to be
b) can never
c) must
d) may

19) Swapping requires a __________.


a) motherboard
b) keyboard
c) monitor
d) backing store

20) The backing store is generally a : (choose all that apply)


a) fast disk
b) disk large enough to accommodate copies of all memory images for all users
c) disk to provide direct access to the memory images
d) All of these

21) The ________ consists of all processes whose memory images are in the backing
store or in memory and are ready to run.
a) wait queue
b) ready queue
c) CPU
d) secondary storage
22) The _________ time in a swap out of a running process and swap in of a new
process into the memory is very high.
a) context – switch
b) waiting
c) execution
d) All of these

23) The major part of swap time is _______ time.


a) waiting
b) transfer
c) execution
d) None of these

24) Swapping _______ be done when a process has pending I/O, or has to execute
I/O operations only into operating system buffers.
a) must
b) can
c) must never
d) maybe

25) Swap space is allocated :


a) as a chunk of disk
b) separate from a file system
c) into a file system
d) All of these

26. CPU fetches the instruction from memory according to the value of
a) program counter
b) status register
c) instruction register
d) program status word

27. A memory buffer used to accommodate a speed differential is called


a) stack pointer
b) cache
c) accumulator
d) disk buffer
28. Which one of the following is the address generated by CPU?
a) physical address
b) absolute address
c) logical address
d) none of the mentioned

29. Run time mapping from virtual to physical address is done by


a) memory management unit
b) CPU
c) PCI
d) none of the mentioned

30. Memory management technique in which system stores and retrieves data from
secondary storage for use in main memory is called
a) fragmentation
b) paging
c) mapping
d) none of the mentioned

31. The address of a page table in memory is pointed by


a) stack pointer
b) page table base register
c) page register
d) program counter

32. Program always deals with


a) logical address
b) absolute address
c) physical address
d) relative address

33. The page table contains


a) base address of each page in physical memory
b) page offset
c) page size
d) none of the mentioned

34. What is compaction?


a) a technique for overcoming internal fragmentation
b) a paging technique
c) a technique for overcoming external fragmentation
d) a technique for overcoming fatal error
35. Operating System maintains the page table for
a) each process
b) each thread
c) each instruction
d) each address

36. The main memory accommodates :


a) operating system
b) CPU
c) user processes
d) All of these

37. The operating system is :


a) in the low memory
b) in the high memory
c) either a or b (depending on the location of interrupt vector)
d) None of these

38. In contiguous memory allocation :


a) each process is contained in a single contiguous section of memory
b) all processes are contained in a single contiguous section of memory
c) the memory space is contiguous
d) None of these

39. The relocation register helps in :


a) providing more address space to processes
b) a different address space to processes
c) to protect the address spaces of processes
d) None of these

40. With relocation and limit registers, each logical address must be _______ the
limit register.
a) less than
b) equal to
c) greater than
d) None of these

41. The operating system and the other processes are protected from being modified
by an already running process because :
a) they are in different memory spaces
b) they are in different logical addresses
c) they have a protection algorithm
d) every address generated by the CPU is being checked against the relocation
and limit registers

42. Transient operating system code is code that :


a) is not easily accessible
b) comes and goes as needed
c) stays in the memory always
d) never enters the memory space

46. Using transient code, _______ the size of the operating system during program
execution.
a) increases
b) decreases
c) changes
d) maintains

47. When memory is divided into several fixed sized partitions, each partition may
contain ________.
a) exactly one process
b) atleast one process
c) multiple processes at once
d) None of these

48. In fixed sized partition, the degree of multiprogramming is bounded by


___________.
a) the number of partitions
b) the CPU utilization
c) the memory size
d) All of these

49. The first fit, best fit and worst fit are strategies to select a ______.
a) process from a queue to put in memory
b) processor to run the next process
c) free hole from a set of available holes
d) All of these
50. In internal fragmentation, memory is internal to a partition and :
a) is being used
b) is not being used
c) is always used
d) None of these
51. A solution to the problem of external fragmentation is :
a) compaction
b) larger memory space
c) smaller memory space
d) None of these

52. Another solution to the problem of external fragmentation problem is to :


a) permit the logical address space of a process to be noncontiguous
b) permit smaller processes to be allocated memory at last
c) permit larger processes to be allocated memory at last
d) All of these

53. If relocation is static and is done at assembly or load time, compaction


_________.
a) cannot be done
b) must be done
c) must not be done
d) can be done

54. The disadvantage of moving all process to one end of memory and all holes to the
other direction, producing one large hole of available memory is :
a) the cost incurred
b) the memory used
c) the CPU used
d) All of these
55. __________ is generally faster than _________ and _________.
a) first fit, best fit, worst fit
b) best fit, first fit, worst fit
c) worst fit, best fit, first fit
d) None of these

56. External fragmentation exists when :


a) enough total memory exists to satisfy a request but it is not contiguous
b) the total memory is insufficient to satisfy a request
c) a request cannot be satisfied even when the total memory is free
d) None of these

57. External fragmentation will not occur when :


a) first fit is used
b) best fit is used
c) worst fit is used
d) no matter which algorithm is used, it will always occur

58. Sometimes the overhead of keeping track of a hole might be :


a) larger than the memory
b) larger than the hole itself
c) very small
d) All of these

59. When the memory allocated to a process is slightly larger than the process, then :
a) internal fragmentation occurs
b) external fragmentation occurs
c) both a and b
d) neither a nor b

60. Physical memory is broken into fixed-sized blocks called ________.


a) frames
b) pages
c) backing store
d) None of these

61. Logical memory is broken into blocks of the same size called _________.
a) frames
b) pages
c) backing store
d) None of these

62. Every address generated by the CPU is divided into two parts : (choose two)
a) frame bit
b) page number
c) page offset
d) frame offset

63. The __________ is used as an index into the page table.


a) frame bit
b) page number
c) page offset
d) frame offset

64. The _____ table contains the base address of each page in physical memory.
a) process
b) memory
c) page
d) frame

65. The size of a page is typically :


a) varied
b) power of 2
c) power of 4
d) None of these

66. If the size of logical address space is 2 to the power of m, and a page size is 2 to
the power of n addressing units, then the high order _____ bits of a logical address
designate the page number, and the ____ low order bits designate the page offset.
a) m, n
b) n, m
c) m – n, m
d) m – n, n

67. With paging there is no ________ fragmentation.


a) internal
b) external
c) either type of
d) None of these

68. The operating system maintains a ______ table that keeps track of how many
frames have been allocated, how many are there, and how many are available.
a) page
b) mapping
c) frame
d) memory

69. Paging increases the ______ time.


a) waiting
b) execution
c) context – switch
d) All of these

70. Smaller page tables are implemented as a set of _______.


a) queues
b) stacks
c) counters
d) registers
71. The page table registers should be built with _______.
a) very low speed logic
b) very high speed logic
c) a large memory space
d) None of these

72. For larger page tables, they are kept in main memory and a __________ points to
the page table.
a) page table base register
b) page table base pointer
c) page table register pointer
d) page table base

73. For every process there is a __________.


a) page table
b) copy of page table
c) pointer to page table
d) All of these

74. Time taken in memory access through PTBR is :


a) extended by a factor of 3
b) extended by a factor of 2
c) slowed by a factor of 3
d) slowed by a factor of 2

75. Each entry in a Translation look-aside buffer (TLB) consists of :


a) key
b) value
c) bit value
d) constant

76. If a page number is not found in the TLB, then it is known as a :


a) TLB miss
b) buffer miss
c) TLB hit
d) TLB hit
77. An ______ uniquely identifies processes and is used to provide address space
protection for that process.
a) address space locator
b) address space identifier
c) address process identifier
d) None of these

78. The percentage of times a page number is found in the TLB is known as :
a) miss ratio
b) hit ratio
c) miss percent
d) None of these

79. Memory protection in a paged environment is accomplished by :


a) protection algorithm with each page
b) restricted access rights to users
c) restriction on page visibility
d) protection bit with each page

80. When the valid – invalid bit is set to valid, it means that the associated page :
a) is in the TLB
b) has data in it
c) is in the process’s logical address space
d) is the system’s physical address space

81. Illegal addresses are trapped using the _____ bit.


a) error
b) protection
c) valid – invalid
d) access

82.When there is a large logical address space, the best way of paging would be :
a) not to page
b) a two level paging algorithm
c) to page the page table itself
d) All of these
83. In a paged memory, the page hit ratio is 0.35. The required to access a page in
secondary memory is equal to 100 ns. The time required to access a page in primary
memory is 10 ns. The average time required to access a page is :
a) 3.0 ns
b) 68.0 ns
c) 68.5 ns
d) 78.5 ns

84. To obtain better memory utilization, dynamic loading is used. With dynamic
loading, a routine is not loaded until it is called. For implementing dynamic loading,
a) special support from hardware is required
b) special support from operating system is essential
c) special support from both hardware and operating system is essential
d) user programs can implement dynamic loading without any special support
from hardware or operating system

85. In paged memory systems, if the page size is increased, then the internal
fragmentation generally :
a) becomes less
b) becomes more
c) remains constant
d) None of these
86. In segmentation, each address is specified by :
a) a segment number
b) an offset
c) a value
d) a key

87. In paging the user provides only ________, which is partitioned by the hardware
into ________ and ______.
a) one address, page number, offset
b) one offset, page number, address
c) page number, offset, address
d) None of these
88. Each entry in a segment table has a :
a) segment base
b) segment peak
c) segment limit
d) segment value

89. The segment base contains the :


a) starting logical address of the process
b) starting physical address of the segment in memory
c) segment length
d) None of these

90. The segment limit contains the :


a) starting logical address of the process
b) starting physical address of the segment in memory
c) segment length
d) None of these

91. The offset ‘d’ of the logical address must be :


a) greater than segment limit
b) between 0 and segment limit
c) between 0 and the segment number
d) greater than the segment number

92. If the offset is legal :


a) it is used as a physical memory address itself
b) it is subtracted from the segment base to produce the physical memory address
c) it is added to the segment base to produce the physical memory address
d) None of these

93. When the entries in the segment tables of two different processes point to the
same physical location :
a) the segments are invalid
b) the processes get blocked
c) segments are shared
d) All of these
94. The protection bit is 0/1 based on : (choose all that apply)
a) write only
b) read only
c) read – write
d) None of these

95. If there are 32 segments, each of size 1Kb, then the logical address should have :
a) 13 bits
b) 14 bits
c) 15 bits
d) 16 bits

96. Consider a computer with 8 Mbytes of main memory and a 128 K cache. The
cache block size is 4 K. It uses a direct mapping scheme for cache management. How
many different main memory blocks can map onto a given physical cache block ?
a) 2048
b) 256
c) 64
d) 8

97. A multilevel page table is preferred in comparison to a single level page table for
translating virtual address to physical address because :
a) it reduces the memory access time to read or write a memory location
b) it helps to reduce the size of page table needed to implement the virtual
address space of a process
c) it is required by the translation look aside buffer
d) it helps to reduce the number of page faults in page replacement algorithms
Chapter 7
VIRTUAL MEMORY

1. Because of virtual memory, the memory can be shared among


a) processes
b) threads
c) instructions
d) none of the mentioned

2. _____ is the concept in which a process is copied into main memory from the
secondary memory according to the requirement.
a) Paging
b) Demand paging
c) Segmentation
d) Swapping
3. The pager concerns with the
a) individual page of a process
b) entire process
c) entire thread
d) first page of a process

4. Swap space exists in


a) primary memory
b) secondary memory
c) CPU
d) none of the mentioned
5. When a program tries to access a page that is mapped in address space but not
loaded in physical memory, then
a) segmentation fault occurs
b) fatal error occurs
c) page fault occurs
d) no error occurs
6. Effective access time is directly proportional to
a) page-fault rate
b) hit ratio
c) memory access time
d) none of the mentioned

7. In FIFO page replacement algorithm, when a page must be replaced


a) oldest page is chosen
b) newest page is chosen
c) random page is chosen
d) none of the mentioned

8. Which algorithm chooses the page that has not been used for the longest period of
time whenever the page required to be replaced?
a) first in first out algorithm
b) additional reference bit algorithm
c) least recently used algorithm
d) counting based page replacement algorithm
9. A process is thrashing if
a) it is spending more time paging than executing
b) it is spending less time paging than executing
c) page fault occurs
d) swapping can not take place
10. Working set model for page replacement is based on the assumption of
a) modularity
b) locality
c) globalization
d) random access

11. Because of virtual memory, the memory can be shared among


a) processes
b) threads
c) instructions
d) none of the mentioned
12. _____ is the concept in which a process is copied into main memory from the
secondary memory according to the requirement.
a) Paging
b) Demand paging
c) Segmentation
d) Swapping

13. The pager concerns with the


a) individual page of a process
b) entire process
c) entire thread
d) first page of a process

14. Swap space exists in


a) primary memory
b) secondary memory
c) CPU
d) none of the mentioned

15. When a program tries to access a page that is mapped in address space but not
loaded in physical memory, then
a) segmentation fault occurs
b) fatal error occurs
c) page fault occurs
d) no error occurs

16. Effective access time is directly proportional to


a) page-fault rate
b) hit ratio
c) memory access time
d) none of the mentioned

17. In FIFO page replacement algorithm, when a page must be replaced


a) oldest page is chosen
b) newest page is chosen
c) random page is chosen
d) none of the mentioned

18. Which algorithm chooses the page that has not been used for the longest period of
time whenever the page required to be replaced?
a) first in first out algorithm
b) additional reference bit algorithm
c) least recently used algorithm
d) counting based page replacement algorithm

19. A process is thrashing if


a) it is spending more time paging than executing
b) it is spending less time paging than executing
c) page fault occurs
d) swapping can not take place

20. Working set model for page replacement is based on the assumption of
a) modularity
b) locality
c) globalization
d) random access

21) A page fault occurs when :


a) a page gives inconsistent data
b) a page cannot be accesses due to its absence from memory
c) a page is invisible
d) All of these
22) When a page fault occurs, the state of the interrupted process is :
a) disrupted
b) invalid
c) saved
d) None of these
23) When a process begins execution with no pages in memory :
a) process execution becomes impossible
b) a page fault occurs for every page brought into memory
c) process causes system crash
d) None of these
24. Which of the following page replacement algorithms suffers from Belady’s
Anomaly ?
a) Optimal replacement
b) LRU
c) FIFO
d) Both optimal replacement and FIFO

25. A process refers to 5 pages, A, B, C, D, E in the order : A, B, C, D, A, B, E, A, B,


C, D, E. If the page replacement algorithm is FIFO, the number of page transfers with
an empty internal store of 3 frames is :
a) 8
b) 10
c) 9
d) 7

26. In question 2, if the number of page frames is increased to 4, then the number of
page transfers :
a) decreases
b) increases
c) remains the same
d) None of these

27. A memory page containing a heavily used variable that was initialized very early
and is in constant use is removed, then the page replacement algorithm used is :
a) LRU
b) LFU
c) FIFO
d) None of these

28. A virtual memory system uses First In First Out (FIFO) page replacement policy
and allocates a fixed number of frames to a process. Consider the following
statements :
P : Increasing the number of page frames allocated to a process sometimes increases
the page fault rate
Q : Some programs do not exhibit locality of reference
Which of the following is TRUE?
a) Both P and Q are true, and Q is the reason for P
b) Both P and Q are true, but Q is not the reason for P
c) P is false but Q is true
d) Both P and Q are false

29. Users _______ that their processes are running on a paged system.
a) are aware
b) are unaware
c) None of these

30. If no frames are free, _____ page transfer(s) is/are required.


a) one
b) two
c) three
d) four

31. When a page is selected for replacement, and its modify bit is set :
a) the page is clean
b) the page has been modified since it was read in from the disk
c) the page is dirty
d) a and b

32. The aim of creating page replacement algorithms is to :


a) replace pages faster
b) increase the page fault rate
c) decrease the page fault rate
d) to allocate multiple pages to processes

33. A FIFO replacement algorithm associates with each page the _______
a) time it was brought into memory
b) size of the page in memory
c) page after and before it
d) All of these

34. Optimal page – replacement algorithm is :


a) Replace the page that has not been used for a long time
b) Replace the page that has been used for a long time
c) Replace the page that will not be used for a long time
d) None of these

35. Optimal page – replacement algorithm is difficult to implement, because :


a) it requires a lot of information
b) it requires future knowledge of the reference string
c) it is too complex
d) it is extremely expensive

36. LRU page – replacement algorithm associates with each page the ______
a) time it was brought into memory
b) the time of that page’s last use
c) page after and before it
d) All of these

37. For 3 page frames, the following is the reference string :


70120304230321201701
i) How many page faults does the LRU page replacement algorithm produce ?
a) 10
b) 15
c) 11
d) 12

ii) How many page faults does the FIFO page replacement algorithm produce ?
a) 10
b) 15
c) 11
d) 12

15) The two methods how LRU page replacement policy can be implemented in
hardware are : (choose two)
a) Counters
b) RAM
c) Stack
d) Registers
38. When using counters to implement LRU, we replace the page with the :
a) smallest time value
b) largest time value
c) greatest size
d) None of the mentioned

39. In the stack implementation of the LRU algorithm, a stack can be maintained in a
manner :
a) whenever a page is used, it is removed from the stack and put on top
b) the bottom of the stack is the LRU page
c) the top of the stack contains the LRU page and all new pages are added to the top
d) None of the mentioned

40. There is a set of page replacement algorithms that can never exhibit Belady’s
Anomaly, called :
a) queue algorithms
b) stack algorithms
c) string algorithms
d) None of the mentioned

41. Applying the LRU page replacement to the following reference string :
12452124
The main memory can accommodate 3 pages and it already has pages 1 and 2. Page 1
came in before page 2.
How many page faults will occur ?
a) 2
b) 3
c) 4
d) 5

42. Increasing the RAM of a computer typically improves performance because:


a) Virtual memory increases
b) Larger RAMs are faster
c) Fewer page faults occur
d) None of the mentioned
43. The essential content(s) in each entry of a page table is / are :
a) Virtual page number
b) Page frame number
c) Both virtual page number and page frame number
d) Access right information
44. The minimum number of page frames that must be allocated to a running process
in a virtual memory environment is determined by :
a) the instruction set architecture
b) page size
c) physical memory size
d) number of processes in memory

45. The reason for using the LFU page replacement algorithm is :
a) an actively used page should have a large reference count
b) a less used page has more chances to be used again
c) it is extremely efficient and optimal
d) All of the mentioned

46. The reason for using the MFU page replacement algorithm is :
a) an actively used page should have a large reference count
b) a less used page has more chances to be used again
c) it is extremely efficient and optimal
d) All of the mentioned

47. The implementation of the LFU and the MFU algorithm is very uncommon
because :
a) they are too complicated
b) they are optimal
c) they are expensive
d) All of the mentioned
48. The minimum number of frames to be allocated to a process is decided by the :
a) the amount of available physical memory
b) Operating System
c) instruction set architecture
d) None of the mentioned
49. When a page fault occurs before an executing instruction is complete :
a) the instruction must be restarted
b) the instruction must be ignored
c) the instruction must be completed ignoring the page fault
d) None of the mentioned

50. Consider a machine in which all memory reference instructions have only one
memory address, for them we need atleast _____ frame(s).
a) one
b) two
c) three
d) None of the mentioned

51. The maximum number of frames per process is defined by :


a) the amount of available physical memory
b) Operating System
c) instruction set architecture
d) None of the mentioned

52. The algorithm in which we split m frames among n processes, to give everyone
an equal share, m/n frames is known as :
a) proportional allocation algorithm
b) equal allocation algorithm
c) split allocation algorithm
d) None of the mentioned

53. The algorithm in which we allocate memory to each process according to its size
is known as :
a) proportional allocation algorithm
b) equal allocation algorithm
c) split allocation algorithm
d) None of the mentioned

7) With either equal or proportional algorithm, a high priority process is treated


___________ a low priority process.
a) greater than
b) same as
c) lesser than
d) None of the mentioned

54. _________ replacement allows a process to select a replacement frame from the
set of all frames, even if the frame is currently allocated to some other process.
a) Local
b) Universal
c) Global
d) Public

55. _________ replacement allows each process to only select from its own set of
allocated frames.
a) Local
b) Universal
c) Global
d) Public

56. One problem with the global replacement algorithm is that :


a) it is very expensive
b) many frames can be allocated to a process
c) only a few frames can be allocated to a process
d) a process cannot control its own page – fault rate

57. ________ replacement generally results in greater system throughput.


a) Local
b) Global
c) Universal
d) Public

58. A process is thrashing if :


a) it spends a lot of time executing, rather than paging
b) it spends a lot of time paging, than executing
c) it has no memory allocated to it
d) None of these
59. Thrashing _______ the CPU utilization.
a) increases
b) keeps constant
c) decreases
d) None of these

60. A locality is :
a) a set of pages that are actively used together
b) a space in memory
c) an area near a set of processes
d) None of these

61. When a subroutine is called,


a) it defines a new locality
b) it is in the same locality from where it was called
c) it does not define a new locality
d) b and c

62. A program is generally composed of several different localities, which _____


overlap.
a) may
b) must
c) do not
d) must not

63. In the working set model, for :


261577775162341234443434441323
if DELTA = 10, then the working set at time t1 (….7 5 1) is :
a) {1, 2, 4, 5, 6}
b) {2, 1, 6, 7, 3}
c) {1, 6, 5, 7, 2}
d) {1, 2, 3, 4, 5}

64. The accuracy of the working set depends on the selection of :


a) working set model
b) working set size
c) memory size
d) number of pages in memory

65. If working set window is too small :


a) it will not encompass entire locality
b) it may overlap several localities
c) it will cause memory problems
d) None of these

66. If working set window is too large :


a) it will not encompass entire locality
b) it may overlap several localities
c) it will cause memory problems
d) None of these

67. If the sum of the working – set sizes increases, exceeding the total number of
available frames :
a) then the process crashes
b) the memory overflows
c) the system crashes
d) the operating system selects a process to suspend

11) Consider the following page reference string :


12342156212376321236
i) For LRU page replacement algorithm with 4 frames, the number of page faults is :
a) 10
b) 14
c) 8
d) 11

ii) For LRU page replacement algorithm with 5 frames, the number of page faults is :
a) 10
b) 14
c) 8
d) 11
iii) For FIFO page replacement algorithms with 3 frames, the number of page faults is
:
a) 16
b) 15
c) 14
d) 11

iv) For FIFO page replacement algorithms with 4 frames, the number of page faults is
:
a) 16
b) 15
c) 14
d) 11

v) For Optimal page replacement algorithms with 3 frames, the number of page faults
is :
a) 16
b) 15
c) 14
d) 11

vi) For Optimal page replacement algorithms with 5 frames, the number of page
faults is :
a) 6
b) 7
c) 10
d) 9
Chapter 8
I/O SYSTEMS
1) If one or more devices use a common set of wires to communicate with the
computer system, the connection is called ______.
a) CPU
b) Monitor
c) wirefull
d) bus

2) A ____ a set of wires and a rigidly defined protocol that specifies a set of messages
that can be sent on the wires.
a) port
b) node
c) bus
d) None of these

3) When device A has a cable that plugs into device B, and device B has a cable that
plugs into device C and device C plugs into a port on the computer, this arrangement
is called a _________.
a) port
b) daisy chain
c) bus
d) cable

4) The _________ present a uniform device-access interface to the I/O subsystem,


much as system calls provide a standard interface between the application and the
operating system.
a) devices
b) buses
c) device drivers
d) I/O systems

5) A ________ is a collection of electronics that can operate a port, a bus, or a device.


a) controller
b) driver
c) host
d) bus

6) An I/O port typically consists of four registers status, control, ________ and
________ registers.
a) system in, system out
b) data in, data out
c) flow in, flow out
d) input, output

7) The ______ register is read by the host to get input.


a) flow in
b) flow out
c) data in
d) data out

8) The ______ register is written by the host to send output.


a) status
b) control
c) data in
d) data out

9) The hardware mechanism that allows a device to notify the CPU is called
_______.
a) polling
b) interrupt
c) driver
d) controlling

10) The CPU hardware has a wire called __________ that the CPU senses after
executing every instruction.
a) interrupt request line
b) interrupt bus
c) interrupt receive line
d) interrupt sense line
11) The _________ determines the cause of the interrupt, performs the necessary
processing and executes a return from the interrupt instruction to return the CPU to
the execution state prior to the interrupt.
a) interrupt request line
b) device driver
c) interrupt handler
d) All of these

12) In general the two interrupt request lines are :


a) nonmaskable interrupt
b) blocked interrupt
c) maskable interrupt
d) None of these

13) The _________ are reserved for events such as unrecoverable memory errors.
a) nonmaskable interrupts
b) blocked interrupts
c) maskable interrupts
d) None of these
1) The ________ can be turned off by the CPU before the execution of critical
instruction sequences that must not be interrupted.
a) nonmaskable interrupt
b) blocked interrupt
c) maskable interrupt
d) None of these

2) The __________ is used by device controllers to request service.


a) nonmaskable interrupt
b) blocked interrupt
c) maskable interrupt
d) None of these

3) The interrupt vector contains :


a) the interrupts
b) the memory addresses of specialized interrupt handlers
c) the identifiers of interrupts
d) the device addresses

4) Division by zero, accessing a protected or non existent memory address, or


attempting to execute a privileged instruction from user mode are all categorized as
________.
a) errors
b) exceptions
c) interrupt handlers
d) All of these

5) For large data transfers, _________ is used.


a) DMA
b) programmed I/O
c) controller register
d) None of these

6) A character stream device transfers :


a) bytes one by one
b) block of bytes as a unit
c) with unpredictable response times
d) None of these

7) A block device transfers :


a) bytes one by one
b) block of bytes as a unit
c) with unpredictable response times
d) None of these

8) A dedicated device is : (choose all that apply)


a) opposite to a sharable device
b) same as a sharable device
c) can be used concurrently by several processes
d) cannot be used concurrently by several processes

9) A keyboard is an example of a device that is accessed through a __________


interface.
a) block stream
b) set of blocks
c) character stream
d) None of these

10) In polling :
a) busy – wait cycles wait for I/O from device
b) interrupt handler receives interrupts
c) interrupt-request line is triggered by I/O device
d) All of these

11) A non blocking system call _________________.


a) halts the execution of the application for an extended time
b) does not halt the execution of the application
c) does not block the interrupts
d) None of these

12) An asynchronous call :


a) returns immediately, without waiting for the I/O to complete
b) does not return immediately and waits for the I/O to complete
c) consumes a lot of time
d) is too slow
1) Buffering is done to :
a) cope with device speed mismatch
b) cope with device transfer size mismatch
c) maintain copy semantics
d) All of these

2) Caching is ________ spooling.


a) same as
b) not the same as
c) None of these

3) Caching : (choose all that apply)


a) holds a copy of the data
b) is fast memory
c) holds the only copy of the data
d) holds output for a device

4) Spooling : (choose all that apply)


a) holds a copy of the data
b) is fast memory
c) holds the only copy of the data
d) holds output for a device

5) The ________ keeps state information about the use of I/O components.
a) CPU
b) OS
c) kernel
d) shell

6) The kernel data structures include :


a) process table
b) open file table
c) close file table
d) All of these

7) Windows NT uses a __________ implementation for I/O


a) message – passing
b) draft – passing
c) secondary memory
d) cache

8) A ________ is a full duplex connection between a device driver and a user level
process.
a) bus
b) I/O operation
c) stream
d) flow

9) I/O is a _________ in system performance.


a) major factor
b) minor factor
c) does not matter
d) None of these

10) If the number of cycles spent busy – waiting is not excessive, then :
a) interrupt driven I/O is more efficient than programmed I/O
b) programmed I/O is more efficient than interrupt driven I/O
c) Both programmed and interrupt driven I/O are equally efficient
d) None of these
Operating System Concepts

Class TE CSE Semester-I


Multiple Choice Questions

UNIT-1 (Introduction)

1. What is operating system?

a) collection of programs that manages hardware resources


b) system service provider to the application programs
c) link to interface the hardware and application programs
d) all of the mentioned

2. When a computer is first turned on or restarted, a special type of absolute loader called is executed
a) Compile and Go loader b) Boot loader
c) Bootstrap loader d) Relating loader

3. To access the services of operating system, the interface is provided by the


a) System calls b) API
c) Library d) Assembly instructions

4. Which one of the following error will be handling by the operating system?
a) Power failure b) lack of paper in printer
c) connection failure in the network d) all of the mentioned

5. By operating system, the resource management can be done via


a) time division multiplexing b) space division multiplexing
c) both time and space division multiplexing d) none of the mentioned

6. What is the function of an operating system?


a) Manages computer’s resources very efficiently b) Takes care of scheduling jobs for execution
c) Manages the flow of data and instructions d) All of the above

7. In a time-sharing operating system, when the time slot given to a process is completed, the process goes from
the running state to the :
a) Blocked state b) Ready state
c) Suspended state d) Terminated state
UNIT-2 (Process)

1. The systems which allows only one process execution at a time, are called
a) uniprogramming systems b) uniprocessing systems
c) unitasking systems d) none of the mentioned

2. In operating system, each process has its own


a) address space and global variables b) open files
c) pending alarms, signals and signal handlers d) all of the mentioned

3. A process can be terminated due to


a) normal exit b) fatal error
c) killed by another process d) all of the mentioned

4. What is the ready state of a process?


a) when process is scheduled to run after some execution
b) when process is unable to run until some task has been completed
c) when process is using the CPU
d) none of the mentioned

5. A set of processes is deadlock if


a) each process is blocked and will remain so forever b) each process is terminated
c) all processes are trying to kill each other d) none of the mentioned

6. A process stack does not contain


a) Function parameters b) Local variables
c) Return addresses d) PID of child process

7. Which system call returns the process identifier of a terminated child?


a) Wait b) exit
c) fork d) get

8. The address of the next instruction to be executed by the current process is provided by the
a) CPU registers b) Program counter
c) Process stack d) Pipe
UNIT-3 (Process Scheduling)

1. Which of the following do not belong to queues for processes?


a) Job Queue b) PCB queue
c) Device Queue d) Ready Queue

2. When the process issues an I/O request :


a) It is placed in an I/O queue b) It is placed in a waiting queue
c) It is placed in the ready queue d) It is placed in the Job queue

3. When a process terminates :


a) It is removed from all queues b) It is removed from all, but the job queue
c) Its process control block is de-allocated d) Its process control block is never de-allocated

4. What is a long-term scheduler?


a) It selects which process has to be brought into the ready queue
b) It selects which process has to be executed next and allocates CPU
c) It selects which process to remove from memory by swapping
d) None of the mentioned

5. What is a medium-term scheduler?


a) It selects which process has to be brought into the ready queue
b) It selects which process has to be executed next and allocates CPU
c) It selects which process to remove from memory by swapping
d) None of the mentioned

6. The only state transition that is initiated by the user process itself is :
a) block b) wakeup
c) dispatch d) none of the mentioned

7. In a multiprogramming environment :
a) the processor executes more than one process at a time
b) the programs are developed by more than one person
c) more than one process resides in the memory
d) a single user can execute many programs at the same time

8. Suppose that a process is in “Blocked” state waiting for some I/O service. When the service is
completed, it goes to the :
a) Running state b) Ready state
c) Suspended state d) Terminated state
UNIT-4 (Inter-process synchronization)

1. Which process can be affected by other processes executing in the system?


a) cooperating process b) child process
c) parent process d) init process

2. When several processes access the same data concurrently and the outcome of the execution
depends on the particular order in which the access takes place, is called
a) dynamic condition b) race condition
c) essential condition d) critical condition

3. If a process is executing in its critical section, then no other processes can be executing in their
critical section. This condition is called
a) mutual exclusion b) critical exclusion
c) synchronous exclusion d) asynchronous exclusion

4. Which one of the following is a synchronization tool?


a) thread b) pipe
c) semaphore d) socket

5. A semaphore is a shared integer variable


a) that cannot drop below zero b) that cannot be more than zero
c) that cannot drop below one d) that cannot be more than one

6. Mutual exclusion can be provided by the


a) mutex locks b) binary semaphores
c) both mutex locks and binary semaphores d) none of the mentioned

7. Process synchronization can be done on


a) hardware level b) software level
c) both hardware and software level d) none of the mentioned

8. A monitor is a module that encapsulates


a) shared data structures
b) procedures that operate on shared data structure
c) synchronization between concurrent procedure invocation
d) all of the mentioned

9. To enable a process to wait within the monitor,


a) a condition variable must be declared as condition
b) condition variables must be used as boolean objects
c) semaphore must be used
d) all of the mentioned
UNIT-5 (Deadlocks)

1. What is the reusable resource?


a) that can be used by one process at a time and is not depleted by that use
b) that can be used by more than one process at a time
c) that can be shared between various threads
d) none of the mentioned

2. Which of the following condition is required for deadlock to be possible?


a) mutual exclusion
b) a process may hold allocated resources while awaiting assignment of other resources
c) no resource can be forcibly removed from a process holding it
d) all of the mentioned

3. The circular wait condition can be prevented by


a) defining a linear ordering of resource types b) using thread
c) using pipes d) all of the mentioned

4. Which one of the following is the deadlock avoidance algorithm?


a) banker’s algorithm b) round-robin algorithm
c) elevator algorithm d) karn’s algorithm

5. A problem encountered in multitasking when a process is perpetually denied necessary resources is


called
a) deadlock b) starvation
c) inversion d) aging

6. Which one of the following is a visual (mathematical) way to determine the deadlock occurrence?
a) resource allocation graph b) starvation graph
c) inversion graph d) none of the mentioned

7. To avoid deadlock
a) there must be a fixed number of resources to allocate
b) resource allocation must be done only once
c) all deadlocked processes must be aborted
d) inversion technique can be used

8. What is the drawback of banker’s algorithm?


a) in advance processes rarely know that how much resource they will need
b) the number of processes changes as time progresses
c) resource once available can disappear
d) all of the mentioned
UNIT-6 (Memory Management)

1. CPU fetches the instruction from memory according to the value of


a) program counter b) status register
c) instruction register d) program status word

2. A memory buffer used to accommodate a speed differential is called


a) stack pointer b) cache
c) accumulator d) disk buffer

3. Which one of the following is the address generated by CPU?


a) physical address b) absolute address
c) logical address d) none of the mentioned

4. Run time mapping from virtual to physical address is done by


a) Memory management unit b) CPU
c) PCI d) None of the mentioned

5. Memory management technique in which system stores and retrieves data from secondary storage for
use in main memory is called
a) fragmentation b) paging
c) mapping d) none of the mentioned

6. The address of a page table in memory is pointed by


a) stack pointer b) page table base register
c) page register d) program counter

7. Program always deals with


a) logical address b) absolute address
c) physical address d) relative address

8. The page table contains


a) base address of each page in physical memory b) page offset
c) page size d) none of the mentioned

9. What is compaction?
a) a technique for overcoming internal fragmentation
b) a paging technique
c) a technique for overcoming external fragmentation
d) a technique for overcoming fatal error
UNIT-7 (Virtual Memory)

1. Because of virtual memory, the memory can be shared among


a) processes b) threads
c) instructions d) none of the mentioned

2. is the concept in which a process is copied into main memory from the secondary memory
according to the requirement.
a) Paging b) Demand paging
c) Segmentation d) Swapping

3. The pager concerns with the


a) individual page of a process b) entire process
c) entire thread d) first page of a process

4. Swap space exists in


a) primary memory b) secondary memory
c) CPU d) none of the mentioned

5. When a program tries to access a page that is mapped in address space but not loaded in physical
memory, then
a) segmentation fault occurs b) fatal error occurs
c) page fault occurs d) no error occurs

6. Effective access time is directly proportional to


a) page-fault rate b) hit ratio
c) memory access time d) none of the mentioned

7. In FIFO page replacement algorithm, when a page must be replaced


a) oldest page is chosen b) newest page is chosen
c) random page is chosen d) none of the mentioned

8. A process is thrashing if
a) it is spending more time paging than executing
b) it is spending less time paging than executing
c) page fault occurs
d) swapping cannot take place

9. Working set model for page replacement is based on the assumption of


a) modularity b) locality
c) globalization d) random access
UNIT-8 (IO System)

1. If one or more devices use a common set of wires to communicate with the computer system, the
connection is called
a) CPU b) Monitor
c) Wirefull d) Bus

2. A a set of wires and a rigidly defined protocol that specifies a set of messages that can be sent on
the wires.
a) port b) node
c) bus d) none of the mentioned

3. The present a uniform device-access interface to the I/O subsystem, much as system calls
provide a standard interface between the application and the operating system.
a) Devices b) Buses
c) Device drivers d) I/O systems

4. A is a collection of electronics that can operate a port, a bus, or a device.


a) controller b) driver
c) host d) bus

5. An I/O port typically consists of four registers status, control, and registers.
a) system in, system out b) data in, data out
c) flow in, flow out d) input, output

6. The register is read by the host to get input.


a) flow in b) flow out
c) data in d) data out

7. The hardware mechanism that allows a device to notify the CPU is called
a) polling b) interrupt
c) driver d) controlling

8. The CPU hardware has a wire called that the CPU senses after executing every
instruction.
a) interrupt request line b) interrupt bus
c) interrupt receive line d) interrupt sense line
GATE QUESTIONS (LOW LEVEL)

1. Which of the following is NOT a valid deadlock prevention scheme?


(a) Release all resources before requesting a new resource
(b) Number the resources uniquely and never request a lower numbered resource than
the last one requested
(c) Never request a resource after releasing any resource
(d) Request and all required resources be allocated before execution.

2. Let m[0]…m[4] be mutexes (binary semaphores) and P[0] …. P[4] be processes.


Suppose each process P[i] executes the following:
wait (m[i]); wait(m[(i+1) mode 4]);
------
release (m[i]); release (m[(i+1)mod 4]);

This could cause


(a) Thrashing
(b) Deadlock
(c) Starvation, but not deadlock
(d) None of the above

3. A graphics card has on board memory of 1 M(B) Which of the following modes can the card
not support?
(a) 1600 x 400 resolution with 256 colours on a 17 inch monitor
(b) 1600 x 400 resolution with 16 million colours on a 14 inch monitor
(c) 800 x 400 resolution with 16 million colours on a 17 inch monitor
(d) 800 x 800 resolution with 256 colours on a 14 inch monitor

4. Consider a virtual memory system with FIFO page replacement policy. For an arbitrary page
access pattern, increasing the number of page frames in main memory will
a) Always decrease the number of page faults
b) Always increase the number of page faults
c) Sometimes increase the number of page faults
d) Never affect the number of page faults

5. Which of the following requires a device driver?


a) Register
b) Cache
c) Main memory
d) Disk

6. Consider a machine with 64 MB physical memory and a 32-bit virtual address space. If the
page size is 4KB, what is the approximate size of the page table?
(a) 16 MB
(b) 8 MB
(c) 2 MB
(d) 24 MB
7. Consider Peterson’s algorithm for mutual exclusion between two concurrent processes i
and j. The program executed by process is shown below.
repeat
flag [i] = true;
turn = j;
While (P) do no-op;
Enter critical section, perform actions, then exit critical section
flag [ i ] = false;
Perform other non-critical section actions.
until false;
For the program to guarantee mutual exclusion, the predicate P in the while loop should be
a) flag [j] = true and turn = i
b) flag [j] = true and turn = j
c) flag [i] = true and turn = j
d) flag [i] = true and turn = i
8. More than one word are put in one cache block to
(a) exploit the temporal locality of reference in a program
(b) exploit the spatial locality of reference in a program
(c) reduce the miss penalty
(d) none of the above

9. Which of the following statements is false?


a) Virtual memory implements the translation of a program’s address space into physical
memory address space
b) Virtual memory allows each program to exceed the size of the primary memory
c) Virtual memory increases the degree of multiprogramming
d) Virtual memory reduces the context switching overhead

10. Consider a set of n tasks with known runtimes r1, r2, … rn to be run on a uniprocessor
machine. Which of the following processor scheduling algorithms will result in the
maximum throughput? (GATE 2001)
(a) Round-Robin
(b) Shortest-Job-First
(c) Highest-Response-Ratio-Next
(d) First-Come-First-Served

11. Suppose the time to service a page fault is on the average 10 milliseconds, while a memory
access takes 1 microsecond. Then a 99.99% hit ratio results in average memory access time
of
(a) 1.9999 milliseconds
(b) 1 millisecond
(c) 9.999 microseconds
(d) 1.9999 microseconds
12. Which of the following need not necessarily be saved on a context switch between
processes?
(a) General purpose registers
(b) Translation look-aside buffer
(c) Program counter
(d) All of the above

13. Where does the swap space reside?


(a) RAM
(b) Disk
(c) ROM
(d) On-chip cache

14. Which of the following does not interrupt a running process?


(a) A device
(b) Timer
(c) Scheduler process
(d) Power failure

15. Which of the following scheduling algorithms is non-preemptive?


a) Round Robin
b) First-In First-Out
c) Multilevel Queue Scheduling
d) Multilevel Queue Scheduling with Feedback

16. Using a larger block size in a fixed block size file system leads to
a) better disk throughput but poorer disk space utilization
b) better disk throughput and better disk space utilization
c) poorer disk throughput but better disk space utilization
d) poorer disk throughput and poorer disk space utilization
17. Consider the following statements with respect to user-level threads and kernel supported
threads
i. context switch is faster with kernel-supported threads
ii. for user-level threads, a system call can block the entire process
iii. Kernel supported threads can be scheduled independently
iv. User level threads are transparent to the kernel
which of the above statements are true?
a) (ii), (iii) and (iv) only
b) (ii) and (iii) only
c) (i) and (iii) only
d) (i) and (ii) only

18. The minimum number of page frames that must be allocated to a running process in a
virtual memory environment is determined by
a) the instruction set architecture
b) page size
c) physical memory size
d) number of processes in memory

19. In a system with 32 bit virtual addresses and 1 KB page size, use of one-level page tables for
virtual to physical address translation is not practical because of
a) the large amount of internal fragmentation
b) the large amount of external fragmentation
c) the large memory overhead in maintaining page tables
d) the large computation overhead in the translation process

20. A process executes the code


fork ();
fork ();
fork ();
The total number of child processes created is
(A) 3
(B) 4
(C) 7
(D) 8

21. Consider the 3 processes, P1, P2 and P3 shown in the table


Process Arrival time Time unit required
P1 0 5
P2 1 7
P3 3 4
The completion order of the 3 processes under the policies FCFS and RRS (round robin
scheduling with CPU quantum of 2 time units) are
(A) FCFS: P1, P2, P3 RR2: P1, P2, P3
(B) FCFS: P1, P3, P2 RR2: P1, P3, P2
(C) FCFS: P1, P2, P3 RR2: P1, P3, P2
(D) FCFS: P1, P3, P2 RR2: P1, P2, P3

22. Consider the virtual page reference string 1, 2, 3, 2, 4, 1, 3, 2, 4, 1


On a demand paged virtual memory system running on a computer system that main
memory size of 3 pages frames which are initially empty. Let LRU, FIFO and OPTIMAL
denote the number of page faults under the corresponding page replacements policy. Then
(A) OPTIMAL < LRU < FIFO
(B) OPTIMAL < FIFO < LRU
(C) OPTIMAL = LRU
(D) OPTIMAL = FIFO

23. A file system with 300 GByte uses a file descriptor with 8 direct block address. 1 indirect
block address and 1 doubly indirect block address. The size of each disk block is 128 Bytes
and the size of each disk block address is 8 Bytes. The maximum possible file size in this file
system is
(A) 3 Kbytes
(B) 35 Kbytes
(C) 280 Bytes
(D) Dependent on the size of the disk

24. A thread is usually defined as a ‘light weight process’ because an operating system (OS)
maintains smaller data structures for a thread than for a process. In relation to this, which of
the followings is TRUE?
(A) On per-thread basis, the OS maintains only CPU register state
(B) The OS does not maintain a separate stack for each thread
(C) On per-thread basis, the OS does not maintain virtual memory state
(D) On per thread basis, the OS maintains only scheduling and accounting information.

25. Let the page fault service time be 10ms in a computer with average memory access time
being 20ns. If one page fault is generated for every 10^6 memory accesses, what is the
effective access time for the memory?
(A) 21ns
(B) 30ns
(C) 23ns
(D) 35ns
GATE QUESTIONS (MEDIUM LEVEL)

1. An application loads 100 libraries at startup. Loading each library requires exactly one disk
access. The seek time of the disk to a random location is given as 10ms. Rotational speed of
disk is 6000rpm. If all 100 libraries are loaded from random locations on the disk, how long
does it take to load all libraries? (The time to transfer data from the disk block once the
head has been positioned at the start of the block may be neglected)
(A) 0.50s
(B) 1.50s
(C) 1.25s
(D) 1.00s

2. Consider the following table of arrival time and burst time for three processes P0, P1 and
P2.
Process Arrival time Burst Time
P0 0 ms 9 ms
P1 1 ms 4 ms
P2 2 ms 9 ms
The pre-emptive shortest job first scheduling algorithm is use(D) Scheduling is carried out
only at arrival or completion of processes. What is the average waiting time for the three
processes?
(A) 5.0 ms
(B) 4.33 ms
(C) 6.33 ms
(D) 7.33 ms

3. Let the time taken to switch between user and kernel modes of execution be t1 while the
time taken to switch between two processes be t2. Which of the following is TRUE?
(A) t1 > t2
(B) t1 = t2
(C) t1 < t2
(D) Nothing can be said about the relation between t1 and t2

4. A system uses FIFO policy for page replacement. It has 4 page frames with no pages loaded
to begin with. The system first accesses 100 distinct pages in some order and then access
the same 100 pages but now in the reverse order. How many page faults will occur?
(A) 196
(B) 192
(C) 197
(D) 195

5. Which of the following statements are true?


I. Shortest remaining time first scheduling may cause starvation
II. Preemptive scheduling may cause starvation
III. Round robin is better than FCFS in terms of response time
(A) I only
(B) I and III only
(C) II and III only
(D) I, II and III

6. Consider the methods used by processes P1 and P2 for accessing their critical sections
whenever needed, as given below. The initial values of shared boolean variables S1 and S2
are randomly assigne(D)
Method Used by P1
while (S1 == S2) ;
Critica1 Section
S1 = S2;

Method Used by P2
while (S1 != S2) ;
Critica1 Section
S2 = not (S1);
Which one of the following statements describes the properties achieved? (GATE CS 2010)
(A) Mutual exclusion but not progress
(B) Progress but not mutual exclusion
(C) Neither mutual exclusion nor progress
(D) Both mutual exclusion and progress

7. In which one of the following page replacement policies, Belady’s anomaly may occur?
(A) FIFO
(B) Optimal
(C) LRU
(D) MRU

8. The essential content(s) in each entry of a page table is / are


(A) Virtual page number
(B) Page frame number
(C) Both virtual page number and page frame number
(D) Access right information

9. Consider a system with 4 types of resources R1 (3 units), R2 (2 units), R3 (3 units), R4 (2


units). A non-preemptive resource allocation policy is use(D) At any given instance, a
request is not entertained if it cannot be completely satisfie(D) Three processes P1, P2, P3
request the sources as follows if executed independently.
Process P1:
t=0: requests 2 units of R2
t=1: requests 1 unit of R3
t=3: requests 2 units of R1
t=5: releases 1 unit of R2
and 1 unit of R1.
t=7: releases 1 unit of R3
t=8: requests 2 units of R4
t=10: Finishes

Process P2:
t=0: requests 2 units of R3
t=2: requests 1 unit of R4
t=4: requests 1 unit of R1
t=6: releases 1 unit of R3
t=8: Finishes

Process P3:
t=0: requests 1 unit of R4
t=2: requests 2 units of R1
t=5: releases 2 units of R1
t=7: requests 1 unit of R2
t=8: requests 1 unit of R3
t=9: Finishes
Which one of the following statements is TRUE if all three processes run concurrently
starting at time t=0?
(A) All processes will finish without any deadlock
(B) Only P1 and P2 will be in deadlock.
(C) Only P1 and P3 will be in a deadlock.
(D) All three processes will be in deadlock

10. Consider a disk system with 100 cylinders. The requests to access the cylinders occur in
following sequence: 4, 34, 10, 7, 19, 73, 2, 15, 6, 20
Assuming that the head is currently at cylinder 50, what is the time taken to satisfy all
requests if it takes 1ms to move from one cylinder to adjacent one and shortest seek time
first policy is used?
(A) 95ms
(B) 119ms
(C) 233ms
(D) 276ms
11. The enter_CS() and leave_CS() functions to implement critical section of a process are
realized using test-and-set instruction as follows:
void enter_CS(X)
{
while test-and-set(X) ;
}
void leave_CS(X)
{
X = 0;
}
In the above solution, X is a memory location associated with the CS and is initialized to 0.
Now consider the following statements:
I. The above solution to CS problem is deadlock-free
II. The solution is starvation free.
III. The processes enter CS in FIFO order.
IV More than one process can enter CS at the same time.
Which of the above statements is TRUE?
(A) I only
(B) I and II
(C) II and III
(D) IV only

12. A multilevel page table is preferred in comparison to a single level page table for translating
virtual address to physical address because
(A) It reduces the memory access time to read or write a memory location.
(B) It helps to reduce the size of page table needed to implement the virtual address space
of a process.
(C) It is required by the translation lookaside buffer.
(D) It helps to reduce the number of page faults in page replacement algorithms.
13. The data blocks of a very large file in the Unix file system are allocated using
(A) contiguous allocation
(B) linked allocation
(C) indexed allocation
(D) an extension of indexed allocation

14. The P and V operations on counting semaphores, where s is a counting semaphore, are
defined as follows:
P(s) : s = s - 1;
if (s < 0) then wait;
V(s) : s = s + 1;
if (s <= 0) then wakeup a process waiting on s;
Assume that Pb and Vb the wait and signal operations on binary semaphores are provide(D)
Two binary semaphores Xb and Yb are used to implement the semaphore operations P(s)
and V(s) as follows:
P(s): Pb (Xb);
s = s - 1;
if (s < 0) {
Vb (Xb);
Pb (Yb) ;
}
else Vb(Xb);

V(s): Pb (Xb) ;
s = s + 1;
if (s <= 0) Vb(Yb) ;
Vb (Xb) ;
The initial values of Xb and Yb are respectively
(A) 0 and 0
(B) 0 and 1
(C) 1 and 0
(D) 1 and 1
15. Which of the following statements about synchronous and asynchronous I/O is NOT true?
(A) An ISR is invoked on completion of I/O in synchronous I/O but not in asynchronous I/O
(B) In both synchronous and asynchronous I/O, an ISR (Interrupt Service Routine) is
invoked after completion of the I/O
(C) A process making a synchronous I/O call waits until I/O is complete, but a process
making an asynchronous I/O call does not wait for completion of the I/O
(D) In the case of synchronous I/O, the process waiting for the completion of I/O is woken
up by the ISR that is invoked after the completion of I/O

16. A process executes the following code


for (i = 0; i < n; i++) fork();
The total number of child processes created is
(A) n
(B) 2n - 1
(C) 2n
(D) 2(n+1) - 1;

17. Which of the following is NOT true of deadlock prevention and deadlock avoidance
schemes?
(A) In deadlock prevention, the request for resources is always granted if the resulting state
is safe
(B) In deadlock avoidance, the request for resources is always granted if the result state is
safe
(C) Deadlock avoidance is less restrictive than deadlock prevention
(D) Deadlock avoidance requires knowledge of resource requirements a priori

18. A processor uses 36 bit physical addresses and 32 bit virtual addresses, with a page frame
size of 4 Kbytes. Each page table entry is of size 4 bytes. A three level page table is used for
virtual to physical address translation, where the virtual address is used as follows
• Bits 30-31 are used to index into the first level page table
• Bits 21-29 are used to index into the second level page table
• Bits 12-20 are used to index into the third level page table, and
• Bits 0-11 are used as offset within the page
The number of bits required for addressing the next level page table (or page frame) in the
page table entry of the first, second and third level page tables are respectively
(A) 20, 20 and 20
(B) 24, 24 and 24
(C) 24, 24 and 20
(D) 25, 25 and 24

19. Consider a disk pack with 16 surfaces, 128 tracks per surface and 256 sectors per track. 512
bytes of data are stored in a bit serial manner in a sector. The capacity of the disk pack and
the number of bits required to specify a particular sector in the disk are respectively:
(A) 256 Mbyte, 19 bits
(B) 256 Mbyte, 28 bits
(C) 512 Mbyte, 20 bits
(D) 64 Gbyte, 28 bits

20. Group 1 contains some CPU scheduling algorithms and Group 2 contains some applications.
Match entries in Group 1 to entries in Group 2.
Group I Group II
(P) Gang Scheduling (1) Guaranteed Scheduling
(Q) Rate Monotonic Scheduling (2) Real-time Scheduling
(R) Fair Share Scheduling (3) Thread Scheduling

(A) P – 3 Q – 2 R – 1
(B) P – 1 Q – 2 R – 3
(C) P – 2 Q – 3 R – 1
(D) P – 1 Q – 3 R – 2
21. An operating system uses Shortest Remaining Time first (SRT) process scheduling
algorithm. Consider the arrival times and execution times for the following processes:
Process Execution time Arrival time
P1 20 0
P2 25 15
P3 10 30
P4 15 45
What is the total waiting time for process P2?
(A) 5
(B) 15
(C) 40
(D) 55

22. A virtual memory system uses First In First Out (FIFO) page replacement policy and
allocates a fixed number of frames to a process. Consider the following statements:
P: Increasing the number of page frames allocated to a process sometimes increases the
page fault rate.
Q: Some programs do not exhibit locality of reference. Which one of the following is TRUE?
(A) Both P and Q are true, and Q is the reason for P
(B) Both P and Q are true, but Q is not the reason for P.
(C) P is false, but Q is true
(D) Both P and Q are false.

23. A single processor system has three resource types X, Y and Z, which are shared by three
processes. There are 5 units of each resource type. Consider the following scenario, where
the column alloc denotes the number of units of each resource type allocated to each
process, and the column request denotes the number of units of each resource type
requested by a process in order to complete execution. Which of these processes will finish
LAST?
alloc request X Y Z X Y Z P0 1 2 1 1 0 3 P1 2 0 1 0 1 2 P2 2 2 1 1 2 0
(A) P0
(B) P1
(C) P2
(D) None of the above, since the system is in a deadlock

24. Two processes, P1 and P2, need to access a critical section of code. Consider the following
synchronization construct used by the processes: Here, wants1 and wants2 are shared
variables, which are initialized to false. Which one of the following statements is TRUE
about the above construct?
/* P1 */
While (true)
{
wants1 = true; while (wants2 == true);
/* Critical Section */
wants1=false;
/* Remainder section */
/* P2 */
while (true)
{
wants2 = true; while (wants1==true);
/* Critical Section */
wants2 = false;
}
/* Remainder section */
(A) It does not ensure mutual exclusion.
(B) It does not ensure bounded waiting.
(C) It requires that processes enter the critical section in strict alternation.
(D) It does not prevent deadlocks, but ensures mutual exclusion.
GATE QUESTIONS (HIGH LEVEL)

1. Pre-emptive scheduling, is the strategy of temporarily suspending a running process


(A) Before the CPU time slice expires
(B) to allow starving processes to run
(C) when it requests I/O)
(D) none of the above

2. Mutual exclusion problem occurs


(A) between two disjoint processes that do not interact
(B)among processes that share resources
(C) among processes that do not use the same resource
(D) none of the above

3. Sector interleaving in disks is done by


(A) the disk manufacturer
(B) the disk controller cord
(C) the operating system
(D) none of the above

4. Memory protection is of no use in a


(A) single user system
(B) non-multiprogramming system
(C) non-multitasking system
(D) none of the above

5. Some computer systems support dual mode operation—the user mode and the supervisor or
monitor mode. These refer to the modes
(A) by which user programs handle their data
(B) by which the operating system executes user programs
(C) in which the processor and the associated hardware operate.
(D) of memory access

6. Disk scheduling involves deciding


(A) which disk should be accessed next
(B) the order in which disk access requests must be serviced
(C) the physical location where files should be accessed in the disk
(D) none of the above

7. A computer system has 6 tape drives, with 'n' processes competing for them. Each process may need
3 drives. The maximum value of 'n' for which the system is guaranteed to be deadlock free is
(A) 2
(B)3
(C)4
(D)1

8. Dirty bit is used to show the


(A) Page with corrupted data
(B) Wrong page in the memory
(C) Page that is modified after being loaded into cache memory
(D) Page that is less frequently accessed

9. Fence register is used for


(A) CPU protection
(B) Memory protection
(C) File protection
(D) all of the above

10. Which of the following is a service not supported by the operating system?
(A) Protection
(B) Accounting
(C) Compilation
(D) I/O operation

11. Which of the following statements is false?


(A) Virtual memory implements the translation of a program’s address space into physical memory
address space.
(B) Virtual memory allows each program to exceed the size of the primary memory.
(C) Virtual memory increases the degree of multi-programming
(D) Virtual memory reduces the context switching overhead.

12. Where does the swap space reside?


(A) RAM
(B) Disk
(C) ROM
(D) On-chip cache

13. Consider a virtual memory system with FIFO page replacement policy. For an arbitrary page access
pattern, increasing the number of page frames in main memory will.
(A) Always decrease the number of page faults
(B) Always increase the number of page faults
(C) Sometimes increase the number of page faults
(D) Never affect the number of page faults

14. Consider a machine with 64 MB physical memory and a 32-bit virtual address space. If the page size
is 4 KB, what is the approximate size of the page table?
(A) 16 MB
(B) 8 MB
(C) 2 MB
(D) 24 MB

15. Which of the following scheduling algorithms is non-preemptive?


(A) Round Robin
(B) First-In First-Out
(C) Multilevel Queue Scheduling
(D) Multilevel Queue Scheduling with Feedback

16. The optimal page replacement algorithm will select the page that
(A) Has not been used for the longest time in the past.
(B) Will not be used for the longest time in the future.
(C) Has been used least number of times.
(D) Has been used most number of times

17. Which combination of the following features will suffice to characterize an OS as a multi-
programmed OS?
(A) More than one program may be loaded into main memory at the same time for execution.
(B) If a program waits for certain events such as I/O, another program is immediately scheduled for
execution.
(C) If the execution of a program terminates, another program is immediately scheduled for
execution.
(A) A
(B) A and B
(C) A and C
(D) A, B and C

18. In the index allocation scheme of blocks to a file, the maximum possible size of the file depends on
(A) The size of the blocks, and the size of the address of the blocks
(B) The number of blocks used for the index, and the size of the blocks.
(C) The size of the blocks, the number of blocks used for the index, and the size of the address of
the blocks.
(D) None of the above.

19. Using a larger block size in a fixed block size file system leads to
(A) Better disk throughput but poorer disk space utilization
(B) Better disk throughput and better disk space utilization
(C) Poorer disk throughput but better disk space utilization
(D) Poorer disk throughput and poorer disk space utilization

20. In a system with 32 bit virtual addresses and 1 KB page size, use of one-level page tables for virtual
to physical address translation is not practical because of
(A) The large amount of internal fragmentation
(B) The large amount of external fragmentation
(C) The large memory overhead in maintaining page tables
(D) The large computation overhead in the translation process

21. The minimum number of page frames that must be allocated to a running process in a virtual
memory environment is determined by
(A) The instruction set architecture
(B) Page size
(C) Physical memory size
(D) number of processes in memory

22. Consider a system with a two-level paging scheme in which a regular memory access takes 150
nanoseconds, and servicing a page fault takes 8 milliseconds. An average instruction takes 100
nanoseconds of CPU time, and two memory accesses. The TLB hit ratio is 99%, and the page fault
rate is one in every 10,000 instructions. What is the effective average instruction execution time?
(A) 645 nanoseconds
(B) 1050 nanoseconds
(C) 1215 nanoseconds
(D) 1230 nanoseconds

23. A Unix-style I-node has 10 direct pointers and one single, one double and one triple indirect pointer.
Disk block size is 1 Kbyte, disk block address is 32 bits, and 48-bit integers are used. What is the
maximum possible file size?
(A) 224 bytes
(B) 232 bytes
(C) 234 bytes
(D) 248 bytes

24. Consider three CPU-intensive processes, which require 10,20 and 30 time units and arrive at times
0,2, and 6, respectively. How many context switches are needed if the operating system implements
a shortest remaining time first scheduling algorithm? Do not count the context switches at time zero
and at the end
(A) 1
(B) 2
(C) 3
(D) 4

25. A CPU generates 32-bit virtual addresses. The page size is 4 KB. The processor has a translation
look-aside buffer (TLB) which can hold a total of 128 page table entries and is 4-way set associative.
The minimum size of the TLB tag is
(A) 11 bits
(B) 13 bits
(C) 15 bits
(D) 20 bits

You might also like