CS FundamentalsVery hardGATE CS
A buddy system manages 512 KB, initially one free block. Requests arrive: A = 70 KB, B = 35 KB, C = 80 KB, then A is freed, then D = 60 KB. Each request takes the lowest-addressed free block of the right power-of-two size. At which address (in KB) does D start?
- A. 0
- B. 192
- C. 128
- D. 384
Correct answer: B. 192
A gets 128 KB at 0 (splitting 512→256+256→128+128). B gets 64 KB at 128 (splitting 128→64+64). C gets 128 KB at 256. Freeing A frees 0–127 (its buddy 128–255 is split, so no merge). D needs 64 KB, and a free 64 KB block already exists at 192 (B's buddy), so it is used without splitting the 128 KB block at 0.
More Operating Systems questions
- Memory holes in address order: 100 KB, 500 KB, 200 KB, 300 KB, 600 KB. Requests in order: 212 KB, 417 KB, 112 KB, 426 KB (a hole that is…
- A virtual address is 0x00403A7C on a system with 4 KB pages and a two-level page table (10-bit outer index, 10-bit inner index, 12-bit…
- 32-bit addresses, 4 KB pages, 4-byte PTEs, two-level paging (10/10/12). A process uses only 8 MB of code at virtual address 0 and 4 MB of…
- A system has resource types A, B, C. Available = (2,1,0). Allocation: P0 (1,1,0), P1 (0,1,2), P2 (2,0,1), P3 (1,0,0). Max: P0 (3,2,2), P1…
- Banker's algorithm state: Available = (3,3,2). Allocation: P0 (0,1,0), P1 (2,0,0), P2 (3,0,2), P3 (2,1,1), P4 (0,0,2). Max: P0 (7,5,3), P1…
- Two resource types X, Y. Available = (1,1). Allocation: P0 (1,0), P1 (0,1), P2 (1,1). Max: P0 (2,1), P1 (1,2), P2 (2,2). How many of the…