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.
Here we collect news, blog posts, etc. related to OS development in Rust.
riscv32cheriot-unknown-cheriotrtos target.In this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.
unsafe when they maintain safety invariants.try_shrink_to and try_shrink_to_fit to Vec
TryReserveError instead of panicking on OOM.ptr_as_ref_unchecked
atomic_try_update and deprecate fetch_update
fetch_update will be deprecated starting in Rust 1.99.0.avr_target_feature
tinyencoding, lowbytefirst, and various instruction features.cfg_select!
core::hint::cold_path
rust-osdev ProjectsIn this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.
uefi-rsMaintained by @GabrielMajeri, @nicholasbishop, and @phip1611
uefi makes it easy to develop Rust software that leverages safe, convenient,
and performant abstractions for UEFI functionality.
We merged the following PRs this month:
OpenProtocolAttributeshandle_protocol doc alias to open_protocol functionsThanks to @seijikun for their contributions!
bootloaderMaintained by @phil-opp and @Freax13
The bootloader crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables. This month, we merged the following changes:
Thanks to @Freax13 and @Wasabi375 for their contributions!
virtio-spec-rsMaintained by @mkroening
The virtio-spec crate provides definitions from the Virtual I/O Device (VIRTIO) specification.
This project aims to be unopinionated regarding actual VIRTIO drivers that are implemented on top of this crate.
We merged the following PRs this month:
doc_auto_cfg to doc_cfgbootimageMaintained by @phil-opp
The bootimage tool allows the creation of bootable disk images for bootloader-based kernels. It also provides a runner executable for cargo to make cargo run and cargo test work using QEMU.
We merged the following changes this month:
x86_64-unknown-none target-Zjson-target-specacpiMaintained 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.
We merged the following changes this month:
Thanks to @martin-hughes for their contributions!
endian-numMaintained by @mkroening
The endian-num crate provides the Be (big-endian) and Le (little-endian) byte-order-aware numeric types.
We merged the following changes this month:
fuse-abiMaintained by @mkroening
The fuse-abi crate provides bindings to FUSE devices. In motivation similar to that of virtio-spec, this project aims to provide correct foundational definitions for the FUSE kernel ABI.
We merged the following changes this month:
spinning_topMaintained by @phil-opp
The spinning_top crate provides a simple spinlock implementation based on the abstractions of the lock_api crate.
We merged the following changes this month:
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.
metta-systems/ram-map-viewer(Section written by @berkus)
Added a little GUI for visualizing memory maps. The application itself currently supports a map format that my initialisation code emits, but it has a MemorySource trait that you can implement to consume any format.
metta-systems/vesper(Section written by @berkus)
Vesper has learned to put nucleus into higher-half memory and added a kernel syscall API with a single syscall - a capability invocation. I have a list of capabilities I want to implement, and first one implemented is Debug Console so you can output execution trace from your domains.
Init thread implementation in progress, now parsing DTB and preparing to launch a user-space "init" process. The video above shows memory map produced by the init thread after parsing a RasPi3 B+ 1Gb DTB.
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.
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.
Here we collect news, blog posts, etc. related to OS development in Rust.
In this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.
-Zunstable-options again. This affects OS developers using custom targets.json-target-spec = true to the [unstable] table in .cargo/config.tomlVec::push in consts MVPAtomicPtr::nullrust-osdev ProjectsIn this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.
bootloaderMaintained by @phil-opp and @Freax13
The bootloader crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables. This month, we merged the following changes:
Thanks to @Wasabi375 and @the-ssd for their contributions!
multiboot2Maintained by @phip1611
Convenient and safe parsing of Multiboot2 Boot Information (MBI) structures and the contained information tags. Usable in no_std environments, such as a kernel. An optional builder feature also allows the construction of the corresponding structures.
We merged the following PRs this month:
No notable changes this month.
ovmf-prebuiltMaintained by @nicholasbishop and @phil-opp
The ovmf-prebuilt project provides pre-built edk2 releases to make it easier to set up OVMF. We merged the following improvement this month:
uefi-rsMaintained by @GabrielMajeri, @nicholasbishop, and @phip1611
uefi makes it easy to develop Rust software that leverages safe, convenient,
and performant abstractions for UEFI functionality.
We merged the following PRs this month:
addr_of/addr_of_mut with raw pointer syntaxThanks to @yaroslav957 for their contribution!
virtio-spec-rsMaintained by @mkroening
The virtio-spec crate provides definitions from the Virtual I/O Device (VIRTIO) specification.
This project aims to be unopinionated regarding actual VIRTIO drivers that are implemented on top of this crate.
We merged the following PRs this month:
MAGIC_VALUE constantVIRTIO_NET_F_CTRL_RX_EXTRAVIRTIO_NET_F_GUEST_USO{4,6}recommendations and recommendations_satisfiedx86_64Maintained 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 PRs this month:
MappedPageTable::displayOffsetPageTable a type aliasmap_to_* functions!Copyrepr(transparent) and range types repr(Rust)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 the following changes to the Writing an OS in Rust blog this month:
keyboard_task function in async/await postjson-target-spec featurejson-target-spec featureno_mangle attribute is unstable nowThanks to @ebkalderon for their contribution!
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.
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.
Here we collect news, blog posts, etc. related to OS development in Rust.
no-std supportIn this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.
No content was submitted for this section this month.
rust-osdev ProjectsIn this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.
bootloaderMaintained by @phil-opp and @Freax13
The bootloader crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables. This month, we merged the following changes:
DiskAccess::read_exact_intoThanks to @spencer3035, @Taxrosdev, and @oxyzenQ for their contributions!
ovmf-prebuiltMaintained by @nicholasbishop and @phil-opp
The ovmf-prebuilt project provides pre-built edk2 releases to make it easier to set up OVMF. We merged the following improvement this month:
Thanks to @fogti for their contribution!
uefi-rsMaintained by @GabrielMajeri, @nicholasbishop, and @phip1611
uefi makes it easy to develop Rust software that leverages safe, convenient,
and performant abstractions for UEFI functionality.
We merged the following PRs this month:
Option<Event>Thanks to @seijikun and @Virv12 for their contributions!
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.
valibali/cluu(Section written by @valibali)
CLUU’s kernel has transitioned from a feature-oriented hobby kernel to a strict L4-style microkernel that provides mechanisms only.
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.
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.
Here we collect news, blog posts, etc. related to OS development in Rust.
In this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.
asm_cfg-Zno-jump-tables into -Cjump-tables=boolconst in assemblyas_array in [_] and *const [_]; stabilise as_mut_array in [_] and *mut [_]rust-osdev ProjectsIn this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.
mem_barrierMaintained by @mkroening
This crate provides cross-architecture, no-std memory barriers.
When compiling with optimizations, the compiler may try to improve performance by reordering independent memory accesses and instructions. Modern CPUs use similar techniques for improving performance, such as out-of-order execution. Memory barriers affect both the compiler and the CPU by restricting reordering of certain memory operations across these barriers respective to other CPUs or devices, allowing proper communication with them.
See the docs for details!
bootloaderMaintained by @phil-opp and @Freax13
The bootloader crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables. This month, we merged the following changes:
Thanks to @peppergrayxyz for their contribution!
pci_typesMaintained by @IsaacWoods
The pci_types library provides types for accessing and configuring PCI devices from Rust operating systems. We merged the following change this month:
Thanks to @cagatay-y for their contribution!
uefi-rsMaintained by @GabrielMajeri, @nicholasbishop, and @phip1611
uefi makes it easy to develop Rust software that leverages safe, convenient,
and performant abstractions for UEFI functionality.
We merged the following PRs this month:
Thanks to @seijikun, @jasonbking, @JayKickliter, @crawfxrd, @RenTrieu, @rymdbar, and @splaled for their contributions!
x86_64Maintained 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 PRs this month:
Thanks to @Restioson for their contribution!
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 the following changes to the Writing an OS in Rust blog this month:
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.
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.
Here we collect news, blog posts, etc. related to OS development in Rust.
In this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.
rust-osdev ProjectsIn this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.
acpiMaintained 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. We merged the following changes this month:
Thanks to @jackpot51 for their contributions!
ovmf-prebuiltMaintained by @nicholasbishop and @phil-opp
The ovmf-prebuilt project provides pre-built edk2 releases to make it easier to set up OVMF. We merged the following improvement this month:
Thanks to @ZR233 for their contribution!
uefi-rsMaintained by @GabrielMajeri, @nicholasbishop, and @phip1611
uefi makes it easy to develop Rust software that leverages safe, convenient,
and performant abstractions for UEFI functionality.
We merged the following PRs this month:
Thanks to @seijikun for their contribution!
multiboot2Maintained by @phip1611
Convenient and safe parsing of Multiboot2 Boot Information (MBI) structures and the contained information tags. Usable in no_std environments, such as a kernel. An optional builder feature also allows the construction of the corresponding structures.
We merged the following PRs this month:
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.
No projects updates were submitted this month.
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.
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.
Here we collect news, blog posts, etc. related to OS development in Rust.
In this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.
rust-osdev ProjectsIn this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.
bootloaderMaintained by @phil-opp and @Freax13
The bootloader crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables. This month, we merged the following fix:
target-pointer-width field now expects an integerv0.11.12uefi-rsMaintained by @GabrielMajeri, @nicholasbishop, and @phip1611
uefi makes it easy to develop Rust software that leverages safe, convenient,
and performant abstractions for UEFI functionality.
We merged the following PRs this month:
Thanks to @BrokenC1oud for their contribution!
virtio-spec-rsMaintained by @mkroening
The virtio-spec crate provides definitions from the Virtual I/O Device (VIRTIO) specification.
This project aims to be unopinionated regarding actual VIRTIO drivers that are implemented on top of this crate.
We merged the following PRs this month:
Thanks to @hcsch for their contribution!
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 the following changes to the Writing an OS in Rust blog this month:
target-pointer-width field now expects an integer
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.
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.
Here we collect news, blog posts, etc. related to OS development in Rust.
no_std MP3 decoding libraryIn this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.
rust-osdev ProjectsIn this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.
acpiMaintained 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. We merged the following changes this month:
bootloaderMaintained by @phil-opp and @Freax13
The bootloader crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables. This month, we merged the following fix:
uefi-rsMaintained by @GabrielMajeri, @nicholasbishop, and @phip1611
uefi makes it easy to develop Rust software that leverages safe, convenient,
and performant abstractions for UEFI functionality.
We merged the following PRs this month:
Thanks to @seijikun and @RenTrieu for their contributions!
virtio-spec-rsMaintained by @mkroening
The virtio-spec crate provides definitions from the Virtual I/O Device (VIRTIO) specification.
This project aims to be unopinionated regarding actual VIRTIO drivers that are implemented on top of this crate.
We merged the following PRs this month:
Thanks to @Gelbpunkt for their contributions!
x86_64Maintained 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 PRs this month:
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 the following changes to the Writing an OS in Rust blog this month:
test=true to enable main.rs testing againtest = true in Cargo.totarget-pointer-width field now expects an integertarget-pointer-width changeAre 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.
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.
Here we collect news, blog posts, etc. related to OS development in Rust.
std librarybitpiece: a crate for defining and manipulating bitfields with procedural macrosIn this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.
rust-osdev ProjectsIn this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.
bootloaderMaintained by @phil-opp and @Freax13
The bootloader crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables. This month, we merged the following fix:
Thanks to @OmegaMetor for their contribution!
uart_16550Maintained by @phil-opp
The uart_16550 crate provides basic support for serial port I/O for 16550-compatible UARTs. We merged the following change this month:
Thanks to @rsahwe for their contribution!
uefi-rsMaintained by @GabrielMajeri, @nicholasbishop, and @phip1611
uefi makes it easy to develop Rust software that leverages safe, convenient,
and performant abstractions for UEFI functionality.
We merged the following PRs this month:
uefi-raw IoMmu Protocol ImplThanks to @seijikun, @Jonathas-Conceicao and @PelleKrab for their contributions!
x86_64Maintained 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 PRs this month:
Thanks to @mkroening for their contributions!
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 the following changes to the Writing an OS in Rust blog this month:
target-c-int-width field now expects an integer
[[bin]] section with test=false to Cargo.toml (thanks to @tigeryant)
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.
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.
Here we collect news, blog posts, etc. related to OS development in Rust.
In this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.
loongarch32-unknown-none*format_args!() in a variablerust-osdev ProjectsIn this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.
uefi-rsMaintained by @GabrielMajeri, @nicholasbishop, and @phip1611
uefi makes it easy to develop Rust software that leverages safe, convenient,
and performant abstractions for UEFI functionality.
We merged the following PRs this month:
ctr16! to cstr16!crate:: and uefi:: prefix from StatusThanks to @seijikun, @nicholasbishop, @phip1611, @renovate[bot], @RenTrieu, and @diamant3 for their contributions!
ovmf-prebuiltMaintained by @nicholasbishop and @phil-opp
The ovmf-prebuilt project provides pre-built edk2 releases to make it easier to set up OVMF. We merged the following improvement this month:
multiboot2Maintained by @phip1611
Convenient and safe parsing of Multiboot2 Boot Information (MBI) structures and the contained information tags. Usable in no_std environments, such as a kernel. An optional builder feature also allows the construction of the corresponding structures.
We merged the following PRs this month:
virtio-spec-rsMaintained by @mkroening
The virtio-spec crate provides definitions from the Virtual I/O Device (VIRTIO) specification.
This project aims to be unopinionated regarding actual VIRTIO drivers that are implemented on top of this crate.
We merged the following PRs this month:
Thanks to @stlankes for their contribution!
bootloaderMaintained by @phil-opp and @Freax13
The bootloader crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables. This month, we merged the following improvements:
Thanks to @aaronzper for their contribution!
x86_64Maintained 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 PRs this month:
Thanks to @ChocolateLoverRaj for their contribution!
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.
No projects updates were submitted this month.
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.
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.
Here we collect news, blog posts, etc. related to OS development in Rust.
In this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.
rust-osdev ProjectsIn this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.
uefi-rsMaintained by @GabrielMajeri, @nicholasbishop, and @phip1611
uefi makes it easy to develop Rust software that leverages safe, convenient,
and performant abstractions for UEFI functionality.
We merged the following PRs this month:
system::with_* now take mutably closureThanks to @seijikun, @fox0, and @JarlEvanson for their contributions!
x86_64Maintained 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 PRs this month:
Thanks to @zyuiop for their contribution!
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.
No projects updates were submitted this month.
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.
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.
Here we collect news, blog posts, etc. related to OS development in Rust.
In this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.
rust-osdev ProjectsIn this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.
uefi-rsMaintained by @GabrielMajeri, @nicholasbishop, and @phip1611
uefi makes it easy to develop Rust software that leverages safe, convenient,
and performant abstractions for UEFI functionality.
We merged the following PRs this month:
Thanks to @seijikun, @andersson, @kraxel, and @JarlEvanson for their contributions!
x86_64Maintained 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 PRs this month:
bootloaderMaintained by @phil-opp and @Freax13
The bootloader crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables. This month, we merged the following improvements:
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 the following changes to the Writing an OS in Rust blog this month:
Thanks to @tigeryant and @v4zha for their contributions!
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.
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.
Here we collect news, blog posts, etc. related to OS development in Rust.
In this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.
rust-osdev ProjectsIn this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.
uefi-rsMaintained by @GabrielMajeri, @nicholasbishop, and @phip1611
uefi makes it easy to develop Rust software that leverages safe, convenient,
and performant abstractions for UEFI functionality.
We merged the following PRs this month:
use items in pxe module&mut self for pxe::BaseCode methodsPxeBaseCodeProtocol to implement the internals of pxe::BaseCodeThanks to @seijikun, @ifd3f, @ptf2, and @quic-bjorande for their contributions!
bootloaderMaintained by @phil-opp and @Freax13
The bootloader crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables. This month, we merged the following improvements:
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 the following changes to the Writing an OS in Rust blog this month:
Thanks to @dobleuber and @JINHUILYU for their contributions!
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.
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.
Here we collect news, blog posts, etc. related to OS development in Rust.
In this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.
rust-osdev ProjectsIn this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.
uefi-rsMaintained by @GabrielMajeri, @nicholasbishop, and @phip1611
uefi makes it easy to develop Rust software that leverages safe, convenient,
and performant abstractions for UEFI functionality.
We merged the following PRs this month:
boot::memory_map() and Status::BUFFER_TOO_SMALLbootloaderMaintained by @phil-opp and @Freax13
The bootloader crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables. This month, we merged the following improvements:
x86_64 to 0.15.2v0.11.10Result::okThanks to @Stazer, @Wasabi375, and @ChocolateLoverRaj for their contributions!
x86_64Maintained 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 PRs this month:
Thanks to @farnz for their contribution!
acpiMaintained 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. We merged the following changes this month:
Thanks to @jellllly420 for their contribution!
ovmf-prebuiltMaintained by @nicholasbishop and @phil-opp
The ovmf-prebuilt project provides pre-built edk2 releases to make it easier to set up OVMF. We merged the following improvement this month:
Source::LATEST to EDK2_STABLE202502_R1Thanks to @mkroening for their contributions!
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.
No projects updates were submitted this month.
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.
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.
Here we collect news, blog posts, etc. related to OS development in Rust.
In this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.
rust-osdev ProjectsIn this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.
uefi-rsMaintained by @GabrielMajeri, @nicholasbishop, and @phip1611
uefi makes it easy to develop Rust software that leverages safe, convenient,
and performant abstractions for UEFI functionality.
We merged the following PRs this month:
TryFrom<&DevicePathNode>Thanks to @crawfxrd and @hannahfluch for their contributions!
bootloaderMaintained by @phil-opp and @Freax13
The bootloader crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables. This month, we merged the following improvements:
x86_64Maintained 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 PRs this month:
Thanks to @hannahfluch and @adavis628 for their contributions!
acpiMaintained 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. We merged the following changes this month:
Thanks to @IsaacWoods, @mrjbom, and @00xc for their contributions!
multiboot2Maintained by @phip1611
Convenient and safe parsing of Multiboot2 Boot Information (MBI) structures and the contained information tags. Usable in no_std environments, such as a kernel. An optional builder feature also allows the construction of the corresponding structures.
We merged the following PRs this month:
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.
roeeshoshani/genesis(Section written by @roeeshoshani)
genesis is a bare metal firmware implementation for mips. it implements everything from the bottom up, from
initializing the cpu caches, to configuring pci devices and the interrupt controller.
this month, the core async executor was implemented.
this means that we can implement blocking operations (for example reading a byte from the UART) as rust futures, and we then
.await them.
this makes our lives much easier when writing code that needs to block until some I/O events happen. instead of using callbacks,
and having to pass our state all over the place, we can just .await the blocking future, and write our code using async functions,
which is much more ergonomic.
currently, there is only one blocking operation implemented, the operation of reading a byte from the UART.
this allows code like the following to be written:
loop {
let byte = uart_read_byte().await;
println!("received uart byte: {}", byte);
}
which is a huge improvement over the previous implementation of putting the code inside the UART interrupt handler.
the way this works is that the core kernel's main loop looks roughly like the following:
loop {
poll_tasks();
wait_for_interrupt();
}
then, the interrupt handler is responsible for waking up the relevant tasks.
futures that need interrupt handlers to wake them up should somehow register themselves, and the interrupt hanlers will then wake the registered tasks.
then, in the next iteration, the tasks that were woken up will be polled again, which completes the loop.
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.
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.
Here we collect news, blog posts, etc. related to OS development in Rust.
In this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.
x86_64-unknown-linux-nonerust-osdev ProjectsIn this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.
uefi-rsMaintained by @GabrielMajeri, @nicholasbishop, and @phip1611
uefi makes it easy to develop Rust software that leverages safe, convenient,
and performant abstractions for UEFI functionality.
We merged the following PRs this month:
core::error::Error implsbuild.rsThanks to @crawfxrd and @JarlEvanson for their contributions!
x86_64Maintained 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 PRs this month:
impl fmt::Debug for EntryOptionsMapperFlush method to get pageupdate() to Cr3, Dr7, SFMask, UCet, SCet, mxcsr, rflags, and XCr0{Fs,Gs,KernelGs}Base::write() unsafeThanks to @mkroening and @adavis628 for their contributions!
bootloaderMaintained by @phil-opp and @Freax13
The bootloader crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables. This month, we merged the following improvements:
Thanks to @ChocolateLoverRaj for their contributions!
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.
roeeshoshani/genesis(Section written by @roeeshoshani)
genesis is a bare metal firmware implementation for mips. it implements everything from the bottom up, from
initializing the cpu caches, to configuring pci devices and the interrupt controller.
i noticed that every kernel implementation is always for x86, so i decided to implement it for something a little more esoteric - mips.
the project is currently in very early stages but the basics are there.
it is my hobby project for me to learn about embedded programming.
feel free to follow along the development of it :).
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.
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.
Here we collect news, blog posts, etc. related to OS development in Rust.
In this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.
-Ctarget-featureabi_unsupported_vector_types lint in future breakage reportsextended_varargs_abi_supportrust-osdev ProjectsIn this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.
x86_64Maintained 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 PRs this month:
Thanks to @mrjbom for their contribution!
acpiMaintained 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. We merged the following changes this month:
Thanks to @pjhades, @00xc, and @Hsy-Intel for their contributions!
bootloaderMaintained by @phil-opp and @Freax13
The bootloader crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables. This month, we merged the following improvements:
Thanks to @Ollrogge, @ChocolateLoverRaj, and @Makonede for their contributions!
uefi-rsMaintained by @GabrielMajeri, @nicholasbishop, and @phip1611
uefi makes it easy to develop Rust software that leverages safe, convenient,
and performant abstractions for UEFI functionality.
We merged the following PRs this month:
uefi-raw and use it from ueficargo xtask fmt --checkuefi-raw and use them from uefiThanks to @diekmann for their contribution!
ovmf-prebuiltMaintained by @nicholasbishop and @phil-opp
The ovmf-prebuilt project provides pre-built edk2 releases to make it easier to set up OVMF. We merged the following improvement this month:
uart_16550Maintained by @phil-opp
The uart_16550 crate provides basic support for serial port I/O for 16550-compatible UARTs. We merged the following change this month:
Thanks to @kouchekiniad for their contribution!
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.
No projects were proposed for this section this month.
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.
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.
Here we collect news, blog posts, etc. related to OS development in Rust.
v2.0.0 of thiserror released with no_std supportIn this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.
&raw (const|mut)) of a deref of pointer (*ptr) is always safe-Ctarget-featureunsupported_calling_conventions a hard errorrust-osdev ProjectsIn this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.
uefi-rsMaintained by @GabrielMajeri, @nicholasbishop, and @phip1611
uefi makes it easy to develop Rust software that leverages safe, convenient,
and performant abstractions for UEFI functionality.
We merged the following PRs this month:
uefi::table::{boot,system} modulesx86_64Maintained 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 PRs this month:
pci_typesMaintained by @IsaacWoods
The pci_types library provides types for accessing and configuring PCI devices from Rust operating systems. We merged the following change this month:
Thanks to @ZR233 for their contributions!
ovmf-prebuiltMaintained by @nicholasbishop and @phil-opp
The ovmf-prebuilt project provides pre-built edk2 releases to make it easier to set up OVMF. We merged the following improvement this month:
multiboot2Maintained by @phip1611
Convenient and safe parsing of Multiboot2 Boot Information (MBI) structures and the contained information tags. Usable in no_std environments, such as a kernel. An optional builder feature also allows the construction of the corresponding structures.
We merged the following PRs this month:
acpiMaintained 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. We merged the following changes this month:
Thanks to @Hsy-Intel for their contributions!
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.
No updates were proposed for this section this month.
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.
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.
Here we collect news, blog posts, etc. related to OS development in Rust.
In this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.
const_refs_to_static'r#ident)rust-osdev ProjectsIn this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.
multiboot2Maintained by @phip1611
Convenient and safe parsing of Multiboot2 Boot Information (MBI) structures and the contained information tags. Usable in no_std environments, such as a kernel. An optional builder feature also allows the construction of the corresponding structures.
Last month, we talked about the major milestone of the v0.22
release of the multiboot2 crate, where all Undefined Behaviour (UB) and a
bunch of safety and memory issues have been removed / fixed. After a short
grace-period of one month, we now yanked all prior releases. As all of them
contain UB, sensitive low-level software can break in subtle ways.
We hope that all users can have a smooth migration to v0.22 or above
(with Rust 1.70 from June 2023 as MSRV). If there are problems, we
are happy to temporarily unyank certain versions or create a v0.22.x
with a lower MSRV. We can discuss this
here.
Further, we released v0.23 which contains dependency bumps and missing
tags. Specifically:
Please find more in the changelog.
We merged the following PRs this month:
Thanks to @filiplajszczak for their contributions!
uefi-rsMaintained by @GabrielMajeri, @nicholasbishop, and @phip1611
uefi makes it easy to develop Rust software that leverages safe, convenient,
and performant abstractions for UEFI functionality.
We merged the following PRs this month:
boot::open_protocolxhciMaintained by @toku-sa-n
The xhci crate provides types of xHCI structures, such as Registers and TRBs. We merged the following PRs this month:
Thanks to @dbydd for their contributions!
acpiMaintained 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. We merged the following changes this month:
Thanks to @jokemanfire, and @Hsy-Intel for their contributions!
pci_typesMaintained by @IsaacWoods
The pci_types library provides types for accessing and configuring PCI devices from Rust operating systems. We merged the following change this month:
Thanks to @bjorn3 for their contributions!
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.
No updates were proposed for this section this month.
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.
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.
Here we collect news, blog posts, etc. related to OS development in Rust.
In this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.
asm_constunsafe_attributesrust-osdev ProjectsIn this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.
multiboot2Maintained by @phip1611
Convenient and safe parsing of Multiboot2 Boot Information (MBI) structures and the contained information tags. Usable in no_std environments, such as a kernel. An optional builder feature also allows the construction of the corresponding structures.
🎉 We are happy to announce release v0.22 of the multiboot2 crate. This is a
major step forward as all Undefined Behaviour (UB) and a bunch of safety and
memory issues have been removed / fixed. 🎉 Now, all unit tests (and there are
many) pass Miri! This was possible due to massive internal refactorings done
in #226 and #227.
The quite complex logic to parse all these structures safe and correctly
has been moved to a new multiboot2-common
crate. This way, the multiboot2-header
crate can also leverage the new abstractions. A comprehensive writeup about why
the parsing of Multiboot2 structures and typing them correctly in Rust is much
more complex than one initially might think is written down in
lib.rs of multiboot2-common.
multiboot2-header also got a new release v0.5 and can now be considered
safe and free of UB when parsing the corresponding structures. The internal
refactorings only slightly leak to the public interfaces of multiboot2
and multiboot2-header.
Read more:
The crate grew historically without a centralized design or approach how to work with memory and pointers. Therefore, many UB way unintentionally created. We are happy to get lack of the technical debt. Nevertheless, thanks to everyone who contributed over the years - sorry if we had to rewrite your code in this one! :)
uefiMaintained by @GabrielMajeri, @nicholasbishop, and @phip1611
uefi makes it easy to develop Rust software that leverages safe, convenient,
and performant abstractions for UEFI functionality. Recently, we released
version v0.31 with some notable changes:
std implementation for UEFI targets compares to uefi and
how both can be used together.We are planning a massive API change and introduced a new replacement API in
release v0.31. The old API co-exists and will be marked as
#[deprecated] in 0.32. The new API will make it easier to call boot or
runtime services without having to pass &BootServices around all the time.
The typical use-case of our library users is to write a UEFI bootloader application that heavily leverages boot services. Then control is handed over to the next stage, which is typically the kernel of an OS. Boot services are usually exited either just prior to launching the kernel or by the kernel itself. In any case, the UEFI application spends almost all of its time with boot services active.
Although the old API design ensures via the type system that no boot services can be called after they have been exited, the test of time has proven that this adds unjustified complexity without bringing much real value add.
Instead, with the new API, which we provide additionally at this point, one can use freestanding functions which are behind the new modules:
uefi::system: is a new module that provides freestanding functions for
accessing fields of the global system table.uefi::boot:
is a new module that provides freestanding functions for boot services using
the global system table.uefi::runtime: is a new module that provides freestanding functions for
runtime services using the global system table.The freestanding functions itself are close to the originals ones but without
&BootServices or &RuntimeServices parameters, as you can see for example
here.
The new API design solves API inconsistencies and restrictions already existing so far, and makes the overall handling a lot easier. This comes with the costs that functions may panic, if the boot services were exited but one tries to use them. However, the massive API simplification justifies this.
Find more and follow the progress and discussions on:
TL;DR: What used to return MemoryMap<'buf> in the API, now returns
MemoryMapOwned. Additionally, you can parse a chunk of memory using
MemoryMapRef or MemoryMapRefMut.
We put significant effort into refactoring our abstractions for the UEFI memory
map. These started in release v0.29 and were finalized in release v0.31.
Instead of one MemoryMap<'buf> type, we now have the traits MemoryMap and
MemoryMapMut along with the implementations MemoryMapRef, MemoryMapRefMut,
and MemoryMapOwned. It is recommended to work with the specific
implementations, as the main purpose for the traits is only to enforce a
consistent API for these three implementations. This gives users the
flexibility to cover all possible use cases one can have with an UEFI memory
map. Read more:
In any case, obtaining the memory map from UEFI is hidden behind the public API of the crate, but we made it very easy to read/parse it in all possible scenarios!
We put notable work into our README and lib.rs files to improve the
structure of our documentation. The main value-add and improvement is that we
clearly, directly, and precisely talk about:
uefi?std for Rust targets?To see an example how uefi and std can be used together, please head to
our repository.
There were also a ton of other interesting fixes, changes, and additions! Check out our Changelog.
We merged the following PRs this month:
create_eventboot moduleuefi::boot modulecargo xtask fmt --checkuefi::runtime modulebootloaderMaintained by @phil-opp and @Freax13
The bootloader crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables. This month, we merged the following improvements:
Thanks to @spencer3035 for their contributions!
x86_64Maintained 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:
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.
No projects updates were submitted this month.
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.
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.
Here we collect news, blog posts, etc. related to OS development in Rust.
In this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.
offset_of_nested#[must_use] to some into_raw* functions&raw (const|mut) UNSAFE_STATIC implied deref as safe#[naked]: report incompatible attributesrust-osdev ProjectsIn this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.
virtio-spec-rs (new project!)Maintained by @mkroening
The virtio-spec crate provides definitions from the Virtual I/O Device (VIRTIO) specification.
This project aims to be unopinionated regarding actual VIRTIO drivers that are implemented on top of this crate.
The origins of this crate are in Hermit. Due to the need for correct foundational definitions from the Virtio spec that are easily reviewable and independent of the actual driver logic, this project was created from the ground up and without any intended bias towards Hermit.
Currently, definitions are available for split and packed virtqueues, for Virtio over MMIO and Virtio over PCI, and for the network, socket and file system devices. Feature requests for additional devices are more than welcome!
fuse-abi (new project!)Maintained by @mkroening
The fuse-abi crate provides bindings to FUSE devices.
In motivation similar to that of virtio-spec, this project aims to provide correct foundational definitions for the FUSE kernel ABI.
It can even be used together with virtio-spec when creating a driver for the Virtio file system device.
This crate essentially brings #include <linux/fuse.h> to Rust.
The code is autogenerated using bindgen, ensuring the correctness of definitions.
uefi-rsMaintained 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:
uefi::runtimeuefi::runtimeboot::locate_handle_bufferboot::{load_image, unload_image, start_image}acpiMaintained 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. We merged the following changes this month:
Thanks to @00xc for their contributions!
uart_16550Maintained by @phil-opp
The uart_16550 crate provides basic support for serial port I/O for 16550-compatible UARTs. We merged the following change this month:
Thanks to @mkroening for their contributions!
endian-numMaintained by @mkroening
The endian-num crate provides the Be (big-endian) and Le (little-endian) byte-order-aware numeric types.
bootloaderMaintained by @phil-opp and @Freax13
The bootloader crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables. This month, we merged the following improvements:
x86_64Maintained 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:
1Thanks to @Wasabi375 for their contribution!
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.
phip1611/bit_ops(Section written by @phip1611)
I've recently created and published bit_ops.
It offers common bit-oriented operations on primitive integer types with a focus on
no_std and const compatibility. Unlike other crates that provide tooling to
create sophisticated high-level types with bitfields, the focus of bit_ops is
on raw primitive integer types.
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.
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.
Here we collect news, blog posts, etc. related to OS development in Rust.
In this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.
PanicInfo::message() and PanicMessagef16 inline ASM support for RISC-Vrust-osdev ProjectsIn this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.
uefi-rsMaintained 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:
error_in_core featureuefi::helpersThanks to @LightAndLight, @andre-braga, and @JeffLi01 for their contributions!
bootloaderMaintained by @phil-opp and @Freax13
The bootloader crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables. This month, we merged the following improvements:
Thanks to @Wasabi375 for their contributions!
pci_typesMaintained by @IsaacWoods
The pci_types library provides types for accessing and configuring PCI devices from Rust operating systems. We merged the following change this month:
FnOnce for updating commandsCommandRegisterrustfmt.tomlCommandRegisterEndpointHeader::update_interruptConfigRegionAccessCopy for all types that already implement Cloneupdate_interruptupdate_command take &mut selfThanks to @IsaacWoods, @bjorn3, and @mkroening for their contributions!
x86_64Maintained 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:
volatileMaintained by @phil-opp
The volatile crate provides a safe wrapper type for implementing volatile read and write operations. This is useful for accessing memory regions that have side-effects, such as memory-mapped hardware registers.
We merged the following PR this month:
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.
nicholasbishop/ext4-view-rs(Section written by @nicholasbishop)
I've released a new Rust crate for reading ext4 filesystems. It's easy to use, with an API very similar to std::fs. The crate is no-std compatible, but does require an allocator.
Note that by design this crate will remain read-only; writing to an ext4 filesystem is not a goal.
Thanks to @tedbrandston for doing a ton of code review on this project!
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.
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.
Here we collect news, blog posts, etc. related to OS development in Rust.
In this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.
LazyCell and LazyLock (LazyCell is available in no_std)error_in_corex86_64-unknown-linux-none target (freestanding linux binaries without libc dependency)opt-for-size core lib feature flaginteger_sign_castrust-osdev ProjectsIn this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.
endian-num (new project!)Maintained by @mkroening
The endian-num crate provides the Be (big-endian) and Le (little-endian) byte-order-aware numeric types.
Thanks to @mkroening for creating and maintaining this crate!
uefi-rsMaintained 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 @stillinbeta and @andre-braga for their contributions!
bootloaderMaintained by @phil-opp and @Freax13
The bootloader crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables. This month, we merged the following improvements:
Thanks to @fmckeogh and @Wasabi375 for their contributions!
x86_64Maintained 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 PRs this month:
Thanks to @Wasabi375 for their contribution!
multiboot2Maintained by @phip1611
The multiboot2 crate provides abstraction types for the multiboot information structure (MBI) of multiboot2 bootloaders. We merged the following changes this month:
Thanks to @YtvwlD for their contribution!
linked-list-allocatorMaintained by @phil-opp and @jamesmunns
The linked-list-allocator crate provides a basic no_std allocator that builds a linked list from freed memory blocks and thus needs no additional data structures. We merged the following PR this month:
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/free-list(Section written by @mkroening)
The free-list crate provides the FreeList type for managing virtual or physical memory.
Opposed to normal memory allocators, FreeList does not use pointers but page ranges.
It operates by keeping a list of free page ranges (hence the name) and allows allocating at user-provided ranges.
Instead of operating directly on the unallocated memory through a linked list, this free list uses statically allocated memory before dynamically allocating more memory to hold its elements.
use free_list::{FreeList, PageLayout};
let mut free_list = FreeList::<16>::new();
unsafe {
free_list.deallocate((0x1000..0x5000).try_into().unwrap()).unwrap();
}
assert_eq!(free_list.free_space(), 0x4000);
let layout = PageLayout::from_size(0x4000).unwrap();
assert_eq!(free_list.allocate(layout).unwrap(), (0x1000..0x5000).try_into().unwrap());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.
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.
Here we collect news, blog posts, etc. related to OS development in Rust.
v38. The source code of the Guest Tests is on GitHub.offset-allocator crate, providing a fast, simple, hard real time allocator
no_std yet, but should be easy to port (only requires a Vec-like type)In this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.
f16 and f128 step 4: basic library supportinline_constwasm-c-abi flag(const_)slice_ptr_len and (const_)slice_ptr_is_empty_nonnullaarch64-apple-visionos and aarch64-apple-visionos-sim tier 3 targetsrust-osdev ProjectsIn this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.
volatileMaintained by @phil-opp
The volatile crate provides a safe wrapper type for implementing volatile read and write operations. This is useful for accessing memory regions that have side-effects, such as memory-mapped hardware registers.
We merged the following PRs this month:
VolatileRef::restrict and VolatilePtr::restrictVolatileRef::borrow and VolatileRef::borrow_mutNonNull importsmap_field operations#[derive(VolatileFieldAccess)] for easy, access-limited field-based access to structsdoc_auto_cfg on docs.rs#[repr(align(N))]RestrictAccess<To> and generalize restrict to all access types#[must_use] to volatile types, read, and as_raw_ptrThanks to @mkroening for their contributions!
uefi-rsMaintained by @GabrielMajeri, @nicholasbishop, and @phip1611
The uefi-rs crate provides safe and performant wrappers for UEFI, the successor to the BIOS.
Recently, we deprecated the [uefi-services] crate and removed all usages from
the uefi repository. A new drop-in
replacement exists in uefi::helpers.
The test of time showed us that having a single crate with multiple cargo features is a better and more productive way forward with less maintenance burden - for users/consumers as well as maintainers.
Please find more information in:
We merged the following PRs this month:
as casts--no-default-featuresuefi-services and add uefi::helpers as replacementcstr16! with a declarative macrocstr8! with a declarative macroThanks to @sky5454 for their contributions!
ucs2-rsMaintained by @GabrielMajeri, @nicholasbishop, and @phip1611
acpiMaintained 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. We merged the following changes this month:
Thanks to @rw-vanc for their contribution!
x86_64Maintained 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 PRs this month:
in{,b,w,l} and out{,b,w,l}rust-toolchain to rust-toolchain.tomlx86_64-bare-metal.json with x86_64-unknown-none-Crelocation-model=static in RUSTFLAGS for bootloader test jobx86_64Thanks to @mkroening for their contributions!
bootloaderMaintained by @phil-opp and @Freax13
The bootloader crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables. This month, we merged the following improvements:
.cargo/config to .cargo/config.tomlmultiboot2Maintained by @phip1611
The multiboot2 crate provides abstraction types for the multiboot information structure (MBI) of multiboot2 bootloaders. We merged the following changes this month:
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.
efs is a recently published no-std library which provides an OS and architecture independent implementation of some UNIX filesystems in Rust.
Currently only the ext2 filesystem is directly implemented, but I will soonly work on other filesystems!
It's still young so it may contain bugs, but it's hugely tested so that it does not happen.
Some of the features provided :
no_std support (enabled by default)read/write regular filesI hope you will find this useful! If you have any remark, idea or issue, do not hesitate to submit an issue!
tar-no-std supports a relevant
subset of Tar archives to extract multiple files from a single Tar archive in
no_std environments with zero allocations. Recently, v0.3.0 was released
with support for filenames with up to 256 characters (including the directory
path) and various bug fixes. Using fuzzing, a lot of pitfalls and sudden panics
could be removed in this release.
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.
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.
Here we collect news, blog posts, etc. related to OS development in Rust.
io_uring, Derives, Oh MyIn this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.
f16 and f128c_unwind full stabilization request: change in extern "C" behaviorrust-osdev ProjectsIn this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.
acpiMaintained 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. We merged the following changes this month:
_SEG,_BBN, and _ADR methods for PCI region accesses, plus assorted bitsSdtHeaderIterator to get all headers.Thanks to @fslongjin and @rw-vanc for their contributions!
x86_64Maintained 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 PRs this month:
InterruptStackFrameValueThanks to @uglyoldbob, @GZTimeWalker, and @Sxmourai for their contributions!
bootloaderMaintained by @phil-opp and @Freax13
The bootloader crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables. This month, we merged the following improvements:
Thanks to @nicholasbishop, and @Freax13 for their contributions!
ucs2-rsMaintained by @GabrielMajeri, @nicholasbishop, and @phip1611
pic8259Maintained by @phil-opp
The pic_8259 crate provides abstractions for 8259 and 8259A Programmable Interrupt Controllers (PICs).
We merged the following PR this month:
Thanks to @iTitus for their contribution!
ovmf-prebuiltMaintained by @phil-opp and @nicholasbishop
The ovmf-prebuilt project provides pre-built edk2 releases to make it easier to set up OVMF. We merged the following improvement this month:
volatileMaintained by @phil-opp
The volatile crate provides a safe wrapper type for implementing volatile read and write operations. This is useful for accessing memory regions that have side-effects, such as memory-mapped hardware registers.
We merged the following PRs this month:
very_unstable featureSized requirement for Send and Sync on VolatileRefThanks to @nspin and @kadiwa4 for their contributions!
linked-list-allocatorMaintained by @phil-opp and @jamesmunns
The linked-list-allocator crate provides a basic no_std allocator that builds a linked list from freed memory blocks and thus needs no additional data structures. We merged the following PR this month:
uefi-rsMaintained 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:
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.
No projects updates were submitted this month.
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.
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.
Here we collect news, blog posts, etc. related to OS development in Rust.
In this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.
f16 and f128f16 and f128 step 2: intrinsicswasm32-wasip1 target to rustcwasm32-wasi-preview2 targetptr::invalid -> ptr::without_provenancerust-osdev ProjectsIn this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.
x86_64Maintained 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 PRs this month:
from_page_table_indicesv0.15.0-betaStep impl for VirtAddruefi-rsMaintained 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 @bjorn3 for their contribution!
bootloaderMaintained by @phil-opp and @Freax13
The bootloader crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables. This month, we merged the following improvements:
NO_EXECUTE flag for all writable memory regionsv0.11.7Thanks to @vinc and @tsatke for their contributions!
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.
No projects updates were submitted this month.
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.
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.
Here we collect news, blog posts, etc. related to OS development in Rust.
In this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.
rust-osdev ProjectsIn this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.
x86_64Maintained 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:
We also merged the following changes into the next branch, which will be released as v0.15 soon:
next branch with latest changes from masterHandlerFuncType unsafeset_handler_fn behaviorbootloaderMaintained by @phil-opp
The bootloader crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables. This month, we merged the following nightly fixes:
v0.11.6x86_64-bootloader target
acpiMaintained 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. We merged the following changes this month:
Thanks to @Spartan2909 for their contribution!
uefi-rsMaintained 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 @gurry for their contribution!
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.
phip1611/phipsboot(Section written by @phip1611)
I'd like to announce my project PhipsBoot. 🎉 PhipsBoot is a relocatable x86_64 bootloader for legacy x86_64 boot written in Rust and assembly. It is intended to be loaded by GRUB via Multiboot2, where it uncovers its main benefit: It is relocatable in physical memory without having relocation information in the ELF! It outsources a lot of complexity to GRUB which also better fits into the ecosystem and makes it easier usable. The README contains more background about why I have chosen to use GRUB instead of writing my own stage 1 bootloader.
This project combines a lot of toolchain and binary knowledge and experience I collected and gained in recent years about legacy x86_64 boot. The main contribution IMHO is how the binary is assembled and that the thing boots with all the properties described in the README, but not the high-level functionality itself.
I am especially proud of the well-commented structure of the assembly files. For example the whole page-table mappings are done IMHO very nicely even tho it is assembly language. Also, I think it turned out quite cool how I configured the linker script. I hope this can be a learning resource for others!
TL;DR: It is a learning ground and a reference for how to solve the relocation problem with Multiboot2 and GRUB, as GRUB is not able to load DYN ELFs.
You have multiple options for testing it out:
$ cloud-hypervisor --debug-console file=log.txt --kernel ./build/phipsboot.elf64 (using Xen PVH)$ qemu-system-x86_64 -kernel ./build/phipsboot.elf32 -debugcon stdio (using Multiboot 1)phil-opp/blog_os(Section written by @phil-opp)
We merged the following changes to the Writing an OS in Rust blog this month:
embedded_graphics crate in chapter 3Thanks to @acyanbird, @proudmuslim-dev, and @lachsdachs for their contributions!
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.
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.
Here we collect news, blog posts, etc. related to OS development in Rust.
no_std client for PostgreSQLcargo-ft (cargo filter target) is a cargo extension for specifying supported targets for a crateIn this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.
opt-level="z" on Cortex-Mcore::intrinsics::simdip_in_core featureptr::{from_ref, from_mut}target_feature configs to check-cfg-Zfunction-return={keep,thunk-extern} optionaarch64-apple-watchos targetrust-osdev ProjectsIn this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.
bootloaderMaintained by @phil-opp
The bootloader crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables. This month, we merged the following PRs:
ramdisk as used in memory mapv0.11.5take method to OptionalThanks to @mysteriouslyseeing for their contribution!
xhciMaintained by @toku-sa-n
The xhci crate provides types of xHCI structures, such as Registers and TRBs. We merged the following PRs this month:
Doorbell renamingThanks to @paulsohn for their contribution!
ovmf-prebuiltMaintained by @phil-opp and @nicholasbishop
The ovmf-prebuilt project provides pre-built edk2 releases to make it easier to set up OVMF. We merged the following improvement this month:
uefi-rsMaintained 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:
to_string return typeIpAddress typepci_typesMaintained by @IsaacWoods
The pci_types library provides types for accessing and configuring PCI devices from Rust operating systems. We merged the following change this month:
acpiMaintained 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. We merged the following changes this month:
Thanks to @ytakano for their contributions!
multiboot2Maintained by @phip1611
The multiboot2 crate provides abstraction types for the multiboot information structure (MBI) of multiboot2 bootloaders. We merged the following changes this month:
Thanks to @elbiazofor their contribution!
x86_64Maintained 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 changes this month:
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.
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.
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.
Here we collect news, blog posts, etc. related to OS development in Rust.
In this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.
There weren't really any OS-related infrastructure updates this month, but there was some great progress on several upcoming language and tooling features that may also be of interest to OS development:
rust-osdev ProjectsIn this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.
uefi-rsMaintained 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:
uefi-raw, use those types from ueficargo add commandis_ascii function on Char16 and CStr16Thanks to @RaitoBezarius for their contributions!
linked-list-allocatorMaintained by @phil-opp and @jamesmunns
The linked-list-allocator crate provides a basic no_std allocator that builds a linked list from freed memory blocks and thus needs no additional data structures. We merged the following PR this month:
Thanks to @00xc for their contribution!
pic8259Maintained by @phil-opp
The pic_8259 crate provides abstractions for 8259 and 8259A Programmable Interrupt Controllers (PICs).
We merged the following PR this month:
Thanks to @zoo868e for their contribution!
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.
No projects updates were submitted this month.
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.
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.
Here we collect news, blog posts, etc. related to OS development in Rust.
In this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.
There weren't really any OS-related infrastructure updates this month, but there was some great progress on several upcoming language and tooling features that may also be of interest to OS development:
async fn and return-position impl Trait in traitcg_clif as rustup component on the nightly channel
gen blocks in the 2024 edition
[const_]pointer_byte_offsetschar has the same size and alignment as u32-Ztrim-paths
rust-osdev ProjectsIn this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.
spinning_topMaintained by @phil-opp
The spinning_top crate provides a simple spinlock implementation based on the abstractions of the lock_api crate.
We merged the following changes this month:
RwSpinlock readers-writer lockarc_lock feature and typedefsconst_spinlock functionnightly featureThanks to @mkroening for their contributions!
uefi-rsMaintained 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:
MemoryMap.static mut in allocatorThanks to @JohnAZoidberg and @JarlEvanson for their contributions!
x86_64Maintained 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 changes this month:
Thanks to @Wasabi375, @joycebrum, and @mkroening for their contributions!
acpiMaintained 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. We merged the following changes this month:
Thanks to @alnyan for their contribution!
ovmf-prebuiltMaintained by @phil-opp and @nicholasbishop
The ovmf-prebuilt project provides pre-built edk2 releases to make it easier to set up OVMF. We merged the following improvement this month:
Thanks to @Firenezz for their contribution!
bootloaderMaintained by @phil-opp
The bootloader crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables. This month, we merged the following PRs:
Thanks to @kennystrawnmusic for their contribution!
linked-list-allocatorMaintained by @phil-opp and @jamesmunns
The linked-list-allocator crate provides a basic no_std allocator that builds a linked list from freed memory blocks and thus needs no additional data structures. We merged the following PR this month:
Thanks to @00xc for their contribution!
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.
RanvOS, (from norwegian; raven), is a operative system programmed in Rust. Aims to be; minimal, stable, secure and modern ( this maybe you know as; state-of-art ).
The objective of RavnOS is make an operative system minimalist, self hosted (no external crates, all programmed by me), stable and secure.
mkroening/interrupt-mutex(Section written by @mkroening)
Building upon last month's interrupts crate, I created a mutex for sharing data with interrupt handlers or signal handlers.
RawInterruptMutex wraps any lock_api::RawMutex, be it a parking_lot::RawMutex on Unix or a spinning_top::RawSpinlock on bare metal.
When such an InterruptMutex is locked, interrupts are disabled.
When the InterruptMutex is unlocked again, the previous interrupt state is restored.
This does not completely rule out deadlocks, since you can just enable interrupts manually when you should not.
Still, it is very convenient to just change the mutex type of data that is shared with interrupt handlers instead of disabling and enabling interrupts manually on every access.
// Make a mutex of your choice into an `InterruptMutex`.
type InterruptSpinlock<T> = interrupt_mutex::InterruptMutex<spinning_top::RawSpinlock, T>;
static X: InterruptSpinlock<Vec<i32>> = InterruptSpinlock::new(Vec::new());
fn interrupt_handler() {
X.lock().push(1);
}
let v = X.lock();
// Raise an interrupt
raise_interrupt();
assert_eq!(*v, vec![]);
drop(v);
// The interrupt handler runs
let v = X.lock();
assert_eq!(*v, vec![1]);
drop(v);mkroening/interrupt-ref-cell(Section written by @mkroening)
Also building upon last month's interrupts crate, I created a RefCell for sharing data with interrupt handlers or signal handlers on the same thread.
On the same thread (software thread or hardware thread (core)), a compiler fence is sufficient for synchronization with signal handlers (on Unix) and interrupt handlers (on bare metal).
In these cases, the new InterruptRefCell allows easy sharing without the overhead of mutexes and without the deadlock potential of mutexes.
Similar to InterruptMutex, this is helpful for disabling interrupts on accesses but does not protect you from manually enabling interrupts while holding a reference.
use interrupt_ref_cell::{InterruptRefCell, LocalKeyExt};
thread_local! {
static X: InterruptRefCell<Vec<i32>> = InterruptRefCell::new(Vec::new());
}
fn interrupt_handler() {
X.with_borrow_mut(|v| v.push(1));
}
X.with_borrow(|v| {
// Raise an interrupt
raise_interrupt();
assert_eq!(*v, vec![]);
});
// The interrupt handler runs
X.with_borrow(|v| assert_eq!(*v, vec![1]));
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.
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.
Here we collect news, blog posts, etc. related to OS development in Rust.
In this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.
unsafe_op_in_unsafe_fn to be warn-by-default from edition 2024rust-osdev ProjectsIn this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.
multiboot2Maintained 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.
acpiMaintained 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
We merged the following changes this month:
acpiDefSleep opcodeDefStall opcodeThanks to @alnyan for their contributions!
x86_64Maintained 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:
flush_broadcast and tlbsync functionsHandlerFuncType traitThanks to @brandonchinn178 and @mkroening for their contributions!
uefi-rsMaintained 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!
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. :)
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.
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.
Here we collect news, blog posts, etc. related to OS development in Rust.
In this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.
riscv-interrupt-{m,s} calling conventionsrelocation_model to the cfgrelax_elf_relocations to trueaarch64-unknown-teeos targettarget.'cfg(..)'.linkerrust-osdev ProjectsIn this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.
uefi-rsMaintained 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:
memmove and set_mem from boot servicesuefi-raw and use it in uefiuefiDebug in more places (requires Rust 1.70)Thanks to @cmoylan and @julic20s for their contributions!
bootloaderMaintained by @phil-opp
The bootloader crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables. This month, we merged the following PRs:
RacyCell<T>: Data race allowed on TThanks to @frisoft, @devsnek, and @kuzeyardabulut for their contributions!
x86_64Maintained 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:
inline attribute to segment functionsiretq function to the InterruptStackFrameValue struct.Thanks to @tsoutsman, @NathanKolpa, and @xzmeng for their contributions!
acpiMaintained 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. We merged the following changes this month:
DefSizeOf implementationDefIfElse parser returning UnexpectedEndOfStream when If (...) {} is not followed by anythingThanks to @alnyan for their contributions!
uart_16550Maintained by @phil-opp
The uart_16550 crate provides basic support for serial port I/O for 16550-compatible UARTs. We merged the following change this month:
Thanks to @phip1611 for their contributions!
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/take-static(Section written by @mkroening)
I published a tiny new crate, allowing you to get a mutable reference to static items safely (only once, though):
use take_static::take_static;
take_static! {
static NUMBER: usize = 5;
}
assert_eq!(NUMBER.take(), Some(&mut 5));
assert_eq!(NUMBER.take(), None);
This allows you to easily use statically allocated memory before dynamic memory allocators may be available.
Compared to cortex_m::singleton, take_static is thread-safe.
Compared to takecell::TakeCell, take_static also supports !Send types.
hermit-os/kernel(Section written by @mkroening)
The Hermit unikernel project allows you to bundle your Rust application with our library operating system to create a bootable unikernel image. Hermit is a single-address-space operating system. Since there is only one application running in the virtual machine, no isolation between applications or between user space and kernel space is necessary. This reduces system call overhead immensely, since every system call is just a library call. For more information, see our The Hermit Operating System showcase post.
The RustyHermit project has been renamed. We have renamed our GitHub organization from @hermitcore to @hermit-os and reserved the http://hermit-os.org domain.
We have also renamed some of our core projects to reduce confusion:
We have a new logo! As hermit crabs occupy empty shells produced by other organisms, the original HermitCore occupied one or several cores on a computer. Because we migrated to Rust in 2018, our new logo of a hermit crab occupying the Rust logo's bike gear fits quite nicely with the Rust logo as well as Rust's Ferris.
And as always, please come and try Hermit! :)
phil-opp/blog_os(Section written by @phil-opp)
We merged the following changes to the Writing an OS in Rust blog this month:
Thanks to @Connortsui20 and @xzmeng for these contributions!
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.
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.
Here we collect news, blog posts, etc. related to OS development in Rust.
allocator_api2 crate to use Rust's nightly allocator API on stable RustIn this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.
chkstk/alloca intrinsics on x86_64-unknown-uefiriscv64gc-unknown-hermit targetx86_64-unikraft-linux-musl targetAtomicBool for target that don't support byte-sized atomicsrust-osdev ProjectsIn this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.
multiboot2Maintained by @phip1611
The multiboot2 was bumped from 0.16.0
to 0.17.0. The new release includes the builder pattern for the MBI builder
and the ability to use custom memory types in the memory map in addition to
pre-defined ones. For more info, look here.
uefi-rsMaintained 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:
GraphicsOutputProtocol to uefi_raw and use it from uefiuefiuefiFileSystem::copy to operate on 1MiB chunksThanks to @devsnek for their contribution!
xhciMaintained by @toku-sa-n
The xhci crate provides types of xHCI structures, such as Registers and TRBs. We merged the following PRs this month:
Thanks to @lemolatoon for their contribution!
x86_64Maintained 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:
Thanks to @SamZhang3 for their contribution!
bootloaderMaintained by @phil-opp
The bootloader crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables. This month, we released a new patch version to fix the build on the latest nightlies:
ovmf-prebuiltMaintained by @phil-opp
The ovmf-prebuilt project provides pre-built edk2 releases to make it easier to set up OVMF. We merged the following improvement this month:
Thanks to @nicholasbishop for their contribution!
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.
SFBdragon/talc(Section written by @SFBdragon)
Talc is a recently published, fast, and flexible no-std memory allocator.
By the time you're seeing this, hopefully v2 should be out or coming soon:
lock_api is used to allow for custom allocator synchronization.I hope you find it useful!
vinc/moros(Section written by @vinc)
MOROS is a text-based hobby operating system targeting computers with a x86-64 architecture and a BIOS.
Since last month's release, I focused on adding new syscalls to interact with network sockets from userspace. The DNS and HTTP clients are now using the new UDP and TCP sockets.
I also added another syscall to poll multiple handles at the same time, to read from the console and a socket, improving the main network tool that can now be used as a simple chat program.
The VGA driver, the filesystem, and the editor got a few significant improvements as well, to support downloading and reading larger files.
valibali/cluu(Section written by @phil-opp)
There is a new project featured in our Showcase series:
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.
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.
Here we collect news, blog posts, etc. related to OS development in Rust.
In this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.
No updates were proposed for this section this month.
rust-osdev ProjectsIn this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.
volatileMaintained by @phil-opp
The volatile crate provides a safe wrapper type for implementing volatile read and write operations. This is useful for accessing memory regions that have side-effects, such as memory-mapped hardware registers or framebuffers.
Unfortunately, the design crate had a soundness issue because it used reference types for accessing the volatile memory. This is problematic because the Rust compiler marks references are "dereferenceable", which allows LLVM to insert spurious read operations. This is fine for accessing "normal" memory, but it can lead to correctness issues when used in combination with memory-mapped device registers. These registers look like normal memory, but they are actually accessing some device-specific registers, which might change at any time. So they might change between spurious reads, which violates the assumptions of LLVM and can lead to undefined behavior.
To solve this issue, we started a full redesign of the crate that uses raw pointers only. This solves the issue because raw pointers are not considered "dereferenceable", so LLVM is not allowed to insert spurious reads. While we started working on the new design more than 2 years ago, we didn't merge it until this month because we weren't sure about the implementation details. The main discussion point was whether we should treat the proposed VolatilePointer type like Rust's reference types or like Rust's raw pointer types. The difference is that raw pointers implement the Copy trait, but are not Send to prevent aliasing. References, on the other hand, can safely implement Send because they're only Copy if the reference is read-only.
After a lot of back and forth, we decided to provide both options and finally publish volatile v0.5. So the new design has two wrapper types, VolatilePtr (behaves like a raw pointer) and VolatileRef (behaves like a reference). We hope that we support most use cases this way!
Note that there is also some ongoing discussion about a potential VolatileCell type to wrap values in-place. Most implementations of such a type would require support from the Rust compiler, which needs an RFC. However, there is one promising design based on zero-sized types and proc-macros by @Freax13 that should not require any new language features. We will continue to investigate.
multiboot2Maintained by @phip1611
The multiboot2 and the multiboot2-header crates got a big overhaul. The list of new features includes but is not limited to:
multiboot2 was updated from 0.15.1 to 0.16.0 and multiboot2-header was updated from 0.2.0 to 0.3.0. Both
releases come with a large amount of breaking changes.
However, after a sensible consideration, they are all worth it for a more streamlined API and more memory safety.
x86_64Maintained 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 changes this month:
Thanks to @Qix-, @grant0417, and @Egggggg for their contributions!
vgaMaintained 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 @tsatke for their contribution!
uefi-rsMaintained by @GabrielMajeri, @nicholasbishop, and @phip1611
The uefi crate provides safe and performant wrappers for UEFI,
the successor to the BIOS firmware. It empowers everyone to write EFI-
applications with Rust in a convenient way, such as your own bootloader.
In June, we added multiple small improvements for developers using
Nix(OS) and simplifications for working with device
paths. Additionally, we moved more definitions to the new uefi-raw crate.
Furthermore, we'd like to mention the new high-level File-System API. It was merged in April actually, but not mentioned in this newsletter so far. Feel free to give it a try!
We merged the following PRs this month:
[workspace.package] to deduplicate metadataBootServices a wrapper around uefi_raw::table::boot::BootServicesEventTypeSimpleTextInputProtocol in InputSimpleTextOutputProtocol in OutputLoadedImageProtocol to implement LoadedImageSimplePointerProtocolThanks to @medhefgo for their contribution!
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.
hermitcore/rusty-hermit(Section written by @mkroening)
The Hermit library operating system allows you to bundle a whole OS directly with your application, creating a freestanding, bootable Unikernel image. This month, we achieved several milestones for reaching more users with Hermit:
Stable Rust support.
You can now compile your programs for Hermit using the stable Rust toolchain! 🥳
While the Hermit targets (x86_64-unknown-hermit and aarch64-unknown-hermit) are still at tier 3, we now distribute pre-built artifacts of the Rust standard library for use with stable toolchains!
This means, no more -Zbuild-std, resulting in faster builds, and the bliss of the stable Rust compiler.
See hermitcore/rust-std-hermit for details on our rust-std artifacts.
Windows support.
Thanks to Rust's awesome cross-compilation capabilities, you can now compile Hermit applications from anywhere! 😎
We have resolved a longstanding issue when building Hermit applications on Windows (hermitcore/rusty-hermit#431). The issue is all sorted out now and Windows, macOS, and Linux are tested and verified by our CI.
AArch64 (ARM64) support.
You can now run real applications on AArch64, with scheduling, network and everything! 🤯
PCI now works on AArch64, which allows us to use the network devices (hermitcore/libhermit-rs#748).
We merged scheduling support for AArch64 (hermitcore/libhermit-rs#765).
You can also now chainload Hermit apps for AArch64 using our loader (hermitcore/rusty-loader#201).
This means, you don't have to statically compile the full application into the final loader image anymore.
We'd love if you gave Hermit a try. Just start with our "Hello, World!" application template: hermitcore/rusty-demo.
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.
CLUU is a hobby operating system being written in Rust - in the active development phase - targeting x86_64 and with plans to support aarch64 in the future. The project is made for fun and joy, drawing inspiration from various operating systems and projects while incorporating unique approaches and ideas.
CLUU is driven by the motivation to explore operating system development in a powerful language like Rust. The project seeks to break away from the traditional approach using languages like C, which can sometimes feel limiting or mundane. With CLUU, the goal is to embark on a learning journey and have fun in the process. Contributions from the community are highly encouraged and welcomed.
CLUU draws inspiration from the following operating systems:
As well as heavily influenced by the following projects:
CLUU aims to create a UNIX-like operating system, although not plannig to fully adhere to the POSIX standards. The goal is to get as close to the UNIX philosophy and compatibility as possible. This would enable easier porting of Linux software to CLUU and provide a familiar environment for developers.
CLUU is currently in the early stages of development, with the focus on building a solid foundation for the operating system. At this stage, the following basic functionalities have been implemented:

As the project progresses, the focus will shift towards implementing additional features, such as:
The project remains open-source, and contributions from the community are highly encouraged. If you're interested in exploring the code, contributing enhancements, or reporting issues, please visit the GitHub repository.
CLUU is licensed under the MIT License. See LICENSE for more information.
]]>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 collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.
No updates were proposed for this section this month.
Here we collect news, blog posts, etc. related to OS development in Rust.
mnemos
mnemos, an async-first hobby OSrust-osdev ProjectsIn this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.
uefi-rsMaintained by @GabrielMajeri, @nicholasbishop, and @phip1611
install_configuration_tableRuntimeServices definition to uefi-raw and use it from uefiThanks to @RaitoBezarius and @medhefgo for their contributions!
multiboot2Maintained by @IsaacWoods, @phip1611, @robert-w-gries, @ahmedcharles, and @Caduser2020
Thanks to @YtvwlD for their contributions!
vgaMaintained by @RKennedy9064
Thanks to @tsatke for their contribution!
ovmf-prebuiltMaintained by @phil-opp
Thanks to @nicholasbishop for this contribution!
acpiMaintained by @IsaacWoods
Thanks to @YtvwlD, @semiviral, and @A0lson for their contributions!
pci_typesMaintained by @IsaacWoods
Thanks to @stlankes for their contributions!
bootloaderMaintained by @phil-opp
Thanks to @mgr0dzicki for their contributions!
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 the following changes to the Writing an OS in Rust blog this month:
Thanks to @SPuntte, @Firenezz, and @twilfredo for these contributions!
There wasn't much progress on the upcoming third edition this month, as I've been on vacation for the past few weeks. I still have a lot of catching up to do, but I'll try my best to continue writing 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 Zulip chat.
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 collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.
No updates were proposed for this section this month.
Here we collect news, blog posts, etc. related to OS development in Rust.
rust-osdev ProjectsIn this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.
uefi-rsMaintained by @GabrielMajeri, @nicholasbishop, and @phip1611
Guid struct and guid! macrouefi-raw and use it from uefiStatus to uefi-raw, along with related API changesThanks to @JohnAZoidberg and @felipebalbi for their contributions!
bootloaderMaintained by @phil-opp
uefi dependency to v0.20Thanks to @kennystrawnmusic and @JarlEvanson for their contributions!
pic8259Maintained by @phil-opp
Thanks to @rasheedmhd for their contributions!
x86_64Maintained by @phil-opp, @josephlr, and @Freax13
acpiMaintained by @IsaacWoods
Thanks to @A0lson, and @rw-vanc for their contributions!
ucs2-rsMaintained by @GabrielMajeri, @nicholasbishop, and @phip1611
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 the following changes to the Writing an OS in Rust blog this month:
zola to v0.17.2#[alloc_error_handler] attribute was removedalloc_error_handlerI also continued writing on the upcoming third edition of the blog. I finished a draft of the second post, which is about booting using v0.11 of the bootloader crate. You can already read it on GitHub if you like.
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.
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 collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.
Here we collect news, blog posts, etc. related to OS development in Rust.
rust-osdev ProjectsIn this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.
multiboot2Maintained by @IsaacWoods, @phip1611, @robert-w-gries, @ahmedcharles, and @Caduser2020
The multiboot2 crate provides abstraction types for the multiboot information
structure (MBI) of multiboot2 bootloaders. The latest release of the
multiboot2-crate is now v0.15.0 (was v0.14.0), which fixed a
bug. Furthermore, the
documentation was improved. However, the biggest change is that the library now
allows the parsing of custom multiboot tags, which are not prohibited by the
spec. For a full changelog, please refer to the
GitHub repo.
In the CI, we want to run many tests that cover a big portion of the cartesian product of the following properties:
As I (@phip1611) was annoyed by all the boilerplate configuration and repetition, I've investigated new ways to improve that situation and created a reusable workflow can be used like that:
jobs:
build_msrv:
name: build (msrv)
uses: ./.github/workflows/_build-rust.yml
with:
rust-version: 1.56.1
do-style-check: false
style_nightly:
name: style (nightly)
needs: build_nightly
uses: ./.github/workflows/_build-rust.yml
with:
rust-version: nightly
do-style-check: true
do-test: false
The ./.github/workflows/_build-rust.yml workflow abstracts setting up the
toolchain, setting up a cargo cache for a faster CI, and, depending on the
configuration, running cargo test|clippy|doc|build|fmt. I think that the
outcome is quite nice and might also help others. Feel free to check out the
corresponding PR.
uefi-rsMaintained by @GabrielMajeri, @nicholasbishop, and @phip1611
delete_variable() helper'boot lifetime from Output protocolcore::error::Error for all error payloadsBorrow/ToOwned for CString16/CStr16global_allocator module and change scope of global_allocator featureSystemTable implementationrepr(transparent) on bitflagsentry example more compatible with stable--unstable option to cargo xtask docuse consistentlyThanks to @hughsie, @nicholasbishop, @JohnAZoidberg, @phip1611, @JarlEvanson, and @dependabot[bot] for their contributions!
x86_64Maintained by @phil-opp, @josephlr, and @Freax13
doc_cfg featuredoc_auto_cfg on docs.rs buildsPageSize traitDescriptor::dpl const method and use it in GDT constructionThanks to @joycebrum for their contributions!
acpiMaintained by @IsaacWoods
l_and parser and opcodeaml compiling on 32-bit platformsThanks to @A0lson, @rcerc, and @rw-vanc for their contributions!
pci_typesMaintained by @IsaacWoods
Thanks to @devsnek for their contributions!
bootloaderMaintained by @phil-opp
BootConfig0.11.1v0.11.2v0.11.3Thanks to @jasoncouture for their contributions!
vgaMaintained by @RKennedy9064
Thanks to @bendudson for their contributions!
pic8259Maintained by @phil-opp
Thanks to @Virux for their contributions!
volatileMaintained by @phil-opp
Thanks to @joycebrum for their contributions!
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.
phip1611/paging-calculator(Section written by @phip1611)
In the November newsletter, I announced the initial release of my
paging-calculator CLI utility. Recently, I released a new version, which now
covers page table indices for x86, x86 with physical address extension (PAE),
x86_64, and x86_64 with 5 levels. For example, just type $ paging-calculator 0xdeadbeef x86
and $ paging-calculator 0xdeadbeef x86 --paeand compare the result. You can
install it from crates.io or with
the pkgs.paging-calculator attribute,
if you are a Nix user.

xiaoyang-sde/rust-kernel-riscv(Section written by @xiaoyang-sde)
rust-kernel-riscv is an experimental operating system kernel built using Rust's asynchronous programming model to schedule threads in both kernel and user space. This approach allows for more efficient context switching and eliminates the need for allocating a separate kernel stack for each user process. In its current iteration, the kernel provides a basic shell capable of running several executables that demonstrate various kernel mechanisms.
The kernel provides a built-in executor, which manages the scheduling and execution of threads. Threads are executed for a time slice before an exception or interrupt occurs, and then the executor switches to another thread. To give you a better understanding, I included the async function that represents the lifetime of a user thread below, and I wrote a detailed design document.
async fn thread_loop(thread: Arc<Thread>) {
loop {
let trap_context = thread.state().lock().user_trap_context_mut();
_enter_user_space(trap_context, thread.satp());
// Invokes related methods to handle the exception or interrupt,
// which returns a variant of the `ControlFlow` enum
match control_flow {
ControlFlow::Continue => continue,
ControlFlow::Yield => yield_now().await,
ControlFlow::Exit(exit_code) => {
thread.exit(exit_code);
break;
}
}
}
}
The idea behind rust-kernel-riscv was inspired by Phil's recent blog post on using async/await in the kernel. Thanks Phil for his invaluable support to the Rust community!
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.
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 collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.
rust-lang/rustkernel-address sanitizer support for freestanding targets#![feature(target_feature_11)]. Allows enabling target features such as avx2 for specific functions.This new flag makes cargo switch to the specified directory before building.
This means that the .cargo/config.toml file is also read from that directory, which can be very useful when configuring features such as build-std.
Here we collect news, blog posts, etc. related to OS development in Rust.
rust-osdev ProjectsIn this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.
uefi-rsuefi-0.19.1exit_boot_services APIcstr8, cstr16, and entry macros from the rootDeref for HandleBuffer and ProtocolsPerHandleInput::read_key docstringunstable an optional featurebootloaderacpiThanks to @rw-vanc for their contributions!
spinning_topv0.2.5)Thanks to @jannic for this contribution!
linked-list-allocatorThanks to @jannic for this contribution!
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 the following changes to the Writing an OS in Rust blog this month:
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.
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 collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.
abi_efiapi featurestart lang itemrust-osdev ProjectsIn this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.
bootloaderMaintained by @phil-opp and @rybot666
The bootloader crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables.
We merged lots of improvements this month:
bios and uefi cargo featuresFrameBuffer::into_buffer method for taking ownershipkernel_slice_end as an exclusive bound when checking for overlapstime cratestdin when spawning QEMUThanks to @jasoncouture, @Stary2001, @AlexJMohr, @Freax13, @tsoutsman, and @asensio-project for their contributions!
uefi-rsMaintained by @GabrielMajeri, @nicholasbishop, and @phip1611
The uefi crate provides safe and performant wrappers for UEFI, the successor to the BIOS.
We merged the following changes last month:
abi_efiapi stabilizationThanks to @nsemmel and @liferooter for their contributions!
volatileMaintained by @phil-opp
The volatile crate provides a safe wrapper type for implementing volatile read and write operations. This is useful for accessing memory regions that have side-effects, such as memory-mapped hardware registers or framebuffers.
We merged the following PRs this month:
Deref returns different references (published as v0.4.6)Thanks to @Freax13 for their contributions!
We are still working on a new, safer design. This month, we opened PR #29 to compare and discuss two alternative designs. The main question is whether the provided VolatilePtr type should implement Copy or Send. Only one of these trait implementations is possible, otherwise there could be data races that lead to undefined behavior. Since both variants have valid use cases, the latest proposal is to implement two different types with conversion methods between them. We haven't reached a decision yet, so if anyone has more input on this, please join the discussion.
x86_64Maintained 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.
We merged the following changes in January:
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.
metta-systems/vesper(Section written by @berkus)
Vesper is a capability-based single-address-space nanokernel. This means it is aiming to be small, to provide only isolation primitives; at the same time SAS makes it a lot easier to perform cross-process operations (because all addresses are the same across all processes). It uses capabilities to provide security for such operations, so that unauthorized processes will not be able to intervene in legitimate traffic.
The kernel is in very early stages of development...
And for the past few months I've been on and off involved in deciphering a mystical miscompilation problem. I've managed to summarize it in a ticket to rustc.
The most minimal reproduction scenario triggers when I use a format_args!() macro in my code and a nightly version later than 2022-08-12.
Here's a key snippet:
// if you keep this line, it works when compiled
// via rustc 2022-08-12 and breaks on 2022-08-13 and all the versions past that.
// if you comment this line out, on 2022-08-13 everything else starts to work.
uart.write_fmt(format_args_nl!("Lets {}!", "go")).ok();
There's also a QEMU-only reproduction code, which is much smaller, as it reuses armv8a_semihosting and armv8a_panic_semihosting crates for pretty much everything.
The behavior is the same though:
// if you don't comment it out, it works on 08-12 and breaks on 08-13.
// if you comment this line out on 08-13 everything else starts to work.
armv8a_semihosting::hprintln!("Lets {}!", "go").ok();
"Working" here means the kernel boots and runs through to the last panic line:
[cargo-make] INFO - Running Task: qemu
🚜 Run QEMU -M raspi3b -semihosting with vesper/target/nucleus.bin
Letsgo!
Lets go!
Lets go 2!
panicked at 'Off you go!', src/main.rs:34:5
And "not working" is the kernel either panicking on boot in arch64, for which I've extracted panic message but I have low confidence this is what actually happens - panic was in once_cell detecting it is initializing a second time, which I discounted as potentially just a bug in linker script layout and not an actual code generation bug. This code is even completely removed in the latest reproduction (no once_cells) but the kernel still crashes before it even can write anything to serial.
In the qemu repro it's even weirder:
🚜 Run QEMU -M raspi3b -semihosting with vesper/target/nucleus.bin
No output - because hstdout_str() function from armv8a_semihosting crate fails to open semihosting stdout handle - syscall returns -1. Why would that happen simply by a compiler version change - is the biggest question.
I'm yet to find what am I missing here - assuming this is my own mistake and not a compiler fault, because it would've been noticed by everybody else then? But who knows, maybe you can spot something - drop me a line if you see anything suspicious, I'm pretty much out of ideas here.
phil-opp/blog_os(Section written by @phil-opp)
We merged the following changes to the Writing an OS in Rust blog this month:
Thanks a lot to @kennystrawnmusic for this contribution!
We also have an open pull request for a Chinese translation of the Paging Implementation post. We're still looking for a reviewer, so if you're speaking Chinese we would appreciate if you could take a look. Thanks!
Since I mostly worked on the bootloader crate this month, I haven't made much process on the upcoming third edition of the blog yet.
I'll do my best to have something ready 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 Zulip chat.
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 collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.
interoperable_abiThis Rust language proposal suggests to create a new extern "interop" ABI as a strict superset of the C ABI.
The goal of this new ABI is to "define a standard way to make calls across high-level languages, passing high-level data types, without dropping to the lowest common denominator of C".
For example, it will define a specific memory representation for strings, tuples, and common standard library types such as Option and Result.
This new ABI would be very useful for operating system development because there are often multiple executables that need to communicate with each other using a stable ABI.
For example, user-space programs communicate with the kernel using system calls, and with other programs using different forms of inter-process communication.
With new extern "interop" ABI, these communication boundaries could use safe, higher-level types when both sides are written in Rust.
default_alloc_error_handler has been stabilizedOn no_std targets, enabling alloc requires providing an OOM (out-of-memory) handler. The usual implementation of this handler just panics, but implementing the handler requires an unstable feature: alloc_error_handler. The newly-stabilized default_alloc_error_handler automatically provides an OOM handler that panics if no custom handler is implemented. This is an important step towards using some targets on the stable channel.
.bss section do not need to be statically
allocated inside the ELF. Symbols in the .bss segment are expected to be initialized to all
zeroes..bss section "as they are" into the binary
so that they occupy zeroed memory in the ELF. This is relevant for some very rudimentary
ELF loaders that are found in some microkernels to bootstrap their initial process.rust-osdev ProjectsIn this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.
uefi-rsMaintained by @GabrielMajeri, @nicholasbishop, and @phip1611
The uefi crate provides safe and performant wrappers for UEFI, the successor to the BIOS.
We merged the following changes last month:
SIMPLE_NETWORK_PROTOCOLunsafe_protocol macro and drop use of the unstable negative_impls featureUnalignedSlice: impl Clone and improve DebugError and Display traits for FromStrErrorptr_meta dependencymaybe_uninit_slice and vec_into_raw_parts featuresBootServices::open_protocol docsBootServices function docsBootServices functions describing error casesBootServicesThanks to @veluca93, @phip1611, and @raccog for their contributions!
x86_64Maintained 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.
We merged the following changes in December:
next_higher_level to PageLevelIndexis_empty to PageTablePage::from_page_table_indices (for upcoming v0.15 release)Thanks to @TornaxO7 for their contribution!
Want to contribute to a Rust OSDev project, but don't know where to start? Help with one of these outstanding issues!
No tasks were proposed for this section this month.
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.
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.
(Section written by Kevin Boos (@kevinaboos))
Theseus is a safe-language OS written from scratch in Rust that is in the midst of a shift from academic research to usability and legacy compatibility. Theseus loads and links all components at runtime, and executes everything at a single privilege level in a single address space, relying on Rust safety for isolation and correctness.
As a fully open-source project, we welcome and encourage contributions from everyone!
Since our last update here a few months ago, we have worked on the following things:
dreadnought, a basic async executor that brings Rust's async/await syntax to Theseus
dreadnought tasks and native Theseus taskssmoltcp version, 0.8uefi_loader tool, loosely based on the rust-osdev org's bootloader projectPorthole, from scratch
JoinableTaskRef and ExitableTaskRef
JoinableTaskRef is similar to std::task::JoinHandle, but is fully safe
joined by the "parent" task that spawned itjoining a task and obtaining its ExitValueExitableTaskRef statically ensures that only a task itself can mark itself as exited
TaskRefs during a context switch
hull, plus new terminal, console, and TTY components
owning_ref, a crate with unsoundness, in favor of our own types:
BorrowedMappedPages<T>: a pseudo-self-referential type that allows persistent, efficient borrowing of a MappedPages memory region as a specific type T
Mutability type parameter for either immutable (&T) or mutable (&mut T) borrowingBorrowedSliceMappedPages also supports dynamically-sized slices, i.e., &[T] and &mut [T]owning_ref because MappedPages is always pinned in memory, avoiding the need for Box allocationdereffer: a new library crate that provides DerefsTo<T>, a generic wrapper type that allows the enclosed object T to be arbitrarily dereferenced to any inner type reachable from that object T
std::ops::Derefx86_64-unknown-theseus target spec
rustc as built-in targetsowned_borrowed_trait: a new library crate that abstracts over Owned values vs. Borrowed refs
Cow)Clone or care about any characteristics of the inner type Tconsts to conditionally branch based on whether an owned value or borrowed reference was passed into a functionCheck out the Theseus OS blog for more.
Andy-Python-Programmer/Aero(Section written by @Andy-Python-Programmer)
Aero is a new modern, experimental, unix-like operating system following the monolithic kernel design. Supporting modern PC features such as long mode, 5-level paging, and SMP (multicore), to name a few.
This month, Aero successfully managed to get mesa-demos and alacritty running.

