Skip to content

Using files to imitate the memory allocation of Linux system, while ensuring the accuracy of writing and reading, the memory blocks and fragments are retrieved and sorted out, and through improving the file architecture to achieve faster search and write.

Notifications You must be signed in to change notification settings

Labmem009/MyMalloc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OSLab05

本次作业提供的datafile为一个磁盘映像,任务是将里面的文件数据块整理并排序,处理完毕的datafile-defrag仍然是一个磁盘映像,且空闲块数量大于datafile

原始磁盘映像结构为

| boot[512] | SuperBlock[512] | Inode[2048] | null[512] | ............................................................................. |

经过处理后(这里是将数据块依次排列,然后索引块依次排列) 

| boot[512] | SuperBlock[512] | Inode[2048] | null[512] | data block.................. | index block.............. |

*正确性验证:原始磁盘映像中有20个inode,其中3个的nlink=0意为被删除,另外17个都是能提取出来,双击打开的文件,有PDF,JPG,源代码文件等

*经过处理后的磁盘映像文件,再用程序提取一遍,也能提取出17个一模一样的文件,否则就不正确

About

Using files to imitate the memory allocation of Linux system, while ensuring the accuracy of writing and reading, the memory blocks and fragments are retrieved and sorted out, and through improving the file architecture to achieve faster search and write.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published