This fifth and final lab will explore how a basic file system works.
This lab will again use Python and the Colab Jupyter Notebook environment.
This lab is an individual deliverable.
Submit your Python Notebook with your updated code, and add a markup cell which answers the two questions set out below.
Email me your deliverable before midnight 22 November 2024.
Access the Colab Notebook with the starter code here.
In this lab, you'll explore how we can scale up a very basic file system to accommodate a larger number of files of various sizes, and will help you better understand the interplay of block size, file size, the inode and data block allocation.
The starter code implements a very basic, and really quite crappy, file system which permits no more than 5 files within no more than 64 blocks of memory of 1KB each. Files are also limited to only 4KB in size.
You will note that the code implements very basic file write, read, and delete functionality. The code does not store any actual data - it only allocates memory from a call to write_file()with a file_size value.
Study the code and gain a solid understanding of how all the various bits work together. Pay particular attention to how the inode and data allocation works and what the bounds for each are.
You will note two cells at the end of the notebook, the first one of which is not working, because of the limitations of our crappy file system. Adapt the code to make the file system work for more and larger files.
The second cell bombards our file system with a large number of writes and deletes and is encountering a very high rate of write failures. You will note there is a commented out file_size instantiation.
Adapt the code so that the code with the uncommented file_size works in such a way that we have very few write failures.
Adjust the loop range value (i.e. make it run for various values, try 3000, or higher) and try to divine some relationship between it and how big the file system needs to be.
Adjust the minimal file size (the first parameter in the line which generates the file_size), and assess how this influences the required dimensions and performance of the filesystem.
Report your observations on these two items in a markup cell at the bottom of your code.
Your solution should not adjust the block size of 1KB.
Declaring some global constants for the bits you will need to change and experiment with, will likely make your testing easier and your solution more elegant.
Also, be sure to make appropriate adjustments to the show_bitmaps() function so it looks nice.