Solution:
suppose z is the starting file address
NOw,
Contiguous:
In this strategy: Divide the logical address by 512 and after it let's say D is the dividend and R is the remainder
D+z will be the physical block number. and the remainder R is the displacement into the block.
Linked:
In this strategy: Divide the logical address by 511 and after it let's say D is the dividend and R is the remainder
D+1 is the physical block number in the list, and R+1 is the displacement.
Indexed:
In this strategy: Divide the logical address by 512 and after it let's say D is the dividend and R is the remainder
The physical block address is indexed at D, and in the block.t, and R+1 is the displacement.
2)
I f we are currently at logical block 10 and want to access logical block 4, for that number of physical blocks must be read from the disk is :
Linked, the number of physical blocks must be read from the disk is 4.
Contiguous, the number of physical blocks must be read from the disk is 1.
Indexed, the number of physical blocks must be read from the disk is 2.
I hope this helps if you find any problem. Please comment below. Don't forget to give a thumbs up if you liked it. :)
1 Mark Question Two Consider a file system on a disk that has both logical and...
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: If we are currently at logical block 5 (the last block accessed was blocked 4) and want to access logical block 15, how many physical blocks must be read from the disk?
Suppose that a file requires 20 blocks to be stored in disk. For each of the following allocation strategies( contiguous, linked, indexed), determine the number of disk block we need to read to bring in block 7 into memory after reading the file’s directory header?
We know that there are different disk allocation methods that help the operating system decide how disk blocks are allocated for files. In the contiguous disk allocation method, each file occupies a set of consecutive addresses on the disk. While this makes file allocation easier, an increase in the file size means that it has to be assigned elsewhere on the disk. The linked disk allocation method requires including a pointer in the current file, which points to the location...
Operating System Problem Three file allocation techniques for storing a file on disk, namely contiguous allocation, linked allocation, and indexed allocation. For each allocation method show how a file of 10 blocks would be allocated on disk. Note that the disk is represented as 30 blocks with blocks 0, 5, 6, 15, 25 already allocated. Note you must show the entire data structure for each allocation method as part of the answer. Thanks
Consider a file system similar to the one used by UNIX (indexed allocation). How many disk operations are required to access the contents of a file at /dir1/dir2/fle3 ? Assume that none of the disk blocks is currently being cached Total number of disk operations:
How many disk accesses are needed to bring byte i of a file into memory when the file is stored using contiguous allocation? Assume only the file’s FCB is in memory , block pointers require 32 bits , and that blocks hold 4096 bytes each. 3 accesses 1 + [ i/4096] accesses [i/4096 accesses 2 accesses 1 access
Consider an empty 1 Gbyte disk with the block size of 4096 bytes. When the disk is formatted blocks 0 is occupied for system-related information. The system always allocated free blocks starting st the lowest numbered block, and it uses non-contiguous allocation. Question 6 (2, 4) Consider an empty 1 Gbyte disk with the block size of 4096 bytes. When the disk is formatted blocks 0 is occupied for system-related information. The system always allocates free blocks starting at the...
Consider a file system similar to the one used by UNIX (indexed allocation). How many disk operations are required to access the contents of a file at dir1/dir2/file3 ? Assume that none of the disk blocks is currently being cached. Total number of disk operations:
How many disk accesses are needed to bring byte i of a file into memory when the file is stored using contiguous allocation? Assume only the file’s FCB is in memory , block pointers require 32 bits , and that blocks hold 4096 bytes each. 3 accesses 1 + [ i/4096] accesses [i/4096 accesses 2 accesses 1 access
How many disk accesses are needed to bring byte 4090 of a file into memory when the file is stored using double indirect indexed allocation? Assume that only the file's FCB is in memory, block pointers require 32 bits, and that blocks hold 1024 bytes each. How many disk accesses are needed to bring byte 4090 of a file into memory when the file is stored using double indirect indexed allocation? Assume that only the file's FCB is in memory,...