In addition, deps.sh script was added to automate the process of installing the required dependencies on the host to build the sysroot.
phil-opp/blog_os(Section written by @phil-opp)
We merged the following changes to the Writing an OS in Rust blog in the past two months:
bootloader (thanks to @seewishnew)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.
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.
We have some new sections this month, we hope you like the content!
In this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.
(Section written by @nicholasbishop)
The MCP to raise the three UEFI targets to tier 2 by @dvdhrm was recently approved.
Following that we merged a PR to dist builds of the UEFI targets so that you can install them via rustup (e.g. rustup target add --toolchain nightly x86_64-unknown-uefi), and a PR to add an initial QEMU test for the x86_64 UEFI target to help prevent regressions from landing.
The initial nightlies containing the prebuilt UEFI targets revealed some issues in compiler_builtins which we fixed and are in the 0.1.84 release.
Finally, we changed the C compiler for the UEFI targets from gcc to clang, which resolved some linker problems.
As of the 2022-11-22 nightly, the three UEFI targets should be fully usable, which means you no longer need to use the unstable -Zbuild-std feature.
rust-osdev ProjectsIn this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.
bootloaderMaintained by @phil-opp
Just a few days ago, we finally released version 0.11.0 of the the bootloader crate. This release is a major rewrite with various new features and also breaking changes:
bootloader_api crate to make kernels loadable by the bootloader and the actual bootloader implementation. This makes the build process for kernels much easier and faster.Cargo.toml, the configuration now happens through a normal Rust struct, which is part of the entry_point! macro. The macro then serializes the config struct at compile time and places it in a special ELF output section. The compile time serialization happens through a manually implemented const fn of the config struct.0.10, the bootloader used to link the kernel at compile time, which required recompiling the bootloader whenever the kernel was modified. In v0.11, we now load both the kernel and the configuration at runtime, so no rebuilding of the bootloader is needed anymore.Cargo.toml anymore, we can build the different parts of the bootloader independently. For example, the BIOS boot sector is now a separate crate, and the UEFI bootloader is too. (We plan to make them proper artifact dependencies as soon as they're allowed on crates.io.)bootloader library crate, which compiles everything as part of its build script. This library includes functions for creating BIOS and UEFI disk images for a given kernel. These functions can be used e.g. from a builder crate or a build script of the downstream operating system.See our README for detailed usage instructions. We also created migration guides that explain how to update from v0.9 and v0.10.
Thanks a lot to the numerous people that tested our beta releases and reported issues!
uefi-rsMaintained by @GabrielMajeri, @nicholasbishop, and @phip1611
cstr16! macro usable in const contextsMemoryAttributes in MemoryDescriptorsDevicePathBuilderBootServices functionsTryFrom<core::ffi::CStr> implementation for CStr8Directory::read_entry_boxed plus common abstraction make_boxeduefi::Errorread_entry_boxed_in and get_boxed_info_in that use the allocator_apiunstable feature and improve CI for feature flagsmbrman to 0.5.0--targetcargo xtask docThanks to @blitz, @YtvwlD, @timrobertsdev, @NathanRoyer, and @d-sonuga for their contributions!
linked-list-allocatorMaintained by @phil-opp and @jamesmunns
We merged the following tooling changes this month to make the crate more reliable:
Thanks to @evanrichter for their contribution!
acpiMaintained by @IsaacWoods
Thanks to @semiviral for their contribution!
Want to contribute to a Rust OSDev project, but don't know where to start? Help with one of these outstanding issues!
No tasks were proposed for this section this month.
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.
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.
bendudson/EuraliOS(Section written by @bendudson)
EuraliOS is a hobby multitasking operating system written in Rust. It's based on a microkernel ("Merriwig") that provides on-demand paging, stack and heap memory management for multi-threaded user processes. Drivers run in Ring 3 and communication between processes is by Rendezvous message passing. Each process can have its own virtual file system, enabling multiple users to be isolated from each other.
This still has many rough edges and doesn't have many drivers: EuraliOS only has ramdisk storage, but does have a TCP stack thanks to the smoltcp crate. The only user programs are a simple shell and a Gopher client; I'm trying to port the kibi text editor but have a lot of work to do on the standard library.
This was based on Phil's blog and uses many rust-osdev crates including x86_64, bootloader and vga. Thanks to Phil and Rust-OSdev contributors for all their work supporting this community!
I've tried to
document the
development steps and hope these are useful for others, particularly
the sections on getting into Ring 3, implementing syscalls and
switching stacks with swapgs. Suggestions for improvement welcome!
hermitcore/hermit-sync(Section written by @mkroening)
While working on the libhermit-rs kernel, I moved the synchronization primitives targeted at kernel development into a separate crate: hermit-sync.
Whilst I was there, I also enhanced the code and made it independent from libhermit, so the code can now be used in other projects as well; at least x86_64 and aarch64 ones for the moment.
The crate contains the following features:
OnceCell and Lazy based on generic_once_cell (another recent project of mine)All of these primitives are available with and without interrupt safety. See the API docs for more details.
Any feedback is very welcome of course.
phip1611/paging-calculator(Section written by @phip1611)
I worked on setting up page tables in a low-level project and noticed that there is lots of room for
confusion. For example, x86 has at least four different modes of paging: 32-bit paging, 32-bit
paging with PAE, 64-bit 4-level paging, and 64-bit 5-level paging. 32-bit without PAE paging uses 10
bits to index into a page table while 64-bit paging uses 9 bits to index into the table of each
level. To demystify the magic a little, I created a CLI utility called paging-calculator that
takes a virtual address as input and shows you the indices the hardware will use. You can find the
utility on crates.io.
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.
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.
rust-osdev ProjectsIn this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.
uefi-rsMaintained by @GabrielMajeri, @nicholasbishop, and @phip1611
Event to be FFI-safe using NonNullguid! macroRevisionUnalignedCStr16 with UnalignedSliceDeviceSubType valuesThanks to @timrobertsdev and @raccog for their contributions!
linked-list-allocatorMaintained by @phil-opp and @jamesmunns
v0.10.allocate_first_fit, deallocate, and extend methods<=0.10.1Thanks to @evanrichter for their contribution!
bootloaderMaintained by @phil-opp, @rybot666, and @64
We merged the following changes this month:
noto-sans-mono-bitmap to v0.2.0
�GNU_RELRO program header handling to make relocations read-onlynext branch for the upcoming v0.11 releaseThanks to @phip1611, and @Freax13 for their contributions!
acpiMaintained by @IsaacWoods
This month, we began work to remove acpi's dependence on the alloc crate for allocations, instead directly
using the core::alloc::Allocator API. This
improves support for bootloaders and kernels that want to treat memory allocation as fallible, allowing them to
more gracefully recover from out-of-memory situations. In the future, we hope that this support will be brought
into alloc, so that the library can return to using the standard containers.
These changes are not yet finished or released, but a new major version will likely be out in December with these
changes, as well as better support for PCI topologies with multiple segment groups, and a few other changes. If
you'd like to make use of these new features as they're developed, they're already in main, so you can use a Git
dependency.
Thanks to @semiviral, and @mattfbacon for their contributions!
Want to contribute to a Rust OSDev project, but don't know where to start? Help with one of these outstanding issues!
No tasks were proposed for this section this month.
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.
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.
d-sonuga/blog-blasterball(Section written by @d-sonuga)
Demilade Sonuga's Blog is a new blog on writing a simple blasterball game with no OS, no engine and minimal external crates. The blog's aim is to take a Rust beginner from starting the project to finishing it and understanding everything involved in the project's creation.
The project is still in it's early stages, so lots of feedback is very much needed.
If you're interested, please take a look, and send your thoughts to @d_sonuga on Twitter.
(Section written by @ColinFinck)
At the first ever EuroRust conference from 13th to 14th October, Colin Finck gave a talk about the challenges of developing his nt-list crate.
The crate provides a safe and idiomatic Rust wrapper around the Windows variant of Linked Lists.
It was presented on this blog in July.
A recording of the talk has just been uploaded. Check it out, and also check out the other videos from that conference for some great takes on Rust!
MaderNoob/galloc(Section written by @phil-opp)
The new good_memory_allocator crate implements a no_std-compatible linked list allocator, inspired by the dlmalloc algorithm. It stores an additional usize of metadata per allocation, which decreases memory efficiency, but increased runtime efficiency. The README includes promising benchmark results that compare the crate against the linked-list-allocator and simple-chunk-allocator crates.
phil-opp/blog_os(Section written by @phil-opp)
We merged the following changes to the Writing an OS in Rust blog this month:
post-09 address calculation section (thanks to @seewishnew)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.
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.
rust-osdev ProjectsIn this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.
bootloaderMaintained by @phil-opp, @rybot666, and @64
The bootloader crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables.
We encountered various boot issues with the new v7.1.0 release of QEMU in September. This also affected downstream projects such as phil-opp/blog_os and hawkw/mycelium. After some debugging, we found out that QEMU now reports a new memory region at offset ~1 TiB in the physical memory map, which was much higher than expected by the bootloader crate. As a result, BIOS booting became unusably slow (because of the initial identity mapping) and the automated offset selection for the physical memory map ran into a panic. For full details, see the summary issue.
We fixed the issues in the following way:
max_phys_addr to 4 GiBget_free_address for large sizes (0.10) (published as 0.10.13)0.9.23)Thanks to @hawkw and @Freax13 for these contributions!
We also brought the upcoming v0.11 release even closer to the finish line. Thanks to an extensive review of @Freax13, we found and fixed multiple remaining issues. Also thanks to @asensio-project and @TheBotlyNoob for testing the new version and reporting bugs! Some notable changes are:
RUNTIME_SERVICES_* memory regionsuefi-rsMaintained by @GabrielMajeri, @nicholasbishop, and @phip1611
HardDriveMediaDevicePath (along with MBR and GPT tests). CStr8 cleanup and enhancementsuefi-macros-0.8.0, uefi-0.17.0, uefi-services-0.14.0PhysicalAddress and VirtualAddress type aliasesThanks to @ColinFinck for their contribution!
xhciMaintained by @toku-sa-n
The xhci crate provides types of xHCI structures, such as Registers and TRBs.
We merged the following changes in September:
Thanks to @Demindiro for their contribution!
Want to contribute to a Rust OSDev project, but don't know where to start? Help with one of these outstanding issues!
phil-opp/blog_os) Looking for a reviewer for a Chinese translationphil-opp/blog_os) Looking for a reviewer for a Korean translationphil-opp/blog_os) Looking for a reviewer for a French translationIf 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.
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.
(Section written by Kevin Boos (@kevinaboos))
Theseus is a safe-language OS written from scratch in Rust that is in the process of migrating from pure academic research objectives to more general usability and legacy compatibility. As a fully open-source project, we welcome and encourage contributions from everyone!
Since our last update here two months ago, we have worked on the following things:
std to Theseus
aarch64 ARM architecture to Theseus
Mutex and RwLock implementationTaskRef during a task switch, ensuring that it is dropped at the right time to avoid delays in its cleanupJoinableTaskRef typelazy_static where possible in favor of plain const expressions
const_btree_new nightly feature allows BTree::new() to be constrangemap crate such that it can optionally use that new feature
interrupts crate would statically register device-specific interrupt handlersinterrupts crate when they initialize themselves
interrupts to <device crate> for predictable behavior over dynamically-registered states, but causes problems with inverted and cyclic dependenciesclippy CI action and addressed most lint warnings
rustfmt is next, with the hope of standardizing our code baseCheck out the Theseus OS blog for the latest details.
phil-opp/blog_os(Section written by @phil-opp)
We merged the following changes this month:
paging-introduction/index.md01-freestanding-rust-binaryThanks to @shimomura1004, @woodyZootopia, @bolded, and @Firenezz for their contributions!
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.
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.
rust-osdev ProjectsIn this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.
uefi-rsMaintained by @GabrielMajeri, @nicholasbishop, and @phip1611
The uefi crate provides safe and performant wrappers for UEFI, the successor to the BIOS.
We merged the following changes in August:
DiskIo and DiskIo2 protocolsprint! and println!doc_auto_cfg to show feature requirements on docs.rsOrd and PartialOrd for Guid structnix requirement from 0.24.1 to 0.25.0ScopedProtocol::interfaceWe also published a subset of the above changes as a new v0.16.1 release:
Thanks to @kendase3, @JonahPlusPlus, and @e820 for their contributions!
bootloaderMaintained by @phil-opp, @rybot666, and @64
The bootloader crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables.
This month, we finally finished the new BIOS boot implementation for the upcoming v0.11 release. It's now almost completely written in Rust (instead of assembly), which should make further improvements much easier.
Some selected commits that might be interesting:
GDT and jump to 4th stageE820 memory map and put everything togetherAll the tests are passing now, so we only need to do some cleanup and write proper documentation, then we should be ready to publish an alpha release for testing.
linked-list-allocatorMaintained by @phil-opp and @jamesmunns
The linked-list-allocator crate provides a basic no_std allocator that builds a linked list from freed memory blocks and thus needs no additional data structures.
In August, Evan Richter discovered a vulnerability in Heap::extend that could lead to out-of-bound writes. The issue occurred when extend was called with a size smaller than size_of::<usize> * 2, i.e., a size too small to store the metadata for the new memory region.
Upon investigating this issue, we found several similar issues:
size_of::<usize> * 3 could result in an out-of-bounds write too.extend on an uninitialized heap could also result in an out-of-bounds write.extend on a heap whose size is not a multiple of the size of two usizes resulted in unaligned writes.We created a security advisory with more details and released a fix in v0.10.2, with the following changes:
2 * size_of::<usize> and 3 * size_of::<usize>.extend method now panics when trying to extend an uninitialized heap.size_of::<usize>() * 2 are now buffered internally and not added to the list directly. The buffered region will be merged with future extend calls.size() method now returns the usable size of the heap, which might be slightly smaller than the top() - bottom() difference because of alignment constraints.Thanks to @evanrichter for reporting this vulnerability and working with us on a fix.
xhciMaintained by @toku-sa-n
The xhci crate provides types of xHCI structures, such as Registers and TRBs.
We merged the following changes this month:
InterruptRegisterSet to InterrupterRegisterSet (published as 0.8.7)0.9.0)Thanks to @Demindiro for their contribution!
pci_typesMaintained by @IsaacWoods
The pci_types library provides types for accessing and configuring PCI devices from Rust operating systems.
We merged the following change in August:
Thanks to @0Killian for this contribution!
acpiMaintained by @IsaacWoods, @Restioson, and @Gegy
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.
We merged the following changes this month:
Thanks to @semiviral, and @Freax13 for their contributions!
Want to contribute to a Rust OSDev project, but don't know where to start? Help with one of these outstanding issues!
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.
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.
cdrzewiecki/celos(Section written by @drzewiec)
It's been a while since my last project update! That's partly because life has been busy, but also because this update concerns a huge feature. I'm very pleased to report that I have been able to add preemptive multitasking to CelOS.
This was feature that took a good bit of foundation to be able to implement (hence why it took me so long). I had to spend a good bit of time getting memory allocation (both physical and virtual) into a happier place, as well as add support for ACPI and the APIC. And, of course, there were many snags along the way as I learned (at least some of) the traps that are easy to step into when doing something as delicate as context switching.
Now that I have finished this key feature, I plan to work on setting up the other infrastructure needed to begin writing services in userspace (such as message passing and synchronization primitives). And, hopefully soon, finally make the jump into ring 3!
As always, many thanks to @phil-opp for his hard work on supporting the Rust osdev community, and for writing the apic crate which helped serve as a sanity check while I wrote my own driver for the IOAPIC and LAPIC. Thanks as well to the maintainers of the excellent acpi crate, you guys are doing incredible work out there!
(Section written by @phip1611)
In late August/early September, I encountered problems when building my Rust kernel. I faced
unintuitive interaction between my global assembly code and the linker. I specified a custom
section in assembly with executable code with .section .bootcode. The linker never linked
the code where I specified it in my linker script. It's address was not what it is supposed to be.
readelf didn't show the section inside the binary either. The section was discarded no matter
how hard I tried to modify the linker, thus, KEEP((.bootcode)); also didn't work. An experienced
colleague ensured me that my linker script is correct.
Section names such as .init or .text.bootcode worked by the way. Only my custom name was
rejected somehow. In the end, I figured out writing .section .bootcode, "ax" does the trick. The
difference is small, but the impact to the object file and final executable of those section flags
is big. I could find the answer in the ELF specification. A section needs to be allocatable
(a-flag) so that it can be properly placed in a LOAD segment/program header. The section names
.init and .text.* have this pre-configured but my custom section name .bootcode has not.
I traced it down to a minimal reproducible example that can be found on GitHub. A comprehensive write-up can be found on my website Phip's Blog.
phil-opp/blog_os(Section written by @phil-opp)
This month, we merged a pull request that fixes numerous grammar and punctuation errors across all posts of the "Writing an OS in Rust" series. Thanks to @hecatia-elegua for this contribution!
We also received multiple pull requests to add and update translations:
We are still looking for reviewers for the last two PRs. If you speak Chinese or Korean, it would be great if you could take a look!
Thanks to @ykomatsu, @liuyuran, and @JOE1994 for contributing these translations!
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.
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.
rust-osdev ProjectsIn this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.
uefi-rsMaintained by @GabrielMajeri, @nicholasbishop, and @phip1611
The uefi crate provides safe and performant wrappers for UEFI, the successor to the BIOS.
We merged the following changes in July:
EqStrUntilNul trait to compare Rust strings (str, String) against CStr16 and CString16x86_64Maintained 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 July, we merged the following changes:
Thanks to @Zildj1an for their contribution!
xhciMaintained by @toku-sa-n
The xhci crate provides types of xHCI structures, such as Registers and TRBs.
We merged the following changes this month:
TryFrom<[u32; 4]> to Command/Transfer TRB structstry_from! macro not checking MSb of typeThanks to @Demindiro and @ytoml for their contributions!
Want to contribute to a Rust OSDev project, but don't know where to start? Help with one of these outstanding issues!
(rust-osdev/volatile) Various improvements for the new design
We are currently discussing a new design for the volatile crate based on raw pointer types in order to avoid potential undefined behavior. The linked pull requests proposes an implementation where the volatile wrapper type is Copy and its methods take self by value. We haven't reached a decision yet, so if anyone has more input on this, please join the discussion. For more context, see also PR #22.
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.
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.
rust-lang/rust(Section written by @phil-opp)
This Month, @dvdhrm started an initiative to get the *-unknown-uefi targets to Tier-2. As a first step, they added a detailed description of the platform to the rustc book. The entry is already published in the nightly release of the book.
Please reach out if you would like to help with this!
(Section written by Kevin Boos (@kevinaboos))
Theseus is a safe-language OS written from scratch in Rust that is in the process of migrating from pure academic research objectives to more general usability and legacy compatibility.
Theseus dynamically loads and links all components at runtime, and executes everything in a single address space and at a single privilege level. With this, Theseus employs intralingual design principles to maximally leverage the strengths of the Rust language, allowing the compiler to both view and semantically understand (and thus extend its safety checks to) all components from top-level apps to low-level kernel entities. Theseus strives to not only ensure isolation between different entity components and subsystems in the OS, but also to go further than language safety to provide various invariants that guarantee properties about most system-provided types. For more, check out the Theseus OS Book or our academic papers and presentations.
Theseus is fully open-source and always welcomes contributions from anyone.
Over the past month (or two), Theseus OS made significant progress on a variety of topics:
no_std, enabling us to run WASM binary workloads on Theseus with relative ease.
std library to Theseus.limine bootloader and for building Theseus on non-Debian Linux distributions like Fedora.rustc build steps by about 15-20 seconds with simple Makefile loop parallelization.Check out the Theseus OS blog for the latest details.
nt-list: Windows Linked Lists in idiomatic Rust(Section written by @ColinFinck)
On his quest to develop a ReactOS/Windows bootloader in Rust, Colin Finck released another building block as a reusable no_std crate this month.
After nt-hive for reading Windows registry hive files and ntfs to access Microsoft's proprietary NTFS filesystem, the nt-list crate provides a type-safe and idiomatic Rust interface to work with Windows Linked Lists, known as LIST_ENTRY and SINGLE_LIST_ENTRY.
This is what Windows, Windows drivers, and components influenced by Windows (e.g. UEFI) have been using for a long time to uniformly handle linked lists.
Colin's blog post goes into detail about some of the differences between textbook and Windows linked lists and the challenges in coming up with a safe Rust implementation.
The final interface provided by nt-list is as simple to use as Vec while being fully compatible to the original LIST_ENTRY.
The compatibility is proven in a WinDbg debugging session:
If you want to give it a spin, the crate is available on crates.io, and make sure to also check the docs.
phip1611/simple-chunk-allocator and rust-osdev/linked-list-allocator(Section written by @phip1611)
In March 2022, Philipp Schuster proposed his simple-chunk-allocator
crate. It focuses on being a very simple-to-use general purpose allocator that "just works" for various workloads
in no_std context. However, there are other allocators, such as rust-osdev/linked-list-allocator.
When you choose an allocator, you should not only consider the API and how to set it up, but actually the runtime
characteristics. OS research has shown us that there is no perfect allocator. You can optimize an allocator for speed,
memory utilization (i.e., prevent fragmentation), code simplicity, and worst case execution time. There exist different
strategies to reach those goals: first-fit, next-fit, best-fit
Recently, Philipp benchmarked his simple-chunk-allocator against rust-osdev/linked-list-allocator
to learn under which conditions which performs better. But at first, let's point out some differences. simple-chunk-allocator needs
a static backing storage for heap and an additional static backing storage for its internal bookkeeping. linked-list-allocator
can solve this better by organizing the heap with the heap backing memory itself. simple-chunk-allocator uses a slightly
adjusted variant of best-fit that tries to reduce fragmentation. linked-list-allocator is a first-fit allocator that
has a lower performance to more heap is used.
The relevant outcome is that simple-chunk-allocator always outperforms linked-list-allocator in median allocation time.
For stress tests with a low heap consumption, thus, no long stress test with 90% and more heap usage, simple-chunk-allocator
also outperforms linked-list-allocator in average allocation time. However, if the heap is full and frequent allocations
happen, the average (but not the median) allocation time of linked-list-allocator is better. Also, linked-list-allocator
can come close to 100% heap usage which is not the case for simple-chunk-allocator, because it suffers from internal
fragmentation under certain circumstances. Last but not least, even small allocations always takes up a multiple of the
used chunk size in simple-chunk-allocator.
In the end, there is no optimal allocator. You must choose which properties are more relevant for your scenario.
For concrete measurements, please head to the README of simple-chunk-allocator.
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.
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 rust-osdev organization.
linked-list-allocatorMaintained by @phil-opp and @jamesmunns
The linked-list-allocator crate provides a basic no_std allocator that builds a linked list from freed memory blocks and thus needs no additional data structures.
This month, @jamesmunns redesigned the internal API for traversing the linked list in order to pass the strict tests of miri, which is an experimental interpreter for Rust's intermediate representation (MIR). Among other things, miri checks that pointers are correctly aligned and that no invalid aliasing occurs (based on different formal models). By checking our implementation against miri, we make it more robust and reduce the chance that undefined behavior occurs with future compiler versions.
The change was implemented across the following pull requests:
v0.10.0, but yanked later)try_insert_after)v0.10.1)Thanks to @jamesmunns for the redesign and @haraldh for reporting a critical issue in the v0.10.0 release and providing a fix! Also, we would like to welcome @jamesmunns as a maintainer of this crate!
multiboot2Maintained by @IsaacWoods, @phip1611, @robert-w-gries, @ahmedcharles, and @Caduser2020
The multiboot2 crate provides abstraction types for the multiboot information structure (MBI)
of multiboot2 bootloaders. The latest release of the multiboot2-crate is now v.0.14.0 (was
v0.13.2). It contains some small breaking changes because so far, we used some unsafe code and
relied on having not to verify UTF-8 strings. For a full changelog, please refer to the
GitHub repo.
uefi-rsMaintained by @GabrielMajeri and @nicholasbishop
The uefi crate provides safe and performant wrappers for UEFI, the successor to the BIOS.
We merged the following changes in June:
From<ucs2::Error> implseh_personality lang itemuefi-services panic handlerbootloaderMaintained by @phil-opp, @rybot666, and @64
The bootloader crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables. This month, we made more progress on the upcoming v0.11 version:
mini_fat crate (to keep the executable size down)kernel-x86_64 file on FAT partitionx86_64Maintained 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 June, we merged the following pull request:
registers::debug (published as v0.14.10)Thanks to @mkroening for this contribution!
cargo-xbuildMaintained by @phil-opp
The cargo-xbuild project provides cargo command wrappers to cross-compile the sysroot crates core and alloc. It is mostly useful in situations, where cargo's unstable -Zbuild-std flag is not usable.
This month, we fixed a build error of the alloc crate on the latest nightlies:
v0.6.6)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/volatile) New design based on pointer types
We are currently discussing a new design for the volatile crate based on raw pointer types in order to avoid potential undefined behavior. The linked pull requests proposes an implementation where the volatile wrapper type is Copy and its methods take self by value. We haven't reached a decision yet, so if anyone has more input on this, please join the discussion. For more context, see also PR #22.
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.
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.
google/gpt-disk-rs(Section written by @nicholasbishop)
gpt-disk-rs is a collection of three libraries related to GPT (GUID Partition Table) disk data. The crates are no-std by default, have minimal dependencies, and include a lot of documentation. I'm hoping they'll be a suitable base for any project that wants to read or write GPT data.
uguid: GUID data type.gpt_disk_types: all the GPT types defined by the UEFI specificationgpt_disk_io: types for reading and writing GPT data to an abstract block IO device.vinc/moros(Section written by @vinc)
MOROS is a text-based hobby operating system targeting computers with a x86-64 architecture and a BIOS. It is inspired by Unix and ITS but is closer to a modern DOS at the moment in term of features.
In the last month I finally managed to run rust programs (without alloc) inside the OS after being limited to nasm programs for a long time. This triggered a lot of refactoring and improvements in the shell and the lisp language used for scripting.
Next step will be publishing a 0.8.0 release and working on userspace allocation.
phil-opp/blog_os(Section written by @phil-opp)
This month, we merged the following improvements:
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.
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 rust-osdev organization.
uefi-rsMaintained by @GabrielMajeri and @nicholasbishop
The uefi crate provides safe and performant wrappers for UEFI, the successor to the BIOS.
We merged the following changes in May:
uefi v0.16.0, uefi-macros v0.7.0, and uefi-services v0.13.0)Deref and DerefMut for ScopedProtocolcore::fmt::Write for Serial*const conversionDebug derive for Header structThanks to @JonahPlusPlus, @raccog, and @verticalegg for their contributions!
bootloaderMaintained by @phil-opp, @rybot666, and @64
The bootloader crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables. This month, we merged the following new feature:
This feature will be part of the upcoming v0.11 release. Thanks to @Freax13 for this contribution!
pci_typesThe pci_types library provides types for accessing and configuring PCI devices from Rust operating systems. Lots of this code (e.g. identifying devices by class codes) can be shared
between projects, and would benefit from community contributions.
We merged the following change in May:
Thanks to @alesharik for this contribution!
xhciMaintained by @toku-sa-n
The xhci crate provides types of xHCI structures, such as Registers and TRBs.
We merged the following fix this month:
Thanks to @Yuna-Tomi for this contribution!
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!
No tasks were proposed for this section this month.
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.
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.
No projects were proposed for this section this month.
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.
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 rust-osdev organization.
x86_64Maintained 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 April, we merged the following improvements and fixes:
Thanks to @prinzdezibel for their contribution!
We also merged two updates into the next branch for the upcoming v0.15 release:
uefi-rsMaintained by @GabrielMajeri and @nicholasbishop
The uefi crate provides safe and performant wrappers for UEFI, the successor to the BIOS.
We merged the following changes in April:
FilePathMediaDevicePath (and a bunch of supporting code)File::get_boxed_infotest_get_boxed_info when -Zmiri-tag-raw-pointers is enabledUnsafeCell is used for protocolsBootServices and RuntimeServicesThanks to @supdrewin, @nicholasbishop and @raccog for their contributions!
bootloaderMaintained by @phil-opp, @rybot666, and @64
The bootloader crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables. This month, we merged the following changes:
Thanks to @Freax13 and @toothbrush7777777 for these contributions!
We also made some good progress on the upcoming v0.11 version of the crate:
mainrand_chacha with rand_hcThe next steps now are: setting up unreal mode on the CPU, loading the kernel from the FAT partition, loading the memory map, and setting up the page tables.
multiboot2Maintained by @IsaacWoods, @phip1611, @robert-w-gries, @ahmedcharles, and @Caduser2020
The multiboot2 crate provides abstraction types for the multiboot information structure (MBI) of multiboot2
bootloaders. The latest release of the multiboot2-crate is now v.0.13.2 (was v0.13.1). It contains minor
improvements, such as that TagType implements Ord.
multboot2-headerMaintained by @IsaacWoods, @phip1611, @robert-w-gries, @ahmedcharles, and @Caduser2020
The multiboot2-header crate provides abstraction types for Multiboot2 headers and a builder struct to construct such
headers. The latest release of the multiboot2-header-crate is now v0.2.0 (was v0.1.0). The changes include a
bugfix that prevented the usage in no_std contexts. Furthermore, overall code quality was improved. The internal CI
was updated to verify no_std builds as well as regular builds.
Full changelog: https://github.com/rust-osdev/multiboot2/releases/tag/multiboot2-header-v0.2.0
uart_16550Maintained by @phil-opp
The uart_16550 crate provides basic support for serial port I/O for 16550-compatible UARTs. We merged the following change this month:
stable and nightly features (published as v0.2.18)Thanks to @josephlr for this contribution!
volatileMaintained by @phil-opp
The volatile crate provides a safe wrapper type for implementing volatile read and write operations. This is useful for accessing memory regions that have side-effects, such as memory-mapped hardware registers or framebuffers. In April, we merged the following pull request:
v0.4.5)Thanks to @hawkw for this contribution!
xhciMaintained by @toku-sa-n
The xhci crate provides types of xHCI structures, such as Registers and TRBs.
In this month, we released a new version 0.8.3 which includes a bug fix reported and committed by @Yuna-Tomi. The bug was that EventRingDequeuePointerRegister::event_ring_dequeue_pointer() did not return the correct address. Thanks for the contribution!.
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!
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.
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.
rust-embedded/rust-raspberrypi-OS-tutorials(Section written by @andre-richter)
The Operating System development tutorials in Rust on the Raspberry Pi project saw two more tutorial releases:
The two tutorials implement the generation of backtraces that show address and symbol information. Here is an example of the of a backtrace generated as part of the kernel's panic handler:
[ 0.002782] Writing to bottom of address space to address 1 GiB...
[ 0.004623] Kernel panic!
Panic location:
File 'kernel/src/_arch/aarch64/exception.rs', line 59, column 5
[...]
Backtrace:
----------------------------------------------------------
Address Function containing address
----------------------------------------------------------
1. ffffffffc0001294 | core::fmt::write
2. ffffffffc0005560 | libkernel::panic_wait::_panic_print
3. ffffffffc00054a0 | rust_begin_unwind
4. ffffffffc0002950 | core::panicking::panic_fmt
5. ffffffffc0004898 | current_elx_synchronous
6. ffffffffc0000a74 | __vector_current_elx_synchronous
7. ffffffffc000111c | kernel_init
-----------------------------------------------------------metta-systems/vesper(Section written by @berkus)
Vesper is a capability-based single-address-space nanokernel. This means it is aiming to be small, to provide only isolation primitives; at the same time SAS makes it a lot easier to perform cross-process operations (because all addresses are the same across all processes). It uses capabilities to provide security for such operations, so that unauthorized processes will not be able to intervene in legitimate traffic.
The kernel is in very early stages of development. This time I will update on the progress of tooling and my next steps. As usual, I will link directly to my blog for more details. Read the full article here.
phil-opp/blog_os(Section written by @phil-opp)
We merged the following improvements for the "Writing an OS in Rust" blog this in April:
Thanks to @JOE1994, @QuqqU, @ruhuang2001, and @PoorlyDefinedBehaviour for their contributions!
For the current status of the upcoming third edition, see my comment on the related GitHub issue.
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.
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 rust-osdev organization.
x86_64Maintained 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.
This month, we released version 0.14.9 of the x86_64 crate with lots of improvements:
UCet and SCet registersREADMErustversion to mark certain functions const fn on Rust 1.61Entry::handler_addr() is now publicconst fn
VirtAddr::as_ptr()VirtAddr::as_mut_ptr()PhysAddr::new()PhysAddr::try_new()Already merged last month:
external_asm and inline_asm features are deprecated and now have no effect.instructions feature (on by default) now requires Rust 1.59core::iter::Step for VirtAddr and Page
step_trait feature flagVirtAddrNotValid and PhysAddrNotValid is now public
PageRangeInclusiveconst_fn_fn_ptr_basics and const_fn_trait_bound featuresnomem in load_tssGlobalDescriptorTable::add_entry error handling)tss_segment documentation)Thanks to @jarkkojs, @drzewiec, and @kevinaboos for contributing to this release!
We also merged some breaking changes which will be published in the upcoming v0.15 release:
VirtAddr improvementssoftware_interrupt! macroSpecial thanks to our co-maintainer @josephlr, who did a lot of great work this month!
uefi-rsMaintained 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). The RFC for the removal of the Completion type has been accepted and the corresponding changes have been merged in March: the Completion type has been removed and the crate has reverted to using more standard Results everywhere, by treating all warnings as errors.
We merged the following changes in March:
connect_controller/disconnect_controller methodsBootServices::locate_handle_buffer functionBootServices::load_imageGptPartitionAttributes bitflagsFileHandle convenience methods and new file system testsRuntimeServices::query_variable_infoLoadedImage's load options API saferResult conversionsThanks to @nicholasbishop, @sven-eliasen, @necauqua and @AtsukiTak for their contributions!
uart_16550Maintained by @phil-opp
The uart_16550 crate provides basic support for serial port I/O for 16550-compatible UARTs. We merged the following changes this month:
const_ptr_offset (published as v0.2.17)Thanks to @tsatke for this contribution!
xhciMaintained by @toku-sa-n
The xhci crate provides types of xHCI structures such as Contexts, Extended Capabilities, Registers, and TRBs. This month, we merged some cleanups:
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!
No tasks were proposed for this section.
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.
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.
phip1611/simple-chunk-allocator(Section written by @phip1611)
Philipp Schuster recently released an initial version of his simple-chunk-allocator
crate. It focuses on being a very simple-to-use general purpose allocator that "just works" for various workloads
in no_std context. A bitmap is used for bookkeeping of used blocks/chunks. This enables a simple algorithm that is easy
to understand. The allocator uses a combination of the strategies "next fit" and "best fit". It is usable as #[global_allocator]
and operates on static memory, i.e., no paging mechanism involved. The crate is suited to manage the heap inside a kernel
or in a similar no_std application. It is part of the roottask in Philipp's Diplom (Master) Thesis
where he wrote a runtime system for a Microkernel in Rust.
phip1611/linux-libc-auxv(Section written by @phip1611)
Philipp Schuster recently released an initial version of his linux-libc-auxv
crate. The crate enables the creation and the parsing of the initial Linux stack layout. This layout is a
special data structure that Linux prepares for applications before they start execution. The C runtime behind the
_start symbol of a libc implementation uses this to find program arguments, environment variables, and the
auxiliary vector. The layout is tricky to create because the creator must ensure that the layout is valid in the
address space of the target. However, linux-libc-auxv found a way to cope with this.
You can write a "freestanding" binary, i.e., without libc, with this crate, run it under Linux and parse the stack layout yourself. This is similar to what the libc does, before Rust's runtime starts, that eventually calls the main function of a Rust program.
The crate is part of Philipp's Diplom (Master) Thesis where he wrote a runtime system for a Microkernel in Rust that can emulate Linux behaviour and run unmodified Linux applications.
phip1611/diplomarbeit-impl(Section written by @phip1611)
Philipp Schuster submitted his Diplom (Master) Thesis at TU Dresden where he build a policy-free system-call layer for the Hedron microhypervisor. The project comes with a runtime system written in Rust for the microkernel and involves a roottask that enables the execution of unmodified Linux binaries through an OS personality/Linux emulation. The runtime system covers several interesting aspects of OS development, such as interaction with a kernel, system call emulation, and starting programs from ELF files.
phil-opp/blog_os(Section written by @phil-opp)
We merged a new Korean translation of first post of Writing an OS in Rust blog this month. Thanks a lot to @JOE1994 for creating this translation and @QuqqU for reviewing it!
We also received lots of smaller fixes, by @MaxDesiatov, @alaincao, @Programatic, @ruhuang2001, @Hofer-Julian, @SilensAngelusNex, and @julien-me. Thank you all for your contributions!
Unfortunately I didn't have time to work on the new version of the bootloader crate for the upcoming third edition of the blog this month. However, there was some surprising development on the Rust side that should help us with the new build system: @bstrie created a Major Change Proposal to promote the x86_64-unknown-none target to Tier 2. This is a bare-metal target that should be compatible with our kernel, so we might not need -Zbuild-std anymore in the future. Instead, we could download a precompiled version of the core/alloc crates via rustup target add. The great news is that the proposal was already accepted and the corresponding implementation PR is ready for review too!
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.
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 rust-osdev organization.
uefi-rsMaintained 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:
xtask and test it in CIREADME fileCStr16::as_stringFile::openAlign trait docstring+nightlyCHANGELOG.mdLoadedImage protocolProtocolsPerHandle internal slice propertyLoadedImage protocol saferThanks to @nicholasbishop, @Stzx, @avirule and @AtsukiTak for their contributions!
x86_64Maintained 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:
core::iter::Step for VirtAddr and PageVirtAddrNotValid and PhysAddrNotValid publicVirtAddrNotValid and PhysAddrNotValid should contain the whole addressWe also merged a few breaking changes, which will be part of the upcoming v0.15 release:
master into next and migrate codeCr2::read return a resultexternal_asm and inline_asm featuresbootloaderMaintained 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:
maybe_uninit_extra is no longer feature-gated (published as v0.10.12)asm and global_asm features, which are now stable (published as v0.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!
vgaMaintained 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!
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 errorsphil-opp/blog_os) Looking for a reviewer for a new Korean translationIf 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.
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:
-Zbuild-std and that there is currently no way to enable -Zbuild-std=core for an artifact dependency without enabling it globally.v0.11 version of the bootloader crate is already finished for the UEFI part. I'm still working on the BIOS implementation, which is more difficult unfortunately.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.
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 rust-osdev organization.
x86_64The 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 January, we merged the following pull requests:
Thanks to @jarkkojs for their contribution!
bootloaderThe bootloader crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables.
This month, we merged the following changes:
set_reg method of CS, DS, ES and SS segment structslang_items, asm and global_asm (published as v0.10.11)UsedLevel4Entriesentry_point! macroThanks to @abachmann, @Freax13, @phip1611, and @georglauterbach for their contributions!
uefi-rsThe uefi crate provides safe and performant wrappers for UEFI, the successor to the BIOS.
We merged the following changes in January:
uefi-services version 0.11.0vec_spare_capacity nightly featureThanks to @phip1611 for their contribution!
multiboot2The multiboot2 crate provides abstraction types for the boot information of multiboot2 bootloaders.
The latest release of the multiboot2-crate is now v.0.13.1 (was v0.12.2). It contains minor improvements,
such as new getters that were originally missing.
The combined diff of all changes can be found here.
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!
No tasks were proposed for this section.
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.
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.
ntfs(Section written by @ColinFinck)
Colin Finck released an initial version of his ntfs crate this month, a Rust library to access Microsoft's proprietary NTFS filesystem.
For those of you who are not running Windows: NTFS is the primary filesystem in Windows, from Windows NT's release in 1993 up to the current Windows 11. Unlike FAT32, NTFS has no practical limits for file and partition sizes, comes with B-Tree Indexes for faster lookups, and adds a few resilience and efficiency features (such as journaling, compression, and sparse files).
The ntfs crate supports Rust's no_std environment and is therefore not tied to a specific platform API. It aims to be embeddable in firmware-level code and kernels just as well as in user-mode applications.
Colin Finck will talk about NTFS and his adventures in writing a filesystem crate in Rust on the upcoming FOSDEM conference. The talk is on Saturday, 5 February at 17:00 (CET, UTC+1). The conference is virtual and admission is free.
phip1611/noto-sans-mono-bitmap-rs(Section written by @phip1611)
Philipp Schuster released an initial version of his noto-sans-mono-bitmap crate this month. It provides a pre-rasterized bitmap font from Noto Sans Mono, an open font from Google. The crate is a replacement for legacy bitmap fonts, such as the font8x8 crate. It is suitable for printing high quality/nice looking text to a framebuffer in bootloaders, kernels and similar environments where you don't want or can't use the FPU.
To avoid CPU intensive soft float workloads, the crate contains pre-rendered symbols from the Noto Sans Mono font in different sizes and font weights (light, regular, bold) as Rust constants paired with a convenient getter function.

