OSCAFS Project
Developer: Zifeng ZHANG
Tutor: Sami TAKTAK
Date:09/01/2022
The file system OSCAFS is designed based on FAT. This file system includes directory entries, FAT tables and data blocks.
OSCAFS is currently designed as a file system that can hold 512KB and can store 128 files.(The file system capacity and file number data can be changed in NB_BLOCKS and NUM_DENTRY in the header file oscafs.h).
OSCAFS uses the FAT table to index data blocks, so file writing and file reading use a chain structure to ensure that there is no waste of data blocks between disk blocks.
All OSCAFS programs are written in 6 C files, 1 header file and one Makefile:
-
osca_fs.c is the main program.
-
fs_os.c contains the code for most of the command functions of the file system,including OSCAFS open and close functions and functions related to input processing.
-
copy_os.c contains all the code related to the copy function.
-
fs_fat.c contains the code related to processing the FAT table.
-
fs_dentry.c contains the code for processing directory entries.
-
fs_block.c contains the code that handles writing data blocks.
-
oscafs.h is the header file of all functions.
-
Makefile is a compiled file.
- "write" : To creat a file and input content
- "read" : To read file content
- "seek" : Search files by file name
- "copy host" : Copy file from local to OSCAFS
- "copy OSCAFS" : Copy OSCAFS file to local
- "rm" : Delet file
- "ls" : List all files
- "ls -l" : List files detail information
- "FAT " : Show FAT table
- The codes of "write", "read", "seek", "ls", "ls -l", "rm", and "FAT" are stored in fs_os.c.
- The codes of "copy host" and "copy OSCAFS" are stored in copy_os.c.
- In the OSCAFS program, all empty lines (empty line’\n’) are used to roll back the function mode to the command line interface until the OSCAFS file system is closed.That is to say, return to the command line interface and eject the file system with the Enter key.
-
clone the repository
git clone https://github.com/ZIFENG278/FAT_filesystem.git
or download zip file and unzip
wget https://github.com/ZIFENG278/FAT_filesystem/archive/refs/heads/master.zip
-
compile source code
make
-
run execution file
./osca_fs