You are on page 1of 18

B3.

4-R3: OPERATING SYSTEMS


Previous Question Papers
• Jan, 2006
• July, 2005
• January, 2005
• July, 2004
• January, 2004
• July, 2004 (Old Syllabus)

JANUARY 2006

NOTE:

1. Answer question 1 and any FOUR questions from 2 to 7.


2. Parts of the same question should be answered together and in the same
sequence.

Time: 3 Hours Total Marks: 100

1.a) Does a process incur more execution overhead compared to a thread? Justify
your answer.

b) Distinguish between multiprocessing and multiprogramming.

c) What are the “special files” in Unix?

d) What is the main difference between worm and virus?

e) State the practical limitations of implementing non-preemptive SJF algorithm.

f) What is the difference between a long-term scheduler and a short-term scheduler?

g) How can a single copy of a text editor be used to serve multiple users in a time-sharing
system?

(7x4)

2.a) What is TLB? Find out the effective memory-access time with an 80% hit ratio and
the following access time:
TLB access time: 20ns; MM access time: 100ns

b) Describe the public-key encryption scheme and mention how is it advantageous to the
data-encryption standard.

(8+10)

3.a) Consider the following page reference during a given time interval for a memory
consisting of 5 frames: y,c,z,c,d,a,y,a,e,a,y,f,d,e. Using the i) FIFO replacement strategy
and ii) the LRU replacement strategy compare the results. Repeat both FIFO and LRU
replacement strategies for memory with 3 frames and same page reference pattern.
Comment on the findings and draw a conclusion justifying the adoption of a particular
replacement strategy.

(18)

4.a) What does ‘init’ do? What happens to the parent process id of a child when the
parent terminates before its child? When does a child become ‘zombie’?

b) With reference to Unix when do the following situations occur?

i) Single process table entry contains pointes to the same file table entry.

ii) Different file table entries point to the same i-node table entry.

iii) Shell ‘forks’ a copy of itself and ‘waits’ for the child to terminate.

c) How does CPU time-slice affect the Round-Robin algorithm?

(8+6+4)

. For more questions papers visit www.DoeaccOnline.com, www.IgnouOnline.com

5.a) Show and explain an implementation of the classical producer-consumer (producer


produces an item, keeps it in a buffer from where the consumer is picking it up) problem
using semaphore.

b) What is dynamic loading? Mention its advantage. How is dynamic linking performed?
Mention any disadvantage that you can think of for both the schemes.
(10+8)

6.a) What is meant by a domain and rights on it? Describe a Capability list and ways of
protecting it from user tampering.

b) Rewrite the following code introducing code parallelism wherever applicable:

For i = 1 to k

a(i) = b(i) + c(i)

For j = 1 to k

d(j) = x(j) - y(j)

For p = 1 to k

x(p) = y(p) + b(p)

read(m,n,o,r)

q = m*n + r/o

write(q)

c) Using preemptive SJF (shortest-job-first) algorithm draw the Gannt chart and calculate
the average waiting time for the following processes:

Process Arrival time Burst time

P006

P124

P 2 3 10

P379

(9+4+5)
7.a) Where and how “bit vector/table” is used? What are the advantages and
disadvantages of the technique?

b) What is deadlock? How can deadlock be prevented by not allowing “Hold and Wait” ?
Is it a feasible policy?

c) How can synchronization be achieved when two processes communicate by message


passing?

d) Provide a programming example of multithreading giving improved performance over


a single-threaded solution.

(5+5+5+3)

July, 2005
Note:

1. Answer question 1 and any FOUR questions from 2 to 7.


2. Parts of the same question should be answered together and in the same sequence.

Time: 3 Hours Total Marks:100

1.
1. Point out the architectural features that must be present in order to support
a Multi Programming Operating System along with proper justification.
2. Suppose a new user wishes to do high level programming on a multi user
computer system. The source code has already been developed on paper
but the source file is yet to be created on disk. The system is already
powered on. Specify, in brief, all the underlying system software that gets
involved from the moment the new user logs on, to the point an .EXE file
is created on Disk.
3. Enforcing mutual exclusion with respect to a set of Re-Usable resources
does not guarantee elimination of Starvation. Justify or refute this claim by
an Example.
4. What are the various modes that can be used to perform Static Address
binding? What are the pros & cons of such Static Address binding?
5. List out some of the possible mechanisms/situations that can bring any
user process from running State to Ready State in a Multitasking
Operating System.
6. Illustrate the notions of temporal locality of reference as well as spatial
locality of reference in a high level program by some example.
7. How can a CPU be brought from user mode to Kernel mode? How it can
be brought back from the Kernel Mode to User mode? Justify your
answer.

