0
$\begingroup$

In trying to solve the following problem:

You are presented with the first 15 blocks of a secondary storage device (disk) which has a total of 30000 KB available. The linked allocation method is used to assign space on the disk. Each block has 512 bytes. A file names Exam is represented.

Blocks:

[ 0 | $\ $ ] $\ \ \ \ $ [ 1 | $ $ ] $\ \ \ \ $ [ 2 | $\ $ ] $\ \ \ \ $ [ 3 | 14 ] $\ \ \ \ $ [ 4 | $\ $ ]

[ 5 | 3 ] $\ \ \ \ $ [ 6 | $ $ ] $\ \ \ \ $ [ 7 | 12 ] $\ \ \ \ $ [ 8 | $\ $ ] $\ \ \ \ $ [ 9 | $\ $ ]

[ 10 | $\ $ ] $\ \ \ \ $ [ 11 | $ $ ] $\ \ \ \ $ [ 12 | 5 ] $\ \ \ \ $ [ 13 | 14 ] $\ \ \ \ $ [ 14 | -1 ]

[ 0 | $\ $ ] $\ \ \ \ $ [ 1 | $ $ ] $\ \ \ \ $ [ 2 | $\ $ ] $\ \ \ \ $ [ 3 | 14 ] $\ \ \ \ $ [ 4 | $\ $ ]

Directory: Exam

Start: 7

End: 14

  1. Calculate for each block, the number of bytes that can be assigned to data and to pointers to other blocks.

  2. Calculate the maximum size (in bytes) of the stored data in the file Exam.

What I have tried:

Question 1

I don't fully understand the concept but I would say that if there are 15 blocks and 30000 KB of space on the disk, then each block can be assigned $30000 / 15 = 2000$ KB?

Question 2

The file occupies 5 blocks and each block has a size of 512 bytes = $2^9$ therefore the files stores $2^9 * 5 = 2^9 * (2^2 + 1) = 2^{11} + 2^9 = 2560$ bytes of data.

Would my above assumptions and calculations be correct? If not, how is it to be done?

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.