GATE CS Operating System questions
Practise Operating System questions for GATE CS. Explore official PYQs and original subject-wise quizzes, check answers and view available solutions. Free, no sign-in.
Trace the state changes explicitly. For scheduling, memory and synchronisation questions, record the given policy before calculating the result.
Subject, topic, year and type filter the full library. Match any choice within a filter, and all selected filter categories. Search, source and sort apply to this page.
20 on this page
With respect to deadlocks in an operating system, which of the following statements is/are FALSE?
Consider a system consisting of instances of a resource , being shared by processes. Assume that each process requires a maximum of two instances of resource and a process can request or release only one instance at a time. Further, a process can request the second instance of the resource only after acquiring the first instance. The …
Consider the following program snippet. Assume that the program compiles and runs successfully. Further, assume that the fork() system call is always successful in creating a process. int main () { int i; for (i = 0; i < 3; i++) { if (fork() == 0) { continue; } break; } printf("Hello!"); return 0; } The total number of times that the printf statement gets …
Consider a CPU that has to execute two types of processes. The first type, Actuators (A), requires a CPU burst of seconds. The second type, Controllers (C), requires a CPU burst of seconds. A new process of type A arrives at time , , and (in seconds). Similarly, a new process of type C arrives at time …
Which one of the following CPU scheduling algorithms cannot be preemptive?
Consider three processes , and running identical code, as shown in the pseudocode below. and are two binary semaphores initialized to and , respectively. is a shared variable initialized to . Each line in the pseudocode is executed atomically. Pseudocode of P1, P2, and P3 …
A system has a Translation Lookaside Buffer (TLB) that has a reach of MB. TLB reach is defined as the total amount of physical memory that can be accessed through the TLB entries. The paging system uses pages of size KB. The virtual address space is GB and physical address space is GB. If each TLB entry stores a -bit process id, …
Consider contiguous allocation of physical memory to processes using variable partitioning scheme. Suppose there are holes in the memory of sizes , , and KB. Assume that no two holes are adjacent. Two processes of …
Consider a demand paging memory management system with -bit logical address, -bit physical address, and page size of bytes. Assuming that the memory is byte addressable, what is the maximum number of entries in the page table?
Suppose in a multiprogramming environment, the following C program segment is executed. A process goes into I/O queue whenever an I/O related operation is performed. Assume that there will always be a context switch whenever a process requests for an I/O, and also whenever the process returns from an I/O. The number of times the process will enter the ready …
A computer has two processors, and . Four processes with CPU bursts of , and milliseconds, respectively, arrive at the same time and these are the only processes in the system. The scheduler uses non-preemptive priority scheduling, with priorities decided as follows: uses priority …
A disk of size bytes is divided into blocks of bytes. A file is stored in the disk using linked allocation. In linked allocation, each data block reserves bytes to store the pointer to the next data block. The link part of the last data block contains a NULL pointer (also of bytes). Suppose a file of …
In optimal page replacement algorithm, information about all future page references is available to the operating system (OS). A modification of the optimal page replacement algorithm is as follows: The OS correctly predicts only up to next page references (including the current page) at the time of allocating a frame to a page. A process accesses the …
A computer system supports a logical address space of bytes. It uses two-level hierarchical paging with a page size of bytes. A logical address is divided into a -bit index to the outer page table, an offset within the page of the inner page table, and an offset within the desired page. Each entry of the inner page table uses eight …
Processes arrive in that order at times , and 8 milliseconds respectively, and have execution times of , and 9 milliseconds respectively. Shortest Remaining Time First (SRTF) algorithm is used as the CPU scheduling policy. Ignore context switching times. Which ONE of the following correctly gives the average …
Consider a demand paging system with three frames, and the following page reference string: 1 2 3 4 5 4 1 6 4 5 1 3 2 . The contents of the frames are as follows initially and after each reference (from left to right): …
consists of all active processes in an operating system. consists of single instances of distinct types of resources in the system. The resource allocation graph has the following assignment and claim edges. Assignment edges: …
Which of the following statements about threads is/are TRUE?
Which of the following process state transitions is/are NOT possible?
Consider the following two threads and that update two shared variables and . Assume that initially . Though context switching between threads can happen at any time, each statement of or is executed atomically without interruption. …
