Operating Systems questions

Q14

GATE CS 2025 CS-1Memory ManagementMCQ1 mark−1/3 if wrong
Consider a demand paging memory management system with 32-bit logical address, 20-bit physical address, and page size of 2048 bytes. Assuming that the memory is byte addressable, what is the maximum number of entries in the page table?
Show answer without attempting

Answer: A

Q29

GATE CS 2025 CS-1Processes and ThreadsNAT1 mark
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 queue during its lifetime (not counting the time the process enters the ready queue when it is run initially) is _______. (Answer in integer)
int main()
{
 int x=0,i=0;
 scanf("%d",&x);
 for(i=0; i<20; i++)
 {
 x = x+20;
 printf("%d
",x);
 }
 return 0;
}
Show answer without attempting

Answer: 21

Q38

GATE CS 2025 CS-1SchedulingMCQ2 marks−2/3 if wrong
A computer has two processors, M1M_1 and M2M_2. Four processes P1,P2,P3,P4P_1, P_2, P_3, P_4 with CPU bursts of 20, 16, 25, and 10 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:
- M1M_1 uses priority of execution for the processes as, P1>P3>P2>P4P_1 > P_3 > P_2 > P_4, i.e., P1P_1 and P4P_4 have highest and lowest priorities, respectively.
- M2M_2 uses priority of execution for the processes as, P2>P3>P4>P1P_2 > P_3 > P_4 > P_1, i.e., P2P_2 and P1P_1 have highest and lowest priorities, respectively.
A process PiP_i is scheduled to a processor MkM_k, if the processor is free and no other process PjP_j is waiting with higher priority. At any given point of time, a process can be allocated to any one of the free processors without violating the execution priority rules. Ignore the context switch time. What will be the average waiting time of the processes in milliseconds?
Show answer without attempting

Answer: A

Q51

GATE CS 2025 CS-1Memory ManagementNAT2 marks
A disk of size 512M bytes is divided into blocks of 64K bytes. A file is stored in the disk using linked allocation. In linked allocation, each data block reserves 4 bytes to store the pointer to the next data block. The link part of the last data block contains a NULL pointer (also of 4 bytes). Suppose a file of 1M bytes needs to be stored in the disk. Assume, 1K=2101\text{K} = 2^{10} and 1M=2201\text{M} = 2^{20}. The amount of space in bytes that will be wasted due to internal fragmentation is ______. (Answer in integer)
Show answer without attempting

Answer: 65468

Q54

GATE CS 2025 CS-1Memory ManagementNAT2 marks
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 4 page references (including the current page) at the time of allocating a frame to a page.
A process accesses the pages in the following order of page numbers:
1, 3, 2, 4, 2, 3, 1, 2, 4, 3, 1, 4.
If the system has three memory frames that are initially empty, the number of page faults that will occur during execution of the process is ________ . (Answer in integer)
Show answer without attempting

Answer: 6

Q26

GATE CS 2025 CS-2SchedulingMCQ1 mark−1/3 if wrong
Processes P1,P2,P3,P4P1, P2, P3, P4 arrive in that order at times 0, 1, 2, and 8 milliseconds respectively, and have execution times of 10, 13, 6, 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 turnaround time of the four processes in milliseconds?
Show answer without attempting

Answer: D

Q47

GATE CS 2025 CS-2Memory ManagementMSQ2 marks
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  21 \; 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), as shown in the table:

The *-marked references cause page replacements.

Which one or more of the following could be the page replacement policy/policies in use?
Question figure
More than one option can be correct.
Show answer without attempting

Answer: D

Q48

GATE CS 2025 CS-2DeadlocksMSQ2 marks
P={P1,P2,P3,P4}P = \{P_1, P_2, P_3, P_4\} consists of all active processes in an operating system.
R={R1,R2,R3,R4}R = \{R_1, R_2, R_3, R_4\} 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: R1→P1,R2→P2,R3→P3,R4→P4R_1 \rightarrow P_1, R_2 \rightarrow P_2, R_3 \rightarrow P_3, R_4 \rightarrow P_4 (the assignment edge R1→P1R_1 \rightarrow P_1 means resource R1R_1 is assigned to process P1P_1, and so on for others)
Claim edges: P1→R2,P2→R3,P3→R1,P2→R4,P4→R2P_1 \rightarrow R_2, P_2 \rightarrow R_3, P_3 \rightarrow R_1, P_2 \rightarrow R_4, P_4 \rightarrow R_2 (the claim edge P1→R2P_1 \rightarrow R_2 means process P1P_1 is waiting for resource R2R_2, and so on for others)

Which of the following statement(s) is/are CORRECT?
More than one option can be correct.
Show answer without attempting

Answer: C, D

Q58

GATE CS 2025 CS-2Memory ManagementNAT2 marks
A computer system supports a logical address space of 2322^{32} bytes. It uses two-level hierarchical paging with a page size of 4096 bytes. A logical address is divided into a bb-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 bytes. All the pages in the system have the same size.

The value of bb is ___________ . (Answer in integer)
Show answer without attempting

Answer: 11

0/90 correct0 marks

Related topics in GATE CS