Consider a file system on a disk that has both logical and physical block sizes
ID: 3700442 • Letter: C
Question
Consider a file system on a disk that has both logical and physical block sizes of 512 bytes. Assume that the information about each file is already in memory. For each of the three allocation strategies (contiguous, linked, and indexed), answer these questions: a. How is the logical-to-physical address mapping accomplished in this system? (For the indexed allocation, assume that a file is always less than 512 blocks long.) b. If we are currently at logical block 10 (the last block accessed was block 10) and want to access logical block 4, how many physical blocks must be read from the disk?
Explanation / Answer
Assuming the starting file address (block number) as Z.
1. Contiguous.
Here we divide the logical address by 512 with X = Resulting quotient and Y = Remainder.
a. For logical to physical mapping we add X to Z which gives us the physical block number. Y is the displacement into that block.
b. 1
2. Linked
Here we divide the logical physical address by 511 with X = Resulting quotient and Y = Remainder.
a. Logical to physical physical address mapping is accomplished by chasing down the linked list which gives us X + 1 blocks and Y + 1 will be the displacement into the last physical block.
b. 4
3. Indexed.
Here we divide the logical address by 512 with X = Resulting quotient and Y = Remainder.
a. Logical to physical physical address mapping is accomplished by getting the index block into memory. Physical block address is contained in the index block present at location X. Y is the displacement into the desired physical block.
b. 2
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.