Question: 1.) Consider a computer system that uses demand paging. The size of each page is 128 words. A two dimensional array data[128][128] of words is
1.) Consider a computer system that uses demand paging. The size of each page is 128 words. A two dimensional array data[128][128] of words is stored row major, that is, the array is stored as follows: data[0][0], data[0][1], ..., data[0][127], data[1][0], data [1][1], ..., data[127][127].
For the following code fragments (that initialize the array), state the number of page faults assuming that 8 pages are allocated to the process and FIFO is used as the page replacement algorithm. Explain your answer.
a) for (j = 0; j <128; j++)
for (i = 0; i < 128; i++)
data[i,j] = 0;
b) for (i = 0; i < 128; i++)
for (j = 0; j < 128; j++)
data[i,j] = 0;
2.) Consider a computer system with a 64-bit logical address and 4-KB page size. The system supports up to 1GB (2^30 bytes) of physical memory. How many entries are there in a single-level page table?
3.) Consider a file system on a disk with disk block size of 256 bytes.
Assume that the file allocation information ([start, end] or index block) is already in memory. For each of the three allocation strategies (contiguous, linked, and indexed with a single index block already in memory), answer the following question: If we are currently at logical block 12 (the last block accessed was block 12) and want to access logical block 6, how many physical blocks must be read from the disk? Note: Logical block numbers start at 0.
4.) If the block size of a Unix file system is 1KB and the disk address length (length of the pointer to a disk block) is 4 bytes, what is the maximum file size if the file control block of a file contains 16 direct entries, one single indirect entry, and one double indirect entry?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
