Related Questions8 Items
Q1.MCQ
A computer has two processors, $M1$ and $M2$. Four processes $P1, P2, P3, P4$ 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:
- $M1$ uses priority of execution for the processes as, $P1 > P3 > P2 > P4$, i.e., $P1$ and $P4$ have highest and lowest priorities, respectively.
- $M2$ uses priority of execution for the processes as, $P2 > P3 > P4 > P1$, i.e., $P2$ and $P1$ have highest and lowest priorities, respectively.
A process $Pi$ is scheduled to a processor $Mk$, if the processor is free and no other process $Pj$ 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?
Q2.MCQ
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?
Q3.NUMERICAL
A disk of size $512$M bytes is divided into blocks of $64$K 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 $1$M bytes needs to be stored in the disk. Assume, $1\text{K} = 2^{10}$ and $1\text{M} = 2^{20}$. The amount of space in bytes that will be wasted due to internal fragmentation is . (Answer in integer)
Q4.NUMERICAL
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)
Q5.MCQ
A computer has two processors, $M1$ and $M2$. Four processes $P1, P2, P3, P4$ 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:
- $M1$ uses priority of execution for the processes as, $P1 > P3 > P2 > P4$. i.e., $P1$ and $P4$ have highest and lowest priorities, respectively.
- $M2$ uses priority of execution for the processes as, $P2 > P3 > P4 > P1$. i.e., $P2$ and $P1$ have highest and lowest priorities, respectively.
A process $Pi$ is scheduled to a processor $Mk$, if the processor is free and no other process $Pj$ 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?
Q6.NUMERICAL
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)
!image(https://uadmin.udsfgecw.tech/file/download/public/public:76f5a863-90b1-4238-8100-4663a549ae70.png)
Q7.MCQ
Consider the following two threads T1 and T2 that update two shared variables a and b. Assume that initially a = b = 1. Though context switching between threads can happen at any time, each statement of T1 or T2 is executed atomically without interruption.
$$\begin{array}{cc}
\textbf{T1} & \textbf{T2} \\
\text{a} = \text{a} + 1; & \text{b} = 2 \text{b}; \\
\text{b} = \text{b} + 1; & \text{a} = 2 \text{a};
\end{array}$$
Which one of the following options lists all the possible combinations of values of a and b after both T1 and T2 finish execution?
Q8.NUMERICAL
Consider a memory management system that uses a page size of $2\text{ KB}$. Assume that both the physical and virtual addresses start from $0$. Assume that the pages $0, 1, 2,$ and $3$ are stored in the page frames $1, 3, 2,$ and $0$, respectively. The physical address (in decimal format) corresponding to the virtual address $2500$ (in decimal format) is
Computer Science And EngineeringOperating Systems (OS)Numerical Answer (NAT)2 Marks
Q4.
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)
A
6