demofs is a minimal filesystem experiment featuring a custom disk format running entirely on a simulated 1 MB virtual disk (disk.sim). The project is structured into two main components:
This module implements the core filesystem logic that manages the virtual disk. It is designed in two layers:
-
Low-level API (fs__* functions): Internal functions that directly manipulate disk blocks, inodes, and the superblock. They handle raw read/write operations and are not meant to be used by end users directly.
-
High-level API (fs_* functions): User-facing functions that abstract the underlying implementation. These functions perform operations like file creation, deletion, copying, backup, restore, integrity checking, and defragmentation by utilizing the low-level API.
This layered design gives the fs module the structure of a self-contained framework,
Offers a minimal text-based user interface (TUI) for interacting with the filesystem. It allows you to create, edit, delete, and inspect files, manage backups, or test disk integrity through an interactive terminal menu system. This interface bridges the gap between the low-level filesystem logic and user interaction.
The goal of demofs is to provide a hands-on, educational environment for exploring filesystem design, storage management, and low-level data organization principles.
make clean && makemake Run- You can explore the entire file system through this menu.
- Shortcut operations on the file system are not implemented yet, but they can be added.
- You can create a file from this menu.
- Navigate to the location where you want to create the file and press 'Enter'. !!(You need to press it on the location, not inside a folder)
- If the file metadata is full, if a file with the same name exists in that location, or if the disk is full, you will get an operation failed warning.
- Error messages are not fully detailed based on the type of error yet, but invalid operations are prevented.
- You can delete a file from this menu.
- Navigate through the file system and press 'Enter' on the file/folder you want to delete.
- Navigate through the file system, press 'Enter' on the file, and enter the new name.
- First, select the file you want to copy from the file system, then select the destination location.
- First, select the file you want to move from the file system, then select the destination location.
- Navigate through the file system and press 'Enter' on the file/folder you want to read.
- In this mode, you can also see the format of inode index and names inside folders if you are curious.
- Navigate through the file system and press 'Enter' on the file you want to open.
- The selected file will open in a simple text editor where you can make changes.
- [ctrl+s = save] [ctrl+x = exit]
- A backup will be created as soon as you select this menu.
- A list of existing backups will be displayed. You can select the backup you want to restore.
- A disk integrity test will be performed, and warnings will be displayed on the screen as well as written in detail to the relevant log files.
- If you select this menu, a confirmation step will appear. After confirming, the disk will be reset.
- It is recommended to use this menu to exit the application safely. Even though disk metadata is backed up after important operations, exiting with a termination signal may cause some inconsistencies.
