Question: Please create this in Rust. Description: You will develop and implement a small file system, a combination of Unix and CP / M concepts, the
Please create this in Rust.
Description:
You will develop and implement a small file system, a combination of Unix and
CPM concepts, the file system in this example is called FS
Your file system will not be part of an operating system, but similar to
Many modern file systems it will run in several different operating systems to
provide a portable file system a group of files
Details:
Your FS will use a file for example disk rather than directly using
a physical flash or disk, to store data.
You may have several disklike files for example: disk disk
used to store data. The data stored in disk may be a users programs, text files,
other data files, or any type of binary information. In addition to the data
stored, your FS will need to store other, metainformation, such as free space
blocks directory details, and possibly other information. The FS directory is flat
one level fixed sized, has a user name associated with each file, and has fixed
sized blocksentries
You should use fixed size blocks similar to disk blocks of size bytes to store
files and all metadata in your disk
Your diskfor example disk is logically divided into a number of sectors
which are fixed size blocks. Everything that is stored persistent is in these
blocks
Your program the FS executable should provide the following operations:
Createfs #ofblocks creates a filesystem disk with #ofblocks size, each bytes
Formatfs #filenames #DABPTentries
Savefs name save the disk image in a file name
Openfs name use an existing disk image
List list files and other metainformation in a FS
Remove name remove named file from fs
Rename oldname newname rename a file stored in the FS
Put ExternalFile put store Host OS file into the disk
Get ExternalFile get disk file, copy from disk to host OS file system
User name this user owns this users files
LinkUnlink Unix style file linking
Implementation:
Your FS should have or more, if easier to implement sections:
A FileNameTable FNT an directory and attributeblock pointer table DABPT
and the data blocks.
The FNT should be of size allocated, each entry should contain a char
maximum file name and an inode pointer index to DABPTblocks
The DABPT should be allocated from disk blocks, entries per block, where each entry
should contain a file metainformation FileSize last timedate secspointers
to data blocksthat is a pointer to the first entry in the Block Pointer Table
and a user name maximum length characters
The Block Pointer Table has direct pointers to data blocks, and one additional
pointer to another entry in the Table, if needed for big files these may be
chained for very large files. Similar to CPM extents there is an array of sets
groups of pointers, of bits each, and the last th pointer can chain.
Since disks and some metainformation are fixed size, many small or one
large file might not fit on the disk File names, file attributes and other file
information stored in FS are restrictive for example, file creation time
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
