Operating Systems questions — page 6 of 7

Q43

GATE CS 2015 CS-2Memory ManagementNAT2 marks
A computer system implements 8 kilobyte pages and a 32-bit physical address space. Each page table entry contains a valid bit, a dirty bit, three permission bits, and the translation. If the maximum size of the page table of a process is 24 megabytes, the length of the virtual address supported by the system is _______________ bits.
Show answer without attempting

Answer: 36

Q20

GATE CS 2014 CS-2File SystemsNAT1 mark
A FAT (file allocation table) based file system is being used and the total overhead of each entry in the FAT is 4 bytes in size. Given a 100×106100 \times 10^6 bytes disk on which the file system is stored and data block size is 10310^3 bytes, the maximum size of a file that can be stored on this disk in units of 10610^6 bytes is ____________.
Show answer without attempting

Answer: 99.55 to 99.65

Q31

GATE CS 2014 CS-2Concurrency and SynchronizationMCQ2 marks−2/3 if wrong
Consider the procedure below for the Producer-Consumer problem which uses semaphores:
semaphore n = 0;
semaphore s = 1;

void producer()
{
    while(true)
    {
        produce();
        semWait(s);
        addToBuffer();
        semSignal(s);
        semSignal(n);
    }
}

void consumer()
{
    while(true)
    {
        semWait(s);
        semWait(n);
        removeFromBuffer();
        semSignal(s);
        consume();
    }
}
Which one of the following is TRUE?
Show answer without attempting

Answer: C

Q32

GATE CS 2014 CS-2SchedulingNAT2 marks
Three processes A, B and C each execute a loop of 100 iterations. In each iteration of the loop, a process performs a single computation that requires tct_c CPU milliseconds and then initiates a single I/O operation that lasts for tiot_{io} milliseconds. It is assumed that the computer where the processes execute has sufficient number of I/O devices and the OS of the computer assigns different I/O devices to each process. Also, the scheduling overhead of the OS is negligible. The processes have the following characteristics:
Process idtct_ctiot_{io}
A100 ms500 ms
B350 ms500 ms
C200 ms500 ms
The processes A, B, and C are started at times 0, 5 and 10 milliseconds respectively, in a pure time sharing system (round robin scheduling) that uses a time slice of 50 milliseconds. The time in milliseconds at which process C would complete its first I/O operation is ___________.
Show answer without attempting

Answer: 1000

Q33

GATE CS 2014 CS-2Memory ManagementMCQ2 marks−2/3 if wrong
A computer has twenty physical page frames which contain pages numbered 101 through 120. Now a program accesses the pages numbered 1, 2, …, 100 in that order, and repeats the access sequence THRICE. Which one of the following page replacement policies experiences the same number of page faults as the optimal page replacement policy for this program?
Show answer without attempting

Answer: D

Q20

GATE CS 2014 CS-3Memory ManagementNAT1 mark
A system uses 3 page frames for storing process pages in main memory. It uses the Least Recently Used (LRU) page replacement policy. Assume that all the page frames are initially empty. What is the total number of page faults that will occur while processing the page reference string given below?

4,7,6,1,7,6,1,2,7,24, 7, 6, 1, 7, 6, 1, 2, 7, 2
Show answer without attempting

Answer: 6

Q31

GATE CS 2014 CS-3DeadlocksNAT2 marks
A system contains three programs and each requires three tape units for its operation. The minimum number of tape units which the system must have such that deadlocks never arise is _________.
Show answer without attempting

Answer: 7

Q32

GATE CS 2014 CS-3SchedulingNAT2 marks
An operating system uses shortest remaining time first scheduling algorithm for pre-emptive scheduling of processes. Consider the following set of processes with their arrival times and CPU burst times (in milliseconds):
ProcessArrival TimeBurst Time
P1012
P224
P336
P485
The average waiting time (in milliseconds) of the processes is _________.
Show answer without attempting

Answer: 5.5

Q33

GATE CS 2014 CS-3Memory ManagementNAT2 marks
Consider a paging hardware with a TLB. Assume that the entire page table and all the pages are in the physical memory. It takes 10 milliseconds to search the TLB and 80 milliseconds to access the physical memory. If the TLB hit ratio is 0.6, the effective memory access time (in milliseconds) is _________.
Show answer without attempting

Answer: 122

Q19

GATE CS 2014 CS-1SchedulingNAT1 mark
Suppose a disk has 201 cylinders, numbered from 0 to 200. At some time the disk arm is at cylinder 100, and there is a queue of disk access requests for cylinders 30, 85, 90, 100, 105, 110, 135 and 145. If Shortest-Seek Time First (SSTF) is being used for scheduling the disk access, the request for cylinder 90 is serviced after servicing ____________ number of requests.
Show answer without attempting

Answer: 3

Q20

GATE CS 2014 CS-1Processes and ThreadsMCQ1 mark−1/3 if wrong
Which one of the following is FALSE?
Show answer without attempting

Answer: D

Q31

