CS FundamentalsVery hardGATE CS (PYQ pattern)
A buddy allocator manages 1024 KB (minimum block 16 KB, requests rounded up to powers of two; the lowest-addressed free block of the smallest sufficient size is always used and split as needed; frees coalesce buddies). Requests in order: A=100 KB, B=240 KB, C=60 KB, D=120 KB, free B, E=35 KB, free A, free C. How many free blocks exist afterwards and what is the largest of them?
- A. 6 free blocks; largest 256 KB
- B. 5 free blocks; largest 512 KB
- C. 5 free blocks; largest 256 KB
- D. 4 free blocks; largest 128 KB
Correct answer: C. 5 free blocks; largest 256 KB
Final free list (address KB, size KB) = [(0, 128), (128, 64), (256, 256), (640, 128), (768, 256)]: simulate splitting and buddy coalescing step by step.
More Operating Systems questions
- A 128 KB physically-tagged, virtually-indexed L1 cache has 64-byte lines and is 16-way set-associative. The system uses 4 KB pages. How…
- A machine has 2 GB of RAM; the OS occupies 512 MB and every user process needs 192 MB, so as many whole processes as fit are kept in…
- Highest Response Ratio Next (non-preemptive; ratio = (waiting time + burst) / burst, evaluated whenever the CPU becomes free) schedules…
- Four processes with CPU bursts 10, 4, 2 and 1 ms arrive together at time 0 in that order and are scheduled by Round Robin with quantum 3…
- Round Robin, quantum 4 ms, four processes arriving together at time 0 in the order P1..P4 with bursts 9, 5, 2 and 6 ms. Every switch to a…
- A system has 48-bit virtual addresses, 8 KB pages and 2^40 bytes of physical memory. Each page-table entry holds a frame number plus 5…