(7x4)

2.
1. Distinguish among the following means of invoking an executable code.
1. The Execute command as available in the Operating System.
2. The CALL instruction as provided in the Assembly Instruction Set.
3. A system call provided to invoke Operating System services.
4. Invocation caused due to an erroneous computation condition like
division by zero.
5. A code invoked due to servicing of hardware interrupt coming
from a peripheral device.
2. Apart from all the above features, what other hardware support(s) [if nay]
are needed to implement a Time Shared Operating system that also has a
high speed peripheral like the disk drive? Justify your answer.

(15+3)

3. Consider a typical Ready queue status of a computer system having a single


processor with support for multiprogramming as given below.

Arrival Service
Process Priority
Time in time In
No. No
units units
P0 5 100 3
P1 15 200 5
P2 13 250 1
P3 8 50 2
P4 20 300 4

4. Assume the following:


1. The Context switching time among the processes as well as between any
process and the dispatcher = 5 units (fixed).
2. No Context switching time gets wasted to change the execution status
from the dispatcher to the dispatched process.
3. Dispatcher Execution time = 10 units (fixed). This Dispatcher has to
execute once before any new process gets running.
4. Enqueuing Time can be ignored.
5. No preemption of any process is allowed.
For the Process Mix specified previously, compare the performances of the
following non-preemptive scheduling policies in a manner illustrated later

6. First come First Served (F.C.F.S).


7. Priority based. [Assuming lower Priority Number implies high priority].
8. Shortest Job First (S.J.F).
9. Specify the GANTT Chart.
10. Compute the average Turn around time(s) of the processes.
11. Compute the average Waiting time(s) of the processes.

(6x3)

5.
1. Consider a Computing environment where a process is given the privilege
of accessing an object only n times. Suggest a scheme for implementing
this policy.
2. What are the necessary & sufficient conditions for a deadlock to occur
involving concurrently non- sharable & reusable resources? Out of these
which one is best suited to implement deadlock prevention mechanism?
Justify your answer with reference to the Dining Philosophers' Problem
that involves four (4) philosophers.
3. Consider the following snapshot of a system.

Process Current Resource Maximum Resource Resource


No. Allocation Requirement Available
P0 0 0 1 2 0 0 1 2 0 3 2 0
P1 1 0 0 0 1 7 5 0
P2 1 3 5 4 2 3 5 6
P3 0 6 3 2 0 6 5 2
P4 0 0 1 4 0 6 5 6

4. Answer the following.


1. Is the system in a safe state? Verify your answer.
2. If a request from P4 arrives for (0 | 3 | 2 | 0) can the request be
immediately granted? Justify your answer.

(6+7+[3+2])

6.
1. Demonstrate that monitors, conditional critical regions and semaphores
are all equivalent, in so far as the same type of synchronization problems
can be implemented with them.
2. Discuss a means by which managers of system connected to the Internet
could have designed their systems to limit or eliminate the damage done
by the worm. What are the drawbacks of making the change that you
suggest?
3. What protection problems may arise if a shared stack is used for parameter
passing?

(7+7+4)

7.
1. Suppose the Operating System would like to mark a frame (main memory
copy of a page) as Execute only i.e. Reading & Writing on that page/frame
is not allowed. What feature of the System Architecture is needed to
implement this? Discuss with justification.
2. Specify, in proper sequence, the steps involved in translating a CPU
generated Logical Address to its equivalent physical address in a Demand
Paged Memory Management System. Assume that each of the Process
involved does possess a huge Virtual Address Space such that the entire
Page Map Table (P.M.T.) of any process cannot be accommodated in the
existing Physical Memory System. Assume that the Physical Memory
system consists on 2 level Cache L1 & L2 as well as the main memory
while the secondary memory media (Disk) acts as the Virtual Memory.
Consider ALL possible Hit as well as Miss situations.