GATE CS 2014 CS-1DeadlocksMCQ2 marks−2/3 if wrong
An operating system uses the Banker's algorithm for deadlock avoidance when managing the allocation of three resource types X, Y, and Z to three processes P0, P1, and P2. The table given below presents the current system state. Here, the Allocation matrix shows the current number of resources of each type allocated to each process and the Max matrix shows the maximum number of resources of each type required by each process during its execution.
Allocation XAllocation YAllocation ZMax XMax YMax Z
P0001843
P1320620
P2211333
There are 3 units of type X, 2 units of type Y and 2 units of type Z still available. The system is currently in a safe state. Consider the following independent requests for additional resources in the current state:

REQ1: P0 requests 0 units of X, 0 units of Y and 2 units of Z
REQ2: P1 requests 2 units of X, 0 units of Y and 0 units of Z

Which one of the following is TRUE?
Show answer without attempting

Answer: B

Q32

GATE CS 2014 CS-1SchedulingNAT2 marks
Consider the following set of processes that need to be scheduled on a single CPU. All the times are given in milliseconds.
Process NameArrival TimeExecution Time
A06
B32
C54
D76
E103
Using the shortest remaining time first scheduling algorithm, the average process turnaround time (in msec) is ____________________.
Show answer without attempting

Answer: 7.2

Q33

GATE CS 2014 CS-1Memory ManagementNAT2 marks
Assume that there are 3 page frames which are initially empty. If the page reference string is 1, 2, 3, 4, 2, 1, 5, 3, 2, 4, 6, the number of page faults using the optimal replacement policy is__________.
Show answer without attempting

Answer: 7

Q10

GATE CS 2013 CSSchedulingMCQ1 mark−1/3 if wrong
A scheduling algorithm assigns priority proportional to the waiting time of a process. Every process starts with priority zero (the lowest priority). The scheduler re-evaluates the process priorities every TT time units and decides the next process to schedule. Which one of the following is TRUE if the processes have no I/O operations and all arrive at time zero?
Show answer without attempting

Answer: B

Q16

GATE CS 2013 CSDeadlocksMCQ1 mark−1/3 if wrong
Three concurrent processes X, Y, and Z execute three different code segments that access and update certain shared variables. Process X executes the PP operation (i.e., wait) on semaphores aa, bb and cc; process Y executes the PP operation on semaphores bb, cc and dd; process Z executes the PP operation on semaphores cc, dd, and aa before entering the respective code segments. After completing the execution of its code segment, each process invokes the VV operation (i.e., signal) on its three semaphores. All semaphores are binary semaphores initialized to one. Which one of the following represents a deadlock-free order of invoking the PP operations by the processes?
Show answer without attempting

Answer: B

Q29

GATE CS 2013 CSFile SystemsMCQ2 marks−2/3 if wrong
Consider a hard disk with 16 recording surfaces (0-15) having 16384 cylinders (0-16383) and each cylinder contains 64 sectors (0-63). Data storage capacity in each sector is 512 bytes. Data are organized cylinder-wise and the addressing format is <cylinder no., surface no., sector no.>. A file of size 42797 KB is stored in the disk and the starting disk location of the file is <1200, 9, 40>. What is the cylinder number of the last sector of the file, if it is stored in a contiguous manner?
Show answer without attempting

Answer: D

Q34

GATE CS 2013 CSConcurrency and SynchronizationMCQ2 marks−2/3 if wrong
A shared variable xx, initialized to zero, is operated on by four concurrent processes W, X, Y, Z as follows. Each of the processes W and X reads xx from memory, increments by one, stores it to memory, and then terminates. Each of the processes Y and Z reads xx from memory, decrements by two, stores it to memory, and then terminates. Each process before reading xx invokes the PP operation (i.e., wait) on a counting semaphore SS and invokes the VV operation (i.e., signal) on the semaphore SS after storing xx to memory. Semaphore SS is initialized to two. What is the maximum possible value of xx after all processes complete execution?
Show answer without attempting

Answer: D

Q39

GATE CS 2013 CSConcurrency and SynchronizationMCQ2 marks−2/3 if wrong
A certain computation generates two arrays aa and bb such that a[i]=f(i)a[i]=f(i) for 0≤i<n0 \le i < n and b[i]=g(a[i])b[i] = g(a[i]) for 0≤i<n0 \le i < n. Suppose this computation is decomposed into two concurrent processes X and Y such that X computes the array aa and Y computes the array bb. The processes employ two binary semaphores RR and SS, both initialized to zero. The array aa is shared by the two processes. The structures of the processes are shown below.
Process X:
private i;
for (i=0; i<n; i++) {
  a[i] = f(i);
  ExitX(R, S);
}

Process Y:
private i;
for (i=0; i<n; i++) {
  EntryY(R, S);
  b[i] = g(a[i]);
}
Which one of the following represents the CORRECT implementations of ExitX and EntryY?
Show answer without attempting

Answer: C

0/200 correct0 marks

Related topics in GATE CS