Description
About this Assignment
In this project, you will write code that emulates how operating systems manage interaction between files and memory. The code you are writing will be functions that provide interaction between the code you have seen in the chapters Memory Management & Operating Systems and File Management Systems. As the functionality you are developing is file management related, you are required to develop your code as methods in the file management class. Upon completion of this project you will be able to:
Describe how operating systems manage files in memory
Write simple codes to emulate basic functionalities of operating systems
Prompt
In this project, assume that files are stored on the hard disk using linked storage allocation. Your task is to write a code that:
Collects information about all the fragments of the file from the hard disc in order to calculate the total required space needed for the file in memory
Calculates the space required to store the file in memory (For simplicity, you can assume that this space equals only to the total size of the file. Do not consider other related metadata)
Allocates space in memory for the file. If needed, you can use the code you wrote in Assignment 1: Solving Memory Management Problems to liberate space in memory
Use the following example as a use case to build your code:
Total Memory size = 20 Kbyte
Page size = 1 Kbyte
Initial memory state
Job ID Start Time Job required size Execution interval Job state at the end of the interval
1 1 2 7 Sleep
2 2 3 8 Sleep
3 3 4 6 Sleep
4 4 3 6 Sleep
5 5 2 9 Sleep
6 6 3 6 Sleep
7 7 2 6 Sleep
Note that all processes are in sleep state at the end of their respective time intervals in the previous table.
Your program should not be limited to a single file and you are required to test it against different other files.
Here is the information related to the file:
File size = 8Kbyte
Disk bloc size= 1 Kbyte
File initially allocated the following disk blocs: 28, 5, 12, 13, 1, 4
File required to be transferred to the memory in time interval 12
File required to stay in memory up to interval 16
Grading Rubric
Your project will be graded based on the following rubric:
Category Unacceptable (0-1) Needs Improvement (2-3) Acceptable (4-5) Total Possible Points
Syntax (x4) Program does not compile and contains more than 3 compiling errors Program does not compile but contains less than 3 compiling errors) Program compiles and executes 20
Correctness (x4) Program does not work correctly for both the specified file and other files Program works correctly only for the specified file fails for other files Program works correctly for different files 20
Assignment Specifications (x2) Significant details of the specification are violated Minor details of the assignment specification are violated Code respects the assignment specifications 10
Documentation (x2) Code does not contain any documentation or code not commented Code contains documentation for functions and/or variables with some inaccuracies Code contains accurate documentation for all functions and variables 10