MinimalOS-StorageManager is a minimal storage management system built in assembly. It is designed as a component of a custom operating system to manage storage devices (hard-disk or SSD). The project implements basic file operations, memory allocation, and defragmentation for both unidimensional and bidimensional memory models, focusing on efficient resource management and low-level hardware interaction.
- Fixed Storage Capacity: Simulated storage device with a fixed capacity of 8MB, divided into 8kB blocks.
- File Storage:
- Each file requires at least two contiguous blocks for storage.
- Files are stored contiguously; if contiguous space is unavailable, storage fails.
- File Operations:
- Add a file: Allocates the first available contiguous block interval for the file.
- Get file location: Returns the start and end block interval for a given file descriptor.
- Delete a file: Frees the blocks occupied by the file by resetting their descriptor to 0.
- Defragmentation: Reorganizes files to occupy consecutive blocks starting from block 0, eliminating gaps.
- Add File: Allocates blocks for a file based on its size and descriptor.
- Get File Location: Returns the block interval for a file.
- Delete File: Frees the blocks occupied by a file.
- Defragmentation: Compacts memory to optimize storage and reduce fragmentation.
The program accepts input in a specific format. For detailed input specifications, refer to the Input Format Specification.
A machine that runs linux. (It can also be a VM or WSL)
Clone the repository:
git clone https://github.com/fernandodonea/MinimalOS-StorageManagerNavigate to the project directory:
cd MinimalOS-StorageManagerCommand to obtain the executable:
gcc -m32 StorageManager.s -o task1 -no-pie -z noexecstackCommand to run the executable:
./task1 < input.txtThe checker is a Python script that verifies the output of the assembly program. It compares the expected output with the actual output generated by the program. The checker is designed to ensure that the program behaves as intended and produces correct results.
Ensure that Python 3.9 (or later) is installed on your system.
sudo apt update
sudo apt install python3The script must be placed in the same directory as the executables to be tested.
python3 checker.py task1