Samux
A no_std operating system kernel written from scratch in Rust.
Goals
- Learn OS design and implementation fundamentals.
- Explore Rust for safe, efficient systems-level code.
- Understand hardware interaction, memory management, and process scheduling from the ground up.
Building and Running
Prerequisites
QEMU:
sudo apt-get update && sudo apt-get install -y qemu-system-x86Rust nightly toolchain:
rustup toolchain install nightly rustup override set nightlyrust-src component:
rustup component add rust-srcllvm-tools-preview component:
rustup component add llvm-tools-previewbootimage:
cargo install bootimage
Running
Clone the repository:
git clone https://github.com/sammme/samux.git cd samuxRun the OS:
cargo run -- uefi
Roadmap
Phase 1: Core Kernel and Bootstrapping
- Project setup (
no_stdRust binary) - Bootloader integration (
bootimagecrate) - Framebuffer-based text output
- Panic handler
Phase 2: Interrupts and Memory Management
- GDT (Global Descriptor Table)
- IDT (Interrupt Descriptor Table)
- Paging (4-level page tables)
- Heap allocator (
linked_list_allocator) - Physical frame allocator
Phase 3: Hardware and Concurrency
- PIC/APIC interrupt handling
- PIT (Programmable Interval Timer)
- PS/2 keyboard driver
- Preemptive multitasking
Phase 4: Userspace and Filesystems
- Syscall interface
- Userspace program execution
- FAT32 filesystem
- Basic shell
Documentation
Memory Layout
Contributing
Contributions are welcome. Please follow these guidelines:
- Fork the repository.
- Create a new branch:
git checkout -b feature/your-new-feature - Make your changes.
- Format your code:
cargo fmt - Lint your code:
cargo clippy - Ensure the project builds:
cargo build - Open a Pull Request with a clear description of your changes.
License
This project is licensed under the MIT License. See the LICENSE file for details.