(4+14)

8.
1. What are the advantages of a distributed System over a conventional
system? Highlight all the salient points.
2. Compare the methods of caching vis-à-vis Remote services in a distributed
system.
3. Consider the following situations in a typical Multi Programmed
Computer system:
 The Operating System of the given Computer System employs pre-
emptive FIRST COME FIRST SERVED Scheduling.
 It employs semaphores to achieve Mutual Exclusion of the single
printer it processes.
- Any process wishing to use the printer mmust do so in the
KERNEL mode.
- All the processes in the KERNEL mode, poossesses the Highest
Priority.
 The Printer is currently printing the Output generated by the
process PA. The process PA has got some more tasks to complete
even after printing is done.
 Another process PB has been waiting for some time for the printer.
 The CPU is currently executing the process PC.
 Two other processes PD & PE are ready to be executed. The
Process PE having arrived earlier.
7. Identify the states of each of the processes PA, PB,, PC, PD & PE
along with proper justifications.
8. When the printer finishes printing the job associated with the
process PA, depict the sequence of events that take place in a
stepwise fashion. What will be the new states of each of the
processes PA, PB,, PC, PD & PE?

(4+5+[3+6])

January, 2005
Note:

1. Answer question 1 and any FOUR questions from 2 to 7.


2. Parts of the same question should be answered together and in the same sequence.

Time: 3 Hours Total Marks:100

1.
1. What is the purpose of the Command Interpreter? Why is it usually
separate from the Kernel?

Ans. Command Interpreter is the traditional console programe acting as


the primary interface between the operating system and the user. It is
already running when a user logs on and accepts and interprets commands
typed by user and runs them in foreground / background. Commands are
typed on the keyboard which are echoed on the screen and can be edited
before the user presses enter to send them for execution. However, GUI
shells displaying windows and using mouse have become very popular
now.

It is usually separate from the kernel as it is not a critical process and


moreover, users may want to write their own command interpreters which
can be just run as user programs without requiring recompilation.

2. What is the difference between spooling and buffering and how are they
related, if at all?

Ans.Spooling or Simultaneous Peripheral Operation On-Line is the


copying of jobs meant for a dedicated I/O device like printer to disk to
prevent processes from waiting in a multiprogrammed environment
implemented by copying the jobs for the dedicated device in a special
spool directory which are picked for service by daemons.
Buffering on the other hand is copying in order to prevent mismatch
between devices of varying speed or sizes. Buffering is also used to
implement copy semantics.

Spooling and buffering are related in that they are both different forms of
copying.

3. What are the different kinds of errors that the I/O component of an
Operating System has to handle?

Ans.The I/O Component of an operating system has to handle two types


of errors:

 logical errors: logical errors are the errors in programming which


are the result of passing invalid command or wrong parameters
including non-existent buffer address and so on.
 hardware errors: These errors occur when hardware is not ready to
accept the command. These errors may be temoporary, e.g. read
error caused by a speck of dust on a disk sector or permanent, e.g.
disk arm crashing on media rendering a disk unusable.
4. When files are deleted, the blocks freed are put on the free list without
being erased. Should these blacks be erased of all the, data an them? If
yes, when should it be done?

Ans.The blocks should ideally be erased when files are deleted for
disallowing unauthorised access. However, this is not done for
performance reasons as this would involve writing to the whole file which
can be time consuming for long files. Instead, the blocks are erased when
they are required to be written by a new file. This can ideally be done by a
daemon which can become active during intervals of low disk activity.

5. What is the difference between the running of an interrupt handler and a


task? What are some restrictions that might be placed on an interrupt
handler that would not be placed on a task?

Ans.An interrupt handler has usually a higher priority and can pre-empt a
task. Interrupt-handlers are usally small processes while tasks can be very
large. An interrupt handler, once started, is carried out in its entirety while
a task may be scheduled many times during its lifetime. Interrupt handlers
require to be quick and small and therefore, are often coded in assembly
language.

6. Which is the most commonly used scheduling algorithm, and why?