The screenshot above shows text that is rendered into an UEFI framebuffer using the bitmap font
from noto-sans-mono-bitmap.
An example of usage can be found in PR#213 of the
rust-osdev/bootloader crate, where this crate was merged and replaced font8x8.
phil-opp/blog_os(Section written by @phil-opp)
This month, we merged three small improvements for the Writing an OS in Rust blog:
Thanks to @TisnKu for their contribution!
I have also brought the edition-3 branch up to date again. I marked all the stub posts of the upcoming third edition as drafts, which should allow us to merge the unfinished branch now and then prepare the new edition directly in the main branch (without publishing them yet). This way, we can avoid that the branches diverge too much.
Regarding the state of the new edition: I'm planning to release an extra post about UEFI booting first because that article is almost ready. For the main posts of the edition, I'm still waiting for a few cargo features, namely artifact dependencies, a package/target-specific way to enable the unstable build-std feature, and fixes for the experimental package.forced-target manifest key. I also intend to have the new version of the bootloader crate ready soon, which should make the build and test process simpler and more robust.
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.
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 rust-osdev organization.
x86_64The 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 changes in December:
asm! import)const_assert! in favor of std's assert!unsafe_block_in_unsafe_fn lint0.14.7v0.15 release.Thanks to @toku-sa-n for their contribution!
bootloaderThe bootloader crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables.
This month, we released new patch versions for both v0.9 and v0.10 to fix the asm! macro imports on the latest Rust nightlies:
v0.14.7 to fix nightly breakage (published as v0.9.20)asm imports on latest nightly (published as v0.10.10)We also continued the work on the upcoming v0.11 version, which will feature the following improvements:
entry_point macro, instead of a [package.metadata.bootloader] table in the Cargo.toml.
Cargo.toml anymore.include_bytes macro, we read the file dynamically from disk during the boot process.
entry_point macro (this will be used by kernels)The new configuration system is already done and working for both the BIOS and UEFI implementations. For UEFI, we also implemented the kernel loading from a FAT partition already. Unfortunately, this part is more challenging for the BIOS implementation since the loading needs to happen in 16-bit real mode (as it requires calling functions of the BIOS). Parsing a FAT filesystem is not easy using assembly code, so we're currently working on porting all the lower boot stages to Rust. This includes the boot sector, which needs to fit into 448 bytes, so we need some trickery to get a Rust executable that is small enough.
acpiThe 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.
December was a fairly quiet month, but an important bug-fix landed that corrected the way we handled _CRS objects in a structure
called the _PRT, which are found on PCI root bridges and tell the OS how interrupt pins on PCI devices have been routed to the platform's interrupt controller. Each pin can be
hardwired to a specific interrupt, or more commonly, can be dynamically assigned using a 'Link Object' through a set of control methods: _PRS, _CRS, _SRS, and _DIS.
However, many platforms implement Link Objects that actually hardcode the interrupts (including QEMU) and this is where the bug slipped in: _CRS was being evaluated as a
hardcoded object. We now treat these objects correctly as control methods, supporting properly-configured tables. (published as aml v0.16.1)
Thanks to @Dentosal for this contribution!
uefi-rsThe uefi crate provides safe and performant wrappers for UEFI, the successor to the BIOS.
We merged the following PRs this month:
open_protocol, use it to fix flaky screenshot testmemory_map_size to return entry size as wellbuild.py and CIbuild.py: fix clippy --verbosebuild.py: deny warnings when running clippybuild.py to the root of the repoqemu-exit#[must_use] marker attributesThanks to @StevenDoesStuffs and @toku-sa-n for their contributions!
uart_16550The uart_16550 crate provides basic support for serial port I/O for 16550-compatible UARTs. We merged the following changes this month:
send_raw() function to allow sending arbitrary binary data using the serial port (published as v0.2.16)Thanks to @olivercalder for this contribution and @Kazurin-775 for reporting this problem!
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!
No tasks were proposed for this section.
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.
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.
metta-systems/vesper(Section written by @berkus)
Vesper is a capability-based single-address-space nanokernel. This means it is aiming to be small, to provide only isolation primitives; at the same time SAS makes it a lot easier to perform cross-process operations (because all addresses are the same across all processes). It uses capabilities to provide security for such operations, so that unauthorized processes will not be able to intervene in legitimate traffic.
The kernel is in very early stages of development, while I am building up tooling support to make future development fast and painless. This is my second post here and as usual, I will link directly to my blog for more details. Read the full article here.
Just a note: since features described in the article are not fully finalized, they are not merged to the main development branch yet and live in their own branch, which is subject to frequent rebases. Caveat emptor!
rusty-hermit(Section written by @stlankes)
RustyHermit is a unikernel targeting a scalable and predictable runtime for high-performance and cloud computing.
This month, we integrated a virtual i/o device driver, which is based on memory mapped i/o and doesn't depend on PCI device specification.
For instance, micro VMs like Firecracker and Qemu's microvm machine type don't support the PCI specification to accelerate the boot time and to improve the performance.
With this device driver, rusty-hermit is able to run on Qemu's microvm platform.
We are working to support Firecracker in the near future.
phil-opp/blog_os(Section written by @phil-opp)
This month, we merged a small translation improvement to the Writing an OS in Rust blog:
Thanks to @TisnKu for this contribution!
My personal focus this month has been on the new bootloader version mentioned above, which I plan to use for the third edition of the blog. I'm also thinking about writing a post about creating a basic BIOS bootloader in Rust if I can find the time.
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.
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 rust-osdev organization.
uefi-rsThe uefi crate provides safe and performant wrappers for UEFI, the successor to the BIOS.
We merged the following PRs this month:
locate_device_path impl argument pointerHandle representation to be non-nullable so that Option<Handle> is FFI-safeHandle buffer handling codeCStr16::from_str_with_bufbuild.py for disabling KVMThanks to @necauqua and @baloo for their contributions!
x86_64The 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 November, @Freax13 joined our x86_64 maintenance team after doing a lot of great work on the crate. Welcome!
We merged the following non-breaking changes this month:
set_general_handler macro#VC) to the InterruptDescriptorTable#VCWe also merged a number of breaking changes that will go into the upcoming 0.15 release:
Index<u8> for IDT instead of Index<usize>load_tss and GlobalDescriptorTableInterruptStackFrameValue::cpu_flags to RFlagsInvalidStarSegmentSelectors error typePcidTooBig errorfeature(asm_const)Thanks to @Freax13, @haraldh, and @mpajkowski for their contributions!
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!
No tasks were proposed for this section.
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.
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.
metta-systems/vesper(Section written by @berkus)
Vesper is a capability-based single-address-space nanokernel. This means it is aiming to be small, to provide only isolation primitives; at the same time SAS makes it a lot easier to perform cross-process operations (because all addresses are the same across all processes). It uses capabilities to provide security for such operations, so that unauthorized processes will not be able to intervene in legitimate traffic.
It's in very early stages of development and is a basis for a larger envisioned system. The progress is fairly slow, only allowed as my available time permits. This month to motivate me to move it faster I've decided to start posting monthly development updates. The first post is about the tools I use.
Since rebooting to Rust almost 4 years ago I've been constantly amazed by the language ecosystem and what wonders are possible. This time I want to tell about incredible tooling that makes my OSdev experience a sunny warm place in contrast to the barren lands of my previous OSdev environments. Read the full article here.
phil-opp/blog_os(Section written by @phil-opp)
There were no visible changes to the Writing an OS in Rust series this month, but I continued working on the new build system for the upcoming third edition. One particular change that I want to highlight is that I redesigned the configuration of the bootloader crate. Instead of passing it via a package.metadata.bootloader section in the kernel's Cargo.toml, users will pass a configuration struct to the entry_point macro. This struct is then serialized at compile time into a separate section in the ELF executable, which the bootloader can then read on loading. This change should make the build process easier and more flexible.
I plan to simplify the build system further, but I'm currently waiting on some upcoming cargo features for that. In particular, I think that artifact dependencies and per-packet configuration options will be very useful for the project, especially the config options I mentioned in my status update comment on GitHub.
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.
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 rust-osdev organization.
uefi-rsThe uefi crate provides safe and performant wrappers for UEFI, the successor to the BIOS.
We merged the following PRs this month:
const_panicset_virtual_address_map() to allow remapping of SystemTableThanks to @timrobertsdev, @YtvwlD, and @foxcob for their contributions!
acpiThe 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, support for the Boot Graphics Resource Table (BGRT) table was added to acpi. This static table is
passed from firmware to the OS to communicate information about the state of the screen when control is passed
over, as lots of firmwares like to print display a logo when booting. (published as acpi v4.1.0)
Thanks to @ethindp for this contribution!
x86_64The 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 October, we merged the following changes:
Thanks to @haraldh and @Freax13 for their contributions!
multiboot2-header (new)The multiboot2-header crate provides abstraction types for Multiboot2 headers,
parsing utilities, and a builder to construct such headers. The initial release took
place in early October and now is ready to be used. Because lots of code was published
without any in-depth reviews, further testing and code reviews will be highly appreciated.
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!
No tasks were proposed for this section.
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.
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.
phil-opp/blog_os(Section written by @phil-opp)
We merged the following changes to the Writing an OS in Rust blog this month:
localStorage, add a switch for going back to system theme, improve layoutcrate-ci/typos action to check for typosAre 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.
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 rust-osdev organization.
x86_64The 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 September, we merged the following changes:
clean_up and clean_up_with_filter for deallocating unused page tablesbit_field to 0.10.1Thanks to @Freax13, @npmccallum, and @mkroening for their contributions!
uefi-rsThe uefi crate provides safe and performant wrappers for UEFI, the successor to the BIOS.
This month, we merged the following changes:
DebugSupportconst_panicThanks to @necauqua and @timrobertsdev for their contributions!
bootloaderThe bootloader crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables.
We finally merged a long-desired feature this month:
v0.10.9)Thanks to @anellie for this contribution!
multboot2The multiboot2 crate provides abstraction types for the boot information of multiboot2 bootloaders.
It is now part of a workspace and lives next to the new crate multiboot2-header.
The following changes were merged this month:
The changes were published as v0.12.2.
multboot2-header (new)The multiboot2-header crate provides abstraction types for the Multiboot2 header
and a builder struct to construct these headers. The corresponding repository was
prepared (#86) and the initial release
is expected in early October. See #95 for more details.
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!
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.
phil-opp/blog_os(Section written by @phil-opp)
We merged two small fixes to the Writing an OS in Rust blog this month:
Thanks to @jongillham and @non-descriptive for these contributions!
I don't have any notable news about the upcoming third edition of the blog yet, but I'm doing my best to get back up to speed 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 Zulip chat.
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 rust-osdev organization.
acpiThe 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.
There was a fair amount of progress this month, including adding support for a major AML feature: buffer fields.
These are objects that represent bit-level slices of buffer objects, allowing a section of a buffer to be read and
written. This requires us to support multiple namespace objects operating on the same underlying data -
currently this is handled simply with spinlocks, but we're looking to improve this situation in the future.
With this, we grew support for the DefCreateBitField, DefCreateByteField, DefCreateWordField,
DefCreateDWordField, DefCreateQWordField, and DefCreateField opcodes, as well as logic for reading and
writing Integers and Buffers out of them. (published as aml v0.16.0)
The acpi crate also saw improvement, and unfortunately some more breakage. We now support X2APIC entries
appearing in the MADT, and so have changed the representation of Processor UIDs and Local APIC IDs in
acpi::platform::Processor to u32, to support the wider IDs that X2APIC uses to support more processors. On
older platforms that only support APIC, the upper bits will simply always be zeroed, and so these values can be
cast down to u8 when needed. Note that for complex legacy reasons, you cannot rely upon ACPI for detecting
whether a platform has X2APIC support or not, and so whether the MADT actually contained X2APIC entries is not exposed
by this interface - this is by design. (published as acpi v4.0.0)
Other changes were:
aml: the contents of the namespace module were made public.
Thanks to @Andy-Python-Programmer for this contribution!aml: store locals and method arguments in arrays. If you're manually calling AML methods
that take arguments, you will need to update how you create them.aml: support the DefFatal opcode. DefFatal will cause a panic by default, but this behaviour can be overridden by implementing Handler::handle_fatal_error.aml: implement the DefWhile opcodeaml: implement the DefBreak opcodeaml: implement the DefContinue opcodeaml: implement the DefIncrement and DefDecrement opcodesaml: implement the ToInteger opcodeuefi-rsThe uefi crate provides safe and performant wrappers for UEFI, the successor to the BIOS.
In August, @nicholasbishop joined as a co-maintainer of the crate. Welcome!
Many improvements were merged this month:
BootServices::exit method; Make PointerMode's fields public for checking against support of a pointer devicePartialEq+Eq for DevicePathCStr16 to String and str conversionsaarch64-unknown-uefi targetGraphicsOutput.query_mode(...) publicuefi v0.12.0, uefi-macros v0.4.0, and uefi-services v0.9.0)IMAGE_SECURITY_DATABASE to itCStr16CString16Guid::from_values and Guid::fmtThanks to @HTG-YT, @phip1611, @Andy-Python-Programmer, and @timrobertsdev for their contributions!
x86_64The 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 August, we merged the following changes:
XCr0 and CR4 flags#[cfg(doc)] instead of docs.rs-specific cfg flagMapperFlush::new and MapperFlushAll::newGDT::load* method to non-deprecated methodsThese changes were not published yet, but a pull request for a new version is open already: Release version 0.14.5.
Thanks to @toku-sa-n and @ncatelli for their contributions!
bootloaderThe bootloader crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables.
This month, we merged the following changes:
relocation-model: static and panic-strategy: abort and fix .intel_syntax warnings (published as v0.9.19)v0.10.7)v0.10.8)Thanks to @vinc, @bjorn3, @Freax13, @yusdacra, and @martica for their contributions!
multboot2The multiboot2 crate provides abstraction types for the boot information of multiboot2 bootloaders.
The following changes were merged this month:
v0.12.1)ModuleTag cmdlinepic_8259The pic_8259 crate provides abstractions for 8259 and 8259A Programmable Interrupt Controllers (PICs).
In August, we added cargo features to make the crate buildable on stable:
nightly and stable feature flags to enable compilation on stable Rust (published as v0.10.2)Thanks to @toku-sa-n for this contribution!
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!
No tasks were proposed for this section.
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.
phil-opp/blog_os(Section written by @phil-opp)
We merged the following improvements to the Writing an OS in Rust blog:
Thanks to @Foo-x, @adi-g15, @Kalbiq, and @non-descriptive for their contributions!
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.
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 rust-osdev organization.
uefi-rsThe uefi crate provides safe and performant wrappers for UEFI, the successor to the BIOS. In July, we merged the following changes:
BootServices::protocols_per_handlefmt::Debug for Time struct + fmt::DisplayBltRegion::Full bounds checkThanks to @nicholasbishop, @MaulingMoneky, @phip1611 and @necauqua for their contributions!
acpiThe 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:
DefPowerResource opcodeDefThermalZone opcodeDefExternal opcodeDefConcat opcodeDefConcatRes opcodeDefMid opcodeThese changes were published as acpi v3.1.0 and aml v0.14.0. Thanks to @ethindp
and @toku-sa-n for their contributions.
multiboot2The multiboot2 crate provides abstraction types for the boot information of multiboot2 bootloaders.
In July, our multiboot2 maintenance team gained @phip1611 as a new member. Welcome!
The following changes were merged this month:
v0.11.0)load returns a result now (no more assertions that could panic)v0.12.0)x86_64The 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 July, we merged the following improvements:
tables::sgdtThanks to @budde25 and @toku-sa-n for their contributions.
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!
No tasks were proposed for this section.
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.
phil-opp/blog_os(Section written by @phil-opp)
This month, the Writing an OS in Rust blog received the following updates:
Thanks to @Foo-x, @adi-g15, @Kalbiq, and @MrZloHex for their contributions.
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.
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 rust-osdev organization.
acpiThe 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 rsdp and 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 acpi v3.0.0)
PhysicalMapping now implements SendPhysicalMapping's fields were made private, preventing construction of unsound mappings in safe code.
The unmap_physical_region method of AcpiHandler also lost its self type - handlers that used self should
instead access themselves through the PhysicalMapping::handler method. This prevents a mapping from being
unmapped using a different handler to the one that mapped it.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::platform no longer re-exports the contents of its interrupt submoduleThanks to @wusyong and @Freax13 for their contributions!
uefi-rsThe uefi crate provides safe and performant wrappers for UEFI, the successor to the BIOS. In June, we merged the following changes:
qemu-exit dependency optionalBlockIO protocolnewtype_enum for DevicePath enumsDevicePath and AcpiDevicePath unalignedDebug for CharConversionErrormemset to set_memnum_blocks method to GptPartitionEntryShimLock protocol uses sysv64 function ABIstdio handles require a mutable refThanks to @nicholasbishop, @iankronquist and @josephlr for their contributions!
x86_64The 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:
from_raw_slice()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!
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!
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.
phil-opp/blog_os(Section written by @phil-opp)
The Writing an OS in Rust blog received the following changes this month:
og:titlepost-12 to JapaneseThanks to:
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 Zulip chat.
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 rust-osdev organization.
x86_64The 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:
const_fn_trait_bound feature to fix build on latest nightly (published as v0.14.1)v0.14.2)const_fn!v0.14.3)We also started to prepare a v0.15 release, for which we already implemented the following breaking changes:
software_interrupt! macro with generic functionsoftware_interrupt: Add additional testingset_handler_fn (resubmitted in #261)Thanks to @dbeckwith and @Freax13 for their contributions!
bootloaderThe bootloader crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables. This month, we merged the following changes:
SS in stage_4 (published as v0.10.3)uefi v0.9.0v0.10.4)v0.10.5)v0.10.6)Thanks to @Elekrisk for their contribution!
We also published the following backport to v0.9:
--gc-sections (published as v0.9.18)uefi-rsThe uefi crate provides safe and performant wrappers for UEFI, the successor to the BIOS. In May, we merged the following changes:
Try trait APIFromResidual<Result<!, Error>> impl for StatusPartitionInfo protocolThanks to @phil-opp and @nicholasbishop for their contributions!
uart_16550The uart_16550 crate provides basic support for serial port I/O for 16550-compatible UARTs. We merged the following changes this month:
v0.2.14)v0.2.15)Thanks to @josephlr and @remimimimi for their contributions!
pic_8259The 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 pic8259_simple crate:
cpuio dependency with x86_64 crateThanks to @mkroening and @hanmertens for their contributions!
acpiThe 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
undesirable for 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 v0.13.0)
Thanks to @michaelmelanson for his contribution!
xhciThe 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_topThe 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!
vgaThe 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 fixed a nightly build error:
v0.2.7)Thanks to @ethindp for their contribution!
ps2-mouseThe 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:
v0.1.4)Thanks to @littledivy for this contribution!
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 DefExternal opcodesacpi) Add test to make sure AmlContext remains Send + SyncIf 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.
phil-opp/blog_os(Section written by @phil-opp)
We merged the following improvements to the Writing an OS in Rust blog this month:
post-XX tags for x86_64 v0.14: post-05, post-06, post-07, post-08pic8259 forklinked_list_allocator dependency to v0.9.0Thanks to @woodyZootopia, @kahirokunn, @HKalbasi, and @bjorn3 for their contributions!
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.
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 rust-osdev organization.
x86_64The 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 April, we merged the following changes:
v0.13.5)v0.14.0)sidt supportDebug and PartialEq implementations for IDT entry typePort typesThanks to @Luis-Hebendanz, @CraftSpider, and @dbeckwith for their contributions!
We also prepared a pull request to fix the build on the latest Rust nightlies:
const_fn_trait_bound feature to fix build on latest nightly (#250)Since rustfmt is currently broken on the affected newer nightlies, many users are still on older nightlies where the const_fn_trait_bound feature does not exist yet (rustup update skips nightlies where an installed component is missing). For this reason, we decided to wait with merging the fix until the rustfmt component is fixed. For people that want to use the latest nightly already, we pre-published the above fix as version v0.14.1-beta.
bootloaderThe bootloader crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables. This month, we finally merged the UEFI rewrite branch:
v0.10.0)This pull request changes the build process completely so that v0.10.0 is no longer compatible with v0.9.x and below. Instead of using the bootimage crate, it is now recommended to create a custom builder crate. See the API docs for more details. In addition to the build system changes, there are also some API changes such as a new BootInfo struct and a different system init state (e.g. a pixel-based framebuffer instead of the VGA text mode). Right now the documentation for the new version is still a bit sparse. We plan to improve this soon, including an update to the Writing an OS in Rust blog (see below).
In addition to the UEFI pull request, we merged the following changes this month:
llvm_asm! -> asm!x86_64 crate (published as v0.10.2)
v0.9.17 to fix compilation on latest nighlies.Thanks to @mkroening and @CraftSpider for their contributions!
xhciThe xhci crate provides types of xHCI structures such as Contexts, Extended Capabilities, Registers, and TRBs.
Previously the repository was hosted under @toku-sa-n. Since April, the Rust OSDev team hosts the repository.
This crate is still under depelopment. Some types or field accessors may be missing. If you find missing features, feel free to send a PR!
acpiThe 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, we improved diagnostics by recording the original and target AML types in the AmlError::IncompatibleValueConversion error. This error is emitted when AML tries to convert a value
to a data type that it can't be interpreted as - AML's rules on possible type conversions and where they can occur are very elaborate, so it helps to know the conversion that was actually attempted.
(published as v0.12.0)
Thanks to @Knapsac and @toothbrush7777777 for their contributions!
ovmf-prebuiltIn order to make it easier to run UEFI disk images in QEMU using OVMF, we created a new ovmf-prebuilt project this month. The projects automatically downloads the latest prebuilt OVMF RPM images from Gerd Hoffman's firmware repository and publishes the extracted OVMF_*.fd files as GitHub releases. A new release is created daily through a CI script. Note that the licensing terms of the tianocore/edk2 repository apply to the released files.
uart_16550The uart_16550 crate provides basic support for serial port I/O for 16550-compatible UARTs. In April, we updated the x86_64 dependency to fix the build on the latest nightlies:
v0.2.13)This pull request also minimizes the number of unstable features that are enabled for the x86_64 dependency to prevent breakage on future const_fn changes.
uefi-rsThe uefi crate provides safe and performant wrappers for UEFI, the successor to the BIOS. In April, we merged the following changes:
Thanks to @ocadaruma for their contribution!
spinning_topThe spinning_top crate provides a simple spinlock implementation based on the abstractions of the lock_api crate. This month, we fixed a compiler warning:
spin_loop_hint warning on Rust 1.51 (published as v0.2.3)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!
No tasks were proposed for this section.
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.
phil-opp/blog_os(Section written by @phil-opp)
We merged the following improvements to the [Writing an OS in Rust] blog this month:
wake_trait feature is now stable.cargo/config.toml ExplanationThanks to @alexxroche, @hi-rustin, @moomoolive, and @kahirokunn for their contributions!
We also made some further progress on the upcoming third edition of the blog:
cdrzewiecki/celos(Section written by @drzewiec)
Over the past couple of months I have made some great strides on my OS.
Still working hard on squashing bugs, adding all of the things above gave me some pretty serious memory allocation bugs and it's taken me a while to get those worked out. I still want to do more testing to make sure I have all the bugs here worked out before moving on.
Next steps will be to get nicer font drawing, and then attempt to implement process support.
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.
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 rust-osdev organization.
bootloaderThe bootloader crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables. This month, we fixed some build errors that were caused by the update to LLVM 12 in recent Rust nightlies:
v0.9.15)leas with mov + offset (published as v0.9.16)We also made some good progress on the UEFI rewrite:
quote crate for creating Config struct instead of debug implsConfig structx86_64The 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 March, we merged these changes:
Clone for PageTable (published as v0.13.3)v0.13.4)Thanks to @toku-sa-n and @dbeckwith for their contributions!
uefi-rsThe uefi crate provides safe and performant wrappers for UEFI, the successor to the BIOS. In March, we merged the following changes:
Thanks to @gil0mendes and @ocadaruma for their contributions!
multiboot2The multiboot2 crate provides abstraction types for the boot information of multiboot2 bootloaders. We merged the following updates this month:
impl Iterator as return type instead of named typesasm! code examplerustfmtThanks to @toku-sa-n for their contributions!
volatileThe volatile crate provides a safe wrapper type for implementing volatile read and write operations. This is useful for accessing memory regions that have side-effects, such as memory-mapped hardware registers or framebuffers. In March, we fixed a build error that was caused by a change in nightly Rust:
range_bounds_assert_len with slice_range (published as v0.4.4)slice::as_chunks_mut usage
as_chunks_mut, it is possible read and write multiple slice elements through a single volatile operation. This allows the compiler to optimize the code better (compared to reading the elements one by one).Thanks to @KernelFreeze for their contribution!
acpiThe 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 has seen substantial changes to both
the acpi and aml crates:
acpi v2.3.1)AmlValue::native_method constructor.AmlValue no longer implements PartialEq or Eq. This actually improves correctness,
as correctly comparing two AmlValues may require type conversions to be done, and so should be done with the
AmlValue::cmp method, but does make aml v0.11.0 a breaking change.legacy_mode parameter to AmlContext::new, which will affect all
crate users, but makes user's lives simpler - handling old tables will now be done automatically.AmlValue no longer being Eq also led to some cleanups in how control flow is handled in the
interpreter. This is not likely to affect users, but the "fake" error AmlError::Return has been removed, which
is also technically a breaking change in aml v0.11.0.\_OS, \_OSI, and \_REV objects. These objects were designed
to allow firmware to detect OS support for new AML features, but come with a bit of baggage.
This is important for supporting running on real hardware, which often assumes the existence of these objects.
(published as aml v0.11.0)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!
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.
acpi) Record attempted conversion in AmlError::IncompatibleValueConversionacpi) Support the new MADT Multiprocessor Wakeup structureIn 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.
phil-opp/blog_os(Section written by @phil-opp)
The "Writing an OS in Rust" blog received the following updates this month:
before_build.py to python3Thanks to @woodyZootopia, @alexxroche, and @ClementNerma for their contributions!
The third edition is making progress too. I mostly worked on the post about UEFI booting this month:
uefi craterust-embedded/rust-raspberrypi-OS-tutorials(Section written by @andre-richter)
The Operating System development tutorials in Rust on the Raspberry Pi project got two more tutorials this month:
Virtual Memory Part 3: Precomputed Translation TablesVirtual Memory Part 4: Higher-Half KernelThe two tutorials finally conclude the challenging but rewarding journey of enabling the kernel to execute from the top of the 64 bit virtual address space.
Here is a sneak peek of the end result when booting the kernel on a Raspberry Pi 4 (slightly modified to fit on the page):
[5.011] Booting on: Raspberry Pi 4
[5.011] MMU online:
[5.011] --------------------------------------------------------------------------
[5.013] Virtual Physical Size Attr Entity
[5.015] --------------------------------------------------------------------------
[5.017] 0xffff_ffff_8008_0000 --> 0x0008_0000 | 64 KiB | C RO X | Kernel code
[5.018] 0xffff_ffff_8009_0000 --> 0x0009_0000 | 448 KiB | C RW XN | Kernel data
[5.020] 0xffff_ffff_8011_0000 --> 0x0011_0000 | 512 KiB | C RW XN | Kernel stack
[5.021] 0xffff_ffff_f000_0000 --> 0xfe20_0000 | 64 KiB | D RW XN | BCM GPIO
[5.023] | BCM PL011 UART
[5.024] 0xffff_ffff_f001_0000 --> 0xff84_0000 | 64 KiB | D RW XN | GICD
[5.026] | GICC
[5.027] --------------------------------------------------------------------------
[5.029] Current privilege level: EL1Are 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.
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 rust-osdev organization.
uefi-rsThe uefi crate provides safe and performant wrappers for UEFI, the successor to the BIOS. In February, we merged the following changes:
x86_64 dependency to version 0.13.2 (to fix nightly breakage)DevicePath and LoadedImage protocolsThanks to @gil0mendes, @sreehax, and @avirule for their contributions!
x86_64The 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, the unstable const_in_array_repeat_expressions feature was removed from Rust because it implicitly changed drop behavior. This lead to a compile error of the x86_64 crate because it still had that feature enabled. Interestingly, we no longer needed this feature after #175 (and an accidental stabilization in Rust), so the fix was quite simple:
v0.13.2)Thanks to @KernelFreeze for this contribution!
bootloaderThe bootloader crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables. This month, we merged two small updates to fix build errors and warnings on newer Rust nightlies:
v0.9.12)v0.9.14)Thanks to @dspencer12 for their contribution!
There was also some more progress on the uefi branch, which contains the upcoming new bootloader version with UEFI support:
map-physical-memory config key--kernel-manifest path: it should point to a file named Cargo.toml, exist, and the referenced Cargo.toml should depend on the bootloader crate.The UEFI rewrite is almost done, but we still need to update the docs, improve the configurability of the framebuffer, and add more testing.
uart_16550The uart_16550 crate provides basic support for serial port I/O for 16550-compatible UARTs. Since the crate also depends on x86_64, it needed a dependency update to fix the mentioned build error on the latest nightly:
v0.2.12)vgaThe 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. The nightly build error of x86_64 also affected this crate, so it needed a fix too:
v0.2.6)Thanks to @Pollux3737 for this contribution!
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.
phil-opp/blog_os(Section written by @phil-opp)
The Writing an OS in Rust blog received the following updates this month:
Thanks to @MHBahrampour, @garasubo, @dspencer12, @toku-sa-n, and @16yuki0702 for their contributions!
I also made some progress on the upcoming third edition. Some potentially interesting commits are:
cdrzewiecki/celos(Section written by @drzewiec)
I have been working on an OS following along with @phil-opp's tutorial series for a while, but recently decided I would rework my OS based on the first edition of the blog (since I preferred to use GRUB as my bootloader). This is the first progress I have to share on CelOS, and indeed the first time I've published one of these updates in general.
In February, I made a lot of great progress on CelOS. I have the complete physical memory (plus the framebuffer provided by GRUB) mapped to virtual memory, and a pixel-based framebuffer working with text output. Things are not very optimized right now (for one thing I'm stretching the font8x8 font into 8x12), but this is a great first step that I can build on. Next planned steps are:
I probably won't get all of that done in March, but those are my planned next steps. Thanks to this great community and to @phil-opp for being so helpful in the osdev journey!
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.
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.
We started a new Showcase section this month, where we introduce and present interesting Rust OSDev projects. The first post of this section is:
RustyHermit Unikernel written by @stlankesIf you like to present your project too, just let us know!
In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.
bootloaderThe bootloader crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables. While we didn't merge any commits to our main branch this month, we made good process on the UEFI rewrite:
.efi imageacpiThe 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. In January, we added some updates to the aml crate:
uart_16550The uart_16550 crate provides basic support for serial port I/O for 16550-compatible UARTs. The crate received the following maintenance update in January:
cargo-xbuildThe cargo-xbuild project provides cargo command wrappers to cross-compile the sysroot crates core and alloc. This month, we fixed an error that occurred in combination with the XARGO_RUST_SRC environment variable:
v0.6.5)Thanks to @astro for this contribution!
Even though we still maintain the cargo-xbuild crate, we recommend switching to cargo's own build-std feature that is always up-to-date with the latest Rust/Cargo changes. We wrote a short guide on how to switch to it, which is available in our Readme.
rusty-hermitRustyHermit is a unikernel targeting a scalable and predictable runtime for high-performance and cloud computing. This month, we revise the paravirtualized network driver (virtio) and add a simple driver for RTL8139, which Qemu is able to emulate. With the support of KubeVirt, Kubernetes is able to orchestrate RustyHermit applications. As simple show case is explained in RustyHermit's wiki.
Thanks to @tlambertz and @mustermeiszer for the contribution!
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.
phil-opp/blog_os(Section written by @phil-opp)
We made good progress on the Persian and Japanese translations of the "Writing an OS in Rust" blog this month:
Thanks to @hamidrezakp, @MHBahrampour, @woodyZootopia, and @JohnTitor for creating the translations!
In addition to the new translations, we merged the following improvements:
BootInfoFrameAllocator::usable_framesThanks to @delta1, @NickSchmitt, @nana0-0, and @EvanMu96 for these contributions!
As I already mentioned in the previous posts, I'm working on a new 3rd edition of the blog. The new edition will be compatible with UEFI, use a pixel-based framebuffer, and utilize the APIC instead of the legacy PIC for interrupt handling.
As mentioned above, we added support for UEFI disk image creation to the new bootloader version this month. This made it finally possible to start the rewritten blog_os code in UEFI mode on real hardware:

