F8. Consider a file system ona disk that has both logical and physical block siz
ID: 3613272 • Letter: F
Question
F8.
Consider a file system ona disk that has both logical and physical block sizes of 512bytes. Assume that the information about each file is alreadyin memory. For each of the linked and indexed strategies,answer these questions:
(a) How is the logical-to-physical addressmapping accomplished in this system? (For the indexedallocation, assume that a file is always less than 512 blockslong.)
(b) If we are currently at logical block 10(the last block accessed was block 10) and want to access logicalblock 4, how many physical blocks must be read from thedisk? Explain your reasoning for each strategy.
Explanation / Answer
Dear User,(a) Logical –to –physical address mapping: Contiguous: Logical addresses directly mapped to physical address. If a new logical block is added, aphysical block will be allocated adjacent to the physical blockthat corresponds the previous logical address. ->So,Divide the logical address by 512 with X and Y theresulting quotient and remainder respectively. (I)Add X to Z to obtain thephysical block number. Y is the displacement into that block. (II)1. Linked: Logically contiguous addresses‘may not be’ contiguously in physical addresses. Butthe physical blocks are linked in some manner. ->So, Divide the logical physical address by 511 with X andY the resulting quotient and remainder respectively. (I)Chase down the linkedlist (getting X + 1 blocks). Y + 1 is the displacement into thelast physical block. (II)4 Indexed: In the indexed system, the physicaladdresses are allocated independently with relation to each otheras well as to other logical addresses. An identifier or an index isgiven to each logical address to indicate the location of thecorresponding physical address. ->So,Divide the logical address by 512, with X and Y theresulting quotient and remainder, respectively. (I)Get theindex block into memory. Physical block address is contained in theindex block at location X. Y is the displacement into the desiredphysical block. (II) 2
(b) Contiguous:The current address is known andthe blocks are located in consecutive order, the address of anyother block can be found according to the block number. So onlyblock 4 needs to be read from the disk. Linked: Since we are at logical block 10, toread block 4, block 1 should be read at first. Using the addresscontained in block 1 we have read block 2 from the disk, and so on.So 4 blocks, from block 1 to 4, should be read to read block 4 fromthe disk. Indexed: Since it is assumed that all theinformation about each file is already in memory, we just have lookat the index for block 4 and read it according to informationprovided by the index. So only one block, block 4, needs to be readfrom the disk. ITS HELPFUL TO YOU..........
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.