Operating System GATE CS and IT previous year questions with Answer


Ques 11 Gate 2020


Consider allocation of memory to a new process. Assume that none of the existing holes in the memory will exactly fit the process’s memory requirement. Hence, a new hole of smaller size will be created if allocation is made in any of the existing holes. Which one of the following statement is TRUE ?

A

The hole created by first fit is always larger than the hole created by next fit.

B

The hole created by worst fit is always larger than the hole created by first fit.

C

The hole created by best fit is never larger than the hole created by first fit.

D

The hole created by next fit is never larger than the hole created by best fit.



Ques 12 Gate 2020


Consider a paging system that uses 1-level page table residing in main memory and a TLB for address translation. Each main memory access takes 100 ns and TLB lookup takes 20 ns. Each page transfer to/from the disk takes 5000 ns. Assume that the TLB hit ratio is 95%, page fault rate is 10%. Assume that for 20% of the total page faults, a dirty page has to be written back to disk before the required page is read from disk. TLB update time is negligible. The average memory access time in ns (round off to 1 decimal places) is ___________ .


154.5 is the correct answer.


Ques 13 Gate 2019


A certain processor deploys a single-level cache. The cache block size is 8 words and the word size is 4 bytes. The memory system uses a 60 MHz clock. To service a cache-miss, the memory controller first takes 1 cycle to accept the starting address of the block, it then takes 3 cycles to fetch all the eight words of the block, and finally transmits the words of the requested block at the rate of 1 word per cycle. The maximum bandwidth for the memory system when the program running on the processor issues a series of read operations is _________ × 106 bytes/sec.


160 is the correct answer.


Ques 14 Gate 2019


The index node (inode) of a Unix-like file system has 12 direct, one single-indirect and one double-indirect pointer The disk block size is 4 kB and the disk block addresses 32-bits long. The maximum possible file size is (rounded off to 1 decimal place) __________ GB.


4 is the correct answer.


Ques 15 Gate 2019


The following C program is executed on a Unix / Linux system:
 

#include<unistd.h>
int main() {
    int i;
    for (i = 0; i < 10; i++)
    if (i % 2 == 0)
        fork();
    return 0;
}
The total number of child process created is __________


a is the correct answer.


Ques 16 Gate 2019


Consider the following snapshot of a system running n concurrent processes. Process i is holding Xi instances of a resource R, 1 ≤ i ≤ n. Assume that all instances of R arecurrently in use. Further, for all i, process i can place a request for at most Yi additional instances of R while holding the Xt instances it already has. Of the n processes, there are exactly two processes p and q such that Yp = Yq = 0. Which one of the following conditions guarantees that no other process apart from p and q can complete execution?

A

Xp + Xq < Min {Yk ⏐ 1 ≤ k ≤ n, k ≠ p, k ≠ q}

B

Xp + Xq < Min {Yk ⏐ 1 ≤ k ≤ n, k ≠ p, k ≠ q}

C

Min (Xp , Xq ) ≤ Max {Yk ⏐ 1 ≤ k ≤ n, k ≠ p, k ≠ q}

D

Min (Xp , Xq ) ≤ Max {Yk ⏐ 1 ≤ k ≤ n, k ≠ p, k ≠ q}



Ques 17 Gate 2019


Assume that in a certain computer, the virtual addresses are 64 bits long and the physical addresses are 48 bits long. The memory is word addressable. The page size is 8k Band the word size is 4 bytes. The Translation Look-aside Buffer (TLB) in the address translation path has 128 valid entries. At most how many distinct virtual addresses can be translated without any TLB miss?

A

16 x 210

B

8 x 220

C

4 x 220

D

256 x 210



Ques 18 Gate 2018


Consider a storage disk with 4 platters (numbered as 0, 1, 2 and 3), 200 cylinders (numbered as 0, 1, … , 199), and 256 sectors per track (numbered as 0, 1, … 255). The following 6 disk requests of the form [sector number, cylinder number, platter number] are received by the disk controller at the same time: [120, 72, 2], [180, 134, 1], [60, 20, 0], [212, 86, 3], [56, 116, 2], [118, 16, 1] Currently head is positioned at sector number 100 of cylinder 80, and is moving towards higher cylinder numbers. The average power dissipation in moving the head over 100 cylinders is 20 milliwatts and for reversing the direction of the head movement once is 15 milliwatts. Power dissipation associated with rotational latency and switching of head between different platters is negligible. The total power consumption in milliwatts to satisfy all of the above disk requests using the Shortest Seek Time First disk scheduling algorithm is ______


a is the correct answer.


Ques 19 Gate 2018


The size of the physical address space of a processor is 2P bytes. The word length is 2W bytes. The capacity of cache memory is 2N bytes. The size of each cache block is 2M words. For a K-way set-associative cache memory, the length (in number of bits) of the tag field is

A

P − N − log2K

B

P − N + log2K

C

P − N − M − W − log2K

D

P − N − M − W + log2K



Ques 20 Gate 2018


Consider a process executing on an operating system that uses demand paging. The average time for a memory access in the system is M units if the corresponding memory page is available in memory, and D units if the memory access causes a page fault. It has been experimental measured that the average time taken for a memory access in the process is X units. Which one of the following is the correct expression for the page fault rate experienced by the process?

A

(D - M)/(X - M)

B

(X - M)/(D - M)

C

(D - X)/(D - M)

D

(X - M)/(D - X)