#os-kernel #kernel #os

nightly no-std zodiac

Rust OS framework that offers safe interfaces for kernel development

3 releases (breaking)

Uses new Rust 2024

0.3.0 Sep 10, 2025
0.2.0 Aug 9, 2025
0.1.0 Aug 5, 2025

#258 in No standard library

Download history 2/week @ 2025-10-06 2/week @ 2025-10-13 2/week @ 2025-10-20

160 downloads per month

Apache-2.0

185KB
5K SLoC

Zodiac

Zodiac is a framework for framekernel, inspired by ostd

Usage

First, you need to add zodiac to your project's Cargo.toml file:

[dependencies]
zodiac = "0.1.0"

Then, you need a main function with the attribute #[zodiac::main] and a panic handler with the attribute #[zodiac::panic_handler]:

#[zodiac::main]
pub fn main() {
    // Your code here
}

#[zodiac::panic_handler]
pub fn panic_handler(info: &PanicInfo) -> ! {
    log::error!("panic: {}", info);
    loop {
        core::hint::spin_loop();
    }
}

And there are other necessary options, which are listed below:

  • allocator
  • scheduler

If you like, you can also specify the logger.

When you want to run user tasks, you can do something like this:


use zodiac::task::{ReturnReason, Task, TaskBuilder, UserContext};

let thread = TaskBuilder::default()
    .entry(thread_entry)
    .data((user_entry, user_stack))
    .build()?;

fn thread_entry() -> ! {
    let mut user_context = {
        let task = Task::current();
        let (entry, stack) = task.data().downcast_ref::<(usize, usize)>().unwrap();

        UserContext::new(*entry, *stack)
    };
    
    loop {
        let return_reason = user_context.excute(// Some clossure that tells if there is a kernel event.);
        
        match return_reason {
            ReturnReason::Syscall => {
                // Handle Syscall
            }
            ReturnReason::Exception(exception) => {
                // Handle Exception
            }
            ReturnReason::KernelEvent => {
                // Handle Kernel Event
            }
        }
    }
}

For more examples, please refer to racaOS.

Roadmap

  • Bootloader: limine
  • Memory Management
  • SMP
  • Interrupt handling
  • Multitask
  • Syscall
  • PCIe
  • MSI & MSI-X
  • IOMMU

Dependencies

~9.5MB
~160K SLoC