Skip to content

fernandodonea/MinimalOS-StorageManager

Repository files navigation

MinimalOS-StorageManager

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.

Features

Unidimensional Memory Management

  • 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.

Example Operations

  • 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.

Input Format

The program accepts input in a specific format. For detailed input specifications, refer to the Input Format Specification.

Getting Started

Prerequisites

A machine that runs linux. (It can also be a VM or WSL)

Installation

Clone the repository:

git clone https://github.com/fernandodonea/MinimalOS-StorageManager

Navigate to the project directory:

cd MinimalOS-StorageManager

Usage

Command to obtain the executable:

gcc -m32 StorageManager.s -o task1 -no-pie -z noexecstack

Command to run the executable:

./task1 < input.txt

Checker

The 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.

Prerequisites

Ensure that Python 3.9 (or later) is installed on your system.

sudo apt update
sudo apt install python3

Usage

The script must be placed in the same directory as the executables to be tested.

python3 checker.py task1

About

ASC project: a minimal storage management system built in assembly x86. It simulates file operations, memory allocation, and defragmentation on a virtual storage device.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors