This project is a simple block-based, inode-style filesystem written in C for my Operating Systems course (Spring 2025). It runs on top of a simulated software disk provided via softwaredisk.c
.
- Carter Mauer
- Cole Heausler
simple-filesystem-c/
├── src/
│ ├── filesystem.c
│ ├── formatfs.c
│ ├── softwaredisk.c
│ ├── filesystem.h
│ ├── softwaredisk.h
├── tests/
│ ├── testfs0.c
│ ├── testfs4a.c
│ └── exercisesoftwaredisk.c
├── README.md
├── filesystem_design.pdf
├── assignment-instructions.pdf
└── .gitignore
Block Range | Purpose |
---|---|
0 |
Data Block Bitmap |
1 |
Inode Bitmap |
2–5 |
Inodes (4 blocks, 128 per block = 512 total) |
6–69 |
Directory Entries (64 blocks, 8 entries/block) |
70–4095 |
File Data Blocks |
- Inode-based structure with 13 direct and 1 indirect pointer
- Flat directory layout (single-level, no subdirectories)
- 512 max files
- ~8 MB max file size per file
- Supports filenames up to 507 characters
- Bitmaps used for inode and block allocation
- Persistent storage through
softwaredisk
backend - Error handling through
fserror
enum andfs_print_error()
Navigate to the src/
folder and build everything using make
:
cd src/
make
./formatfs
./testfs0 # Simple test
./testfs4a # Alignment test
All file operations set the global variable fserror
. You can check the result of any operation using:
fs_print_error();
Common error types include:
FS_OUT_OF_SPACE
FS_FILE_ALREADY_EXISTS
FS_FILE_NOT_FOUND
FS_IO_ERROR
- No support for subdirectories
- No permissions or timestamps
- Not thread-safe (single-process only)
- No crash recovery
See filesystem_design.md
for a detailed breakdown of the physical layout, file structures, and implementation limits.
This project was developed as an educational assignment for CSC 4103. Not intended for production or commercial use.