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
Barrier is a synchronization construct where a set of processes synchronizes globally i.e., each process in the set arrives at the barrier and waits for all others to arrive and then all processes leave the barrier. Let the number of processes in the set be three and be a binary semaphore with the usual and functions. Consider the following …
Barrier is a synchronization construct where a set of processes synchronizes globally i.e., each process in the set arrives at the barrier and waits for all others to arrive and then all processes leave the barrier. Let the number of processes in the set be three and be a binary semaphore with the usual and functions. Consider the following …
Consider the following snapshot of a system running processes. Process is holding instances of a resource , . Currently, all instances of are occupied. Further, for all , process has placed a request for an additional instances while holding the instances it already has. There are …
Consider three processes, all arriving at time zero, with total execution time of , and units, respectively. Each process spends the first of execution time doing I/O, the next of time doing computation, and the last of time doing I/O again. The operating system uses a shortest remaining …
A computer system supports -bit virtual addresses as well as -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?
Consider three processes (process id , , respectively) with compute time bursts , and time units. All processes arrive at time zero. Consider the longest remaining time first (LRTF) scheduling algorithm. In LRTF ties are broken by giving priority to the process with the lowest process id. The average turn around time is:
A CPU generates -bit virtual addresses. The page size is KB. The processor has a translation look-aside buffer (TLB) which can hold a total of page table entries and is -way set associative. The minimum size of the TLB tag is:
The atomic fetch-and-set instruction unconditionally sets the memory location to and fetches the old value of in without allowing any intervening access to the memory location . Consider the following implementation of and functions on a binary semaphore . void P (binary_semaphore *s) { unsigned y; …
Consider three CPU-intensive processes, which require , and time units and arrive at times , and , 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.
Suppose processes, share identical resource units, which can be reserved and released one at a time. The maximum resource requirement of process is , where . Which one of the following is a sufficient condition for ensuring that deadlock does not occur?
Increasing the RAM of a computer typically improves performance because:
What is the swap space in the disk used for?
Normally user programs are prevented from handling I/O directly by I/O instructions in them. For CPUs having explicit I/O instructions, such I/O protection is ensured by having the I/O instruction privileged. In a CPU with memory mapped I/O, there is no explicit I/O instruction. Which one of the following is true for a CPU with memory mapped I/O?
Which one of the following is true for a CPU having a single interrupt request line and a single interrupt grant line?
Consider the following code fragment: if (fork() == 0) { a = a + 5; printf("%d, %p n", a, &a); } else { a = a - 5; printf ("%d, %p n", a,& a); } Let be the values printed by the parent process and be the values printed by the child process. Which one of the following is TRUE?
A unix-style I-nodes has direct pointers and one single, one double and one triple indirect pointers. Disk block size is Kbyte, disk block address is bits, and -bit integers are used. What is the maximum possible file size?
Consider the following set of processes, with the arrival times and the CPU-burst times gives in milliseconds. …
Consider two processes and accessing the shared variables and protected by two binary semaphores and respectively, both initialized to 1. and denote the usual semaphore operators, where decrements the semaphore value, and increments the semaphore value. The pseudo-code of and …
The minimum number of page frames that must be allocated to a running process in a virtual memory environment is determined by
Consider an operating system capable of loading and executing a single sequential user process at a time. The disk head scheduling algorithm used is First Come First Served (FCFS). If FCFS is replaced by Shortest Seek Time First (SSTF), claimed by the vendor to give better benchmark results, what is the expected improvement in the I/O performance …
