GRUB Gets a Taste of Rust with New Prototype

Rust lands in GRUB as an experiment—initial i386-pc support and dynamic modules, promising safer system code.

There is no doubt that the Rust programming language is picking up serious momentum in the open-source world. We’re seeing more and more projects embrace it—like System76’s COSMIC desktop environment, which is being built entirely in Rust, and Fish Shell 4.

Rust has even started making its way into the Linux kernel. Ubuntu recently also announced plans to replace GNU Coreutils with a Rust-based alternative in the upcoming 25.10 release. And now, another major component from the Linux ecosystem is joining the Rust movement: the iconic GRUB bootloader.

One of its leading developers, Vladimir Serbinenko, has begun experimenting with integrating the Rust code into GRUB. His initial work is accessible across two GitHub repositories: one dedicated to a simple “hello world” Rust module for GRUB and another containing the corresponding changes within GRUB itself.

Serbinenko’s experiment focuses on the i386-pc platform—an understandable starting point, as GRUB’s i386-pc port has historically been a more widely used configuration. However, he emphasizes that there is no inherent technical barrier preventing Rust integration into other architectures.

Only i386-pc is implemented right now but it’s not a technical limit, just others are not implemented yet.

Interestingly, Serbinenko has switched GRUB’s modules from using ET_REL (.o) binaries to ET_DYN (.so) binaries. This approach enables Rust-based modules to function more naturally in tandem with GRUB’s existing infrastructure.

Another technical detail worth noting is the decision to compile with panic=abort. Unwinding panics would require implementing rust_eh_personality, which has not been addressed in this early prototype.

In practical terms, this limitation means that Rust panics do not propagate gracefully through the GRUB environment, so the code relies on aborting execution whenever a serious error occurs.

As expected, not all developers are fully on board with bringing Rust into GRUB. In response to the announcement, another developer, Maxim Fomin, shared some concerns about this switch:

I found it indicative that the post about introducing Rust into the project lacks any technical discussion about the merits of doing so. This agrees with the Rust criticism point that bringing Rust into project is often caused by programmers wanting to show off (“me/project is cool because it has Rust”) rather than technical merits.

However, most of the feedback has been positive, with many devs expecting that bringing Rust into GRUB will boost the software’s reliability.

Just as a reminder, the audit conducted back in February revealed a list of vulnerabilities in GRUB’s code—many of which were tied to memory management. That’s exactly the kind of issue Rust is designed to prevent by default.

For more information, see Serbinenko’s announcement.

Bobby Borisov

Bobby Borisov

Bobby, an editor-in-chief at Linuxiac, is a Linux professional with over 20 years of experience. With a strong focus on Linux and open-source software, he has worked as a Senior Linux System Administrator, Software Developer, and DevOps Engineer for small and large multinational companies.