Ans.Round-Robin is the most commonly used scheduling algorithm as it


is the easiest to implement besides being the oldest. It can be reasonably
responsive with small quantums and offers good throughput if some of the
processes are I/O extensive. Moreover, it is a fair algorithm and avoids
starvation.

7. A programmer has the option of writing a program that runs as multiple


tasks or writing it to run as one multithreaded task. Name two advantages
of writing it as a single multithreaded task.

Ans.The two advantages of writing a program as a single multithreaded


task are:

 simplification of the programming model;


 gain in system performance as context switch is not required

(7x4)

2.
1. Suppose that a system is in an unsafe state. Show that it is possible for the
processes to complete their execution without entering a dead lack state?
2. In what circumstances is the system-call 'fork execute' most appropriate?
3. A password may become known to other user by any way. Is there a
simple method for detecting that such an event has occurred? Explain your
answer.

(8+5+5)

3.
1. The overhead required to. read an entry in a page table (including the time
to. access associative memory) is 50 nanoseconds. To reduce this
overhead the computer has an associative memory that can hold 16 entries
and can be accessed in 10 nanoseconds.
1. Find a formula that expresses the effective access time as a
function of the hit ratio.
2. What hit ratio. is needed to. reduce the effective access time to. 70
nanoseconds?

Ans.

3. Let the hit ratio = h


Then miss ratio = 1-h
In case of hit, Time required = Time to access associative memory, say TA
+ Time to access memory, say TM
= TA+TM

In case of miss, Time Required =


Time to access associative memory, say TA
+ Time to access page table, say TP
+ Time to access memory, say TM
= TA+TP+TM

Effective access time, say EAT, is the sum of products of times


required for hit and miss with their respective ratios, i.e. we get
EAT =h(TA+TM) + (1-h)(TA+TP+TM)----(I)

Now, assuming the page table in memory, accessing page table is


same is accessing memory i.e.
TP = TM

Replacing TP with TM in (I), we get


EAT = h(TA+TM) + (1-h)(TA+2TM)
= hTA+hTM + TA+2TM -hTA-2hTM
= TA(h+1-h) + TM(h+2-2h)
i.e. EAT = TA + (2-h)TM

4. Time overhead required to read an entry in a page table (including reading


associative memory), say TOVR = 50 ns (given)
Time required to access associative memory, say TA = 10 ns (given)
Time required to read an entry from page table (without using associative memory), say
TP = A - B i.e. 50 - 10 = 40 ns
Assuming that the page table is in memory, time to read an entry from page table is the
same is accessing memory, say TM = 40 ns
Now EAT = TA + (2-h)TM
Replacing EAT with 70, TA with 10 and TM with 40
we get 70 = 10 + (2-h)40
Solving for hit ratio h
(70-10)/40 = 2-h
(6/4)-2 = -h
1.5 - 2 = -h
h = .5 or 50%
i.e. A hit ratio of 50% is required for reducing the effective access time to 70
nanoseconds.
2. The time difference between, when an event occurs and when the software
that services this event begins executing is called event latency. Events
can be serviced via a polling-process or it can be interrupt driven. Why is
the palling latency typically faster than the interrupt latency?

Ans.The polling latency is typically faster than the interrupt latency due to
the following reasons:

 In case of polling, the CPU is exclusively engaged in busy waiting


as no other process is being concurrently run. Polling is seldom
seen on multiprogramming general purpose operating systems. It is
used for embedded systems and real-time systems.
 The interrupt latency may be more because the interrupt may be
masked at the moment; this might be because a higher priority
interrupt is being serviced or some process may be inside its
critical region.
 For servicing the interrupt, it is required to save the registers and
stack of the current process, setting up the context for the interrupt
service procedure including TLB, MMU, page table, stack.
Moreover, the interrupt controller has to be acknowledged or
interrupts reenabled. All this processing requires considerable
number of CPU instructions increasing interrupt latency.

([6+4]+8)

4.
1. For each of the following disk scheduling algorithms work, through the
head movements for the queue is given as 100, 200, 300, 10, 12 and 44.
Assume the head was started at 100. The highest cylinder number is 300.
0. FCFS
1. SSTF
2. SCAN

Which is likely to result in less overall head movement?