This is an old Acer TravelMate laptop of mine, booting from a USB stick. The output shows that it successfully sets up the local and IO-APIC for interrupt handling and then listens for timer and keyboard interrupts, just as before. The screen output is now based on a pixel-based framebuffer, using the font8x8 crate for simple font rendering. The memory management code required almost no changes, since the interface provided by the bootloader stayed almost the same (there are only some differences in the memory map format).
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.
Common virtualized environments are based on classical virtual machines. In this case, complete machines are emulated or virtualized, and common operating systems are running on both the host and guest sides:

This technique is established (VMware, Hyper-V, etc.) and widely used. However, it introduces additional overhead, especially regarding memory consumption and performance.
An alternative approach to common virtual machines is OS-level virtualization, where the kernel allows the existence of multiple isolated user-space instances. These isolated instances are also known as “containers.” Typical representatives are LXC and Docker, which promise less overhead in comparison to common virtual machines. However, the isolation between the processes is weaker and may provide less security.
Often, only one application (e.g., a web server) is running in the container or the virtual machine. In this case, a unikernel is an attractive solution. The kernel is provided as a static library and linked to the application. As the images directly contain the OS kernel, unikernels can be directly booted inside a virtual machine and do not require the typical software stack containing a Linux kernel and its user land within the VM.
Unikernels do not provide system calls in the classical sense, as everything is running with the privilege level of a kernel, and what is typically done via system calls is provided via a common function call. At first glance, this sounds more insecure than previous approaches. However, these kernels are expected to run within a virtual machine, which isolates the application from the real system. In addition, common compiler analysis is used to check the complete software stack, and unneeded components can even be removed, which can reduce the attack surface of the application.

