開源人年會 2022

rrxv6: write a RISC-V kernel using Rust
年7月31日, 12:55–13:40 (Asia/Taipei), AU視聽館
語言: 漢語

本次演講我會介紹我的 rrxv6 project,用 Rust 重製 xv6 核心。實作核心讓我使用許多跟 Rust core 有關的功能,是在平常使用 std 時不會特別使用的。我會介紹這些平常少用的功能如 pointer、記憶體管理等等。


我們可以用 Rust 實作 kernel 嗎?可以。
現在已經有許多 Rust 實作的核心,像是瞄準在嵌入式系統的 Tock OS,或是通用型的 Redox OS,以及許多其其他他的核心。
rrxv6 是我去年開始的專案,目標是打造一個 xv6 核心的複製品,沒有 std 的支援,我們必須重頭打造一個核心該有的功能,如排程、記憶體管理等等。我們使用了平常不會用到的 pointer、Rust 記憶體分配器等功能,不但重新學習作業系統,也更深入的了解 Rust;同時,Rust 也提供較 C 更為高階的虛擬化,即便少了 std ,rrxv6 核心的實作仍然非常 Rusty。

我希望 rrxv6 能成為如何用 Rust 打造核心時的簡單範例,不會如 tock os 或 Redox OS 般太過複雜而難以理解;一系統相關的文章發表在 blog 上,包括 Rust 的實作與 RISCV 的相關介紹。
https://yodalee.me/series/rrxv6/

目前 rrxv6 開發到 system call 完成,已經能透過 system call 從 user space 印出 hello world;如有興趣可以參考 github。
https://github.com/yodalee/rrxv6


目標聽眾族群

Operating System, Rust, RISC-V

內容難易度

Advance

I'm Yodalee, a Rustacean and a blogger in Taiwan.
Because of Rust, I have been "allergic" to all language that are not strong-typed. For the past few years, I make some interesting projects using Rust, like Gameboy emulator and the rrxv6 - the xv6 re-implementation kernel.