Click here for answer.

2. Explain, how user-level threads can be implemented (including setting a


time limit on any thread's execution) without kernel intervention, except
the use of system calls.
3. What is the purpose of a prototype page-table entry in NT?

(9+6+3)

5.
1. Give three differences between a networked I/O operating and a disk I/O
operation. Also explain whether the differences are significant.
2. Why is disabling interrupts a pessimistic approach to ensure concurrency
control?
3. What are the advantages of public-key encryption? .

(6+6+6)

6.
1. Outline a design strategy, which would make it possible to support more
than one interrupt of the same type.
2. Related to I/O, what are the main services provided by Kernel? Explain
any two of them?

(10+8)

7.
1. In what ways is using a name server better than using static host tables?
What are the problems and complications associated with name servers?
What methods could be used to decrease the amount of traffic name
servers generates to satisfy transaction requests?
2. What problems could occur if a system allowed a file system to be
mounted simultaneously at more than one location?
3. To build a robust distributed system, you must know what kind of failure
can occur.
0. List possible types of failures in a distributed system.
1. Specify which items in your 'list also are applicab1e to a
centralized system.

(6+6+6)

July, 2004
Note:

1. Answer question 1 and any FOUR questions from 2 to 7.


2. Parts of the same question should be answered together and in the same sequence.

Time: 3 Hours Total Marks:100

1.
1. How does the combined paging-segmentation scheme work?
2. What is microkernel architecture? What are its benefits?
3. Distinguish multiprocessing and multiprogramming.
4. What is the disadvantage with user-level threads?
5. Under what circumstances can a parent terminate the execution of its
child? What is the problem with priority scheduling algorithm?
6. What do you understand by I/O scheduling? What is spool?

(7x4)

2.
1. What is the difference between a long-term scheduler and a short-term
scheduler?
2. Consider the following set of process:

Arrival Processing
Process
Time Time
A 0 3
B 2 6
C 4 4
D 6 5
E 8 2

3. Define Turnaround Time. Compute the average turnaround time using


each of the following scheduling policies:
1. First Come First Served (FCFS),
2. Round Robin with time quantum = 4 units,
3. Shortest Process'Job Next (SPN or SJN)
4. Shortest Remaining Time First (SRTF).

Which of the scheduling policies gives the best result? Comment on


implementation aspects of that policy.

3. (3+15)
4.
1. The readers/writers problem is defined as follows:
A data is shared among a number of processes. Some processes only read
that area (reader) whereas some others write into it (writer). Following
conditions have to be satisfied:
1. Any number of readers may simultaneously read.
2. Only one writer may write at a time.
3. If a writer is writing, no reader may read the area.

Suggest a possible solution to the above problem with the additional


criteria that writers have priority.

2. Consider the following MaximumClaims matrix, ResourceAllocation


matrix and MaximumNoOfResources vector for four processes P1, P2, P3
and P4 and three resources R1, R2 and R3.

R1 R2 R3 R1 R2 R3 R1 R2 R3
P1 3 2 2 P1 1 0 0 9 3 6
P2 6 1 3 P2 5 1 1 MaximumNoOfResources
P3 3 1 4 P3 2 1 1
P4 4 2 2 P4 0 0 2
MaximumClaims ResourceAllocation

1. Suppose P1 requests for one unit each of R1 and R3 and is granted


the request. Answer the following questions with respect to the
above situation:
2. Find out the availability of each resource.
3. Is the situation safe? Give reasons for your answer.

(12+6)

5.
1. What design issues have to be considered for scheduling on
multiprocessors?
2. What are the desirable features of a real-time operating system?
3. Consider a system where free space is kept in a free-space list. Suppose
the pointer to the free-space list is lost. Can the system reconstruct the
free-space list? Explain, Why must the bit map for file allocation be kept
on mass storage rather than in main memory?
4. What is TLB? Mention the disadvantage of using it. Find out the effective
memory access time with an 85% hit ratio and the following access times:
TLB access time: 25ns;
MM access time: 100ns.

(3+4+4+7)

6.
1. Disk requests come in to the disk drive for tracks in the order of 55, 58,
39, 18, 90, 160, 150, 38, 184. The disk arm is initially at track 100. A seek
take 5 msec per track moved. Compare the average seek lengths and seek
times achieved with:
Shortest Service/Seek Time First (SSTF), SCAN and Circular-SCAN (C-
SCAN) strategies.
2. What are the assets of a computer system? What are the possible
categories of attack on the security of a computer system or network?

(12+6)

7.
1. What is the concept behind the working set strategy? What are the
probiems associated with the strategy?
2. Consider the following page reference during a given time interval for a
memory consisting of 3 frames: b,c,a,a,c,d,b,e,f,a,b,d,a,f,a. Using the i)
First In First Out (FIFO) replacement strategy and the ii) the Least
Recently Used (LRU) replacement strategy compare the results. Does
always the page hit increase if the number of frames is increased? Give
reasons for your answer.
(6+12)

