This Month in Rust OSDev: September 2023
Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.
This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.
Announcements, News, and Blog Posts
Here we collect news, blog posts, etc. related to OS development in Rust.
- Toolchain Upgrade - Redox OS
- Open Sourcing Ferrocene
- ESP32 Standard Library Embedded Rust: GPIO Interrupts
- The Embedded Rust ESP Development Ecosystem
- ESP Embedded Rust: Multithreading with FreeRTOS Bindings
- How Rust can build an elegant API around raw memory
- Redox: Development Priorities for 2023/24
Infrastructure and Tooling
In this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.
- Add Minimal Std implementation for UEFI
- Stdio support for UEFI
- Promote loongarch64-unknown-none* to Tier 2
- Add initial libstd support for Xous
- added support for GNU/Hurd
- MCP661: Move wasm32-wasi-preview1-threads target to Tier 2
- add notes about non-compliant FP behavior on 32bit x86 targets
- add more explicit I/O safety documentation
- Change
unsafe_op_in_unsafe_fnto bewarn-by-defaultfrom edition 2024 - cargo: Stabilize lint table
- Final comments period
rust-osdev Projects
In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.
multiboot2
Maintained by @phip1611
The multiboot2 was bumped from 0.18.1
to 0.19.0. The new release includes the ability to add custom tags to the MBI
builder and a bugfix when parsing Multiboot strings, such as the command line
from a Module tag.
For more details, please have a look at the changelog.
Thanks to @A0lson for their contribution that helped to fix the string parsing bug.
acpi
Maintained by @IsaacWoods
The acpi repository contains crates for parsing the ACPI tables – data structures that the firmware of modern computers use to relay information about the hardware to the OS.
This month, a new major version of acpi was published, offering greater control over how the crate allocates
memory. Specifically, the new allocator_api and alloc features allow you to opt-out of allocation altogether
(allowing the crate to be used from slimmer environments like bootloaders), or to provide your own allocator using
the new (and still unstable) core::alloc::Allocator API.
Enabling both features makes the crate behave very similarly to before, so migration should be relatively easy.
Because the acpi crate can now be used from environements without allocation, the rsdp crate has been
deprecated, and all functionality moved into acpi. The rsdp crate will continue to work, but will not receive
further updates. This should not affect users using rsdp to simply find the address of the RSDP, but is a
breaking change as types that have been moved to acpi will no longer be usable across the crate boundary.
Some improvements were also made to the aml crate this month, adding functionality and improving our correctness
- many thanks to our contributors!
We merged the following changes this month:
- AML: Implement OpReg-relative PkgLength parser
- AML: Fix DefPackage len less than NumElements failing
- Prepare new version of
acpi - AML: add support for the
DefSleepopcode - AML: add support for the
DefStallopcode
Thanks to @alnyan for their contributions!
x86_64
Maintained by @phil-opp, @josephlr, and @Freax13
The x86_64 crate provides various abstractions for x86_64 systems, including wrappers for CPU instructions, access to processor-specific registers, and abstraction types for architecture-specific structures such as page tables and descriptor tables.
We merged the following PR this month:
- fix(interrupts): add compiler fences to enable and disable
- add
flush_broadcastandtlbsyncfunctions - Release v0.14.11
- Add
HandlerFuncTypetrait
Thanks to @brandonchinn178 and @mkroening for their contributions!
uefi-rs
Maintained by @GabrielMajeri, @nicholasbishop, and @phip1611
The uefi-rs crate provides safe and performant wrappers for UEFI, the successor to the BIOS. We merged the following PRs this month:
Thanks to @JohnAZoidberg for their contribution!
Other Projects
In this section, we describe updates to Rust OS projects that are not directly related to the rust-osdev organization. Feel free to create a pull request with the updates of your OS project for the next post.
mkroening/interrupts
(Section written by @mkroening)
I created a dependency-free interrupts crate, allowing you to temporarily disable interrupts on AArch64, 64-bit RISC-V, and x86-64.
Two different paradigms allow you to run code without interrupts and synchronize with interrupt handlers running on the same hardware thread (core):
Use disable to disable interrupts with a guard:
// interrupts may or may not be enabled
let guard = interrupts::disable();
// interrupts are disabled
drop(guard);
// interrupts are restored to the previous state
Use without (similar to x86_64::instructions::interrupts::without_interrupts) to run a closure with disabled interrupts:
// interrupts may or may not be enabled
interrupts::without(|| {
// interrupts are disabled
});
// interrupts are restored to the previous state
I would appreciate you dropping by and giving it a try. :)
Join Us?
Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.