BareMetal-OS is designed with a clear separation of concerns and modular architecture. The system is built from the ground up in Rust, focusing on safety and performance.
- Bootloader: Uses the
bootloadercrate to handle the initial system boot. - GDT (Global Descriptor Table): Manages memory segmentation.
- IDT (Interrupt Descriptor Table): Handles interrupt routing.
- Physical Memory Manager: Handles raw memory allocation.
- Virtual Memory: Implements paging with the following features:
- Page Table Management
- Memory Mapping
- Heap Allocation
- Memory Allocator: Supports different allocation strategies:
- Bump Allocator
- Linked List Allocator
- Fixed-Size Block Allocator
- VGA Driver: Manages text-mode display output.
- Keyboard Driver: Handles PS/2 keyboard input.
- UART Driver: Manages serial communication.
- PIC: Manages the Programmable Interrupt Controller.
✅ Implemented:
- Bare metal bootloader integration
- Protected mode initialization
- Basic memory management
- VGA text buffer output
- Interrupt handling infrastructure
- Custom global allocator
- Hardware exception handling
- Unit test framework
🚧 In Progress:
- Keyboard input handling
- Advanced memory management
- Multi-threading support
- File system basics
Before running BareMetal-OS, ensure that your system meets the following requirements:
-
Hardware:
- Architecture: x86_64 (BareMetal-OS is designed for the x86_64 architecture; while it is primarily tested in emulated environments, adaptations may allow it to run on physical hardware with additional configuration.)
- Memory: At least 512 MB available (this may vary depending on the emulator or physical system settings).
-
Emulation / Virtualization:
- QEMU: Recommended (version 6.0 or later) for emulating the hardware environment during development and testing.
-
Storage:
- Sufficient disk space to compile and run the OS.
To build and run BareMetal-OS, install the following dependencies:
- Rust Nightly Toolchain:
The project requires the nightly version of Rust. Set it up with:rustup override set nightly - Cargo Bootimage::
Install the bootimage tool to create bootable disk images:
cargo install bootimage
- Build Dependencies:
All necessary Rust crates are automatically managed by Cargo. For reference, some key dependencies (as seen in the Cargo.lock) include:
- bootloader
- lazy_static
- linked_list_allocator
- pc-keyboard
- pic8259
- spin
- uart_16550
- volatile
- x86_64 (For a complete list, please review the Cargo.lock file.)
- Building the Project:
cargo build
- Creating a Bootable Image:
cargo bootimage
- Running the OS in QEMU:
cargo run
BareMetal-OS is under active development. Future enhancements include more advanced memory management, multi-threading support, and the integration of a basic file system.