8.
1. Compare a stateless file server with a stateful file server in a distributed
system.
2. What are the various methods of concurrency control? Which of these
may lead to deadlock and why?
3. Explain the file-system mounting procedure. How is a mounted file
system found out in Unix?

(6+6+6)

January, 2004
Note:

1. Answer question 1 and any FOUR questions from 2 to 7.


2. Parts of the same question should be answered together and in the same sequence.

Time: 3 Hours Total Marks:100

1.
1. What are the disadvantages of linked allocation technique of files?
2. A 2500 byte long segment begins at physical address 9010. Assuming that
a location can hold one byte. what will be the physical address of byte
187. byte 3004?
3. What are two advantages of encrypting data shared in the computer
system?
4. State an advantage in having different time-quantum sizes for different
levels of a multilevel queuing system?
5. What aspects of a distributed system would you select for a system
running on a totally reliable network?
6. Why special hardware instructions are necessary for solving critical-
section problem in a multiprocessor environment?
7. Describe briefly what happens after a user types the command "delete
myfile" in a system.

(7 x 4)

2.
1. When a process terminates it releases its memory space where a "hole" is
created. If there are several such "holes" in memory and another process is
scheduled to run, then what are the advantages and disadvantages of using
the "best-fit" and the "first-fit" strategies for. .allocating memory space to
the, new process?
2. Consider the following page reference during a given time interval for a
memory consisting of 5 frames:
12,16,13,16,17,14,12,14,18,14,12,19,17,18. Using the i) FIFO
replacement strategy and the ii) the LRU replacement strategy compare
the results. Which page replacement strategy is considered to be the best
one and what disadvantage does it have?
3. Assuming the size of logical address to be 232 and the page size to be 212.
find the bits required for page number and page offset in the logical
address.

(5+(4+4+3)+2)

3.
1. Describe the queuing implementation of semaphore with reference to
processes that wait on a particular semaphore and what happens when the
corresponding resource is released:
2. Differentiate between synchronous and asynchronous message passing.
What is a mailbox?

(10+[5+3])

4.
1. Present an algorithm for reconstructing a logical ring after a process in the
ring fails.
2. What do you understand by I/O scheduling? What is spool?
3. Under what circumstances can a parent terminate the execution of its
child?
4. Under what circumstances is a token ring network more effective than an
Ethernet network?

(7+4+3+4)

5.
1. What is your opinion about deadlock prevention strategy? Describe an
approach to detect deadlock in a system. What are the possible recovery
strategies once deadlock is detected?
2. Explain the concept of Fair-share scheduling.

([2+6+4]+6)

6.
1. What are the advantages of creating a separate swap partition?
2. Define the following terms: seek time, rotational latency, disk bandwidth.
Which algorithm is also sometimes known as the elevator algorithm and
why?
3. The list of all passwords is kept within the operating, system. Thus, If a
user manages to read this list, password protection is no longer provided.
Suggest a scheme that will avoid this problem.

(3+[2.5x4]+5)

7.
1. With reference to Unix consider the following situation:
A process does not find the buffer (when it wants to get a particular block
from disk) in the hash queue and the free list of buffers is also empty.
What does the process do now? If there is more than one process looking
for this particular block, then what happens? .
2. What protection problems may arise if a shared stack is used for parameter
passing?
3. What is Linux's concept of a thread?

([3+4]+6+5)

You might also like