img
Home Blog Docs
Forge the future of Rust OSes
Asterinas is an open-source community dedicated to crafting the
next-generation OS kernels using Rust with the framekernel architecture
Asterinas is an open-source community dedicated to crafting the next-generation
OS kernels using Rust with the framekernel architecture
Asterinas
OSDK
Introduce Asterinas

Asterinas is a Rust OS kernel designed to offer the following distinctive features:

img
Strong Security
Fortified against security vulnerabilities,
including memory safety concerns
img
Excellent Performance
Delivering top-tier performance
benchmarks
img
Broad Usage
Suitable to a wide array of hardware
platforms and usage scenarios
img
Seamless Compatibility
Effortlessly running Linux applications
without any need for modifications

The strong security and excellent performance of the Asterinas Kernel stem from its innovative framekernel architecture.

Introduce OSDK

Asterinas Operating System Development Kit (OSDK) helps OS devs to create, build, run, and test Rust projects for OS kernels effortless. Imagine crafting kernels with the same simplicity as apps!

img
Jump start
img
Crate reuse
img
Rapid testing
img
Safe coding
img
Jump start
img

With OSDK, you can start building your own Rust OS kernel with three simple steps.

1. Install Asterinas OSDK
cargo install cargo-osdk
2. Create a Rust project for your "Hello World" kernel.
cargo osdk new my-first-os --kernel
3. Compile the kernel, generate a bootable image, and run it in a VM with just one single command.
cd my-first-os && cargo osdk run
img
Crate reuse
img

All OSDK-based Rust crates for an OS kernel or library share a common foundation, a crate called ostd. This fosters a more vibrant ecosystem of OS crates, reusable across different Rust OSes.

img
img
Rapid testing
img
Writing unit tests for OSDK-based Rust projects is a breeze with ktest.
                              #[cfg(ktest)] 
mod tests {
    #[ktest]
    fn it_works() {
        assert_eq!(true, true);
    }
}
                              
                            
Running these unit tests in the kernel mode can be done with a simple command:
cargo osdk test
img
Safe coding
img

OSDK is based on ostd, a minimal, expressive, and solid foundation that enables OS devs to implement OS functionalities on top of it in safe Rust.

The effectiveness of ostd has been validated by our extensive experience in developing Asterinas. In Asterinas, all unsafe Rust code is confined to ostd, whereas the rest of the kernel, including all drivers for peripheral devices, is composed of safe Rust code exclusively.

With OSDK, you can start building your own Rust OS kernel with three simple steps.

1. Install Asterinas OSDK
cargo install cargo-osdk
2. Create a Rust project for your "Hello World" kernel.
cargo osdk new my-first-os --kernel
3. Compile the kernel, generate a bootable image, and run it in a VM with just one single command.
cd my-first-os && cargo osdk run
Writing unit tests for OSDK-based Rust projects is a breeze with ktest.
                              #[cfg(ktest)] 
mod tests {
    #[ktest]
    fn it_works() {
        assert_eq!(true, true);
    }
}
                              
                            
Running these unit tests in the kernel mode can be done with a simple command:
cargo osdk test

All OSDK-based Rust crates for an OS kernel or library share a common foundation, a crate called ostd. This fosters a more vibrant ecosystem of OS crates, reusable across different Rust OSes.

img

OSDK is based on ostd, a minimal, expressive, and solid foundation that enables OS devs to implement OS functionalities on top of it in safe Rust.

The effectiveness of ostd has been validated by our extensive experience in developing Asterinas. In Asterinas, all unsafe Rust code is confined to ostd, whereas the rest of the kernel, including all drivers for peripheral devices, is composed of safe Rust code exclusively.

OSDK can be utilized to build any Rust kernel based on the framekernel architecture: Asterinas is built with OSDK; your kernel can too!

Why a framekernel?
img The speed of a monolithic kernel, the security of a microkernel img img
Asterinas adopts the novel framekernel OS architecture, which unleashes the full power of Rust to bring the best of both monolithic kernels and microkernels.
A comparison between different OS architectures
img
img TCB
img Non-TCB
img
img Slow path (e.g., syscall, RPG)
img
img Fast path (e.g., func call)
Image 1
Image 2
Image 3
img TCB
img Non-TCB
img Slow path
img Fast path
In the framekernel OS architecture, the entire OS resides in the same address space (like a monolithic kernel) and is required to be written in Rust. However, there's a twist---the kernel is partitioned in two halves: the privileged Framework (akin to a microkernel) and the unprivileged Services. Only the privileged Framework is allowed to use unsafe features of Rust, while the unprivileged Services must be written exclusively in safe Rust.
The memory safety of the entire kernel is reduced to that of the Framework, a minimal, expressive, and rock-solid foundation. Residing in the same address space, the rest of the kernel can communicate with the Framework in the most efficient way.
Get involved
We are committed to creating a fully-fledged, production-grade OS kernel, and we recognize that nurturing our community of individual kernel developers is critical to achieving this goal. Thus, the Asterinas community prioritizes developer productivity and happiness.
Streamlined Workflow
Comprehensive Docs
Weak Copyleft
With OSDK, our kernel developers enjoy the same seamless experience as Rust app developers. Building and testing OS components or the entire OS kernel is as intuitive and efficient as ever.
We pride ourselves on providing comprehensive documentation. Check out The Asterinas Book to learn more about Asterinas's technical details.
Join a community dedicated to openness and freedom. Asterinas adopts the Mozilla Public License ("MPL") to ensure that the project is free to the entire human race and remains so forever.
The source code is hosted on GitHub. Join the vibrant developer community, and be part of shaping the future of OS development with Asterinas.
Thank you
We express our heartfelt gratitude to the contributors who have made this project a reality.
See individual contributors
img
Asterinas is proud to be supported by forward-thinking organizations that believe in our mission. We're immensely grateful for their sponsorship.
img img img img