zinnia: a modular 64-bit Unix-like kernel written in Rust
Zinnia: A modular 64-bit Unix-like kernel written in Rust
Zinnia:一个用 Rust 编写的模块化 64 位类 Unix 内核
The kernel is written in (almost) 100% Rust and attempts to avoid unsafe code where possible. It implements a big range of POSIX APIs in system calls, but also exposes common extensions found in Linux and BSDs, like epoll and timerfd. 该内核几乎 100% 使用 Rust 编写,并尽可能避免使用不安全(unsafe)代码。它在系统调用中实现了广泛的 POSIX API,同时也提供了 Linux 和 BSD 系统中常见的扩展功能,例如 epoll 和 timerfd。
This allows it to run a somewhat modern desktop using Wayland and X11 sessions. Most drivers are implemented as modules. These are Rust ELF dylibs which get loaded and linked during boot from an initrd, similar to Linux systems. 这使得它能够运行基于 Wayland 和 X11 会话的现代桌面环境。大多数驱动程序以模块形式实现,这些模块是 Rust 编写的 ELF 动态链接库(dylib),在启动时通过 initrd 加载和链接,类似于 Linux 系统。
Zinnia can boot from any UEFI based system thanks to the Limine bootloader. I started this project in 2024 to learn more about systems programming, but over time it started gain more and more features. 得益于 Limine 引导加载程序,Zinnia 可以在任何基于 UEFI 的系统上启动。我于 2024 年启动了这个项目,旨在深入学习系统编程,但随着时间的推移,它开始具备越来越多的功能。
Today the kernel is able to boot on many real x86_64 machines. aarch64 and riscv64 support is planned, but not a priority at the moment. Fixes are always welcome! 如今,该内核已经能够在许多真实的 x86_64 机器上启动。目前已计划支持 aarch64 和 riscv64 架构,但并非当前的首要任务。随时欢迎提交修复补丁!