CS FundamentalsHardGATE CS
An inode has 12 direct pointers, one single-indirect and one double-indirect pointer; blocks are 4 KB and pointers 8 bytes. What is the maximum file size?
- A. 1 GB + 2 MB + 48 KB
- B. 4 GB + 4 MB + 48 KB
- C. 1 GB + 4 MB + 48 KB
- D. 512 MB + 2 MB + 48 KB
Correct answer: A. 1 GB + 2 MB + 48 KB
A 4 KB block holds 512 eight-byte pointers. Direct: 12 × 4 KB = 48 KB; single: 512 × 4 KB = 2 MB; double: 512² × 4 KB = 1 GB. With 4-byte pointers the figures would be 4 MB and 4 GB.
More Operating Systems questions
- A parent forks 3 children that each call exit(0) immediately; the parent then sleeps for a minute without calling wait() and without…
- Why is a test-and-test-and-set spinlock (spin on a plain read, and only try the atomic exchange when the lock looks free) usually faster…
- A lock-free stack pops with CAS(&top, old, old->next). Thread 1 reads top = A (A->next = B) and is delayed; thread 2 pops A, pops B, then…
- A low-priority task L holds a mutex. High-priority H blocks on it, and medium-priority M (which does not need the mutex) becomes ready…
- A semaphore S starts at 7. Over time 20 wait() and 15 signal() operations complete on it, in some order, with no process left blocked at…
- A Unix process opens a file, forks, and both parent and child each write 100 bytes to the inherited descriptor (no OAPPEND, no seeks), one…