MCPcopy Index your code
hub / github.com/asterinas/asterinas

github.com/asterinas/asterinas @v0.18.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.18.0 ↗ · + Follow
13,457 symbols 43,302 edges 1,529 files 4,575 documented · 34%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README
<img src="https://github.com/asterinas/asterinas/raw/v0.18.0/book/src/images/logo_en.svg" alt="asterinas-logo" width="620">


Toward a production-grade Linux alternative—memory safe, high-performance, and more

https://github.com/user-attachments/assets/f77ee711-a0d6-413f-aaaa-8f9566df3e41

<a href="https://github.com/asterinas/asterinas/actions/workflows/test_x86.yml"><img src="https://github.com/asterinas/asterinas/actions/workflows/test_x86.yml/badge.svg?event=push" alt="Test x86-64" style="max-width: 100%;"></a>
<a href="https://github.com/asterinas/asterinas/actions/workflows/test_riscv.yml"><img src="https://github.com/asterinas/asterinas/actions/workflows/test_riscv.yml/badge.svg?event=push" alt="Test riscv64" style="max-width: 100%;"></a>
<a href="https://github.com/asterinas/asterinas/actions/workflows/test_loongarch.yml"><img src="https://github.com/asterinas/asterinas/actions/workflows/test_loongarch.yml/badge.svg?event=push" alt="Test loongarch64" style="max-width: 100%;"></a>
<a href="https://github.com/asterinas/asterinas/actions/workflows/test_x86_tdx.yml"><img src="https://github.com/asterinas/asterinas/actions/workflows/test_x86_tdx.yml/badge.svg" alt="Test Intel TDX" style="max-width: 100%;"></a>
<a href="https://github.com/asterinas/asterinas/actions/workflows/test_nixos_full.yml"><img src="https://github.com/asterinas/asterinas/actions/workflows/test_nixos_full.yml/badge.svg?event=schedule" alt="Test AsterNixOS (full)" style="max-width: 100%;"></a>
<a href="https://asterinas.github.io/benchmark/x86-64/"><img src="https://github.com/asterinas/asterinas/actions/workflows/benchmark_x86.yml/badge.svg" alt="Benchmark x86-64" style="max-width: 100%;"></a>
<a href="https://asterinas.github.io/benchmark/tdx/"><img src="https://github.com/asterinas/asterinas/actions/workflows/benchmark_x86_tdx.yml/badge.svg" alt="Benchmark Intel TDX" style="max-width: 100%;"></a>

News: * 2025-12-08: FAST 2026 accepted a paper on a novel secure storage solution having been integrated into Asterinas: MlsDisk: Trusted Block Storage for TEEs Based on Layered Secure Logging. * 2025-10-17: ICSE 2026 accepted yet another paper about Asterinas: RusyFuzz: Unhandled Exception Guided Fuzzing for Rust OS Kernel. * 2025-10-14: CortenMM: Efficient Memory Management with Strong Correctness Guarantees received the Best Paper Award at SOSP 2025. * 2025-07-23: SOSP 2025 accepted another Asterinas paper: CortenMM: Efficient Memory Management with Strong Correctness Guarantees. * 2025-06-18: USENIX ;login: magazine published Asterinas: A Rust-Based Framekernel to Reimagine Linux in the 2020s. * 2025-04-30: USENIX ATC 2025 accepted two Asterinas papers: 1. Asterinas: A Linux ABI-Compatible, Rust-Based Framekernel OS with a Small and Sound TCB; 2. Converos: Practical Model Checking for Verifying Rust OS Kernel Concurrency.

Congratulations to the Asterinas community🎉🎉🎉

Introducing Asterinas

The future of operating systems (OSes) belongs to Rust—a modern systems programming language (PL) that delivers safety, efficiency, and productivity at once. The open question is not whether OS kernels should transition from C to Rust, but how we get there.

