Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Asterinas 內核

概覽

Asterinas 是一款 安全快速通用 的作業系統內核,提供 相容於 Linux 的 ABI。它能作為 Linux 的無縫替代方案,同時提升 記憶體安全性開發者友善性

  • Asterinas prioritizes memory safety by employing Rust as its sole programming language and limiting the use of unsafe Rust to a clearly defined and minimal Trusted Computing Base (TCB). This innovative approach, known as the framekernel architecture, establishes Asterinas as a more secure and dependable kernel option.

  • Asterinas 在開發者友善性方面超越了 Linux。它賦予內核開發者以下能力:(1) 使用更具生產力的 Rust 程式語言;(2) 利用名為 OSDK 的專用工具組來簡化工作流程;(3) 由於 MPL 提供的靈活性,開發者可以自由選擇將其內核模組開源或保持私有。

While the journey towards a production-grade OS kernel can be challenging, we are steadfastly progressing towards our goal.

支援的 CPU 架構

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).

開發平臺
x86-64
ARM64

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

部署平臺Tier
x86-64Tier 1
x86-64 (Intel TDX)Tier 2
RISC-V 64Tier 2
LoongArch 64Tier 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.

開始使用

Get yourself an x86-64 (or ARM64) Linux machine with Docker installed. Follow the three simple steps below to get Asterinas up and running.

  1. 下載最新的來源碼。

    git clone https://github.com/asterinas/asterinas
    
  2. 執行 Docker 容器作為開發環境。

    docker run -it --privileged \
                --network=host \
                -v /dev:/dev \
                -v $(pwd)/asterinas:/root/asterinas \
                asterinas/asterinas:0.17.1-20260319
    

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

  3. 在容器內,前往專案資料夾建置並執行 Asterinas。

    make kernel
    make run_kernel
    

如果一切順利,Asterinas 現在已在虛擬機中啟動並執行。