BITS Pilani OS Mock Test Questions
BITS Pilani OS Mock Test Questions
The page size is 16 KB, equating to 2^14 bytes, thus requiring 18 bits to address within a page (since 1024 * 16 = 16384 = 2^14). The remaining 32 - 14 = 18 bits are used for the page number, requiring a total of 2^18 entries. Each entry must accommodate the page address and at least 2 protection bits. Assuming a minimal 4-byte entry for the address and protection bits, the page table size is 2^18 * 4 = 1 MB .
For the given problem on scheduling, with priority and specific arrival and burst times, the calculated waiting times are as follows: P1 = 19, P2 = 13, and P4 = 0. This is calculated by simulating the execution order of the processes, ensuring each process is served based on arrival time and priority .
Deadlock occurs due to circular waiting in semaphore operations, which can happen if the semaphore operations are not executed in a consistent manner. However, in this case, the semaphore m and n ensure that, while processes may wait, they won't be concurrently accessing the same shared resource, preventing a race condition. Correct semaphore handling avoids deadlock. No Deadlock and No race condition is ensured in this problem .
Applying SSTF to a disk with a head at cylinder 20 servicing requests in the sequence 10, 22, 20, 2, 40, 6, 38 minimizes travel between nearest requests: Head moves to 22 (2 cylinders), 20 (2), 10 (10), 6 (4), 2 (4), 38 (36), then 40 (2), total 60 cylinders moved, costing 348 ms .
A fork system call fails primarily when the system exhausts available process slots, which can happen if the user exceeds a predetermined limit of concurrent processes or system-wide process capacity is reached. Furthermore, a fork does not inherently fail based solely on previous execution contexts or syncing issues between parent and child processes unless limited by such capacity constraints .
When one process performs semaphore operations out of order compared to others, it can lead to disrupting the mutual exclusion maintained by the semaphore, potentially allowing one more process into the critical section than intended. However, the system described (n-1 maximum simultaneous entries) ensures that separation is maintained generally, except for the anomaly introduced .
An inverted page table involves one entry per actual page frame in physical memory. With 32-bit virtual addresses and 4MB of physical memory partitioned into 8192-byte pages, 4MB/8192 = 512 page frames are present, so there are 512 entries in the inverted page table .
In a system with 21 instances of a resource and processes requesting 5 instances each, the system can safely accommodate up to 4 processes. Calculating maximum processes is done by ensuring that upon a process finishing, enough resources are available to satisfy at least one waiting process (21 - (4-1)*5 = 6, sufficient for next allocation).
Each logical record is 140 bytes. A sector can hold 1024 bytes, which means it can accommodate \( \lfloor 1024 / 140 \rfloor = 7 \) records per sector. A track has 96 sectors, so a track can hold 96 * 7 = 672 records. A surface has 100 tracks, thus a surface can store 672 * 100 = 67,200 records. For 336,000 records, the number of surfaces required is \( \lceil 336,000 / 67,200 \rceil = 5 \) surfaces .
When applying the remaining time first scheduling algorithm to calculate average waiting time for processes, it is done by considering the shortest remaining time at each completion. Average calculating results in a balanced allocation over total processes and total waiting time resulting in an average waiting time of 1.5 ms .