In this project, you will design and implement a simplified UNIX System 7 like file system in C or C++ as described in S

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

In this project, you will design and implement a simplified UNIX System 7 like file system in C or C++ as described in S

Post by answerhappygod »

In This Project You Will Design And Implement A Simplified Unix System 7 Like File System In C Or C As Described In S 1
In This Project You Will Design And Implement A Simplified Unix System 7 Like File System In C Or C As Described In S 1 (105.6 KiB) Viewed 19 times
In this project, you will design and implement a simplified UNIX System 7 like file system in C or C++ as described in Section 4.5.2 of your textbook. Part 1 Design a file system that uses i-node structure to keep your files. Your file system will use, a i-node structure like Fig 4.32 and Fig 4.33 of your textbook. Your file attributes will include size, file creation time, last modification date and time, and name of the file. Write a design report that specifies the following Define your directory structure and directory entries; Define how and where you keep the free blocks; Define your superblock that contains crucial information about the file system such as the block size, root directory position, block positions, etc. Your report should include the function names of your source code that handles the file system operations listed in the table of Part 3. Part 2 Write a C/C++ program that creates an empty file system as a (16 MB max) Linux file. This file will include all the information about your file system including the super block, data blocks, free blocks, directories, data, etc. The sample run of the program will be like makeFileSystem 4 mySystem.dat where 4 is the block size of the file system in KB. mySystem. dat is the Linux file that contains all the file system. When you work on the file system, this file contains all the information for the file system.

Part 3 You will write a program that performs file system operation on the file system. The program will work like following fileSystemOper fileSystem.data operation parameters where fileSystemOper is your program, filesystem.data is the file system data file that you have created in Part 2. You will keep modifying the same fileSystem.data file for all your operations. Allowable operations and parameters for these operations are given below in the following table. Operation Parameters Explanation Example dir Path fileSystemOper fileSystem.data dir "\" Lists the contents of the directory shown by path on the screen. lists the contents of the root directory. The output will be similar to dir command of DOS I

mkdir rmdir dumpe2fs write read del Path and dir name None Path and file name Path and file name Path and file name Makes or removes a directory Gives information about the file system. Creates and writes data to the file Reads data from the file Deletes file from the path fileSystemOper filesystem.data mkdir "\ysa\fname" makes a new directory under the directory "ysa" if possible. These two works exactly like mkdir and rmdir commands of DOS shell fileSystemOper fileSystem.data dumpe2fs works like simplified and modified Linux dumpe2fs command. It will list block count, free blocks, number of files and directories, and block size. Different from regular dumpe2fs, this command lists all the occupied blocks and the file names for each of them. fileSystemOper filesystem.data write "\ysa\file" linuxFile Creates a file named file under "\usr\ysa" in your file system, then copies the contents of the Linux file into the new file. fileSystemOper fileSystem.data read "\ysa\file" linuxFile Reads the file named file under "/usr/ysa" in your file system, then writes this data to the Linux file. This again works very similar to Linux copy command. fileSystemOper fileSystem.data del "\ysa\file" Deletes the file named file under "\ysa\file" in your file system. This again works very similar to Linux del command.

Here is a sequence file system operation commands that you can use to test your file system. Suppose you have a file named linuxFile.data in your Linux current directory. makeFileSystem 4 mySystem.data ; you may change 4 to a reasonable value fileSystemOper fileSystem.data mkdir "usr" fileSystemOper fileSystem.data mkdir "\usr\ysa" ; Should print error! fileSystemOper fileSystem.data mkdir "\bin\ysa" fileSystemOper filesystem.data write "\usr\ysa\filel" linuxFile.data fileSystemOper fileSystem.data write "\usr\file2" linuxFile.data fileSystemOper fileSystem.data write "\file3" linuxFile.data fileSystemOper fileSystem.data dir "\" ; Should list 1 dir, 1 file fileSystemOper filesystem. data del "\usr\ysa\filel" fileSystemOper fileSystem.data dumpe2fs fileSystemOper fileSystem.data read "\usr\file2" linuxFile2.data cmp linuxFile2.data linuxFile.data ; Should not print any difference Notes 1. Always be careful about the errors, such as bad block sizes, bad file names, non-existent files or directories, etc. 2. Run experiments that uses up all of your data blocks. 3. Try to get fragmentation and show your fragmented file system using the dumpe2fs command. 4. Do not use any code from any other source even a single line! General Homework Guidelines II
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply