This Month in Rust OSDev: February 2022
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.
Project Updates
In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.
uefi-rs
Maintained by @GabrielMajeri and @nicholasbishop
The uefi crate provides safe and performant wrappers for UEFI, the successor to the BIOS.
One of the pain points of developers building software using uefi-rs has been the Completion type, which is like an expanded Result type which also handles warnings (besides successes and errors). There's an open proposal to drop this type and revert to using more standard Results everywhere, by treating all warnings as errors. Initial feedback suggests that such a change would be beneficial to the project, but comments and suggestions are welcome on the linked issue.
We merged the following changes in February:
- Run tests on AArch64 VM in CI
- Add IA32 target to
xtaskand test it in CI - Fix links in project template
READMEfile - Remove
CStr16::as_string - Fix status code check at end of VM test
- Automatically test latest crate release on latest nightly in CI
- Fix various phrasing inconsistencies and spelling errors in protocol docs
- Remove implicit string conversion from
File::open - Expand
Aligntrait docstring - Add string equality operator impls
- Fix file info structures' sizes and add tests
- Implicitly run tests with
+nightly - Remove more implicit string conversions
- Add a
CHANGELOG.md - Add minimal test for
LoadedImageprotocol - Fix
ProtocolsPerHandleinternal slice property - Update changelog for file info changes
- Make the load options API on
LoadedImageprotocol safer - Switch all packages to the 2021 edition
Thanks to @nicholasbishop, @Stzx, @avirule and @AtsukiTak for their contributions!
x86_64
Maintained by @phil-opp, @josephlr, @Freax13, and @rybot666
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.
In February, we merged the following pull requests:
- Remove external assembly
- Implement
core::iter::StepforVirtAddrandPage - Make fields of
VirtAddrNotValidandPhysAddrNotValidpublic - Fix:
VirtAddrNotValidandPhysAddrNotValidshould contain the whole address
We also merged a few breaking changes, which will be part of the upcoming v0.15 release:
- Merge latest changes from
masterintonextand migrate code - Make
Cr2::readreturn a result - Remove
external_asmandinline_asmfeatures
bootloader
Maintained by @phil-opp, @rybot666, and @64
The bootloader crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables.
We merged the following changes this month:
- Add ASLR
maybe_uninit_extrais no longer feature-gated (published asv0.10.12)- [v0.9] Remove the
asmandglobal_asmfeatures, which are now stable (published asv0.9.22)
Thanks to @Freax13 and @kennystrawnmusic for their contributions!
We also pushed a big restructuring to the next branch, which will become the v0.11 version eventually. The branch is still in an experimental state and not documented yet, so it's probably a bit early to try it out. But we are making good progress!
vga
Maintained by @RKennedy9064
The work-in-progress vga crate allows the configuration of the VGA hardware, e.g. switching from text-based mode to a pixel-based graphics mode. This month, we merged the following pull request:
Thanks to @clavierpaul for this 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!
- (
rust-osdev/uefi) Feedback requested: Treat UEFI warnings as errors - (
phil-opp/blog_os) Looking for a reviewer for a new Korean translation
If you maintain a Rust project related to operating system development 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.
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.
phil-opp/blog_os
(Section written by @phil-opp)
We merged two fixes for the Writing an OS in Rust blog this month:
Thanks to @kITerE and @MaxDesiatov for these contributions!
I'm also still working on the third edition of the blog. The current state is the following:
- This month, cargo finally gained support for artifact dependencies, which is a feature that I plan to use for the edition. There are still a few issues with it, for example a panic in combination with
-Zbuild-stdand that there is currently no way to enable-Zbuild-std=corefor an artifact dependency without enabling it globally. - The upcoming
v0.11version of thebootloadercrate is already finished for the UEFI part. I'm still working on the BIOS implementation, which is more difficult unfortunately.
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.