Linux follows an incremental path. While the Rust for Linux project has successfully integrated Rust as an official second PL, this approach faces inherent friction. As a newcomer within a massive C codebase, Rust must often compromise on safety, efficiency, clarity, and ergonomics to maintain compatibility with legacy structures. And while new Rust code can improve what it touches, it cannot retroactively eliminate vulnerabilities in decades of existing C code.

Asterinas takes a clean-slate approach. By building a Linux-compatible, general-purpose OS kernel from the ground up in Rust, we are liberated from the constraints of a legacy C codebase—its interfaces, designs, and assumptions—and from the need to preserve historical compatibility for outdated platforms. Languages—including PLs—shape our way of thinking. Through the lens of a modern PL, Asterinas rethinks and modernizes the construction of OS kernels:

  • Modern architecture. Asterinas pioneers the framekernel architecture, combining monolithic-kernel performance with microkernel-inspired separation. Unsafe Rust is confined to a small, auditable framework called OSTD, while the rest of the kernel is written in safe Rust, keeping the memory-safety TCB intentionally minimal.

  • Modern design. Asterinas learns from Linux's hard-won engineering lessons, but it is not afraid to deviate when the design warrants it. For example, Asterinas improves the CPU scalability of its memory management subsystem with a novel scheme called CortenMM.

  • Modern code. Asterinas's codebase prioritizes safety, clarity, and maintainability. Performance is pursued aggressively, but never by compromising safety guarantees. Readability is treated as a feature, not a luxury, and the codebase is structured to avoid hidden, cross-module coupling.

  • Modern tooling. Asterinas ships a purpose-built toolkit, OSDK, to facilitate building, running, and testing Rust kernels or kernel components. Powered by OSTD, OSDK makes kernel development as easy and fluid as writing a standard Rust application, eliminating the traditional friction of OS engineering.

Asterinas aims to become a production-grade, memory-safe Linux alternative, with performance that matches Linux—and in some scenarios, exceeds it. The project has been under active development for four years, supports 230+ Linux system calls, and has launched an experimental distribution, Asterinas NixOS.

In 2026, our priority is to advance project maturity toward production readiness, specifically targeting standard and confidential virtual machines on x86-64. Looking ahead, we will continue to expand functionality and harden the system for mission-critical deployments in data centers, autonomous vehicles, and embodied AI.

Getting Started

Supported CPU Architectures

Asterinas targets modern, 64-bit platforms only.

A development platform is where you build and test Asterinas (i.e., the host machine running the Docker-based development environment).

Development Platform
x86-64
ARM64

A deployment platform is a CPU architecture that Asterinas can run on as an OS kernel.

Deployment Platform Tier
x86-64 Tier 1
x86-64 (Intel TDX) Tier 2
RISC-V 64 Tier 2
LoongArch 64 Tier 3

Tier definitions: - Tier 1: Fully supported and tested. CI runs the full test suite on every PR. - Tier 2: Actively developed with basic functionality working. CI runs build checks and basic tests on a regular basis (per PR for RISC-V and nightly for Intel TDX), but the full test suite is not yet covered. - Tier 3: Early-stage or experimental. The kernel can boot and perform basic operations, but CI coverage is limited and may not include automated runtime tests for every pull request.

For End Users

We provide Asterinas NixOS ISO Installer to make the Asterinas kernel more accessible for early adopters and enthusiasts. We encourage you to try out Asterinas NixOS and share feedback. Instructions on how to use the ISO installer can be found here.

Disclaimer: Asterinas is an independent, community-led project. Asterinas NixOS is not an official NixOS project and has no affiliation with the NixOS Foundation. No sponsorship or endorsement is implied.

For Kernel Developers

