This Month in Rust OSDev (May 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
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 May, we merged the following changes:
- Use new
const_fn_trait_boundfeature to fix build on latest nightly (published as
- Multiple improvements to the inline assembly code (published as
- Minor lint fixes
- Use marker types for Port read/write access
- Bump version to 0.14.3 (published as
We also started to prepare a
v0.15 release, for which we already implemented the following breaking changes:
software_interrupt!macro with generic function
software_interrupt: Add additional testing
- Fix typo in docs
- idt: Fixup Options structure and cleanup
set_handler_fn(resubmitted in #261)
- Use SegmentSelector in InterruptStackFrame
bootloader crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables. This month, we merged the following changes:
- Change register used in setting
- Fix build on latest Rust nightly by updating to
- Fix higher half kernels by identity mapping context switch fn earlier (published as
- Make bootloader v0.10 compatible with latest Rust nightlies by updating uefi-rs dependency (published as
- Add some usage examples
- Uefi: Look for an ACPI2 RSDP first
- Identity-map GDT into kernel address space
- Don't check target architecture for builder crate to support cross-compiling (published as
Thanks to @Elekrisk for their contribution!
We also published the following backport to
- Fix nightly regression by manually passing
uefi crate provides safe and performant wrappers for UEFI, the successor to the BIOS. In May, we merged the following changes:
- Switch to the newer
FromResidual<Result<!, Error>>impl for
- Add shim lock protocol
uart_16550 crate provides basic support for serial port I/O for 16550-compatible UARTs. We merged the following changes this month:
- SerialPort::new() no longer requires nightly (published as
- Add support for memory mapped UARTs
- Improvements to new MMIO support (published as
pic_8259 crate provides abstractions for 8259 and 8259A Programmable Interrupt Controllers (PICs). It is a new fork of the
pic8259_simple crate, which appears to be no longer maintained.
We merged the following changes on top of the original
- PIC: Masks
- cpuio: Use new feature flag for const functions
- Rename to pic8259 and bump version to 0.10.0
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 was fairly quiet, but an important regression was fixed. When native methods were introduced in March,
AmlContext lost its
Send + Sync, as these native methods weren't required to be thread-safe. This meant that
AmlContext could no longer be stored in types such as
spin::Once, or shared between threads/tasks. This is
AmlContext, as it is very expensive to construct, and AML does (in theory) provide mechanisms to
make itself thread-safe, so any probject should only need one.
This was fixed by requiring native methods to be
Send + Sync. If you're hitting this issue, please upgrade to the
latest version. (published as
Thanks to @michaelmelanson for his contribution!
xhci crate provides types of xHCI structures such as Contexts, Extended Capabilities, Registers, and TRBs.
In May we finished implementing all of these structures and field getters/setters. Still there may exist missing. If you find one, feel free to send a PR!
spinning_top crate provides a simple spinlock implementation based on the abstractions of the
lock_api crate. This month, we released version
v0.2.4 with the following small improvements:
Thanks to @toku-sa-n for these contributions!
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 fixed a nightly build error:
- Update dependencies to latest versions to fix E0557
- Update testing (published as
Thanks to @ethindp for their contribution!
ps2-mouse library provides a basic interface for interacting with a PS/2 mouse. It was also affected by the nightly breakage in
x86_64, so it required a dependency update too:
- Update x86_64 to 0.14.2 (published as
Thanks to @littledivy 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!
acpi) Add initial support for
acpi) Add test to make sure
Send + Sync
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)
We merged the following improvements to the Writing an OS in Rust blog this month:
- Update posts to fix build on latest nightly
- Translate post 08 to Japanese
- Remove wrong suggestion part
- Fix typo
- Fix typos in edition 3 uefi booting post
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.