thatmagicalcat/magicalos
Tentang
An operating system written in rust
Sistem dan infrastrukturYang dapat Anda lakukan
- Multiboot2 Booting: Compatible with multiboot2, booted via an ISO image.
- Limine Booting: Switched to Limine bootloader for better features and easier setup.
- Physical memory tracking using a custom Bitmap Frame Allocator.
- Global heap allocator which is a LinkedList Allocator (giving access to Rust's alloc crate, e.g. Box, Arc, Vec).
Pertumbuhan bintang terukur
- dalam 24 jam
- 0
- dalam 7 hari
- 0
- dalam 15 hari
- 0
- dalam 1 bulan
- Mengumpulkan riwayat
Perubahan bersih pada periode yang tumpang tindih, bukan total harian. Pengukuran yang belum tersedia dibiarkan kosong. Bintang menunjukkan perhatian, bukan kualitas.
README.md
AsliMagicalOS
A simple, modern, 64-bit operating system kernel crafted in rust 🦀
MagicalOS is a from-scratch operating system kernel built in Rust (with a little bit of x86_64 assembly). It leverages Rust's safety and modern tooling to build foundational OS primitives.
This project was built for the sake of learning how operating systems work under the hood and having fun bringing a machine to life!
MagicalOS running doom:

Current Features
What makes MagicalOS magical? good question... even idk, but here's the progress so far xD
- Multiboot2 Booting: Compatible with multiboot2, booted via an ISO image.
- Limine Booting: Switched to Limine bootloader for better features and easier setup.
- Memory Management:
- Physical memory tracking using a custom Bitmap Frame Allocator.
- Global heap allocator which is a LinkedList Allocator (giving access to Rust's
alloccrate, e.g.Box,Arc,Vec).
- Hardware Integration:
- APIC & IOAPIC
- Asynchronous Execution: A simple asynchronous task executor.
- Preemptive Multitasking: OS Threads and a simple Robin Round Scheduler.
- Synchronization Primitives: Custom scheduler-aware Mutex and fair spinlock implementation.
- Display & Logging:
- Custom VGA text buffer interface with color support
- VESA graphics with a flanterm for a modern terminal experience.
- qemu logging to easily see kernel traces in the host terminal.
- Userspace and Syscalls: A simple syscall interface with a few implemented syscalls
- File system:
- In memory Virtual File System (VFS)
- ELF Loading: The kernel can load and run ELF binaries, but still there is a lot of work that has to be done.
And oh, it can run doom!
Getting Started
Prerequisites
You need a Linux environment (or WSL2) with the following tools installed:
- Rust Nightly: The kernel relies on unstable features (like
#![feature(allocator_api)]) and custom target JSONs.rustup toolchain install nightly rustup default nightly rustup component add rust-src - QEMU: For emulating the x86_64 machine.
- xorriso: To generate the bootable
.isofile.
Building and Running
Just clone the repository and run:
cargo x r
Running tests
Kernel tests run inside QEMU (no host std test harness), and report through the debug console:
cargo x test
This command compiles the kernel test binary, builds a bootable ISO, launches QEMU headless, and fails/succeeds based on the QEMU debug-exit code.
TODOs:
I'm constantly trying to add magic, here's the rough roadmap of features I want to implement:
- Phase 1: Hardware Interrupts (VGA, APIC, IOAPIC, Keyboard async tasks, Timer)
- Phase 2: Multitasking (Context switching, Scheduler, Kernel threads)
- Phase 3: Storage (VFS)
- Phase 4: User Space (Syscalls, Processes, ELF loader)
- Phase 5: libc and Userland (C library, Shell, Basic utilities)
- Port mlibc
- Run doom
Acknowledgements
- Learning from incredible resources and projects like the OSDev Wiki, RedoxOS, eduOS, Intel SDM (probably not as incredible but this is all i have TT) and Philipp Oppermann's Writing an OS in Rust.
Star History
Jelajahi proyek terkait
Memuat…