Well-known unikernels are kernels such as MirageOS and Unikraft. MirageOS is written in OCaml, while Unikraft still uses C as the programming language of choice. In contrast to these kernels, Hermit is completely written in Rust to benefit from Rust's performance and security behavior.
In principle, every existing Rust application can be built on top of Hermit.
However, unikernels are single-tasking operating systems.
Consequently, support for the system call fork and inter-process communication is missing.
In addition, a classical C library is missing, which is typically used as an interface to the operating system.
Every crate that bypasses the standard runtime and tries to communicate directly with the operating system does not work without modifications.
However, many applications do not depend on these features and work on Hermit.
Unikernels can be highly optimized. For instance, we optimized the network stack of Hermit. Hermit uses smoltcp as the network stack, which is completely written in Rust. As the interface between the guest and host operating systems, we use virtio, which is a para-virtualized driver for KVM and widely used in virtualized Linux environments.
The following figure compares Linux with Hermit, where both are running as guests inside a virtual machine running on top of a Linux-based host system:

Especially for small messages, Hermit is faster than Linux.
Hermit is also a research project to evaluate new operating system designs, that improve the scalability and security of operating systems in cloud environments. For instance, Hermit provides classical techniques to improve security behavior, like stack guards and separating the application stack from the libOS stack. However, a library operating system typically uses a common function call to enter the kernel. A classical separation of user and kernel space by entering a higher privilege level is missing.
In a paper, we presented a modified version of Hermit, which provides intra-unikernel isolation with Intel Memory Protection Keys (MPK). MPK is a relatively new hardware primitive that provides per-thread permission control over groups of pages in a single address space with negligible switching overhead, making it a compelling candidate for use in unikernels.
MPK requires modification of page tables at a small performance cost. Four previously unused bits of each page table entry (the 62nd to the 59th on x86-64) are exploited by MPK. Since MPK exploits four bits of the page table entry, it supports up to 15 protection keys. MPK controls per-thread permission on groups of pages. Each core has a PKRU register (32 bits) containing a permission value. The value of the PKRU register defines the permission of the thread currently running on that core for each group of pages containing a protection key in their page table entries. Unlike page-table-level permission, MPK provides thread-local memory permission.
We provide user and kernel separation, so we simply see the entire application as an untrusted component, independently of application-specific characteristics such as the language it is written in or the level of skill of the application’s programmer. In addition, we divide the kernel code into trusted and untrusted components. Trusted kernel components represent pieces of code written in a memory-safe language, i.e., offering strong security guarantees. Untrusted kernel components correspond to code written either in memory-unsafe languages or in unsafe Rust code blocks.
By entering the library operating system through the application binary interface, the protection keys will be automatically changed, which allows access to the kernel stack and the kernel heap. Unauthorized access from within the application will trigger a page fault, which will be handled by the library operating system.
Take a look at hermit-os/hermit-rs-template for a simple starter application.
The Hermit platform is an official Rust target.
You can either use our prebuilt rust-std artifacts on stable Rust or use build-std on nightly Rust.
Alternatively, you can compile the whole Rust compiler for Hermit, of course.
In the near future, we plan to stabilize the interface to the hardware. For instance, the support of virtiofs is at an early stage. In addition, the integration into the Rust standard library isn't finalized yet, and the current version runs only on x86-64. In the future, we want to also support AArch64 as a processor architecture.
]]>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 new comment form at the bottom of this page.
In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.
x86_64The 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 December, we published the following three new releases:
v0.12.4load_unchecked, from_raw_slice, and as_raw_slicev0.13.0 (breaking)MapperAllSizes::translate()TranslateResult type and create separate Translate traitPhysToVirt trait to PageTableFrameMapping)())UnusedPhysFrame, ExceptionStackFrame, VirtAddr::new_unchecked, interrupts::enable_interrupts_and_hltDescriptorTablePointer::base a VirtAddr)read_rip to VirtAddr)PortReadWrite trait, which is no longer needed)Sized requirement for FrameAllocator in Mapper::map_tov0.13.1Thanks to @mental32, @vinaychandra, @tomaka, @haraldh, @tscs37, and @toku-sa-n for their contributions!
volatileThe volatile crate provides a safe wrapper type for implementing volatile read and write operations. This is useful for accessing memory regions that have side-effects, such as memory-mapped hardware registers or framebuffers. In December, we added to new methods for creating read/write-only Volatile instances:
v0.4.3)bootimageThe bootimage tool allows the creation of bootable disk images for bootloader-based kernels. It also provides a runner executable for cargo to make cargo run and cargo test work using QEMU. This month, we fixed a nightly breakage:
v0.10.2)cargo-xbuildThe cargo-xbuild project provides cargo command wrappers to cross-compile the sysroot crates core and alloc. This month, we merged a small error reporting improvement:
v0.6.4)Thanks to @parasyte for this contribution!
Even though we still maintain the cargo-xbuild crate, we recommend switching to cargo's own build-std feature that is always up-to-date with the latest Rust/Cargo changes. We wrote a short guide on how to switch to it, which is available in our Readme.
bootloaderThe bootloader crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables. In December, we merged the following changes:
Thanks to @Luis-Hebendanz for their contribution!
uefi-rsThe uefi crate provides safe and performant wrappers for UEFI, the successor to the BIOS. In December, we merged the following changes:
Thanks to @avirule for their contribution!
acpiThe 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. In December, we:
rsdp v1.1.0 or acpi v2.2.0.choice! macro. This fixes limitations in how large parsers can get before they break rustc's type limit.
The new version allows better ergonomics, but also generates much less work for the type checker and so speeds up the compilation of the aml crate.DefBuffer and DefPackage objects (1, 2, 3).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.
phil-opp/blog_os(Section written by @phil-opp)
We merged the following changes to the Writing an OS in Rust blog this month:
Thanks to @woodyZootopia, @JohnTitor, @delta1, and @16yuki0702 for their contributions!
Last month, I mentioned that I'm working on a new revision of the blog with support for UEFI booting, a pixel-based framebuffer, and the APIC interrupt controller. I also mentioned that the Cargo team approved my proposal to replicate some cargo/config settings in the Cargo.toml, which will be required for the new build system of the blog. In December, we now saw the first pull request based on this proposal: Expose build.target .cargo/config setting as packages.target in Cargo.toml. Thanks a lot to @Ekleog for tackling this!
While I had planned the new revision for a long time already, there was still one open question: Should I integrate the changes into the second edition or start a new, third edition of the blog? Originally, I tended to integrate the changes into the second edition since a new edition is a lot of work and only a few posts would require substantial changes anyway. However, the recent translation efforts by many great people (thanks to all contributors!) have changed my mind on this because I don't want to throw away any of their work. For this reason I decided to start working on a new, third edition of the blog 🎉!
Apart from the changes mentioned above, the new edition will have some additional "fun" posts at the start that show how to create a simple shell and some basic games (instead of directly jumping into interrupt handling and memory management). In addition to the Testing post we already have, there will be some posts about debugging with GDB and QEMU. There will also be some design improvements such as a refreshed index page and a dark mode. I hope you like these ideas and I look forward to releasing a first draft of the new edition soon!
phil-opp/linked-list-allocator(Section written by @phil-opp)
The linked_list_allocator crate provides a simple heap allocator that is usable on no_std systems. It keeps track of free memory blocks by turning them into a linked list data structure.
In December, the crate received the following updates:
v0.8.7)v0.8.8)use_spin feature (published as v0.8.9)v0.8.10)v0.8.11)Thanks to @haraldh, @MarcoCicognani, and @thalesfragoso for their contributions!.
lucis-fluxum/ps2-rs(Section written by @lucis-fluxum)
I pushed release v0.1.1 this month, which is mainly a documentation update aiming to improve understanding of how to use the library. I've also added links to some reading material that helped me understand the PS/2 protocol better and much of the surrounding terminology. May the old keyboards live on!
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.
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.
In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.
acpiThe 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. In November, we started fuzzing the AML parser to
help find inputs that crash it and we found
a few.
We even found a case where
we'd misinterpreted the spec. This is an important task for the project, as the AML parser will often run in
kernelspace, and so should not panic from any input, however invalid (some more work is needed to make this the
case, however).
Lexicographic comparison was also implemented for Buffer and String AML objects,
which means we should now be able to perform all comparisons tables are allowed to make (bar some object
conversions, which still need some work).
The changes this month, as well as some made in December that should improve compile speed a little, have been
published as aml v0.10.0.
x86_64The 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 November, we merged the following updates:
Thanks to @toku-sa-n for their contribution!
multiboot2The multiboot2 crate provides abstraction types for the boot information of multiboot2 bootloaders. We merged the following updates this month:
v0.10.0)v0.10.1)Thanks to @CalebLBaker for their contribution!
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.
IsaacWoods/pebble(Section written by @IsaacWoods)
Between university and work on acpi, I haven't had a huge amount of time to work on Pebble for the last couple of
months, but in November I:
std, so this was the
next step in creating a std implementation for Pebble.ExitBootServices. This may be a bug in OVMF - please get in touch if you've come across something
similar and know what's going on!cpuid steppingsphil-opp/blog_os(Section written by @phil-opp)
In November, we merged the following changes to the Writing an OS in Rust blog:
Bare Bone ChapterThanks to @hamidrezakp, @Undin, and @briankung for their contributions!
Behind the scenes, I'm still working on the upcoming revision of the blog with UEFI and framebuffer support. One fundamental problem of the new build approach planned for this revision is that we can no longer use .cargo/config files for specifying defaults. See my comment on GitHub for more details on the problem.
To solve this issue, I created a proposal on the Rust internals forum to move some cargo config settings to Cargo.toml. While it is still not implemented yet, the great news is that the proposal was approved by the Cargo team 🎉! Now I (or someone else) just needs to find the time to implement this, then the last remaining blocker for the new build system should be resolved.
lucis-fluxum/ps2-rs(Section written by @lucis-fluxum)
This is a new library I created to provide OS kernels with low-level access to the PS/2 controller and devices. It uses a poll-based approach with a timeout to read and write data to the IO ports.
While some of the library's functionality won't work on modern devices due to differing implementations of PS/2 emulation between manufacturers, it should be enough to get initialized and receiving scancodes and mouse events. Theoretically, it should work with PS/2-compatible keyboards all the way back to the IBM Model M!
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.
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.
In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.
x86_64The 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 October, we merged following changes:
GlobalDescriptorTable::add_entry a const fnTryFrom traitThanks to @toku-sa-n for their contribution! We plan to publish the above changes as version 0.12.3 in the next few days.
volatileThe volatile crate provides a safe wrapper type for implementing volatile read and write operations. This is useful for accessing memory regions that have side-effects, such as memory-mapped hardware registers or framebuffers.
In October, we published a new version to fix the crate's unstable feature on newer Rust nightlies:
slice::check_range to RangeBounds::assert_len (published as v0.4.2)Thanks to @vetio for this contribution!
bootloaderThe bootloader crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables. This month, we published versions 0.9.9 to 0.9.11 to fix build errors on the latest nightlies, caused by the new feature gate names for some const fn features.
We we didn't merge any changes to the master branch this month, we made more progress on the rewrite that adds UEFI support: There is now a draft pull request that tracks the remaining issues.
uefi-rsThe uefi crate provides safe and performant wrappers for UEFI, the successor to the BIOS. In October, we merged the following changes:
Thanks to @Swampman08 for their contribution!
pci_typesThe pci_types library provides types for accessing and configuring PCI devices from Rust operating systems. Lots of this code (e.g. identifying devices by class codes) can be shared
between projects, and would benefit from community contributions.
This month, we published version 0.2.0 with the following changes:
cargo-xbuildThe cargo-xbuild project provides cargo command wrappers to cross-compile the sysroot crates core and alloc. This month, we merged the following changes:
build-std-features flag for Cargo's build-std featurev0.6.3)Thanks to @luqmana and @koushiro for these contributions!
Even though we still maintain the cargo-xbuild crate, we recommend switching to cargo's own build-std feature that is always up-to-date with the latest Rust/Cargo changes. We wrote a short guide on how to switch to it, which is available in our Readme.
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.
rust-embedded/rust-raspberrypi-OS-tutorials(Section written by @andre-richter)
The Operating System development tutorials in Rust on the Raspberry Pi project now provides Tutorial 15 - Virtual Memory Part 2: MMIO Remap.
It introduces a first set of changes which are eventually needed for separating kernel and user address spaces:
identity maps the whole of the board's address space.kernel binary stays identity mapped for now.MMIO regions are remapped lazily to a special virtual address region at the top of the virtual address space during the device driver's init().phil-opp/blog_os(Section written by @phil-opp)
This month, the Writing an OS in Rust series received the following updates:
See the merged pull request list for the complete set of changes this month. Thanks a lot to all contributors!
In case you speak Persian: There is currently an open pull request to add a Persian translation of Bare Bones chapter that needs reviews. Thanks to everyone involved!
In in our previous status update I described my plans to rewrite the blog on top of the upcoming UEFI bootloader. In the past month I started rewriting the Minimal Rust Kernel post for this. Unfortunately, I'm still facing build-related issues because of limitations of Cargo's config files. To resolve these (and other) .cargo/config issues, I created a proposal on the Rust internals forum to make some .cargo/config options available in Cargo.toml too. Feel free to join the discussion if it's relevant to you!
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.
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.
In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.
acpiThe 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. Lots of work happened this month:
Fixed Memory, Word Address Space, DWord Address Space, QWord Address Space, IRQ Format,
DMA Format, and I/O Port Descriptor resource descriptors were added. These appear in _CRS objects - objects
that describe the resources allocated to a particular hardware device. This should be enough support to parse the
_CRS objects of all devices supported by QEMU. Thanks to @michaelmelanson for his contribution!2.0.0 of the acpi crate was published, after consultation with contributors to the Redox project.
This splits the library into two parts - discovering ACPI tables using various methods, and separately, parsing them to discover information about the system.
This provides much more flexibility in how tables are parsed, allows support for OS-specific tables, and is
important to the Redox project as it allows parsing of the ACPI tables in userspace. We also used this
opportunity for breaking changes to clean up a few parts of the library, especially in making our method of
mapping physical memory ranges safer.rsdp, was split out from acpi. This new crate provides methods
for searching for the first ACPI table (the Root System Description Pointer (RSDP)) on BIOS systems without
alloc support. This makes it suitable for use from bootloaders and similar applications where heap allocation
is not supported. All types are reexported by the acpi crate, so users can access the same functionality from
the main library.x86_64The 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.
The crate received the following updates in September:
nop instruction (published as v0.11.4)PageTableEntry::new inside a const fn (published as v0.11.5)
VirtAddr::is_null (published as v0.11.8)v0.12.0)
const_mut_refs feature gate (published as v0.12.1)syscall/sysenter instructionsconst_fn_fn_ptr_basics feature gate (published together with #181 as v0.12.2)Thanks to @ecstatic-morse, @toku-sa-n, @h33p, and @josephlr for their contributions!
We would also like to welcome @josephlr to our x86_64 review and maintenance team!
volatileThe volatile crate provides safe wrapper types for implementing volatile read and write operations. This month, we published version 0.4.0, which completely rewrites the crate based on reference values. Instead of wrapping the target value directly as e.g. Volatile<u32>, the new implementation works by wrapping reference types such as Volatile<&mut u32>. See our completely revamped documentation for more details.
The main advantage of the new reference-based implementation is that it is now possible to work with volatile arrays and slices, at least on nightly Rust. Through the index and index_mut methods it is possible to create sub-slices, which can then be read and written efficiently through the copy_into_slice and copy_from_slice methods. All these operations perform volatile memory accesses, so that the compiler won't optimize them away.
pci_typespci_types is a new library in the Rust OSDev organisation that provides types for accessing and configuring PCI
devices from Rust operating systems. Lots of this code (e.g. identifying devices by class codes) can be shared
between projects, and would benefit from community contributions. This month, work started on some types for
representing PCIe addresses, the layout of the configuration space for endpoints, device types, and a trait that
allows the library to access the PCIe configuration space in whichever way the platform exposes it.
Thanks to @toku-sa-n for their contribution!
uefi-rsThe uefi-rs crate provides safe and performant wrappers for UEFI, the successor to the BIOS. In September, the crate was updated to Rust's new inline assembly implementation. We also published version 0.6.0 of the crate, including all the improvements added in the past two months.
Thanks to @toku-sa-n for their contribution!
bootloaderThe bootloader crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables. This month, we published versions 0.9.9 to 0.9.11 to fix build errors on the latest nightlies, caused by the new feature gate names for some const fn features.
We also made some more progress on the rewrite with UEFI support. It now passes additional framebuffer information and the address of the RSDP structure of ACPI in the boot info. (We later updated the RSDP code to use the new rsdp crate). The bootloader also gained support for setting up a recursive page table mapping, which makes it almost feature-equivalent with the current implementation. There are still a few things missing, but it should be ready to be published soon.
cargo-xbuildThe cargo-xbuild project provides cargo command wrappers to cross-compile the sysroot crates core and alloc. This month, we merged some maintenance updates to increase platform compatibility:
v0.6.1)v0.6.2)Thanks to @pfmooney for these contributions!
Even though we still maintain the cargo-xbuild crate, we recommend switching to cargo's own build-std feature that is always up-to-date with the latest Rust/Cargo changes. We wrote a short guide on how to switch to it, which is available in our Readme.
uart_16550The uart_16550 crate provides basic support for serial port I/O for 16550-compatible UARTs. Like the x86_64 and bootloader crates, this crate received some dependency updates this month to fix nightly breakage. In the process, we released versions 0.2.8 to 0.2.10. Since none of these versions are semver-breaking, a normal cargo update should suffice to update to the latest version.
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.
IsaacWoods/pebble(Section written by @IsaacWoods)
A fairly large amount of progress has been made on Pebble over the last two months, and a prototype of Pebble's defining feature (easy message passing between tasks) is now working!
send_message and get_message, were added that allows a message (a series of bytes, and
optionally a number of handles (effectively, permission to access a certain kernel object)) to be sent
down a channel, between two tasks.echo
was built to test this - it provides a service that simply echos any messages sent down it back to the sending
task.mbus.
All hardware devices on the platform will be added to the Platform Bus by Bus Drivers, and described using properties (as an
example, a PCI device will have properties such as pci.vendor_id, and pci.class). Device drivers will be
able to apply to manage devices by sending a Filter to the Platform Bus, which specifies which devices they are
able to handle, based on a device's properties. In the future, Platform Bus will be responsible for handling all
PCI, USB, and hardwired devices on all platforms.pci_get_info, to get the raw
information about PCI from the kernel, and then creates a Platform Bus device for each function, with the correct
properties. It uses the new pci_types library in the Rust OSDev organisation to identify each device (in the
future, this will be extended to know about specific vendor+device ID combinations, to identify specific devices
such as a particular graphics card).phil-opp/blog_os(Section written by @phil-opp)
This month, the "Writing an OS in Rust" blog received a few minor updates:
x86_64 to v0.12.1const_mut_refs feature gateApart from that, I did a lot of preparation for the upcoming switch to the UEFI bootloader. My prototype implementation of the blog_os system on top of the new UEFI bootloader has now reached feature parity with the existing implementation:

