0% found this document useful (0 votes)
67 views3 pages

Operating Systems Endterm Exam 2014

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)
67 views3 pages

Operating Systems Endterm Exam 2014

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

THE LNM INSTITUTE OF INFORMATION TECHNOLOGY, JAIPUR

ENDTERM EXAM - OPERATING SYSTEMS (2013-2014)

Time: 3 hrs Max. Marks: 100

Q1. Fill in the blanks: (15)


a. Operations which cannot be interrupted are known as ______ operations.
b. In __________________multiprocessing, a master-slave relationship exists between the
processors.
c. Memory dynamically allocated to a process during run-time is allocated from its ____.
d. Swapping of processes is controlled by the _______________scheduler.
e. Compaction of programs in memory is possible when address binding takes place at ______time.
f. Allocation of frames to processes according to their size is called _______________ allocation.
g. Combining adjacent buddies to form larger segments is known as _______.
h. A disk partition that contains a file system is called ______
i. On secondary storage media using constant _______velocity, density of bits per track is uniform.
j. The process of dividing the disk into sectors is called _________.
k. Bad blocks on a disk can be handled using sector ________or sector __________
l. A chunk of blocks is known as _______
m. In a linked allocation of space for file storage, ________access to files is not possible.
n. For sharing of a file or sub-directory, a ________can be created.

Q2. What is the cause of thrashing? How does the system detect thrashing? Once it detects thrashing,
what can the system do to eliminate this problem? (2+1+2=5)

Q3. Discuss the importance of maintaining a balance of I/O bound and CPU bound processes in the ready
queue for scheduling? (4)

Q4. Consider a computer system with a 32-bit logical address and 4KB page size. The system supports
512 MB of physical memory. How many entries are there in each of the following?

a. A conventional single-level page table


b. An inverted page table. (4)

Q5. How many processes will be created by the execution of the following code, provided that no fork()
command fails: (5)

int main(void)
{
pid_t pid = fork();
pid = fork();
pid = fork();
if (pid = = 0)
{
pid = fork();
}
fork();
return 0;
}
Q6. Consider the following program segment:

if (a > 0)
P (s1);
else
P (s2);
b++;
P (s3);
if (b < 0 && a <= 0)
P (s1);
else if (b >= 0 && a > 0)
P (s2);
else
P (s4);
a++;
V (s4);
V (s3);
V (s2);
V (s1);

s1, s2, s3 and s4 are semaphores. All variables are automatic, that is each thread gets a local copy of a and
b from the stack that it modifies. Consider two threads running this fragment of code simultaneously. Can
there be a deadlock? Why, or why not? (5)

Q7. Give one major difference between: (1*4=4)


a. Signal and a system call
b. Kernel level and user level threads
c. Deadlock and starvation
d. Process and a thread

Q8. A disk drive has 5000 cylinders, numbered 0 to 4999. The drive is currently serving a request at
cylinder 143. The queue of pending requests, in FIFO order, is:

86, 1470, 913, 1774, 948, 1509, 1022, 1750, 130

Starting from the current head position, what is the total distance (in cylinders) that the disk arm moves to
satisfy all the pending requests for each of the following disk-scheduling algorithms:

a. SSTF
b. C-SCAN (assume the arm moves outwards to inwards)
c. C-LOOK (3*3=9)

Q9. Consider a paging scheme with the page table stored in the memory.
a. If a memory reference takes 200 nanoseconds, how long does a paged memory reference take?
b. If we add TLBs and 75% of all page table references are found in the TLBs, what is the effective
memory reference time? (Assume that finding a page table entry in the TLBs takes zero time, if
the entry is there). (1+2=3)
Q10. Atul, Bikram, Chirag and Dev are working on their term paper, which is a 10,000 word essay. To
help them work on their papers, they have one dictionary, two copies of Thesaurus, and two coffee cups.
Atul needs to use the dictionary and a thesaurus to write her paper; Bikram needs a thesaurus and a coffee
cup to write his paper; Chirag needs a dictionary and a thesaurus to write his paper; Dev needs two coffee
cups to write his paper. Consider the following state:

Atul has a thesaurus and needs the dictionary; Bikram has a thesaurus and a coffee cup; Chirag
has the dictionary and needs a thesaurus; Dev has a coffee cup and needs another coffee cup.

Is the system deadlocked in this state? Explain using a resource allocation graph. (5)

Q11. Consider a demand-paged computer system with the following time measured utilization:

CPU utilization 20 percent; Paging disk 97 percent; Other I/O devices 5 percent

For each of the following, say whether it will improve CPU utilization. Explain your answers.
a. Install a faster CPU
b. Increase degree of multiprogramming
c. Install more main memory (2*3=6)

Q12. Processes P1, P2, P3 arrive for execution at the times indicated. Using non-premptive scheduling,
answer the questions below:

Process Arrival time Burst time


P1 0.0 8
P2 0.4 4
P3 0.8 1

a. What is the average turnaround time for these processes with the FCFS scheduling algorithm?
b. What is the average turnaround time for these processes with the SJF scheduling algorithm?
c. Compute what the average turnaround time will be if the CPU is left idle for the first 1 unit and
then SJF scheduling is used. (2*3=6)

Q13. Given five memory partitions of 100 KB, 500 KB, 200 KB, 300 KB and 600 KB (in order), how
would the first-fit, best-fit and worst-fit algorithms place processes of 212 KB, 417 KB, 112 KB and 426
KB (in order)? Which algorithm makes the most efficient use of memory? (2+2+2+1=7)

Q14. Assume there is a 1024 KB segment where memory is allocated using the buddy system. Draw a
tree illustrating how the following memory requests will be allocated:

R1- 240 KB, R2 – 120 KB, R3 – 60 KB, R4 – 130 KB (in order). (4)

Q15. Discuss briefly: (3*6=18)


a. Multilevel feedback queue scheduling
b. Priority inversion
c. Recovery from deadlock
d. DLL
e. FAT
f. Context switching

You might also like