Subjects Subjects About Login

OS : 2006 GATE Questions

Questions : 5

QID : 287GATE-2006, 1M

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
Ans : Option B
Solution :
QID : 292GATE-2006, 2M

Consider three processes, all arriving at time zero, with total execution time of 10, 20 and 30 units, respectively. Each process spends the first 20% of execution time doing I/O, the next 70% of time doing computation, and the last 10% of time doing I/O again. The operating system uses a shortest remaining compute time first scheduling algorithm and schedules a new process either when the running process gets blocked on I/O or when the running process finishes its compute burst. Assume that all I/O operations can be overlapped as much as possible. For what percentage of time does the CPU remain idle?

A) 0%
B) 10.6%
C) 30.0%
D) 89.4%
Ans : Option B
Solution :
QID : 289GATE-2006, 2M

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
B) 13
C) 15
D) 20
Ans : Option C
Solution :
Page size of 4KB. So, offset bits are 12 bits.

So, remaining bits of virtual address 32?12=20 bits will be used for identifying a page.

Number of sets = 128/4 = 32 (4-way set) => 5 bits.

So, tag bits =20?5=15 bits.
QID : 288GATE-2006, 2M

The atomic fetch-and-set x,y instruction unconditionally sets the memory location x to 1 and fetches the old value of x in y without allowing any intervening access to the memory location x. Consider the following implementation of P and V functions on a binary semaphore S.

void P (binary_semaphore *s) {
    unsigned y;
    unsigned *x = &(s->value);
    do {
        fetch-and-set x, y;
    } while (y);

void V (binary_semaphore *s) {
    S->value = 0;

Which one of the following is true?

A) The implementation may not work if context switching is disabled in P
B) Instead of using fetch-and-set, a pair of normal load/store can be used
C) The implementation of V is wrong
D) The code does not implement a binary semaphore
Ans : Option A
Solution :
QID : 290GATE-2006, 2M

A computer system supports 32-bit virtual addresses as well as 32-bit physical addresses. Since the virtual address space is of the same size as the physical address space, the operating system designers decide to get rid of the virtual memory entirely. Which one of the following is true?

A) Efficient implementation of multi-user support is no longer possible
B) The processor cache organization can be made more efficient now
C) Hardware support for memory management is no longer needed
D) CPU scheduling can be made more efficient now
Ans : Option C
Solution :
Since the logical address is same the physical address, there is no conversion address needed.

Have a Question?

Submit Here

Previous GATE Papers

Year Key Organized by
2019 Key IIT Madras
2018 Key IIT Guwahati
2017(Set1) Key IIT Roorkee
2017(Set2) Key IIT Roorkee
2016(Set1) Key IISc
2016(Set2) Key IISc
Show All