The output looks different now because we are using a pixel based framebuffer instead of the VGA text mode. This is required because the VGA text mode is no longer supported with UEFI. For the framebuffer implementation I'm using the new version of the volatile crate and the font8x8 crate for font rendering.
You can also see some log output related to the APIC interrupt controller (not to be confused with the ACPI standard). I'm using the APIC instead of the legacy PIC because the latter is not supported anymore on most UEFI systems. For that, I started working on a new apic crate, which will include abstractions for the registers of the local APIC and the IOAPIC.
For the coming month(s), I'm planning to revamp the "Writing an OS in Rust" blog based on this prototype implementation. This will require complete rewrites of the VGA Text Mode and Hardware Interrupts posts, an update of the bootloader build process in A Minimal Rust Kernel, and replacing the QEMU screenshots across all posts. So I expect that it will take some time until the new version is ready.
andre-richter/qemu-exit(Section written by @andre-richter)
Version 1.0.x of the crate has been released!
qemu-exit is a crate that allows you quit a running QEMU session with a user-defined exit code. This is useful for unit or integration tests of bare-metal software (e.g. OS kernels) that are tested in QEMU.
The crate supports the following architectures:
AArch64RISC-V 64x86_64If you want to see the crate in action, you can have a look at how it is used in the rust-raspberrypi-OS-tutorials project.
Shoutout to @phil-opp for inspiring this crate with his original blog post and to @Skallwar for his many contributions.
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.
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.
In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.
uefi-rsThe uefi-rs crate provides safe and performant wrappers for UEFI, the successor to the BIOS. In August, the crate received a large number of improvements:
image_info to infoMemoryMapIter type from the APIalloc APItext::Output::current_mode methodExactSizeIterator in exit_boot_servicesThanks to @tomoyat1 for their contribution!
multiboot2The multiboot2 crate provides abstraction types for the boot information of multiboot2 bootloaders. The most important change this month was the update to the latest release of the multiboot2 specification:
Thanks to @Caduser2020 for these contributions and welcome to the multiboot2 team!
bootloaderThe bootloader crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables. We did not publish any changes to the bootloader crate this month, but we made good progress on the UEFI implementation. See these issue comments for a detailed status report.
The rewrite of the real mode and protected mode stages of the BIOS bootloader is also making progress. The goal is to replace as much of the existing assembly code with Rust as possible, in order to make the code more robust and easier to understand.
ansi_rgbThe ansi_rgb crate implements no_std-compatible support for colored terminal text using ANSI escape sequences. The crate is still in an early state, but it received lots of new features this month:
Foreground and Background traitsWithForeground and WithBackground into ColoredWithForeground and WithBackground structsThanks to @hanmertens for their contributions!
bootimageThe bootimage tool allows the creation of bootable disk images for bootloader-based kernels. It also provides a runner executable for cargo to make cargo run and cargo test work using QEMU. In August, we changed the test behavior to fix a bug where a triple fault is interpreted as a test success. We also fixed a small bug related to the --version argument. The relevant pull requests are:
v0.10.0)
--version argument without subcommand (bootimage --version) (published as v0.10.1)Thanks to @Freax13 for their contribution!
x86_64The 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.
This month, we added some functions for reading and writing the FS and GS segment base registers:
v0.11.2)Thanks to @haraldh for this contribution!
acpiThe 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, support for more opcodes was added to the AML parser:
DefL* opcodesspinning_topThe spinning_top crate provides a simple spinlock implementation based on the abstractions of the lock_api crate. This month, we added an optional feature to make the crate compatible with the owning_ref crate:
v0.2.2)Thanks to @not-a-seagull for this contribution!
cargo-xbuildThe cargo-xbuild project provides cargo command wrappers to cross-compile the sysroot crates core and alloc. At the beginning of this month, we had to update the crate for the new rustc directory layout. The crate also received a small cleanup:
v0.6.0)Thanks to @toku-sa-n for their contribution!
Even though we still maintain the cargo-xbuild crate, we recommend switching to cargo's own build-std feature that is always up-to-date with the latest Rust/Cargo changes. We wrote a short guide on how to switch to it, which is available in our Readme.
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.
phil-opp/blog_os(Section written by @phil-opp)
I'm still mostly working on the new bootloader with UEFI support, so there were no major changes to the Writing an OS in Rust series this month. However, I'm making good progress on the bootloader as noted above and I hope to finish the rewrite soon.
If all goes well, the new version will no longer require the bootimage tool and instead let the users create a simple build script for the bootloader themselves. It will also set up a pixel based framebuffer, which means that we will be able to do display proper graphics instead of just VGA-based text. Unfortunately, I'm currently a bit blocked by limitations of cargo configuration files (our default target should not apply to our build script), but I hope that we can find a solution for this soon.
While I focused most of my time on the bootloader and the cargo config files, I also merged a few few minor improvements for my blog:
rustup override add to rustup override setcore::fmt functions.post-XX branches, so that we can be sure that our code always builds with the latest Rust nightly versions.Thanks to @RWOverdijk and @JohnTitor for their contributions!
(Section written by @JohnTitor)
This month, we also added a Japanese translation newly. You can find the languages list in the sidebar and Japanese if you enable that language in your browser. Only one post is currently translated, but we'd like to translate more posts in the future. Want to participate in the translation or find a typo? Feel free to open a PR/issue on the repository (please use English in the description if possible)!
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.
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.
In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.
bootimageThe bootimage tool allows the creation of bootable disk images for bootloader-based kernels. It also provides a runner executable for cargo to make cargo run and cargo test work using QEMU. In July, the crate was updated to work with cargo's own build-std feature instead of relying on the cargo-xbuild crate:
-Zbuild-std (published as v0.8.1)cargo bootimage use cargo build instead of cargo xbuild (published as v0.9.0)bootloaderThe bootloader crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables. In July, we switched the crate from cargo-xbuild to the build-std feature of cargo and fixed a bug that prevented booting in VirtualBox:
v0.9.6)-Zbuild-std (published as v0.9.7)binary feature (published as v0.9.8)Thanks to @rsribeiro for their contribution!
We also made some progress on adding UEFI support to the bootloader. Our prototype is now able to set up a pixel-based framebuffer, map a given kernel ELF file into virtual memory, and then pass control to its entry point. The next steps are the construction of the boot information structure, including a memory map. You can find a link to the code and the build instructions in this comment.
acpiThe 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 saw some substantial improvements to our AML handling:
\_SB.PCI0.ISA.COM1. Until now, we represented this namespace using a BTreeMap between the path (allocated on the heap) and a handle to the
object, meaning that there was both a heap-allocated container, and a heap allocation for every single path within the namespace. In this PR, we moved the library to use a new representation that has
a BTreeMap for each level of the namespace. Because each level of the path can only be 4 characters long (_SB, PCI0, ISA, and COM1 are the name segments in the example above), storing the path of each level no longer requires a heap
allocation per object, which reduces the heap-burden of the library significantly.Target, DefShiftLeft, DefShiftRight, DefLOr, and DefAnd. These all appear in QEMU's tables.uefi-rsThe uefi-rs crate provides safe and performant wrappers for UEFI, the successor to the BIOS.
The major changes which happened in this month are:
LoadedImage protocol now exposes the handle for the device where the binary is stored.spinning_topThe spinning_top crate provides a simple spinlock implementation based on the abstractions of the lock_api crate. We created the crate to provide an alternative to the no-longer maintained spin crate. In July, the crate received the following updates:
try_lock_weak for use in lock loop (published as v0.1.1)lock_api to 0.4.0 (published as v0.2.0)const_spinlock convenience function (published as v0.2.1)Thanks to @akiekintveld for their contributions!
volatileThe volatile crate provides safe wrapper types for implementing volatile read and write operations. The crate received the following changes this month:
v0.2.7)Debug and Clone derives for WriteOnly (published as v0.3.0)Thanks to @Freax13 for their contributions!
We are also considering a complete rewrite of the crate to wrap references instead of values directly. The main advantage of this is that it makes working with slices possible. See the pull request for details.
multiboot2The multiboot2 crate provides abstraction types for the boot information of multiboot2 bootloaders. In July, we merged a change that makes the checksum field of the RSDP tag more useful:
validate_checksum method to rsdp (published as v0.9.0)Thanks to @dlrobertson for this contribution!
cargo-xbuildThe cargo-xbuild project provides cargo command wrappers to cross-compile the sysroot crates core and alloc. While there were no updates to the crate itself in July, we added a guide on how to switch from cargo-xbuild to cargo's own build-std feature to the Readme. You can read it here.
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.
IsaacWoods/pebble(Section written by @IsaacWoods)
Between my work on acpi and university commitments, I have not had much time to work on Pebble this month, but
some small clean-ups were made:
x86_64 implementation of the HAL were made common to support code-reuse across architectures.phil-opp/blog_os(Section written by @phil-opp)
The main change this month was the migration from cargo-xbuild to the build-std feature of cargo. This means that we can now use the normal cargo build/cargo run/cargo test commands for our kernel 🎉.
The full list of notable changes is:
-Zbuild-std
There were also some contributions this month that fixed typos and updated links. Thanks a lot to all contributors!
For the next weeks/months, my plan is to finish the UEFI bootloader implementation and then adjust the blog to work with both the BIOS and UEFI bootloaders. Among other things, this will require that we switch from the VGA text buffer to a pixel-based framebuffer because the VGA text mode is not available with UEFI. While this makes things more complicated (we need to do some simple font rendering and add slice support to volatile crate), it will allow us to create our own graphical user interface, render a mouse pointer, or display images.
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.
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.
In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.
x86_64The 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, the crate received some smaller improvements:
try_into calls to fix clippy warningsPhysAddrNotValid and VirtAddrNotValid (published as v0.11.1)Thanks to @samueltardieu and @leecannon for their contributions!
cargo-xbuildThe cargo-xbuild project provides cargo command wrappers to cross-compile the sysroot crates core and alloc. This month, support for the cargo-features manifest key was added and a deprecated dependency was replaced:
cargo-features from project's Cargo.toml (published as v0.5.34)v0.5.35)Thanks to @eggyal and @Eijebong for these contributions!
bootloaderThe bootloader crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables. This month, we fixed a newly introduced Rust warning:
_improper_ctypes_check functions (published as v0.9.5)Thanks to @Freax13 for this contribution!
While we do not have to report any news yet, we are still working on a rewrite of the crate in order to make it more robust (use Rust instead of assembly for boot stages) and composable (in order to add UEFI and multiboot2 support).
acpiThe 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, the crate received two small improvements to the RSDP-related code:
uefiThe uefi crate provides abstractions for the UEFI standard that replaces the traditional BIOS on modern systems. This month, the contribution docs were extended with information how to add new UEFI protocols:
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.
phil-opp/blog_os(Section written by @phil-opp)
In June, I pushed two small improvements to the blog_os repository and the Writing an OS in Rust blog:
There were also lots of small contributions this month that fixed typos and dead links and updated the Chinese translation. Thanks a lot to all contributors!
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.
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.
In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.
x86_64The 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, the crate received a bugfix for inclusive page/frame ranges. We also landed a long-awaited change to the Mapper::map_to function to set certain page table flags also in higher level page tables:
v0.10.3)v0.11.0)Thanks to @haraldh and @mrll for their contributions!
cargo-xbuildThe cargo-xbuild project provides cargo command wrappers to cross-compile the sysroot crates core and alloc.
This month, rustc/cargo changed their codegen behavior for builds with link-time optimization (LTO), which lead to breakage for LTO builds with cargo-xbuild. Fixing this issue was not easy and required multiple tries until we found a proper solution.
Unfortunately, the solution still led to link issues for some people, which was caused by a bug in cargo/rustc. Thanks to @alexcrichton, this was quickly fixed in rustc, so that now everything should work again.
Apart from these bugfixes, there were also two other changes this month:
v0.32)v0.5.33)Thanks to @Nils-TUD for their contribution and to all the people that helped investigating the build errors!
acpiThe 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.
Not a lot happened this month, but preparations were made to change how the AML namespace is stored on the heap, in order to avoid a lot of small heap allocations for AML paths, and reduce the number of heap allocations overall. However, some more profiling infrastructure will need to be built before starting this.
In preparation, a change to how DefNames are stored in the namespace was made, which avoids an extra heap
allocation per DefName, and also allows us to simplify some code around the aml crate.
bootloaderThe bootloader crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables. It received the following updates this month:
v0.9.3)v0.9.4)Thanks to @mark-i-m and @Aaron1011 for their contributions!
bootimageThe bootimage tool allows the creation of bootable disk images for bootloader-based kernels. It also provides a runner executable for cargo to make cargo xrun and cargo xtest work using QEMU. In May, the crate was almost completely rewritten with a smaller API to make it more maintainable:
bootimage {run, test} (published as v0.8.0)uart_16550The uart_16550 crate provides basic support for serial port I/O for 16550-compatible UARTs. This month, the crate received the following updates:
spin_loop_hint while waiting for data (published as v0.2.6)v0.2.7)Thanks to @dbeckwith for their contribution!
uefiThe uefi crate provides abstractions for the UEFI standard that replaces the traditional BIOS on modern systems. This month, the crate's dependencies were updated, and a bug was fixed in the graphics protocol:
Thanks to @imtsuki and @BinaryTENSHi for their contributions!
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.
IsaacWoods/pebble(Section written by @IsaacWoods)
This month, I've been tracking down a bug in the kernel that causes usermode stacks to become corrupted on the return of some system calls. While I've not found the root cause, I've taken this opportunity to add some more debugging capabilities, which have found a number of other kernel bugs.
I also started working on the Rust implementation of Ptah,
the wire format for Pebble's message passing interface. It allows libraries to easily use Serde to
serialize and deserialize Rust types to and from the wire format. In the future, a compiler will be able to
generate bindings for Ptah for a number of different supported languages, which will allow tasks written in
different languages to communicate over Pebble Channels using idiomatic types.
RustyHermit(Section written by @stlankes)
RustyHermit is a unikernel targeting a scalable and predictable runtime. Unikernel means, you bundle your application directly with the kernel library, so that it can run without any installed operating system. This reduces image size and overhead, therefore, interesting applications include virtual machines and high-performance computing.
This month the integration of smoltcp has been improved and first support for virtio has been integrated. The integration in Rust's standard runtime is already in progress and clients can be developed with TcpStream. Server side applications will follow soon.
phil-opp/blog_os(Section written by @phil-opp)
This month, support for the legacy asm! macro was removed from rustc. This lead to build errors for the Writing an OS in Rust project because some dependencies were still using the macro. To fix this, I landed a number of dependency updates:
I also decided to change the design of the executor in the Async/Await post to simplify it:
While I already started a draft on the next blog post about processes, I currently plan to look into adding UEFI support to the bootloader crate first. The reason is that UEFI support will require some fundamental changes to the blog because the VGA text buffer and the legacy PIC are not supported on UEFI. This is also relevant to the upcoming post about processes, since different designs would be possible if we used the APIC instead of the legacy PIC. It therefore makes most sense to me to sort this out first.
rust-embedded/rust-raspberrypi-OS-tutorials(Section written by @andre-richter)
May was a quiet month for the project, since I am currently taking a little hiatus. I am planning to restart working on new content two or three months down the road.
Therefore, only some maintenance updates went in, e.g. bumping all dependency crates to versions that support the new llvm_asm! macros. Also, the :cn: chinese translations received updates/additions (main Readme; 00_before_we_start).
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.
These posts are the successor of the "Status Update" posts on the "Writing an OS in Rust" blog. Instead of only focusing on the updates to the blog and the directly related crates, we try to give an overview of the full Rust OSDev ecosystem in this new series. This includes all the projects under the rust-osdev GitHub organization, relevant projects of other organizations, and also personal OS projects.
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.
We try to collect posts that are relevant to Rust-based OS development each month. Please create pull requests for any posts that you want linked in the next issue.
In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.
x86_64The 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.
This month, we released version 0.10.0 of x86_64, which includes some breaking changes:
map_to and update_flags unsafe#[inline] everywhere{PhysFrame,Page}::from_start_address_uncheckedAfter v0.10.0, the following changes were merged:
InterruptDescriptorTable::load_unsafe (published as v0.10.1)llvm_asm! instead of deprecated asm! macro
0.10.x is so recent, we still decided to release only a patch version. Note that this isn't a breaking change in the semver sense since we only guarantee compatibility with recent nightlies.GDT::add_entry() (published as v0.10.2)Thanks to @m-ou-se, @tomaka, @haraldh, and @imtsuki for their contributions!
acpi and amlThe 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. The crate for parsing the static tables (acpi) was stabilised this month – while it needs more work to support the entire spec, it is now in the state where it can be integrated into a Rust kernel to provide useful information, and its overall architecture is unlikely to change in the near future.
The full set of changes is:
acpi crate (🎉 published as v1.0.0 🎉)Thanks to @tomaka for their contribution and congratulations to the creator and maintainer @IsaacWoods on the 1.0 release!
bootloaderThe bootloader crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables. It received the following updates this month:
v0.9.1)llvm_asm! instead of deprecated asm! (published as v0.9.2)Thanks to @Freax13 and @realKennyStrawn93 for these changes!
Right now, @rybot666 and @phil-opp are working on a rewrite of the bootloader. The goal is to port the 16-bit and 32-bit stages from assembly to Rust, which should make the crate safer, more composable, and easier to understand for outsiders. Our progress is tracked in the Rewrite milestone.
bootimageThe bootimage tool allows the creation of bootable disk images for bootloader-based kernels. It also provides a runner executable for cargo to make cargo xrun and cargo xtest work using QEMU. In April, the crate received the following updates:
Thanks to @Freax13 for their contribution!
uart_16550The uart_16550 crate provides basic support for serial port I/O for 16550-compatible UARTs. This month, the crate received support for serial input:
Thanks to @imtsuki for their contribution!
cargo-xbuildThe cargo-xbuild project provides cargo command wrappers to cross-compile the sysroot crates core and alloc. This month, we added a new environment variable to help debugging build errors:
uefiThe uefi crate provides abstractions for the UEFI standard that replaces the traditional BIOS on modern systems. This month, the crate received a new cargo feature to ignore logger errors:
There are a number of new projects in the rust-osdev organization:
homepage: As you might have noticed by now, we have a new organization-level homepage at https://rust-osdev.com/. The homepage repository contains the source code for this website. Right now, it is still a work-in-progress and only contains the very minimum to host this post, but we plan to add more content soon.
Note that we will create a branch for the upcoming May issue of "This Month in Rust OSDev". Please open pull requests for any content that you would like to see next month.
vga: The goal of the vga crate is to allow configuration of the VGA hardware. It already makes it possible to switch from a text-based buffer to a pixel-based framebuffer, which enables drawing of lines, geometric shapes, and even images. The library is created by @RKennedy9064.
ps2-mouse: The library provides a basic interface for interacting with a PS/2 mouse. It is also created by @RKennedy9064.
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.
IsaacWoods/pebble(Section written by @IsaacWoods)
Pebble has been undergoing a bit of a reorganisation, in the interests of supporting a second architecture (ARM64). A hardware abstraction layer (HAL) has been introduced that abstracts away the platform-specifics of managing page tables, creating processes etc. so that the main kernel crate is now completely platform-independent.
I also wrote a little TFTP server for netbooting a Raspberry Pi 4 from a development machine. This makes iterating the kernel a lot easier because there's no need to write it to an SD card after every compile. In the next few weeks, I hope to clean this code up and publish it for use as both a library and CLI application, and maybe write a blog-post on the intricacies of netbooting the Pi.
rust-embedded/rust-raspberrypi-OS-tutorials(Section written by @andre-richter)
The Operating System development tutorials in Rust on the Raspberry Pi project received the following updates recently:
tutorial 14: Exceptions Part 2: Peripheral IRQs.
device drivers for the two interrupt controllers on the Raspberry Pi 3 (Broadcom
custom controller) and Pi 4 (ARM Generic Interrupt Controller v2, GICv2).IRQManager.UART's receive IRQ - one IRQ per
received character.32 MiB.
macOS and other Unix systems which have Ruby available.phil-opp/blog_os(Section written by @phil-opp)
Apart from a few minor fixes (thanks for all the contributions!), April was a quiet month for the "Writing an OS in Rust" project. I focused my work this month on the x86_64 library, the rewrite of the bootloader, and my job search instead. In this regard, I'm excited to announce that I have decided to do Rust-related freelance work for now, which will allow me to continue dedicating some of my time to open-source work.
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.