Dev

Rust-Based Modular Kernel Zinnia Boots on x86_64 Hardware

The modular 64-bit Unix-like kernel "zinnia" written in Rust has achieved booting on real x86_64 hardware. It features POSIX-compliant system calls and a modular driver design.

5 min read Reviewed & edited by the SINGULISM Editorial Team

Rust-Based Modular Kernel Zinnia Boots on x86_64 Hardware
Photo by Growtika on Unsplash

The Unix-like operating system kernel “zinnia,” written in Rust, has reached the stage of running on real x86_64 architecture hardware. The project began in 2024, aiming to learn systems programming, but has rapidly expanded in functionality.

Zinnia is a 64-bit kernel with a modular structure, with almost its entire codebase written in Rust. It is designed with the philosophy of avoiding unsafe code as much as possible, emphasizing safety and maintainability.

Project Overview

Zinnia is an attempt to implement a Unix-like operating system kernel from scratch in Rust. Starting as a personal learning project in 2024, practical features have been added one after another as development progressed.

Currently, zinnia can boot on UEFI-based systems and operates via the Limine bootloader. Limine is a lightweight bootloader compatible with multiboot, widely used in kernel development for x86_64. Zinnia’s root filesystem is loaded from initrd, achieving a boot sequence similar to Linux systems.

The only supported architecture is currently x86_64, but ports to aarch64 and riscv64 are also planned. However, the developer does not consider these as near-term priorities.

Technical Features

The most notable feature of zinnia is its modular driver architecture. Most device drivers are implemented as kernel modules, which are provided as Rust ELF format dynamic libraries (dylibs). They are loaded from initrd at boot time and dynamically linked. This approach is similar to Linux’s kernel module mechanism.

In terms of system calls, a wide range of POSIX APIs are implemented. Additionally, it supports extensions commonly used in Linux and BSD-based OSes, such as epoll and timerfd, which reportedly enable running modern desktop environments using Wayland or X11.

The design policy of minimizing Rust’s unsafe code contributes to improved memory safety. Even at the low level of a kernel, leveraging type safety and the ownership model can fundamentally avoid bugs like memory corruption and data races, which frequently occurred in the traditional C language.

Current Status and Future Plans

According to the developer’s report, zinnia can currently boot on various x86_64-based real machines. The fact that it can run desktop environments with Wayland/X11 support indicates that it is moving beyond a mere learning project.

However, it has not yet reached a fully practical stage. Challenges remain in terms of device driver completeness and application compatibility. Contributions for code fixes and new features are always welcome, and the project follows a development model that assumes participation from the open-source community.

The future roadmap includes ports to aarch64 and riscv64 architectures, but for now, development resources are focused on stabilizing and expanding features for x86_64.

Development Background and Significance

Several years have passed since the Rust language began attracting attention in the field of kernel development. Major platform vendors such as Google (introducing Rust into the Android kernel) and Microsoft (experimenting with Rust in the Windows kernel) are also focusing on Rust’s safety. In this context, the emergence of an OSS project like zinnia carries certain significance.

Zinnia’s characteristic lies in its evolution from an educational purpose to a kernel equipped with practical features. It implements major functions that a modern OS should have, such as modular drivers, epoll support, and Wayland compatibility, all under Rust’s type safety.

The Rust kernel development community includes diverse projects, such as Redox OS, a fully scratch-built Unix-like OS, and Tock, an embedded OS. Compared to these projects, zinnia is characterized by a design more conscious of Linux compatibility. Its broad coverage of POSIX APIs and support for Linux extensions (epoll, timerfd) indicate a direction toward improving the ease of porting existing applications.

Editorial Opinion

In the short term, the progress of zinnia’s development will accumulate best practices for Rust kernel development. The implementation methods for modular drivers and techniques to minimize unsafe code provide insights applicable to other similar projects. In particular, the kernel module mechanism using dynamic linking via Rust ELF dylibs offers a different approach from Linux’s module system, making it valuable as a subject for comparative study.

From a long-term perspective, while it cannot be denied that zinnia could mature into a practical desktop OS kernel, what is more important is its role as a reference implementation demonstrating the potential of the Rust language in systems programming. As the integration of Rust into the Linux kernel itself progresses, zinnia serves as an excellent example of how much productivity and safety a full-scratch implementation from scratch can achieve. Furthermore, if ports to aarch64 and riscv64 are realized, it can also be expected to contribute to the embedded field and the RISC-V ecosystem.

From the editorial standpoint, future developments of interest include how far multi-threading support, SMP support, and filesystem expansion will progress. Also, attention should be paid to how many applications actually run and whether the results of compatibility tests are published. While the theoretical advantages of the Rust kernel field are recognized, practical demonstrations have been lacking. We hope that zinnia will help bridge that gap.

References

Frequently Asked Questions

What hardware does zinnia run on?
Currently it runs on x86_64 architecture machines with UEFI firmware. It boots via the Limine bootloader, and booting has been confirmed on multiple real machines. Ports to aarch64 and riscv64 are planned.
How does zinnia's driver mechanism differ from Linux?
Modules are implemented as Rust ELF format dynamic libraries (dylibs) and loaded from initrd at boot time. Instead of using .ko files like Linux, it leverages Rust's dynamic linking mechanism, which is a distinctive feature.
Can zinnia be used for practical desktop purposes?
It has been reported that modern desktop environments using Wayland and X11 sessions can run, but it is still in development in terms of device driver completeness and application compatibility. At present, its main purpose appears to be for learning and research.
Source: Lobsters

Comments

← Back to Home