This Month in Rust OSDev (June 2021)
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.
In this section, we give an overview of notable changes to the projects hosted under 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, both the
acpi crates saw breaking changes. These changes should require minimal work to migrate to;
please file an issue if you encounter any difficulties. (published as
rsdp v2.0.0 and
- Basic support for the MADT's new Multiprocessor Wakeup Structure was added
PhysicalMapping's fields were made private, preventing construction of unsound mappings in safe code. The
AcpiHandleralso lost its
selftype - handlers that used
selfshould instead access themselves through the
PhysicalMapping::handlermethod. This prevents a mapping from being unmapped using a different handler to the one that mapped it.
- Accesses to potentially unaligned packed field were fixed.
repr(packed)structures are very common in OS Dev, and make sure the layout of Rust's structures matches the hardware's. Unfortunately, they can be slightly tricky to work with - creating an unaligned reference is undefined behaviour, and references can transiently be created by, for example, calling a method on an unaligned field of a packed structure (e.g.
entry.flags.get_bit(4)). You can read more about this issue here.
acpi::platformno longer re-exports the contents of its
uefi crate provides safe and performant wrappers for UEFI, the successor to the BIOS. In June, we merged the following changes:
- Make the
- Fix type of the media field in the
- Rename boot services'
- Implement image loading/starting
- Make using the
stdiohandles require a mutable ref
- Fix AArch64 build
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.
In June, we merged the following changes:
- Add common abstractions for x86 Segments
- Specify sysv64 for the calling convention of the external assembly functions
- Make IDT module available on stable Rust
- Fix off-by-one error in GDT
We did not issue a new crates.io release with these changes yet, but we plan to do so soon.
Thanks to @toku-sa-n for their contribution!
Call for Participation
Want to contribute to a Rust OSDev project, but don't know where to start? Pick up one of these outstanding issues in one of our projects and get started!
- New Russian translation needs a reviewer: We're looking for someone that is speaking Russian to review the new Russian translation of @MrZloHex.
If you maintain a Rust OSDev project and are looking for contributors, especially for tasks suited to people
getting started in this space, please create a PR against the
next branch with the tasks you want to include in the next issue.
In this section, we describe updates to personal 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.
(Section written by @phil-opp)
The Writing an OS in Rust blog received the following changes this month:
- Switch comments from utterances to giscus
- giscus: Use specific search term instead of
- giscus: Make it possible to set discussion thread manually per post
- Lots of smaller improvements and typo fixes: #1021, #1023, #1026, #1028, #1032
- @kahirokunn for the new Japanese translation,
- @woodyZootopia, @JohnTitor, and @sozysozbot for reviewing this translation, and
- @Foo-x, @tsao-chi, and @conorbros for fixing typos.
Unfortunately, I didn't have time to work on the upcoming third edition this month. I'll try my best to continue working on it soon!
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 gitter channel.