Follow the steps below to get Asterinas up and running.

  1. Download the latest source code on an x86-64 (or ARM64) Linux machine:

    bash git clone https://github.com/asterinas/asterinas

  2. Run a Docker container as the development environment:

    bash docker run -it --privileged --network=host -v /dev:/dev -v $(pwd)/asterinas:/root/asterinas asterinas/asterinas:0.18.0-20260603

    Alternatively, if you use VS Code with the Dev Containers extension, open the cloned folder and select "Reopen in Container".

  3. Inside the container, go to the project folder (/root/asterinas) and run:

    bash make kernel make run_kernel

    This results in a VM running the Asterinas kernel with a small initramfs.

  4. To install and test real-world applications on Asterinas, build and run Asterinas NixOS in a VM:

    bash make nixos make run_nixos

    This boots into an interactive shell in Asterinas NixOS, where you can use Nix to install and try more packages.

The Book

See The Asterinas Book to learn more about the project.

License

Asterinas's source code and documentation primarily use the Mozilla Public License (MPL), Version 2.0. Select components are under more permissive licenses, detailed here. For the rationales behind the choice of MPL, see here.

Extension points exported contracts — how you extend this code

Device (Interface)
The abstraction of a device. [12 implementers]
kernel/src/device/mod.rs
FuseOperation (Interface)
A FUSE protocol operation with typed request and reply bodies. Each implementer represents one request/reply pair defin [20 …
kernel/libs/aster-fuse/src/operation.rs
Edit (Interface)
An edit of `Edit ` is an incremental change to a state of `S`. [7 implementers]
kernel/comps/mlsdisk/src/layers/2-edit/edits.rs
AsAtomicModeGuard (Interface)
Abstracts any type from which one can obtain a reference to an atomic-mode guard. [9 implementers]
ostd/src/task/atomic_mode.rs
ArrayManufacture (Interface)
Trait that associates an `ArrayFactory` with its corresponding aligned array type. This trait is implemented for `Array [4 …
ostd/libs/ostd-pod/src/array_helper.rs
BundleFile (Interface)
A trait for files in a bundle. The file in a bundle should have its modified time and be validatable. [3 implementers]
osdk/src/bundle/file.rs
SocketPrivate (Interface)
Common methods for sockets, but private to the network module. These are implementation details of sockets, so shouldn' [6 …
kernel/src/net/socket/mod.rs
SetInclude (Interface)
A trait operator to check if a set A includes a set B, i.e., A is a superset of B. [4 implementers]
kernel/libs/typeflags-util/src/set.rs

Core symbols most depended-on inside this repo

unwrap
called by 2781
kernel/src/process/process_vm/mod.rs
contains
called by 460
kernel/src/process/signal/sig_mask.rs
clone
called by 441
kernel/src/fs/file/flock.rs
run_cmd
called by 339
test/nixos/common/framework/src/session.rs
run_cmd_and_expect
called by 322
test/nixos/common/framework/src/session.rs
clone
called by 276
kernel/src/fs/fs_impls/exfat/dentry.rs
read
called by 261
kernel/src/fs/pipe/common.rs
map_err
called by 254
kernel/src/net/socket/netlink/message/result.rs

Shape

Method 7,962
Function 2,971
Class 1,882
Enum 420
Interface 222

Languages

Rust95%
C4%
Python1%
C++1%

Modules by API surface

kernel/src/fs/fs_impls/ramfs/fs.rs90 symbols
kernel/src/fs/fs_impls/overlayfs/fs.rs82 symbols
kernel/src/fs/fs_impls/exfat/inode.rs75 symbols
kernel/comps/mlsdisk/src/layers/3-log/tx_log.rs73 symbols
kernel/src/fs/fs_impls/ext2/inode/block_manager/block_ptr_tree.rs67 symbols
kernel/comps/mlsdisk/src/layers/1-crypto/crypto_log.rs66 symbols
tools/sctrace/src/scml_parser.rs63 symbols
kernel/src/process/process/mod.rs60 symbols
kernel/src/fs/utils/systree_inode.rs60 symbols
kernel/comps/mlsdisk/src/layers/2-edit/journal.rs59 symbols
ostd/src/util/id_set.rs58 symbols
kernel/comps/mlsdisk/src/layers/4-lsm/tx_lsm_tree.rs58 symbols

For agents

$ claude mcp add asterinas \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact