Rust OSDev https://rust-osdev.com Operating System Development in Rust Zola en Wed, 11 Mar 2026 00:00:00 +0000 This Month in Rust OSDev: February 2026 Wed, 11 Mar 2026 00:00:00 +0000 https://rust-osdev.com/this-month/2026-02/ https://rust-osdev.com/this-month/2026-02/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.

This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.

Announcements, News, and Blog Posts

Here we collect news, blog posts, etc. related to OS development in Rust.

  • Linux 7.0 Officially Concluding The Rust Experiment
    • Rust is now formally accepted as a permanent part of the Linux kernel, shipping in production across multiple distributions and millions of Android devices.
  • The future for Tyr
    • Progress on Tyr, a Rust GPU driver for Arm Mali hardware. The DRM subsystem is reportedly "about a year away" from requiring new drivers to be written in Rust.
  • Microsoft LiteBox
    • A Rust library OS supporting kernel- and user-mode execution, with sandboxing for running unmodified Linux programs on Windows and SEV SNP.
  • This Month in Redox - January 2026
    • Redox got Cargo and rustc compiling natively and made progress on capability-based security.
  • CHERIoT Rust: Status update #0
    • Six months of progress porting Rust to the CHERIoT capability-based hardware architecture. Core and alloc now compile for the new riscv32cheriot-unknown-cheriotrtos target.
  • Ariel OS v0.3.0: BLE, Sensors, UART, and More!
    • New release adds BLE support, hardware-agnostic UART drivers, sensor abstraction, and expanded MCU support (ESP32, STM32, Nordic, RP).
  • Async/await on the GPU
    • Rust's Future trait and async/await running on GPU hardware, reusing the Embassy embedded executor.

Infrastructure and Tooling

In this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.

rust-osdev Projects

In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

uefi-rs

Maintained 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 contributions!

bootloader

Maintained 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-rs

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.

We merged the following PRs this month:

bootimage

Maintained 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:

acpi

Maintained by @IsaacWoods

The acpi repository contains crates for parsing the ACPI tables – data structures that the firmware of modern computers use to relay information about the hardware to the OS.

We merged the following changes this month:

Thanks to @martin-hughes for their contributions!

endian-num

Maintained 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-abi

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.

We merged the following changes this month:

spinning_top

Maintained 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:

Other Projects

In this section, we describe updates to Rust OS projects that are not directly related to the rust-osdev organization. Feel free to create a pull request with the updates of your OS project for the next post.

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.

Join Us?

Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

]]>
This Month in Rust OSDev: January 2026 Wed, 04 Feb 2026 00:00:00 +0000 https://rust-osdev.com/this-month/2026-01/ https://rust-osdev.com/this-month/2026-01/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.

This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.

Announcements, News, and Blog Posts

Here we collect news, blog posts, etc. related to OS development in Rust.

Infrastructure and Tooling

In this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.

rust-osdev Projects

In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

bootloader

Maintained 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!

multiboot2

Maintained 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-prebuilt

Maintained 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-rs

Maintained 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 @yaroslav957 for their contribution!

virtio-spec-rs

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.

We merged the following PRs this month:

x86_64

Maintained by @phil-opp, @josephlr, and @Freax13

The x86_64 crate provides various abstractions for x86_64 systems, including wrappers for CPU instructions, access to processor-specific registers, and abstraction types for architecture-specific structures such as page tables and descriptor tables.

We merged the following PRs this month:

Other Projects

In this section, we describe updates to Rust OS projects that are not directly related to the rust-osdev organization. Feel free to create a pull request with the updates of your OS project for the next post.

phil-opp/blog_os

(Section written by @phil-opp)

We merged the following changes to the Writing an OS in Rust blog this month:

Thanks to @ebkalderon for their contribution!

Join Us?

Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

]]>
This Month in Rust OSDev: December 2025 Tue, 06 Jan 2026 00:00:00 +0000 https://rust-osdev.com/this-month/2025-12/ https://rust-osdev.com/this-month/2025-12/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.

This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.

Announcements, News, and Blog Posts

Here we collect news, blog posts, etc. related to OS development in Rust.

Infrastructure and Tooling

In 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 Projects

In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

bootloader

Maintained 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 @spencer3035, @Taxrosdev, and @oxyzenQ for their contributions!

ovmf-prebuilt

Maintained 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-rs

Maintained 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 @Virv12 for their contributions!

Other Projects

In this section, we describe updates to Rust OS projects that are not directly related to the rust-osdev organization. Feel free to create a pull request with the updates of your OS project for the next post.

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.

  • The kernel surface is now intentionally minimal, limited to scheduling, memory management, IPC, interrupts, token verification, and syscall dispatch.
  • All system policy, including filesystems, drivers, and services, has been moved entirely to userspace.
  • Implicit privilege has been eliminated and replaced with an explicit, cryptographically verified token-based authority system.
  • Every privileged operation now requires visible, auditable authority, with no ambient permissions or global namespaces.
  • IPC has become the only communication primitive, implemented as deterministic synchronous rendezvous.
  • The scheduler has been redesigned as an O(1) priority bitmap scheduler with predictable behavior and clear separation of mechanism and policy.
  • Memory management now enforces per-process address spaces, validated user pointers, and lazy allocation via page faults.
  • The syscall interface has been reduced to seven syscalls, with all privileged actions funneled through a single token-guarded entry point.
  • The kernel is now fully unit-tested, smaller, stricter, and architecturally stable, enabling future development to proceed almost entirely in userspace.

Join Us?

Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

]]>
This Month in Rust OSDev: November 2025 Mon, 08 Dec 2025 00:00:00 +0000 https://rust-osdev.com/this-month/2025-11/ https://rust-osdev.com/this-month/2025-11/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.

This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.

Announcements, News, and Blog Posts

Here we collect news, blog posts, etc. related to OS development in Rust.

Infrastructure and Tooling

In this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.

rust-osdev Projects

In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

New Crate: mem_barrier

Maintained 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!

bootloader

Maintained 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_types

Maintained 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-rs

Maintained 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_64

Maintained by @phil-opp, @josephlr, and @Freax13

The x86_64 crate provides various abstractions for x86_64 systems, including wrappers for CPU instructions, access to processor-specific registers, and abstraction types for architecture-specific structures such as page tables and descriptor tables.

We merged the following PRs this month:

Thanks to @Restioson for their contribution!

Other Projects

In this section, we describe updates to Rust OS projects that are not directly related to the rust-osdev organization. Feel free to create a pull request with the updates of your OS project for the next post.

phil-opp/blog_os

(Section written by @phil-opp)

We merged the following changes to the Writing an OS in Rust blog this month:

  • Add Portuguese (pt-BR) translation
    • for all 12 posts
    • thanks a lot to @richarddalves for this contribution!

Join Us?

Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

]]>
This Month in Rust OSDev: October 2025 Fri, 07 Nov 2025 00:00:00 +0000 https://rust-osdev.com/this-month/2025-10/ https://rust-osdev.com/this-month/2025-10/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.

This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.

Announcements, News, and Blog Posts

Here we collect news, blog posts, etc. related to OS development in Rust.

Infrastructure and Tooling

In this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.

rust-osdev Projects

In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

acpi

Maintained by @IsaacWoods

The acpi repository contains crates for parsing the ACPI tables – data structures that the firmware of modern computers use to relay information about the hardware to the OS. We merged the following changes this month:

Thanks to @jackpot51 for their contributions!

ovmf-prebuilt

Maintained 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-rs

Maintained 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!

multiboot2

Maintained 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:

Other Projects

In this section, we describe updates to Rust OS projects that are not directly related to the rust-osdev organization. Feel free to create a pull request with the updates of your OS project for the next post.

No projects updates were submitted this month.

Join Us?

Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

]]>
This Month in Rust OSDev: September 2025 Thu, 09 Oct 2025 00:00:00 +0000 https://rust-osdev.com/this-month/2025-09/ https://rust-osdev.com/this-month/2025-09/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.

This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.

Announcements, News, and Blog Posts

Here we collect news, blog posts, etc. related to OS development in Rust.

Infrastructure and Tooling

In this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.

rust-osdev Projects

In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

bootloader

Maintained 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-rs

Maintained 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-rs

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.

We merged the following PRs this month:

Thanks to @hcsch for their contribution!

Other Projects

In this section, we describe updates to Rust OS projects that are not directly related to the rust-osdev organization. Feel free to create a pull request with the updates of your OS project for the next post.

phil-opp/blog_os

(Section written by @phil-opp)

We merged the following changes to the Writing an OS in Rust blog this month:

Join Us?

Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

]]>
This Month in Rust OSDev: August 2025 Fri, 05 Sep 2025 00:00:00 +0000 https://rust-osdev.com/this-month/2025-08/ https://rust-osdev.com/this-month/2025-08/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.

This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.

Announcements, News, and Blog Posts

Here we collect news, blog posts, etc. related to OS development in Rust.

Infrastructure and Tooling

In this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.

rust-osdev Projects

In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

acpi

Maintained by @IsaacWoods

The acpi repository contains crates for parsing the ACPI tables – data structures that the firmware of modern computers use to relay information about the hardware to the OS. We merged the following changes this month:

bootloader

Maintained 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-rs

Maintained 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-rs

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.

We merged the following PRs this month:

Thanks to @Gelbpunkt for their contributions!

x86_64

Maintained by @phil-opp, @josephlr, and @Freax13

The x86_64 crate provides various abstractions for x86_64 systems, including wrappers for CPU instructions, access to processor-specific registers, and abstraction types for architecture-specific structures such as page tables and descriptor tables.

We merged the following PRs this month:

Other Projects

In this section, we describe updates to Rust OS projects that are not directly related to the rust-osdev organization. Feel free to create a pull request with the updates of your OS project for the next post.

phil-opp/blog_os

(Section written by @phil-opp)

We merged the following changes to the Writing an OS in Rust blog this month:

Join Us?

Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

]]>
This Month in Rust OSDev: July 2025 Fri, 08 Aug 2025 00:00:00 +0000 https://rust-osdev.com/this-month/2025-07/ https://rust-osdev.com/this-month/2025-07/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.

This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.

Announcements, News, and Blog Posts

Here we collect news, blog posts, etc. related to OS development in Rust.

Infrastructure and Tooling

In this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.

rust-osdev Projects

In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

bootloader

Maintained 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_16550

Maintained 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-rs

Maintained 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, @Jonathas-Conceicao and @PelleKrab for their contributions!

x86_64

Maintained by @phil-opp, @josephlr, and @Freax13

The x86_64 crate provides various abstractions for x86_64 systems, including wrappers for CPU instructions, access to processor-specific registers, and abstraction types for architecture-specific structures such as page tables and descriptor tables.

We merged the following PRs this month:

Thanks to @mkroening for their contributions!

Other Projects

In this section, we describe updates to Rust OS projects that are not directly related to the rust-osdev organization. Feel free to create a pull request with the updates of your OS project for the next post.

phil-opp/blog_os

(Section written by @phil-opp)

We merged the following changes to the Writing an OS in Rust blog this month:

Join Us?

Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

]]>
This Month in Rust OSDev: June 2025 Wed, 09 Jul 2025 00:00:00 +0000 https://rust-osdev.com/this-month/2025-06/ https://rust-osdev.com/this-month/2025-06/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.

This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.

Announcements, News, and Blog Posts

Here we collect news, blog posts, etc. related to OS development in Rust.

Infrastructure and Tooling

In this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.

rust-osdev Projects

In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

uefi-rs

Maintained 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, @nicholasbishop, @phip1611, @renovate[bot], @RenTrieu, and @diamant3 for their contributions!

ovmf-prebuilt

Maintained 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:

multiboot2

Maintained 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-rs

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.

We merged the following PRs this month:

Thanks to @stlankes for their contribution!

bootloader

Maintained 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_64

Maintained by @phil-opp, @josephlr, and @Freax13

The x86_64 crate provides various abstractions for x86_64 systems, including wrappers for CPU instructions, access to processor-specific registers, and abstraction types for architecture-specific structures such as page tables and descriptor tables.

We merged the following PRs this month:

Thanks to @ChocolateLoverRaj for their contribution!

Other Projects

In this section, we describe updates to Rust OS projects that are not directly related to the rust-osdev organization. Feel free to create a pull request with the updates of your OS project for the next post.

No projects updates were submitted this month.

Join Us?

Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

]]>
This Month in Rust OSDev: May 2025 Thu, 05 Jun 2025 00:00:00 +0000 https://rust-osdev.com/this-month/2025-05/ https://rust-osdev.com/this-month/2025-05/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.

This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.

Announcements, News, and Blog Posts

Here we collect news, blog posts, etc. related to OS development in Rust.

Infrastructure and Tooling

In this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.

rust-osdev Projects

In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

uefi-rs

Maintained 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, @fox0, and @JarlEvanson for their contributions!

x86_64

Maintained by @phil-opp, @josephlr, and @Freax13

The x86_64 crate provides various abstractions for x86_64 systems, including wrappers for CPU instructions, access to processor-specific registers, and abstraction types for architecture-specific structures such as page tables and descriptor tables.

We merged the following PRs this month:

Thanks to @zyuiop for their contribution!

Other Projects

In this section, we describe updates to Rust OS projects that are not directly related to the rust-osdev organization. Feel free to create a pull request with the updates of your OS project for the next post.

No projects updates were submitted this month.

Join Us?

Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

]]>
This Month in Rust OSDev: April 2025 Sat, 10 May 2025 00:00:00 +0000 https://rust-osdev.com/this-month/2025-04/ https://rust-osdev.com/this-month/2025-04/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.

This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.

Announcements, News, and Blog Posts

Here we collect news, blog posts, etc. related to OS development in Rust.

Infrastructure and Tooling

In this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.

rust-osdev Projects

In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

uefi-rs

Maintained 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_64

Maintained by @phil-opp, @josephlr, and @Freax13

The x86_64 crate provides various abstractions for x86_64 systems, including wrappers for CPU instructions, access to processor-specific registers, and abstraction types for architecture-specific structures such as page tables and descriptor tables.

We merged the following PRs this month:

bootloader

Maintained 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:

Other Projects

In this section, we describe updates to Rust OS projects that are not directly related to the rust-osdev organization. Feel free to create a pull request with the updates of your OS project for the next post.

phil-opp/blog_os

(Section written by @phil-opp)

We merged the following changes to the Writing an OS in Rust blog this month:

Thanks to @tigeryant and @v4zha for their contributions!

Join Us?

Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

]]>
This Month in Rust OSDev: March 2025 Sun, 06 Apr 2025 00:00:00 +0000 https://rust-osdev.com/this-month/2025-03/ https://rust-osdev.com/this-month/2025-03/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.

This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.

Announcements, News, and Blog Posts

Here we collect news, blog posts, etc. related to OS development in Rust.

Infrastructure and Tooling

In this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.

rust-osdev Projects

In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

uefi-rs

Maintained 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, @ifd3f, @ptf2, and @quic-bjorande for their contributions!

bootloader

Maintained 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:

Other Projects

In this section, we describe updates to Rust OS projects that are not directly related to the rust-osdev organization. Feel free to create a pull request with the updates of your OS project for the next post.

phil-opp/blog_os

(Section written by @phil-opp)

We merged the following changes to the Writing an OS in Rust blog this month:

Thanks to @dobleuber and @JINHUILYU for their contributions!

Join Us?

Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

]]>
This Month in Rust OSDev: February 2025 Tue, 04 Mar 2025 00:00:00 +0000 https://rust-osdev.com/this-month/2025-02/ https://rust-osdev.com/this-month/2025-02/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.

This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.

Announcements, News, and Blog Posts

Here we collect news, blog posts, etc. related to OS development in Rust.

Infrastructure and Tooling

In this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.

rust-osdev Projects

In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

uefi-rs

Maintained 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:

bootloader

Maintained 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 @Stazer, @Wasabi375, and @ChocolateLoverRaj for their contributions!

x86_64

Maintained by @phil-opp, @josephlr, and @Freax13

The x86_64 crate provides various abstractions for x86_64 systems, including wrappers for CPU instructions, access to processor-specific registers, and abstraction types for architecture-specific structures such as page tables and descriptor tables.

We merged the following PRs this month:

Thanks to @farnz for their contribution!

acpi

Maintained by @IsaacWoods

The acpi repository contains crates for parsing the ACPI tables – data structures that the firmware of modern computers use to relay information about the hardware to the OS. We merged the following changes this month:

Thanks to @jellllly420 for their contribution!

ovmf-prebuilt

Maintained 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 @mkroening for their contributions!

Other Projects

In this section, we describe updates to Rust OS projects that are not directly related to the rust-osdev organization. Feel free to create a pull request with the updates of your OS project for the next post.

No projects updates were submitted this month.

Join Us?

Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

]]>
This Month in Rust OSDev: January 2025 Tue, 04 Feb 2025 00:00:00 +0000 https://rust-osdev.com/this-month/2025-01/ https://rust-osdev.com/this-month/2025-01/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.

This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.

Announcements, News, and Blog Posts

Here we collect news, blog posts, etc. related to OS development in Rust.

Infrastructure and Tooling

In this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.

rust-osdev Projects

In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

uefi-rs

Maintained 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 @crawfxrd and @hannahfluch for their contributions!

bootloader

Maintained 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

Maintained by @phil-opp, @josephlr, and @Freax13

The x86_64 crate provides various abstractions for x86_64 systems, including wrappers for CPU instructions, access to processor-specific registers, and abstraction types for architecture-specific structures such as page tables and descriptor tables.

We merged the following PRs this month:

Thanks to @hannahfluch and @adavis628 for their contributions!

acpi

Maintained by @IsaacWoods

The acpi repository contains crates for parsing the ACPI tables – data structures that the firmware of modern computers use to relay information about the hardware to the OS. We merged the following changes this month:

Thanks to @IsaacWoods, @mrjbom, and @00xc for their contributions!

multiboot2

Maintained 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:

Other Projects

In this section, we describe updates to Rust OS projects that are not directly related to the rust-osdev organization. Feel free to create a pull request with the updates of your OS project for the next post.

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.

example

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.

how does it work?

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.

Join Us?

Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

]]>
This Month in Rust OSDev: December 2024 Sat, 11 Jan 2025 00:00:00 +0000 https://rust-osdev.com/this-month/2024-12/ https://rust-osdev.com/this-month/2024-12/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.

This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.

Announcements, News, and Blog Posts

Here we collect news, blog posts, etc. related to OS development in Rust.

  • This Month in Redox OS - December 2024
  • Video: Intro to Embassy : embedded development with async Rust
  • 2025: The Year of COSMIC — Alpha 5 Released!
  • Funding Opportunities - with Redox OS or on your own
    • The NGI Zero Commons Fund and NGI Zero Fediversity Fund each have a call for proposals with a Feb. 1 deadline. If the proposal is successful, it would be to start roughly in June or July (based on our experience) and run for up to 12 months, with an amount up to 50,000 EUR. There must be a "European component", so a EU-based developer would be an ideal fit, or perhaps a project where the maintainer is EU-based. Here are the links:
    • NGI Zero Commons Fund
    • NGI Zero Fediversity Fund
    • Redox is looking for a part-time or short-term developer to help with implementing device drivers, ACPI support, and similar, who would like to join our proposal. You must be knowledgeable in Rust and drivers, and have good reputation in the open source community. We have an existing relationship with NLnet, so we can craft the proposal, based on your skillset and our priorities. Please join us on Matrix and let us know you are interested.
    • https://matrix.to/#/#redox-join:matrix.org

Infrastructure and Tooling

In this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.

rust-osdev Projects

In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

uefi-rs

Maintained 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 @crawfxrd and @JarlEvanson for their contributions!

x86_64

Maintained by @phil-opp, @josephlr, and @Freax13

The x86_64 crate provides various abstractions for x86_64 systems, including wrappers for CPU instructions, access to processor-specific registers, and abstraction types for architecture-specific structures such as page tables and descriptor tables.

We merged the following PRs this month:

Thanks to @mkroening and @adavis628 for their contributions!

bootloader

Maintained 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!

Other Projects

In this section, we describe updates to Rust OS projects that are not directly related to the rust-osdev organization. Feel free to create a pull request with the updates of your OS project for the next post.

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 :).

Join Us?

Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

]]>
This Month in Rust OSDev: November 2024 Sun, 08 Dec 2024 00:00:00 +0000 https://rust-osdev.com/this-month/2024-11/ https://rust-osdev.com/this-month/2024-11/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.

This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.

Announcements, News, and Blog Posts

Here we collect news, blog posts, etc. related to OS development in Rust.

Infrastructure and Tooling

In this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.

rust-osdev Projects

In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

x86_64

Maintained by @phil-opp, @josephlr, and @Freax13

The x86_64 crate provides various abstractions for x86_64 systems, including wrappers for CPU instructions, access to processor-specific registers, and abstraction types for architecture-specific structures such as page tables and descriptor tables.

We merged the following PRs this month:

Thanks to @mrjbom for their contribution!

acpi

Maintained by @IsaacWoods

The acpi repository contains crates for parsing the ACPI tables – data structures that the firmware of modern computers use to relay information about the hardware to the OS. We merged the following changes this month:

Thanks to @pjhades, @00xc, and @Hsy-Intel for their contributions!

bootloader

Maintained 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-rs

Maintained 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 @diekmann for their contribution!

ovmf-prebuilt

Maintained 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_16550

Maintained 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!

Other Projects

In this section, we describe updates to Rust OS projects that are not directly related to the rust-osdev organization. Feel free to create a pull request with the updates of your OS project for the next post.

No projects were proposed for this section this month.

Join Us?

Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

]]>
This Month in Rust OSDev: October 2024 Thu, 14 Nov 2024 00:00:00 +0000 https://rust-osdev.com/this-month/2024-10/ https://rust-osdev.com/this-month/2024-10/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.

This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.

Announcements, News, and Blog Posts

Here we collect news, blog posts, etc. related to OS development in Rust.

Infrastructure and Tooling

In this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.

rust-osdev Projects

In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

uefi-rs

Maintained 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:

x86_64

Maintained by @phil-opp, @josephlr, and @Freax13

The x86_64 crate provides various abstractions for x86_64 systems, including wrappers for CPU instructions, access to processor-specific registers, and abstraction types for architecture-specific structures such as page tables and descriptor tables.

We merged the following PRs this month:

pci_types

Maintained 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-prebuilt

Maintained 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:

multiboot2

Maintained 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:

acpi

Maintained by @IsaacWoods

The acpi repository contains crates for parsing the ACPI tables – data structures that the firmware of modern computers use to relay information about the hardware to the OS. We merged the following changes this month:

Thanks to @Hsy-Intel for their contributions!

Other Projects

In this section, we describe updates to Rust OS projects that are not directly related to the rust-osdev organization. Feel free to create a pull request with the updates of your OS project for the next post.

No updates were proposed for this section this month.

Join Us?

Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

]]>
This Month in Rust OSDev: September 2024 Mon, 07 Oct 2024 00:00:00 +0000 https://rust-osdev.com/this-month/2024-09/ https://rust-osdev.com/this-month/2024-09/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.

This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.

Announcements, News, and Blog Posts

Here we collect news, blog posts, etc. related to OS development in Rust.

Infrastructure and Tooling

In this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.

rust-osdev Projects

In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

multiboot2

Maintained by @phip1611

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:

  • ApmTag
  • BootdevTag
  • NetworkTag

Please find more in the changelog.

We merged the following PRs this month:

Thanks to @filiplajszczak for their contributions!

uefi-rs

Maintained 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:

xhci

Maintained 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!

acpi

Maintained by @IsaacWoods

The acpi repository contains crates for parsing the ACPI tables – data structures that the firmware of modern computers use to relay information about the hardware to the OS. We merged the following changes this month:

Thanks to @jokemanfire, and @Hsy-Intel for their contributions!

pci_types

Maintained 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!

Other Projects

In this section, we describe updates to Rust OS projects that are not directly related to the rust-osdev organization. Feel free to create a pull request with the updates of your OS project for the next post.

No updates were proposed for this section this month.

Join Us?

Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

]]>
This Month in Rust OSDev: August 2024 Wed, 04 Sep 2024 00:00:00 +0000 https://rust-osdev.com/this-month/2024-08/ https://rust-osdev.com/this-month/2024-08/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.

This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.

Announcements, News, and Blog Posts

Here we collect news, blog posts, etc. related to OS development in Rust.

Infrastructure and Tooling

In this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.

rust-osdev Projects

In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

multiboot2

Maintained by @phip1611

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:

Background - 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! :)

uefi

Maintained 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:

  1. We introduced a completely new API to access boot and runtime services
  2. We reorganized the MemoryMap-related types.
  3. We reorganized and improved the documentation, and also added documentation about how the std implementation for UEFI targets compares to uefi and how both can be used together.

1. New API: Freestanding Functions API Change

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:

2. Memory Map Refactoring

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!

3. Documentation Reorganization

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:

  • What is uefi?
  • Which problems does it solve?
  • How can it be used?
  • How does it compare to the ecosystem, such as std for Rust targets?

To see an example how uefi and std can be used together, please head to our repository.

Other

There were also a ton of other interesting fixes, changes, and additions! Check out our Changelog.

We merged the following PRs this month:

Click to expand

bootloader

Maintained 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_64

Maintained by @phil-opp, @josephlr, and @Freax13

The x86_64 crate provides various abstractions for x86_64 systems, including wrappers for CPU instructions, access to processor-specific registers, and abstraction types for architecture-specific structures such as page tables and descriptor tables.

We merged the following PR this month:

Other Projects

In this section, we describe updates to Rust OS projects that are not directly related to the rust-osdev organization. Feel free to create a pull request with the updates of your OS project for the next post.

No projects updates were submitted this month.

Join Us?

Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

]]>
This Month in Rust OSDev: July 2024 Thu, 08 Aug 2024 00:00:00 +0000 https://rust-osdev.com/this-month/2024-07/ https://rust-osdev.com/this-month/2024-07/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.

This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.

Announcements, News, and Blog Posts

Here we collect news, blog posts, etc. related to OS development in Rust.

Infrastructure and Tooling

In this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.

rust-osdev Projects

In 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-rs

Maintained by @GabrielMajeri, @nicholasbishop, and @phip1611

The uefi-rs crate provides safe and performant wrappers for UEFI, the successor to the BIOS. We merged the following PRs this month:

acpi

Maintained by @IsaacWoods

The acpi repository contains crates for parsing the ACPI tables – data structures that the firmware of modern computers use to relay information about the hardware to the OS. We merged the following changes this month:

Thanks to @00xc for their contributions!

uart_16550

Maintained 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-num

Maintained by @mkroening

The endian-num crate provides the Be (big-endian) and Le (little-endian) byte-order-aware numeric types.

bootloader

Maintained 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

Maintained by @phil-opp, @josephlr, and @Freax13

The x86_64 crate provides various abstractions for x86_64 systems, including wrappers for CPU instructions, access to processor-specific registers, and abstraction types for architecture-specific structures such as page tables and descriptor tables.

We merged the following PR this month:

Thanks to @Wasabi375 for their contribution!

Other Projects

In this section, we describe updates to Rust OS projects that are not directly related to the rust-osdev organization. Feel free to create a pull request with the updates of your OS project for the next post.

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.

Join Us?

Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

]]>
This Month in Rust OSDev: June 2024 Wed, 10 Jul 2024 00:00:00 +0000 https://rust-osdev.com/this-month/2024-06/ https://rust-osdev.com/this-month/2024-06/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.

This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.

Announcements, News, and Blog Posts

Here we collect news, blog posts, etc. related to OS development in Rust.

Infrastructure and Tooling

In this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.

rust-osdev Projects

In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

uefi-rs

Maintained by @GabrielMajeri, @nicholasbishop, and @phip1611

The uefi-rs crate provides safe and performant wrappers for UEFI, the successor to the BIOS. We merged the following PRs this month:

Thanks to @LightAndLight, @andre-braga, and @JeffLi01 for their contributions!

bootloader

Maintained 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_types

Maintained 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 @IsaacWoods, @bjorn3, and @mkroening for their contributions!

x86_64

Maintained by @phil-opp, @josephlr, and @Freax13

The x86_64 crate provides various abstractions for x86_64 systems, including wrappers for CPU instructions, access to processor-specific registers, and abstraction types for architecture-specific structures such as page tables and descriptor tables.

We merged the following PR this month:

volatile

Maintained 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:

Other Projects

In this section, we describe updates to Rust OS projects that are not directly related to the rust-osdev organization. Feel free to create a pull request with the updates of your OS project for the next post.

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!

Join Us?

Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

]]>
This Month in Rust OSDev: May 2024 Sat, 08 Jun 2024 00:00:00 +0000 https://rust-osdev.com/this-month/2024-05/ https://rust-osdev.com/this-month/2024-05/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.

This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.

Announcements, News, and Blog Posts

Here we collect news, blog posts, etc. related to OS development in Rust.

Infrastructure and Tooling

In this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.

rust-osdev Projects

In 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-rs

Maintained by @GabrielMajeri, @nicholasbishop, and @phip1611

The uefi-rs crate provides safe and performant wrappers for UEFI, the successor to the BIOS. We merged the following PRs this month:

Thanks to @stillinbeta and @andre-braga for their contributions!

bootloader

Maintained 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_64

Maintained by @phil-opp, @josephlr, and @Freax13

The x86_64 crate provides various abstractions for x86_64 systems, including wrappers for CPU instructions, access to processor-specific registers, and abstraction types for architecture-specific structures such as page tables and descriptor tables.

We merged the following PRs this month:

Thanks to @Wasabi375 for their contribution!

multiboot2

Maintained 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-allocator

Maintained 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:

Other Projects

In this section, we describe updates to Rust OS projects that are not directly related to the rust-osdev organization. Feel free to create a pull request with the updates of your OS project for the next post.

mkroening/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());

Join Us?

Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

]]>
This Month in Rust OSDev: April 2024 Fri, 03 May 2024 00:00:00 +0000 https://rust-osdev.com/this-month/2024-04/ https://rust-osdev.com/this-month/2024-04/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.

This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.

Announcements, News, and Blog Posts

Here we collect news, blog posts, etc. related to OS development in Rust.

Infrastructure and Tooling

In this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.

rust-osdev Projects

In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

volatile

Maintained 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:

Thanks to @mkroening for their contributions!

uefi-rs

Maintained by @GabrielMajeri, @nicholasbishop, and @phip1611

The uefi-rs crate provides safe and performant wrappers for UEFI, the successor to the BIOS. 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:

Thanks to @sky5454 for their contributions!

ucs2-rs

Maintained by @GabrielMajeri, @nicholasbishop, and @phip1611

acpi

Maintained by @IsaacWoods

The acpi repository contains crates for parsing the ACPI tables – data structures that the firmware of modern computers use to relay information about the hardware to the OS. We merged the following changes this month:

Thanks to @rw-vanc for their contribution!

x86_64

Maintained by @phil-opp, @josephlr, and @Freax13

The x86_64 crate provides various abstractions for x86_64 systems, including wrappers for CPU instructions, access to processor-specific registers, and abstraction types for architecture-specific structures such as page tables and descriptor tables.

We merged the following PRs this month:

Thanks to @mkroening for their contributions!

bootloader

Maintained 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:

multiboot2

Maintained by @phip1611

The multiboot2 crate provides abstraction types for the multiboot information structure (MBI) of multiboot2 bootloaders. We merged the following changes this month:

Other Projects

In this section, we describe updates to Rust OS projects that are not directly related to the rust-osdev organization. Feel free to create a pull request with the updates of your OS project for the next post.

RatCornu/efs

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)
  • General interface for UNIX files and filesystems
  • read/write regular files
  • retrieve, add and remove directory entries directly from a path and a current working directory.

I hope you will find this useful! If you have any remark, idea or issue, do not hesitate to submit an issue!

phip1611/tar-no-std

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.

Join Us?

Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

]]>
This Month in Rust OSDev: March 2024 Wed, 10 Apr 2024 00:00:00 +0000 https://rust-osdev.com/this-month/2024-03/ https://rust-osdev.com/this-month/2024-03/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.

This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.

Announcements, News, and Blog Posts

Here we collect news, blog posts, etc. related to OS development in Rust.

Infrastructure and Tooling

In this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.

rust-osdev Projects

In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

acpi

Maintained by @IsaacWoods

The acpi repository contains crates for parsing the ACPI tables – data structures that the firmware of modern computers use to relay information about the hardware to the OS. We merged the following changes this month:

Thanks to @fslongjin and @rw-vanc for their contributions!

x86_64

Maintained by @phil-opp, @josephlr, and @Freax13

The x86_64 crate provides various abstractions for x86_64 systems, including wrappers for CPU instructions, access to processor-specific registers, and abstraction types for architecture-specific structures such as page tables and descriptor tables.

We merged the following PRs this month:

Thanks to @uglyoldbob, @GZTimeWalker, and @Sxmourai for their contributions!

bootloader

Maintained 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-rs

Maintained by @GabrielMajeri, @nicholasbishop, and @phip1611

pic8259

Maintained 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-prebuilt

Maintained 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:

volatile

Maintained 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:

Thanks to @nspin and @kadiwa4 for their contributions!

linked-list-allocator

Maintained 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-rs

Maintained by @GabrielMajeri, @nicholasbishop, and @phip1611

The uefi-rs crate provides safe and performant wrappers for UEFI, the successor to the BIOS. We merged the following PRs this month:

Other Projects

In this section, we describe updates to Rust OS projects that are not directly related to the rust-osdev organization. Feel free to create a pull request with the updates of your OS project for the next post.

No projects updates were submitted this month.

Join Us?

Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

]]>
This Month in Rust OSDev: February 2024 Thu, 07 Mar 2024 00:00:00 +0000 https://rust-osdev.com/this-month/2024-02/ https://rust-osdev.com/this-month/2024-02/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.

This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.

Announcements, News, and Blog Posts

Here we collect news, blog posts, etc. related to OS development in Rust.

Infrastructure and Tooling

In this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.

rust-osdev Projects

In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

x86_64

Maintained by @phil-opp, @josephlr, and @Freax13

The x86_64 crate provides various abstractions for x86_64 systems, including wrappers for CPU instructions, access to processor-specific registers, and abstraction types for architecture-specific structures such as page tables and descriptor tables.

We merged the following PRs this month:

uefi-rs

Maintained by @GabrielMajeri, @nicholasbishop, and @phip1611

The uefi-rs crate provides safe and performant wrappers for UEFI, the successor to the BIOS. We merged the following PRs this month:

Thanks to @bjorn3 for their contribution!

bootloader

Maintained 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 @vinc and @tsatke for their contributions!

Other Projects

In this section, we describe updates to Rust OS projects that are not directly related to the rust-osdev organization. Feel free to create a pull request with the updates of your OS project for the next post.

No projects updates were submitted this month.

Join Us?

Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

]]>
This Month in Rust OSDev: January 2024 Thu, 08 Feb 2024 00:00:00 +0000 https://rust-osdev.com/this-month/2024-01/ https://rust-osdev.com/this-month/2024-01/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.

This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.

Announcements, News, and Blog Posts

Here we collect news, blog posts, etc. related to OS development in Rust.

Infrastructure and Tooling

In this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.

rust-osdev Projects

In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

x86_64

Maintained by @phil-opp, @josephlr, and @Freax13

The x86_64 crate provides various abstractions for x86_64 systems, including wrappers for CPU instructions, access to processor-specific registers, and abstraction types for architecture-specific structures such as page tables and descriptor tables.

We merged the following PR this month:

We also merged the following changes into the next branch, which will be released as v0.15 soon:

bootloader

Maintained 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:

acpi

Maintained by @IsaacWoods

The acpi repository contains crates for parsing the ACPI tables – data structures that the firmware of modern computers use to relay information about the hardware to the OS. We merged the following changes this month:

Thanks to @Spartan2909 for their contribution!

uefi-rs

Maintained by @GabrielMajeri, @nicholasbishop, and @phip1611

The uefi-rs crate provides safe and performant wrappers for UEFI, the successor to the BIOS. We merged the following PRs this month:

Thanks to @gurry for their contribution!

Other Projects

In this section, we describe updates to Rust OS projects that are not directly related to the rust-osdev organization. Feel free to create a pull request with the updates of your OS project for the next post.

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:

Thanks to @acyanbird, @proudmuslim-dev, and @lachsdachs for their contributions!

Join Us?

Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

]]>
This Month in Rust OSDev: December 2023 Fri, 05 Jan 2024 00:00:00 +0000 https://rust-osdev.com/this-month/2023-12/ https://rust-osdev.com/this-month/2023-12/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.

This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.

Announcements, News, and Blog Posts

Here we collect news, blog posts, etc. related to OS development in Rust.

Infrastructure and Tooling

In this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.

rust-osdev Projects

In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

bootloader

Maintained 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 @mysteriouslyseeing for their contribution!

xhci

Maintained 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 @paulsohn for their contribution!

ovmf-prebuilt

Maintained 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-rs

Maintained by @GabrielMajeri, @nicholasbishop, and @phip1611

The uefi-rs crate provides safe and performant wrappers for UEFI, the successor to the BIOS. We merged the following PRs this month:

pci_types

Maintained 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:

acpi

Maintained by @IsaacWoods

The acpi repository contains crates for parsing the ACPI tables – data structures that the firmware of modern computers use to relay information about the hardware to the OS. We merged the following changes this month:

Thanks to @ytakano for their contributions!

multiboot2

Maintained 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_64

Maintained by @phil-opp, @josephlr, and @Freax13

The x86_64 crate provides various abstractions for x86_64 systems, including wrappers for CPU instructions, access to processor-specific registers, and abstraction types for architecture-specific structures such as page tables and descriptor tables.

We merged the following changes this month:

Other Projects

In this section, we describe updates to Rust OS projects that are not directly related to the rust-osdev organization. Feel free to create a pull request with the updates of your OS project for the next post.

Join Us?

Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

]]>
This Month in Rust OSDev: November 2023 Thu, 07 Dec 2023 00:00:00 +0000 https://rust-osdev.com/this-month/2023-11/ https://rust-osdev.com/this-month/2023-11/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.

This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.

Announcements, News, and Blog Posts

Here we collect news, blog posts, etc. related to OS development in Rust.

Infrastructure and Tooling

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 Projects

In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

uefi-rs

Maintained by @GabrielMajeri, @nicholasbishop, and @phip1611

The uefi-rs crate provides safe and performant wrappers for UEFI, the successor to the BIOS. We merged the following PRs this month:

Thanks to @RaitoBezarius for their contributions!

linked-list-allocator

Maintained 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!

pic8259

Maintained 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!

Other Projects

In this section, we describe updates to Rust OS projects that are not directly related to the rust-osdev organization. Feel free to create a pull request with the updates of your OS project for the next post.

No projects updates were submitted this month.

Join Us?

Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

]]>
This Month in Rust OSDev: October 2023 Mon, 06 Nov 2023 00:00:00 +0000 https://rust-osdev.com/this-month/2023-10/ https://rust-osdev.com/this-month/2023-10/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.

This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.

Announcements, News, and Blog Posts

Here we collect news, blog posts, etc. related to OS development in Rust.

Infrastructure and Tooling

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 Projects

In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

spinning_top

Maintained 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:

Features

Other

Thanks to @mkroening for their contributions!

uefi-rs

Maintained by @GabrielMajeri, @nicholasbishop, and @phip1611

The uefi-rs crate provides safe and performant wrappers for UEFI, the successor to the BIOS. We merged the following PRs this month:

Thanks to @JohnAZoidberg and @JarlEvanson for their contributions!

x86_64

Maintained by @phil-opp, @josephlr, and @Freax13

The x86_64 crate provides various abstractions for x86_64 systems, including wrappers for CPU instructions, access to processor-specific registers, and abstraction types for architecture-specific structures such as page tables and descriptor tables.

We merged the following changes this month:

Thanks to @Wasabi375, @joycebrum, and @mkroening for their contributions!

acpi

Maintained by @IsaacWoods

The acpi repository contains crates for parsing the ACPI tables – data structures that the firmware of modern computers use to relay information about the hardware to the OS. We merged the following changes this month:

Thanks to @alnyan for their contribution!

ovmf-prebuilt

Maintained 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!

bootloader

Maintained 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-allocator

Maintained 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!

Other Projects

In this section, we describe updates to Rust OS projects that are not directly related to the rust-osdev organization. Feel free to create a pull request with the updates of your OS project for the next post.

RavnOS

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]));

Join Us?

Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

]]>
This Month in Rust OSDev: September 2023 Thu, 05 Oct 2023 00:00:00 +0000 https://rust-osdev.com/this-month/2023-09/ https://rust-osdev.com/this-month/2023-09/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.

This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.

Announcements, News, and Blog Posts

Here we collect news, blog posts, etc. related to OS development in Rust.

Infrastructure and Tooling

In this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.

rust-osdev Projects

In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

multiboot2

Maintained by @phip1611

The multiboot2 was bumped from 0.18.1 to 0.19.0. The new release includes the ability to add custom tags to the MBI builder and a bugfix when parsing Multiboot strings, such as the command line from a Module tag.

For more details, please have a look at the changelog.

Thanks to @A0lson for their contribution that helped to fix the string parsing bug.

acpi

Maintained by @IsaacWoods

The acpi repository contains crates for parsing the ACPI tables – data structures that the firmware of modern computers use to relay information about the hardware to the OS.

This month, a new major version of acpi was published, offering greater control over how the crate allocates memory. Specifically, the new allocator_api and alloc features allow you to opt-out of allocation altogether (allowing the crate to be used from slimmer environments like bootloaders), or to provide your own allocator using the new (and still unstable) core::alloc::Allocator API. Enabling both features makes the crate behave very similarly to before, so migration should be relatively easy.

Because the acpi crate can now be used from environements without allocation, the rsdp crate has been deprecated, and all functionality moved into acpi. The rsdp crate will continue to work, but will not receive further updates. This should not affect users using rsdp to simply find the address of the RSDP, but is a breaking change as types that have been moved to acpi will no longer be usable across the crate boundary.

Some improvements were also made to the aml crate this month, adding functionality and improving our correctness

  • many thanks to our contributors!

We merged the following changes this month:

Thanks to @alnyan for their contributions!

x86_64

Maintained by @phil-opp, @josephlr, and @Freax13

The x86_64 crate provides various abstractions for x86_64 systems, including wrappers for CPU instructions, access to processor-specific registers, and abstraction types for architecture-specific structures such as page tables and descriptor tables.

We merged the following PR this month:

Thanks to @brandonchinn178 and @mkroening for their contributions!

uefi-rs

Maintained by @GabrielMajeri, @nicholasbishop, and @phip1611

The uefi-rs crate provides safe and performant wrappers for UEFI, the successor to the BIOS. We merged the following PRs this month:

Thanks to @JohnAZoidberg for their contribution!

Other Projects

In this section, we describe updates to Rust OS projects that are not directly related to the rust-osdev organization. Feel free to create a pull request with the updates of your OS project for the next post.

mkroening/interrupts

(Section written by @mkroening)

I created a dependency-free interrupts crate, allowing you to temporarily disable interrupts on AArch64, 64-bit RISC-V, and x86-64. Two different paradigms allow you to run code without interrupts and synchronize with interrupt handlers running on the same hardware thread (core):

Use disable to disable interrupts with a guard:

// interrupts may or may not be enabled
let guard = interrupts::disable();
// interrupts are disabled
drop(guard);
// interrupts are restored to the previous state

Use without (similar to x86_64::instructions::interrupts::without_interrupts) to run a closure with disabled interrupts:

// interrupts may or may not be enabled
interrupts::without(|| {
    // interrupts are disabled
});
// interrupts are restored to the previous state

I would appreciate you dropping by and giving it a try. :)

Join Us?

Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

]]>
This Month in Rust OSDev: August 2023 Wed, 06 Sep 2023 00:00:00 +0000 https://rust-osdev.com/this-month/2023-08/ https://rust-osdev.com/this-month/2023-08/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.

This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.

Announcements, News, and Blog Posts

Here we collect news, blog posts, etc. related to OS development in Rust.

Redox Summer of Code

Infrastructure and Tooling

In this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.

rust-osdev Projects

In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

uefi-rs

Maintained by @GabrielMajeri, @nicholasbishop, and @phip1611

The uefi-rs crate provides safe and performant wrappers for UEFI, the successor to the BIOS. We merged the following PRs this month:

Thanks to @cmoylan and @julic20s for their contributions!

bootloader

Maintained 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 @frisoft, @devsnek, and @kuzeyardabulut for their contributions!

x86_64

Maintained by @phil-opp, @josephlr, and @Freax13

The x86_64 crate provides various abstractions for x86_64 systems, including wrappers for CPU instructions, access to processor-specific registers, and abstraction types for architecture-specific structures such as page tables and descriptor tables.

We merged the following PR this month:

Thanks to @tsoutsman, @NathanKolpa, and @xzmeng for their contributions!

acpi

Maintained by @IsaacWoods

The acpi repository contains crates for parsing the ACPI tables – data structures that the firmware of modern computers use to relay information about the hardware to the OS. We merged the following changes this month:

Thanks to @alnyan for their contributions!

uart_16550

Maintained 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!

Other Projects

In this section, we describe updates to Rust OS projects that are not directly related to the rust-osdev organization. Feel free to create a pull request with the updates of your OS project for the next post.

mkroening/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!

Join Us?

Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

]]>
This Month in Rust OSDev: July 2023 Fri, 04 Aug 2023 00:00:00 +0000 https://rust-osdev.com/this-month/2023-07/ https://rust-osdev.com/this-month/2023-07/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.

This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.

Announcements, News, and Blog Posts

Here we collect news, blog posts, etc. related to OS development in Rust.

Infrastructure and Tooling

In this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.

rust-osdev Projects

In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

multiboot2

Maintained by @phip1611

The multiboot2 was bumped from 0.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-rs

Maintained by @GabrielMajeri, @nicholasbishop, and @phip1611

The uefi-rs crate provides safe and performant wrappers for UEFI, the successor to the BIOS. We merged the following PRs this month:

Thanks to @devsnek for their contribution!

xhci

Maintained 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_64

Maintained by @phil-opp, @josephlr, and @Freax13

The x86_64 crate provides various abstractions for x86_64 systems, including wrappers for CPU instructions, access to processor-specific registers, and abstraction types for architecture-specific structures such as page tables and descriptor tables.

We merged the following PR this month:

Thanks to @SamZhang3 for their contribution!

bootloader

Maintained 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-prebuilt

Maintained 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!

Other Projects

In this section, we describe updates to Rust OS projects that are not directly related to the rust-osdev organization. Feel free to create a pull request with the updates of your OS project for the next post.

SFBdragon/talc

(Section written by @SFBdragon)

Talc is a recently published, fast, and flexible no-std memory allocator.

  • It's the fastest allocator I've tested as of yet (galloc falls short, buddy_alloc is close but lacks heap efficiency).
  • It features a OOM-handling component with dynamic arena resizing.

By the time you're seeing this, hopefully v2 should be out or coming soon:

  • The OOM handler system has been made more powerful.
  • lock_api is used to allow for custom allocator synchronization.
  • The internals and API has been improved to pass miri's stacked borrows validation.
  • You can now move the allocator struct around freely.
  • And more :3

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:

Join Us?

Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

]]>
This Month in Rust OSDev: June 2023 Thu, 06 Jul 2023 00:00:00 +0000 https://rust-osdev.com/this-month/2023-06/ https://rust-osdev.com/this-month/2023-06/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.

This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.

Announcements, News, and Blog Posts

Here we collect news, blog posts, etc. related to OS development in Rust.

Infrastructure and Tooling

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 Projects

In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

volatile

Maintained 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.

multiboot2

Maintained by @phip1611

The multiboot2 and the multiboot2-header crates got a big overhaul. The list of new features includes but is not limited to:

  • use DSTs for tags where applicable (#134)
  • model the MBI as DST (#155)
  • add a runtime builder for an MBI (#133)
    Huge thanks to YtvwlD / Niklas for this great external contribution
  • added an integration test including a multiboot2 chainloader for better test coverage (#129)
  • added miri to the CI for more memory safety (#128)
  • several fixes and small improvements

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.

Merged pull requests:

Thanks to @YtvwlD and @scholzp for their contributions!

x86_64

Maintained by @phil-opp, @josephlr, and @Freax13

The x86_64 crate provides various abstractions for x86_64 systems, including wrappers for CPU instructions, access to processor-specific registers, and abstraction types for architecture-specific structures such as page tables and descriptor tables.

We merged the following changes this month:

Thanks to @Qix-, @grant0417, and @Egggggg for their contributions!

vga

Maintained by @RKennedy9064

The work-in-progress vga crate allows the configuration of the VGA hardware, e.g. switching from text-based mode to a pixel-based graphics mode. This month, we merged the following pull request:

Thanks to @tsatke for their contribution!

uefi-rs

Maintained 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:

Thanks to @medhefgo for their contribution!

Other Projects

In this section, we describe updates to Rust OS projects that are not directly related to the rust-osdev organization. Feel free to create a pull request with the updates of your OS project for the next post.

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! 🤯

We'd love if you gave Hermit a try. Just start with our "Hello, World!" application template: hermitcore/rusty-demo.

Join Us?

Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

]]>
CLUU (Compact Lightweight Unix Utopia) Wed, 14 Jun 2023 00:00:00 +0000 https://rust-osdev.com/showcase/cluu/ https://rust-osdev.com/showcase/cluu/

License Documentation Repository

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.

Motivation

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.

Project Information

CLUU draws inspiration from the following operating systems:

  • Plan 9: Plan 9 from Bell Labs is a distributed operating system developed at Bell Labs in the late 1980s. It provides a unique approach to system organization, with a focus on simplicity and distributed computing.
  • BSD: FreeBSD is a modern, advanced operating system for x86 and ARM architectures. It offers a rich feature set and has a long history of stability and reliability.

As well as heavily influenced by the following projects:

  • RedoxOS: RedoxOS is an operating system written in Rust, aiming to bring the innovations of Rust to a modern microkernel and full set of applications. It's fair to say it is the most advanced of all Rust OS-es.
  • k4dos: k4dos is another hobby-os of that sort, it's fairly cool, with userspace, that can run FreeDoom for example. It has a nice shell implementation: kash
  • blog_os: blog_os is a cutting-edge project by Philipp Oppermann that provides a detailed tutorial on building an operating system in Rust. It covers various aspects, including the bootloader, memory management, and device drivers.

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.

Current State and Goals

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:

  • UART16550 driver: A driver for UART16550, allowing communication with the serial port for debugging and logging purposes.
  • Preparation for PIO and MMIO: The groundwork has been laid for implementing both Programmed I/O (PIO) and Memory-Mapped I/O (MMIO) for interacting with hardware devices.
  • Framebuffer driver: A driver for the framebuffer, providing a graphical output display.
  • Simple graphics and writing: Basic graphical capabilities have been implemented, allowing for drawing and writing on the screen using a PSF font.
  • Basic Logging framework: A basic logging framework has been developed to facilitate debugging and information output during the development process.

Screencheck serial_output

As the project progresses, the focus will shift towards implementing additional features, such as:

  • Kernel Implementation: Further development of the microkernel's core functionality, including process management, interprocess communication, and resource management.
  • Device Drivers: Continued development of drivers for essential hardware components, including keyboard, storage devices, and other peripherals.
  • Filesystem Support: Introducing filesystem support to enable file I/O operations and provide a foundation for user-level processes and applications.

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.

License

CLUU is licensed under the MIT License. See LICENSE for more information.

]]>
This Month in Rust OSDev: May 2023 Tue, 06 Jun 2023 00:00:00 +0000 https://rust-osdev.com/this-month/2023-05/ https://rust-osdev.com/this-month/2023-05/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.

This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.

Infrastructure and Tooling

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.

Announcements, News, and Blog Posts

Here we collect news, blog posts, etc. related to OS development in Rust.

rust-osdev Projects

In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

uefi-rs

Maintained by @GabrielMajeri, @nicholasbishop, and @phip1611

Thanks to @RaitoBezarius and @medhefgo for their contributions!

multiboot2

Maintained by @IsaacWoods, @phip1611, @robert-w-gries, @ahmedcharles, and @Caduser2020

Thanks to @YtvwlD for their contributions!

vga

Maintained by @RKennedy9064

Thanks to @tsatke for their contribution!

ovmf-prebuilt

Maintained by @phil-opp

Thanks to @nicholasbishop for this contribution!

acpi

Maintained by @IsaacWoods

Thanks to @YtvwlD, @semiviral, and @A0lson for their contributions!

pci_types

Maintained by @IsaacWoods

Thanks to @stlankes for their contributions!

bootloader

Maintained by @phil-opp

Thanks to @mgr0dzicki for their contributions!

Other Projects

In this section, we describe updates to Rust OS projects that are not directly related to the rust-osdev organization. Feel free to create a pull request with the updates of your OS project for the next post.

phil-opp/blog_os

(Section written by @phil-opp)

We merged 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 :).

Join Us?

Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

]]>
This Month in Rust OSDev: April 2023 Fri, 05 May 2023 00:00:00 +0000 https://rust-osdev.com/this-month/2023-04/ https://rust-osdev.com/this-month/2023-04/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.

This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.

Infrastructure and Tooling

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.

Announcements, News, and Blog Posts

Here we collect news, blog posts, etc. related to OS development in Rust.

rust-osdev Projects

In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

uefi-rs

Maintained by @GabrielMajeri, @nicholasbishop, and @phip1611

Features

Docs

Other

Thanks to @JohnAZoidberg and @felipebalbi for their contributions!

bootloader

Maintained by @phil-opp

Thanks to @kennystrawnmusic and @JarlEvanson for their contributions!

pic8259

Maintained by @phil-opp

Thanks to @rasheedmhd for their contributions!

x86_64

Maintained by @phil-opp, @josephlr, and @Freax13

acpi

Maintained by @IsaacWoods

Thanks to @A0lson, and @rw-vanc for their contributions!

ucs2-rs

Maintained by @GabrielMajeri, @nicholasbishop, and @phip1611

Other Projects

In this section, we describe updates to Rust OS projects that are not directly related to the rust-osdev organization. Feel free to create a pull request with the updates of your OS project for the next post.

phil-opp/blog_os

(Section written by @phil-opp)

We merged the following changes to the Writing an OS in Rust blog this month:

I 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.

Join Us?

Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

]]>
This Month in Rust OSDev: March 2023 Sat, 08 Apr 2023 00:00:00 +0000 https://rust-osdev.com/this-month/2023-03/ https://rust-osdev.com/this-month/2023-03/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.

This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.

Infrastructure and Tooling

In this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.

Announcements, News, and Blog Posts

Here we collect news, blog posts, etc. related to OS development in Rust.

rust-osdev Projects

In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

multiboot2

Maintained by @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.

CI Refactoring

In the CI, we want to run many tests that cover a big portion of the cartesian product of the following properties:

  • rust version: stable, nightly, msrv
  • type: build, test, style check
  • target: default, no_std

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-rs

Maintained by @GabrielMajeri, @nicholasbishop, and @phip1611

Features

Other Improvements

Docs

CI & Testing

show changes

Dependencies

show changes

    Thanks to @hughsie, @nicholasbishop, @JohnAZoidberg, @phip1611, @JarlEvanson, and @dependabot[bot] for their contributions!

    x86_64

    Maintained by @phil-opp, @josephlr, and @Freax13

    Thanks to @joycebrum for their contributions!

    acpi

    Maintained by @IsaacWoods

    Thanks to @A0lson, @rcerc, and @rw-vanc for their contributions!

    pci_types

    Maintained by @IsaacWoods

    Thanks to @devsnek for their contributions!

    bootloader

    Maintained by @phil-opp

    Thanks to @jasoncouture for their contributions!

    vga

    Maintained by @RKennedy9064

    Thanks to @bendudson for their contributions!

    pic8259

    Maintained by @phil-opp

    Thanks to @Virux for their contributions!

    volatile

    Maintained by @phil-opp

    Thanks to @joycebrum for their contributions!

    Other Projects

    In this section, we describe updates to Rust OS projects that are not directly related to the rust-osdev organization. Feel free to create a pull request with the updates of your OS project for the next post.

    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.

    Screenshot: Paging Calculator CLI Utility

    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!

    Join Us?

    Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

    ]]>
    This Month in Rust OSDev: February 2023 Wed, 08 Mar 2023 00:00:00 +0000 https://rust-osdev.com/this-month/2023-02/ https://rust-osdev.com/this-month/2023-02/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.

    This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.

    Infrastructure and Tooling

    In this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.

    rust-lang/rust

    Cargo: Add '-C' flag for changing current dir before build

    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.

    Announcements, News, and Blog Posts

    Here we collect news, blog posts, etc. related to OS development in Rust.

    rust-osdev Projects

    In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

    uefi-rs

    bootloader

    acpi

    Thanks to @rw-vanc for their contributions!

    spinning_top

    Thanks to @jannic for this contribution!

    linked-list-allocator

    Thanks to @jannic for this contribution!

    Other Projects

    In this section, we describe updates to Rust OS projects that are not directly related to the rust-osdev organization. Feel free to create a pull request with the updates of your OS project for the next post.

    phil-opp/blog_os

    (Section written by @phil-opp)

    We merged the following changes to the Writing an OS in Rust blog this month:

    Join Us?

    Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

    ]]>
    This Month in Rust OSDev: January 2023 Tue, 07 Feb 2023 00:00:00 +0000 https://rust-osdev.com/this-month/2023-01/ https://rust-osdev.com/this-month/2023-01/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.

    This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.

    Infrastructure and Tooling

    In this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.

    Announcements, News, and Blog Posts

    rust-osdev Projects

    In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

    bootloader

    Maintained 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:

    Features

    Fixes

    Docs

    Other

    Thanks to @jasoncouture, @Stary2001, @AlexJMohr, @Freax13, @tsoutsman, and @asensio-project for their contributions!

    uefi-rs

    Maintained 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:

    Features

    Fixes

    Docs

    Other

    Thanks to @nsemmel and @liferooter for their contributions!

    volatile

    Maintained 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:

    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_64

    Maintained by @phil-opp, @josephlr, @Freax13, and @rybot666

    The x86_64 crate provides various abstractions for x86_64 systems, including wrappers for CPU instructions, access to processor-specific registers, and abstraction types for architecture-specific structures such as page tables and descriptor tables.

    We merged the following changes in January:

    Other Projects

    In this section, we describe updates to Rust OS projects that are not directly related to the rust-osdev organization. Feel free to create a pull request with the updates of your OS project for the next post.

    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!

    Join Us?

    Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

    ]]>
    This Month in Rust OSDev: December 2022 Mon, 09 Jan 2023 00:00:00 +0000 https://rust-osdev.com/this-month/2022-12/ https://rust-osdev.com/this-month/2022-12/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.

    This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.

    Infrastructure and Tooling

    In this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.

    Experimental feature gate proposal interoperable_abi

    This 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 stabilized

    On 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.

    Announcements, News, and Blog Posts

    rust-osdev Projects

    In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

    uefi-rs

    Maintained 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:

    Features

    Fixes

    Docs

    Tooling

    Thanks to @veluca93, @phip1611, and @raccog for their contributions!

    x86_64

    Maintained by @phil-opp, @josephlr, @Freax13, and @rybot666

    The x86_64 crate provides various abstractions for x86_64 systems, including wrappers for CPU instructions, access to processor-specific registers, and abstraction types for architecture-specific structures such as page tables and descriptor tables.

    We merged the following changes in December:

    Thanks to @TornaxO7 for their contribution!

    Call for Participation

    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.

    Other Projects

    In this section, we describe updates to Rust OS projects that are not directly related to the rust-osdev organization. Feel free to create a pull request with the updates of your OS project for the next post.

    Theseus OS

    (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:

    • Introduced dreadnought, a basic async executor that brings Rust's async/await syntax to Theseus
      • Usable by both applications and low-level kernel components
      • Integrated the concept of wakers with Theseus's native task subsystem
      • Currently, there is a 1-to-1 relationship between async dreadnought tasks and native Theseus tasks
    • Rewrote our networking interface to offer better, simpler, and cleaner abstractions
      • It now supports the latest smoltcp version, 0.8
    • Added support for booting Theseus on UEFI
      • Previously, Theseus could boot from only multiboot2-compliant bootloaders using legacy BIOS
      • UEFI on x86_64 now successfully boots after significant redesign of early bootstrap routines
      • New custom uefi_loader tool, loosely based on the rust-osdev org's bootloader project
      • Early graphical display for basic text printing is a work-in-progress
      • UEFI is required to boot Theseus on aarch64; this is also a work-in-progress
    • Almost completed porting core subsystems to aarch64
      • Bootstrap and logging over UART
      • Memory management: page table modification, arch-agnostic PTE flags and basic memory types, etc
      • Basic context switching and task bootstrap
      • SMP multicore, plus identification of CPU cores
      • Interrupt handling via GIC
    • Redesigned the drivers for PS/2 controller, keyboard, and mouse in an intralingual manner that fully leverages Rust's strong type system.
    • Started implementing a brand new graphics stack and window manager, Porthole, from scratch
      • Added support for x86's Page Attribute Table, which allows Theseus to control the caching properties of individual memory pages
      • We now map graphics video memory as write-combining instead of cache-disabled, which significantly improves performance
    • Redesigned task management to give arbitrary tasks fewer privileges
      • Two new types: JoinableTaskRef and ExitableTaskRef
        • JoinableTaskRef is similar to std::task::JoinHandle, but is fully safe
          • Ensures that a task can only be joined by the "parent" task that spawned it
          • Remove distinction between joining a task and obtaining its ExitValue
          • Automatically reaps "orphan" tasks that are no longer joinable
        • ExitableTaskRef statically ensures that only a task itself can mark itself as exited
          • Now, a given task can no longer invalidly mark another arbitrary task as exited
      • Refactored scheduler and task switching to not hold any TaskRefs during a context switch
        • Ensures that exited tasks are dropped and cleaned up expediently
      • Native ELF Thread-Local Storage (TLS) variables are used to store the current task
        • Accessing the current task is much faster, albeit slightly more complicated to initialize
    • Implemented a new shell called hull, plus new terminal, console, and TTY components
      • Theseus can now run headlessly, e.g., interactively over a serial port instead of via a graphical display.
    • Removed usage of 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
        • Accepts a Mutability type parameter for either immutable (&T) or mutable (&mut T) borrowing
        • Sister type BorrowedSliceMappedPages also supports dynamically-sized slices, i.e., &[T] and &mut [T]
        • Much more efficient than owning_ref because MappedPages is always pinned in memory, avoiding the need for Box allocation
      • dereffer: 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
        • Supports much more arbitrary and complex deref functions than std::ops::Deref
    • Canonicalized the content of Theseus's x86_64-unknown-theseus target spec
      • Codegen flags are now moved into the target spec, making out-of-tree builds easier and more repeatable
      • Target specs are now ready to be upstreamed into rustc as built-in targets
    • owned_borrowed_trait: a new library crate that abstracts over Owned values vs. Borrowed refs
      • Uses traits and marker types instead of the existing enum-based designs (like Cow)
      • Doesn't require Clone or care about any characteristics of the inner type T
      • Allows you to use generics and associated consts to conditionally branch based on whether an owned value or borrowed reference was passed into a function
      • Allows you to return a different (generic) type from a function based on whether an owned value or borrowed reference was passed in

    Check 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.

    Aero

    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:

    Join Us?

    Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

    ]]>
    This Month in Rust OSDev: November 2022 Wed, 07 Dec 2022 00:00:00 +0000 https://rust-osdev.com/this-month/2022-11/ https://rust-osdev.com/this-month/2022-11/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.

    This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.

    We have some new sections this month, we hope you like the content!

    Infrastructure and Tooling

    In this section, we collect recent updates to rustc, cargo, and other tooling that are relevant to Rust OS development.

    UEFI Targets are now Tier 2

    (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.

    Announcements, News, and Blog Posts

    rust-osdev Projects

    In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

    bootloader

    Maintained 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:

    • Separate API crate: The bootloader is now split into two parts: A 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.
    • New config system: Instead of configuring the bootloader via a special table in the 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.
    • Load the kernel at runtime: Up to version 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.
    • Split into sub-crates: Since the bootloader build process does not need access to the kernel executable or its 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.)
    • Library to create disk images: To create an abstraction the complex build steps of the different bootloader executables, we compile them inside cargo build scripts. At the top level, we provide a 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-rs

    Maintained by @GabrielMajeri, @nicholasbishop, and @phip1611

    Features

    Docs

    Internal

    Thanks to @blitz, @YtvwlD, @timrobertsdev, @NathanRoyer, and @d-sonuga for their contributions!

    linked-list-allocator

    Maintained 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!

    acpi

    Maintained by @IsaacWoods

    Thanks to @semiviral for their contribution!

    Call for Participation

    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.

    Other Projects

    In this section, we describe updates to Rust OS projects that are not directly related to the rust-osdev organization. Feel free to create a pull request with the updates of your OS project for the next post.

    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:

    • a function for running a closure without interrupts
    • a simple spinlock with exponential backoff
    • a fair ticket lock with exponential backoff
    • 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.

    Join Us?

    Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

    ]]>
    This Month in Rust OSDev: October 2022 Mon, 07 Nov 2022 00:00:00 +0000 https://rust-osdev.com/this-month/2022-10/ https://rust-osdev.com/this-month/2022-10/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.

    This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.

    rust-osdev Projects

    In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

    uefi-rs

    Maintained by @GabrielMajeri, @nicholasbishop, and @phip1611

    Thanks to @timrobertsdev and @raccog for their contributions!

    linked-list-allocator

    Maintained by @phil-opp and @jamesmunns

    Thanks to @evanrichter for their contribution!

    bootloader

    Maintained by @phil-opp, @rybot666, and @64

    We merged the following changes this month:

    Thanks to @phip1611, and @Freax13 for their contributions!

    acpi

    Maintained 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!

    Call for Participation

    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.

    Other Projects

    In this section, we describe updates to Rust OS projects that are not directly related to the rust-osdev organization. Feel free to create a pull request with the updates of your OS project for the next post.

    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.

    Talk on Windows Linked Lists in safe and idiomatic Rust

    (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!

    Preview of video: Windows linked lists in safe and idiomatic Rust - Colin Finck - EuroRust 2022

    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:

    Other News

    Join Us?

    Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

    ]]>
    This Month in Rust OSDev: September 2022 Fri, 07 Oct 2022 00:00:00 +0000 https://rust-osdev.com/this-month/2022-09/ https://rust-osdev.com/this-month/2022-09/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.

    This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.

    rust-osdev Projects

    In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

    bootloader

    Maintained by @phil-opp, @rybot666, and @64

    The bootloader crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables.

    We 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:

    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:

    uefi-rs

    Maintained by @GabrielMajeri, @nicholasbishop, and @phip1611

    Thanks to @ColinFinck for their contribution!

    xhci

    Maintained 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!

    Call for Participation

    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.

    Other Projects

    In this section, we describe updates to Rust OS projects that are not directly related to the rust-osdev organization. Feel free to create a pull request with the updates of your OS project for the next post.

    Theseus OS

    (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:

    Check 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:

    Thanks to @shimomura1004, @woodyZootopia, @bolded, and @Firenezz for their contributions!

    Join Us?

    Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

    ]]>
    This Month in Rust OSDev: August 2022 Tue, 06 Sep 2022 00:00:00 +0000 https://rust-osdev.com/this-month/2022-08/ https://rust-osdev.com/this-month/2022-08/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.

    This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.

    rust-osdev Projects

    In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

    uefi-rs

    Maintained 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:

    We also published a subset of the above changes as a new v0.16.1 release:

    Thanks to @kendase3, @JonahPlusPlus, and @e820 for their contributions!

    bootloader

    Maintained by @phil-opp, @rybot666, and @64

    The bootloader crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables.

    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:

    All 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-allocator

    Maintained 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:

    • Initializing a heap with a size smaller than size_of::<usize> * 3 could result in an out-of-bounds write too.
    • Calling extend on an uninitialized heap could also result in an out-of-bounds write.
    • Calling 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:

    • The initialization functions now panic if the given size is not large enough to store the necessary metadata. Depending on the alignment of the heap bottom pointer, the minimum size is between 2 * size_of::<usize> and 3 * size_of::<usize>.
    • The extend method now panics when trying to extend an uninitialized heap.
    • Extend calls with a size smaller than 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.
    • The 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.

    xhci

    Maintained by @toku-sa-n

    The xhci crate provides types of xHCI structures, such as Registers and TRBs.

    We merged the following changes this month:

    Thanks to @Demindiro for their contribution!

    pci_types

    Maintained 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!

    acpi

    Maintained 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!

    Call for Participation

    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.

    Other Projects

    In this section, we describe updates to Rust OS projects that are not directly related to the rust-osdev organization. Feel free to create a pull request with the updates of your OS project for the next post.

    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!

    Blog Post: GNU ld Discards Section Containing Code – Section Flags in Assembly are Important

    (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!

    Join Us?

    Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

    ]]>
    This Month in Rust OSDev: July 2022 Wed, 10 Aug 2022 00:00:00 +0000 https://rust-osdev.com/this-month/2022-07/ https://rust-osdev.com/this-month/2022-07/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.

    This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.

    rust-osdev Projects

    In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

    uefi-rs

    Maintained 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:

    x86_64

    Maintained by @phil-opp, @josephlr, @Freax13, and @rybot666

    The x86_64 crate provides various abstractions for x86_64 systems, including wrappers for CPU instructions, access to processor-specific registers, and abstraction types for architecture-specific structures such as page tables and descriptor tables.

    In July, we merged the following changes:

    Thanks to @Zildj1an for their contribution!

    xhci

    Maintained by @toku-sa-n

    The xhci crate provides types of xHCI structures, such as Registers and TRBs.

    We merged the following changes this month:

    Thanks to @Demindiro and @ytoml for their contributions!

    Call for Participation

    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.

    Other Projects

    In this section, we describe updates to Rust OS projects that are not directly related to the rust-osdev organization. Feel free to create a pull request with the updates of your OS project for the next post.

    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!

    Theseus OS

    (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:

    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:

    Using WinDbg to traverse a Windows Linked List created by the nt-list Rust crate

    If you want to give it a spin, the crate is available on crates.io, and make sure to also check the docs.

    Comparison between 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.

    Join Us?

    Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

    ]]>
    This Month in Rust OSDev: June 2022 Sun, 10 Jul 2022 00:00:00 +0000 https://rust-osdev.com/this-month/2022-06/ https://rust-osdev.com/this-month/2022-06/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.

    This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.

    Project Updates

    In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

    linked-list-allocator

    Maintained 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:

    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!

    multiboot2

    Maintained 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-rs

    Maintained 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:

    Fixes

    Improvements

    Internal changes

    bootloader

    Maintained by @phil-opp, @rybot666, and @64

    The bootloader crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables. This month, we made more progress on the upcoming v0.11 version:

    x86_64

    Maintained by @phil-opp, @josephlr, @Freax13, and @rybot666

    The x86_64 crate provides various abstractions for x86_64 systems, including wrappers for CPU instructions, access to processor-specific registers, and abstraction types for architecture-specific structures such as page tables and descriptor tables.

    In June, we merged the following pull request:

    Thanks to @mkroening for this contribution!

    cargo-xbuild

    Maintained 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:

    Call for Participation

    Want to contribute to a Rust OSDev project, but don't know where to start? Pick up one of these outstanding issues in one of our projects and get started!

    • (rust-osdev/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.

    Other Projects

    In this section, we describe updates to Rust OS projects that are not directly related to the rust-osdev organization. Feel free to create a pull request with the updates of your OS project for the next post.

    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 specification
    • gpt_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:

    Join Us?

    Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

    ]]>
    This Month in Rust OSDev: May 2022 Wed, 08 Jun 2022 00:00:00 +0000 https://rust-osdev.com/this-month/2022-05/ https://rust-osdev.com/this-month/2022-05/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.

    This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.

    Project Updates

    In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

    uefi-rs

    Maintained by @GabrielMajeri and @nicholasbishop

    The uefi crate provides safe and performant wrappers for UEFI, the successor to the BIOS.

    We merged the following changes in May:

    Improvements

    Fixes

    Thanks to @JonahPlusPlus, @raccog, and @verticalegg for their contributions!

    bootloader

    Maintained by @phil-opp, @rybot666, and @64

    The bootloader crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables. 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_types

    The 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!

    xhci

    Maintained 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!

    Call for Participation

    Want to contribute to a Rust OSDev project, but don't know where to start? Pick up one of these outstanding issues in one of our projects and get started!

    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.

    Other Projects

    In this section, we describe updates to Rust OS projects that are not directly related to the rust-osdev organization. Feel free to create a pull request with the updates of your OS project for the next post.

    No projects were proposed for this section this month.

    Join Us?

    Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

    ]]>
    This Month in Rust OSDev: April 2022 Sat, 07 May 2022 00:00:00 +0000 https://rust-osdev.com/this-month/2022-04/ https://rust-osdev.com/this-month/2022-04/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.

    This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.

    Project Updates

    In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

    x86_64

    Maintained by @phil-opp, @josephlr, @Freax13, and @rybot666

    The x86_64 crate provides various abstractions for x86_64 systems, including wrappers for CPU instructions, access to processor-specific registers, and abstraction types for architecture-specific structures such as page tables and descriptor tables.

    In 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-rs

    Maintained 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:

    Features

    Bug fixes

    CI and linting

    Documentation improvements

    Thanks to @supdrewin, @nicholasbishop and @raccog for their contributions!

    bootloader

    Maintained by @phil-opp, @rybot666, and @64

    The bootloader crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables. 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:

    The 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.

    multiboot2

    Maintained 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-header

    Maintained 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_16550

    Maintained 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 @josephlr for this contribution!

    volatile

    Maintained 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:

    Thanks to @hawkw for this contribution!

    xhci

    Maintained 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!.

    Call for Participation

    Want to contribute to a Rust OSDev project, but don't know where to start? Pick up one of these outstanding issues in one of our projects and get started!

    If you maintain a Rust project related to operating system development and are looking for contributors, especially for tasks suited to people getting started in this space, please create a PR against the next branch with the tasks you want to include in the next issue.

    Other Projects

    In this section, we describe updates to Rust OS projects that are not directly related to the rust-osdev organization. Feel free to create a pull request with the updates of your OS project for the next post.

    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.

    Join Us?

    Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

    ]]>
    This Month in Rust OSDev: March 2022 Thu, 07 Apr 2022 00:00:00 +0000 https://rust-osdev.com/this-month/2022-03/ https://rust-osdev.com/this-month/2022-03/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.

    This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.

    Project Updates

    In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

    x86_64

    Maintained by @phil-opp, @josephlr, @Freax13, and @rybot666

    The x86_64 crate provides various abstractions for x86_64 systems, including wrappers for CPU instructions, access to processor-specific registers, and abstraction types for architecture-specific structures such as page tables and descriptor tables.

    This month, we released version 0.14.9 of the x86_64 crate with lots of improvements:

    New Features

    Already merged last month:

    Bug fixes and Documentation

    Thanks to @jarkkojs, @drzewiec, and @kevinaboos for contributing to this release!

    v0.15

    We also merged some breaking changes which will be published in the upcoming v0.15 release:

    Special thanks to our co-maintainer @josephlr, who did a lot of great work this month!

    uefi-rs

    Maintained by @GabrielMajeri and @nicholasbishop

    The uefi crate provides safe and performant wrappers for UEFI, the successor to the BIOS.

    One of the pain points of developers building software using uefi-rs has been the Completion type, which is like an expanded Result type which also handles warnings (besides successes and errors). 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:

    New features/protocols

    Refactorings

    Bug fixes

    CI & testing

    Misc & chores

    Thanks to @nicholasbishop, @sven-eliasen, @necauqua and @AtsukiTak for their contributions!

    uart_16550

    Maintained 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:

    Thanks to @tsatke for this contribution!

    xhci

    Maintained 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:

    Call for Participation

    Want to contribute to a Rust OSDev project, but don't know where to start? Pick up one of these outstanding issues in one of our projects and get started!

    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.

    Other Projects

    In this section, we describe updates to Rust OS projects that are not directly related to the rust-osdev organization. Feel free to create a pull request with the updates of your OS project for the next post.

    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!

    Join Us?

    Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

    ]]>
    This Month in Rust OSDev: February 2022 Sun, 06 Mar 2022 00:00:00 +0000 https://rust-osdev.com/this-month/2022-02/ https://rust-osdev.com/this-month/2022-02/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.

    This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.

    Project Updates

    In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

    uefi-rs

    Maintained by @GabrielMajeri and @nicholasbishop

    The uefi crate provides safe and performant wrappers for UEFI, the successor to the BIOS.

    One of the pain points of developers building software using uefi-rs has been the Completion type, which is like an expanded Result type which also handles warnings (besides successes and errors). There's an open proposal to drop this type and revert to using more standard Results everywhere, by treating all warnings as errors. Initial feedback suggests that such a change would be beneficial to the project, but comments and suggestions are welcome on the linked issue.

    We merged the following changes in February:

    Thanks to @nicholasbishop, @Stzx, @avirule and @AtsukiTak for their contributions!

    x86_64

    Maintained by @phil-opp, @josephlr, @Freax13, and @rybot666

    The x86_64 crate provides various abstractions for x86_64 systems, including wrappers for CPU instructions, access to processor-specific registers, and abstraction types for architecture-specific structures such as page tables and descriptor tables.

    In February, we merged the following pull requests:

    We also merged a few breaking changes, which will be part of the upcoming v0.15 release:

    bootloader

    Maintained by @phil-opp, @rybot666, and @64

    The bootloader crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables.

    We merged the following changes this month:

    Thanks to @Freax13 and @kennystrawnmusic for their contributions!

    We also pushed a big restructuring to the next branch, which will become the v0.11 version eventually. The branch is still in an experimental state and not documented yet, so it's probably a bit early to try it out. But we are making good progress!

    vga

    Maintained by @RKennedy9064

    The work-in-progress vga crate allows the configuration of the VGA hardware, e.g. switching from text-based mode to a pixel-based graphics mode. This month, we merged the following pull request:

    Thanks to @clavierpaul for this contribution!

    Call for Participation

    Want to contribute to a Rust OSDev project, but don't know where to start? Pick up one of these outstanding issues in one of our projects and get started!

    If you maintain a Rust project related to operating system development and are looking for contributors, especially for tasks suited to people getting started in this space, please create a PR against the next branch with the tasks you want to include in the next issue.

    Other Projects

    In this section, we describe updates to Rust OS projects that are not directly related to the rust-osdev organization. Feel free to create a pull request with the updates of your OS project for the next post.

    phil-opp/blog_os

    (Section written by @phil-opp)

    We merged two fixes for the Writing an OS in Rust blog this month:

    Thanks to @kITerE and @MaxDesiatov for these contributions!

    I'm also still working on the third edition of the blog. The current state is the following:

    • This month, cargo finally gained support for artifact dependencies, which is a feature that I plan to use for the edition. There are still a few issues with it, for example a panic in combination with -Zbuild-std and that there is currently no way to enable -Zbuild-std=core for an artifact dependency without enabling it globally.
    • The upcoming 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.

    Join Us?

    Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

    ]]>
    This Month in Rust OSDev (January 2022) Thu, 03 Feb 2022 00:00:00 +0000 https://rust-osdev.com/this-month/2022-01/ https://rust-osdev.com/this-month/2022-01/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.

    This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.

    Project Updates

    In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

    x86_64

    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 January, we merged the following pull requests:

    Thanks to @jarkkojs for their contribution!

    bootloader

    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 @abachmann, @Freax13, @phip1611, and @georglauterbach for their contributions!

    uefi-rs

    The uefi crate provides safe and performant wrappers for UEFI, the successor to the BIOS.

    We merged the following changes in January:

    Thanks to @phip1611 for their contribution!

    multiboot2

    The 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.

    Call for Participation

    Want to contribute to a Rust OSDev project, but don't know where to start? Pick up one of these outstanding issues in one of our projects and get started!

    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.

    Other Projects

    In this section, we describe updates to Rust OS projects that are not directly related to the rust-osdev organization. Feel free to create a pull request with the updates of your OS project for the next post.

    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.

    Symbols from the crate 'noto-sans-mono-bitmap' in an UEFI framebuffer.

    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.

    Join Us?

    Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

    ]]>
    This Month in Rust OSDev (December 2021) Sat, 08 Jan 2022 00:00:00 +0000 https://rust-osdev.com/this-month/2021-12/ https://rust-osdev.com/this-month/2021-12/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.

    This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.

    Project Updates

    In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

    x86_64

    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:

    Thanks to @toku-sa-n for their contribution!

    bootloader

    The 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:

    We also continued the work on the upcoming v0.11 version, which will feature the following improvements:

    • Configuration via Rust structs and the entry_point macro, instead of a [package.metadata.bootloader] table in the Cargo.toml.
      • The config data is serialized at compile time and put into a separate ELF section of the kernel executable.
      • This makes it possible to read the config data dynamically when loading the kernel, so we no longer need to recompile the bootloader on config changes.
      • The build process is also simplified as we don't need to read the kernel's Cargo.toml anymore.
    • Instead of including the kernel ELF file using the include_bytes macro, we read the file dynamically from disk during the boot process.
      • The boot image is now a proper FAT partition for both UEFI and BIOS. The kernel file is simply copied to this partition.
      • In combination with the new config mechanism, the dynamic loading means that the bootloader only needs to be compiled once.
    • The bootloader crate is split into three subcrates:
      • an API crate that defines the configuration and boot information structs, and provides the entry_point macro (this will be used by kernels)
      • an implementation crate that contains the actual BIOS and UEFI bootloader code
      • a builder crate that allows to turn kernel ELF files into bootable disk images
        • includes the compiled implementation crate, either by including a precompiled binary or through cargo's upcoming artifact dependencies feature

    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.

    acpi

    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.

    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-rs

    The uefi crate provides safe and performant wrappers for UEFI, the successor to the BIOS.

    We merged the following PRs this month:

    Thanks to @StevenDoesStuffs and @toku-sa-n for their contributions!

    uart_16550

    The uart_16550 crate provides basic support for serial port I/O for 16550-compatible UARTs. We merged the following changes this month:

    Thanks to @olivercalder for this contribution and @Kazurin-775 for reporting this problem!

    Call for Participation

    Want to contribute to a Rust OSDev project, but don't know where to start? Pick up one of these outstanding issues in one of our projects and get started!

    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.

    Other Projects

    In this section, we describe updates to Rust OS projects that are not directly related to the rust-osdev organization. Feel free to create a pull request with the updates of your OS project for the next post.

    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.

    Join Us?

    Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

    ]]>
    This Month in Rust OSDev (November 2021) Mon, 06 Dec 2021 00:00:00 +0000 https://rust-osdev.com/this-month/2021-11/ https://rust-osdev.com/this-month/2021-11/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.

    This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.

    Project Updates

    In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

    uefi-rs

    The uefi crate provides safe and performant wrappers for UEFI, the successor to the BIOS.

    We merged the following PRs this month:

    Thanks to @necauqua and @baloo for their contributions!

    x86_64

    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 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:

    We also merged a number of breaking changes that will go into the upcoming 0.15 release:

    Thanks to @Freax13, @haraldh, and @mpajkowski for their contributions!

    Call for Participation

    Want to contribute to a Rust OSDev project, but don't know where to start? Pick up one of these outstanding issues in one of our projects and get started!

    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.

    Personal Projects

    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.

    Join Us?

    Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

    ]]>
    This Month in Rust OSDev (October 2021) Mon, 08 Nov 2021 00:00:00 +0000 https://rust-osdev.com/this-month/2021-10/ https://rust-osdev.com/this-month/2021-10/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.

    This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.

    Project Updates

    In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

    uefi-rs

    The uefi crate provides safe and performant wrappers for UEFI, the successor to the BIOS.

    We merged the following PRs this month:

    Thanks to @timrobertsdev, @YtvwlD, and @foxcob for their contributions!

    acpi

    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, 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_64

    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 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.

    Call for Participation

    Want to contribute to a Rust OSDev project, but don't know where to start? Pick up one of these outstanding issues in one of our projects and get started!

    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.

    Personal Projects

    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:

    Join Us?

    Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

    ]]>
    This Month in Rust OSDev (September 2021) Thu, 07 Oct 2021 00:00:00 +0000 https://rust-osdev.com/this-month/2021-09/ https://rust-osdev.com/this-month/2021-09/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.

    This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.

    Project Updates

    In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

    x86_64

    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 September, we merged the following changes:

    Thanks to @Freax13, @npmccallum, and @mkroening for their contributions!

    uefi-rs

    The uefi crate provides safe and performant wrappers for UEFI, the successor to the BIOS.

    This month, we merged the following changes:

    Thanks to @necauqua and @timrobertsdev for their contributions!

    bootloader

    The 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:

    Thanks to @anellie for this contribution!

    multboot2

    The 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.

    Call for Participation

    Want to contribute to a Rust OSDev project, but don't know where to start? Pick up one of these outstanding issues in one of our projects and get started!

    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.

    Personal Projects

    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.

    Join Us?

    Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

    ]]>
    This Month in Rust OSDev (August 2021) Wed, 08 Sep 2021 00:00:00 +0000 https://rust-osdev.com/this-month/2021-08/ https://rust-osdev.com/this-month/2021-08/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.

    This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.

    Project Updates

    In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

    acpi

    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.

    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:

    uefi-rs

    The 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:

    Thanks to @HTG-YT, @phip1611, @Andy-Python-Programmer, and @timrobertsdev for their contributions!

    x86_64

    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 August, we merged the following changes:

    These 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!

    bootloader

    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 @vinc, @bjorn3, @Freax13, @yusdacra, and @martica for their contributions!

    multboot2

    The multiboot2 crate provides abstraction types for the boot information of multiboot2 bootloaders.

    The following changes were merged this month:

    pic_8259

    The 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:

    Thanks to @toku-sa-n for this contribution!

    Call for Participation

    Want to contribute to a Rust OSDev project, but don't know where to start? Pick up one of these outstanding issues in one of our projects and get started!

    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.

    Personal Projects

    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!

    Join Us?

    Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

    ]]>
    This Month in Rust OSDev (July 2021) Sat, 07 Aug 2021 00:00:00 +0000 https://rust-osdev.com/this-month/2021-07/ https://rust-osdev.com/this-month/2021-07/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.

    This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.

    Project Updates

    In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

    uefi-rs

    The uefi crate provides safe and performant wrappers for UEFI, the successor to the BIOS. In July, we merged the following changes:

    Thanks to @nicholasbishop, @MaulingMoneky, @phip1611 and @necauqua for their contributions!

    acpi

    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:

    These changes were published as acpi v3.1.0 and aml v0.14.0. Thanks to @ethindp and @toku-sa-n for their contributions.

    multiboot2

    The 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:

    x86_64

    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 improvements:

    Thanks to @budde25 and @toku-sa-n for their contributions.

    Call for Participation

    Want to contribute to a Rust OSDev project, but don't know where to start? Pick up one of these outstanding issues in one of our projects and get started!

    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.

    Personal Projects

    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.

    Join Us?

    Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

    ]]>
    This Month in Rust OSDev (June 2021) Thu, 08 Jul 2021 00:00:00 +0000 https://rust-osdev.com/this-month/2021-06/ https://rust-osdev.com/this-month/2021-06/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.

    This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.

    Project Updates

    In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

    acpi

    The acpi repository contains crates for parsing the ACPI tables – data structures that the firmware of modern computers use to relay information about the hardware to the OS.

    This month, both the 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)

    Thanks to @wusyong and @Freax13 for their contributions!

    uefi-rs

    The uefi crate provides safe and performant wrappers for UEFI, the successor to the BIOS. In June, we merged the following changes:

    Thanks to @nicholasbishop, @iankronquist and @josephlr for their contributions!

    x86_64

    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 changes:

    We did not issue a new crates.io release with these changes yet, but we plan to do so soon.

    Thanks to @toku-sa-n for their contribution!

    Call for Participation

    Want to contribute to a Rust OSDev project, but don't know where to start? Pick up one of these outstanding issues in one of our projects and get started!

    phil-opp/blog_os:

    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.

    Personal Projects

    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:

    Thanks 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!

    Join Us?

    Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

    ]]>
    This Month in Rust OSDev (May 2021) Mon, 07 Jun 2021 00:00:00 +0000 https://rust-osdev.com/this-month/2021-05/ https://rust-osdev.com/this-month/2021-05/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.

    This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.

    Project Updates

    In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

    x86_64

    The x86_64 crate provides various abstractions for x86_64 systems, including wrappers for CPU instructions, access to processor-specific registers, and abstraction types for architecture-specific structures such as page tables and descriptor tables.

    In May, we merged the following changes:

    We also started to prepare a v0.15 release, for which we already implemented the following breaking changes:

    Thanks to @dbeckwith and @Freax13 for their contributions!

    bootloader

    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 @Elekrisk for their contribution!

    We also published the following backport to v0.9:

    uefi-rs

    The uefi crate provides safe and performant wrappers for UEFI, the successor to the BIOS. In May, we merged the following changes:

    Thanks to @phil-opp and @nicholasbishop for their contributions!

    uart_16550

    The uart_16550 crate provides basic support for serial port I/O for 16550-compatible UARTs. We merged the following changes this month:

    Thanks to @josephlr and @remimimimi for their contributions!

    pic_8259

    The 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:

    Thanks to @mkroening and @hanmertens for their contributions!

    acpi

    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 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!

    xhci

    The xhci crate provides types of xHCI structures such as Contexts, Extended Capabilities, Registers, and TRBs.

    In May we finished implementing all of these structures and field getters/setters. Still there may exist missing. If you find one, feel free to send a PR!

    spinning_top

    The spinning_top crate provides a simple spinlock implementation based on the abstractions of the lock_api crate. This month, we released version v0.2.4 with the following small improvements:

    Thanks to @toku-sa-n for these contributions!

    vga

    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 fixed a nightly build error:

    Thanks to @ethindp for their contribution!

    ps2-mouse

    The 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:

    Thanks to @littledivy for this contribution!

    Call for Participation

    Want to contribute to a Rust OSDev project, but don't know where to start? Pick up one of these outstanding issues in one of our projects and get started!

    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.

    Personal Projects

    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:

    Thanks to @woodyZootopia, @kahirokunn, @HKalbasi, and @bjorn3 for their contributions!

    Join Us?

    Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

    ]]>
    This Month in Rust OSDev (April 2021) Wed, 05 May 2021 00:00:00 +0000 https://rust-osdev.com/this-month/2021-04/ https://rust-osdev.com/this-month/2021-04/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.

    This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.

    Project Updates

    In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

    x86_64

    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 changes:

    Thanks to @Luis-Hebendanz, @CraftSpider, and @dbeckwith for their contributions!

    We also prepared a pull request to fix the build on the latest Rust nightlies:

    • Use new 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.

    bootloader

    The 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:

    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:

    Thanks to @mkroening and @CraftSpider for their contributions!

    xhci

    The 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!

    acpi

    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, 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-prebuilt

    In 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_16550

    The 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:

    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-rs

    The 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_top

    The spinning_top crate provides a simple spinlock implementation based on the abstractions of the lock_api crate. This month, we fixed a compiler warning:

    Call for Participation

    Want to contribute to a Rust OSDev project, but don't know where to start? Pick up one of these outstanding issues in one of our projects and get started!

    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.

    Personal Projects

    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:

    Thanks 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.

    • Migrated the kernel to the higher half of virtual memory
    • Added double fault handling
    • Added page fault handling which will attempt to (safely) expand the kernel stack if it overflows
    • Related to the above, added more robust frame allocation
    • Added basic heap allocation

    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.

    Join Us?

    Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

    ]]>
    This Month in Rust OSDev (March 2021) Mon, 05 Apr 2021 00:00:00 +0000 https://rust-osdev.com/this-month/2021-03/ https://rust-osdev.com/this-month/2021-03/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.

    This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.

    Project Updates

    In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

    bootloader

    The 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:

    We also made some good progress on the UEFI rewrite:

    x86_64

    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 March, we merged these changes:

    Thanks to @toku-sa-n and @dbeckwith for their contributions!

    uefi-rs

    The 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!

    multiboot2

    The multiboot2 crate provides abstraction types for the boot information of multiboot2 bootloaders. We merged the following updates this month:

    Thanks to @toku-sa-n for their contributions!

    volatile

    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 March, we fixed a build error that was caused by a change in nightly Rust:

    Thanks to @KernelFreeze for their contribution!

    acpi

    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 has seen substantial changes to both the acpi and aml crates:

    • We made the types that represent raw ACPI tables public. This allows library users to work directly with tables such as the FADT if they need to, which is needed to access power management features we don't yet expose. (published as acpi v2.3.1)
    • Native functions are now supported by the AML interpreter!. A 'native function' is an AML method that is defined in Rust, rather than using AML bytecode. This is useful for defining "up-call" methods (where a method is provided by the OS, and called by the firmware), and will hopefully by useful in the future for patching methods in broken tables. A native method can easily be created with the AmlValue::native_method constructor.
    • However, supporting native functions needed a bit of breakage - 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.
    • We also used this opportunity to remove the 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.
    • Fallout from 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.
    • The AML interpreter now correctly supplies the \_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)

    Call for Participation

    Want to contribute to a Rust OSDev project, but don't know where to start? Pick up one of these outstanding issues in one of our projects and get started!

    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.

    Personal Projects

    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 @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:

    rust-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:

    The 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: EL1

    Join Us?

    Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

    ]]>
    This Month in Rust OSDev (February 2021) Mon, 08 Mar 2021 00:00:00 +0000 https://rust-osdev.com/this-month/2021-02/ https://rust-osdev.com/this-month/2021-02/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.

    This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.

    Project Updates

    In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

    uefi-rs

    The uefi crate provides safe and performant wrappers for UEFI, the successor to the BIOS. In February, we merged the following changes:

    Thanks to @gil0mendes, @sreehax, and @avirule for their contributions!

    x86_64

    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, 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:

    Thanks to @KernelFreeze for this contribution!

    bootloader

    The 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:

    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:

    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_16550

    The 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:

    vga

    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. The nightly build error of x86_64 also affected this crate, so it needed a fix too:

    Thanks to @Pollux3737 for this contribution!

    Personal Projects

    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:

    • Move the kernel in virtual memory so that it occupies the higher half of the 48-bit address space
    • Create some page fault interrupt handling so that the kernel can at least attempt to handle page faults (rather than triple faulting as it does now)
    • Set up memory allocation for the kernel, to get heap allocation
    • Once heap allocation is in place, utilize some existing crate to handle TrueType fonts so that text will look a bit nicer on screen

    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!

    Join Us?

    Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

    ]]>
    This Month in Rust OSDev (January 2021) Sat, 06 Feb 2021 00:00:00 +0000 https://rust-osdev.com/this-month/2021-01/ https://rust-osdev.com/this-month/2021-01/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we will give a regular overview of notable changes in the Rust operating system development ecosystem.

    This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our comment form at the bottom of this page.

    Showcase

    We started a new Showcase section this month, where we introduce and present interesting Rust OSDev projects. The first post of this section is:

    If you like to present your project too, just let us know!

    Project Updates

    In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

    bootloader

    The 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:

    acpi

    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. In January, we added some updates to the aml crate:

    uart_16550

    The 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-xbuild

    The 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:

    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-hermit

    RustyHermit 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!

    Personal Projects

    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:

    Thanks to @delta1, @NickSchmitt, @nana0-0, and @EvanMu96 for these contributions!

    Third Edition

    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:

    Photo of the laptop display, showing some text output

    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).

    Join Us?

    Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

    ]]>
    The Hermit Operating System Fri, 22 Jan 2021 00:00:00 +0000 https://rust-osdev.com/showcase/hermit/ https://rust-osdev.com/showcase/hermit/ Hermit is a unikernel project, that is completely written in Rust. Unikernels are application images that directly contain the kernel as a library, so they do not require an installed operating system (OS). They are typically used in virtualized environments, which build the backbone of typical cloud and edge infrastructures.

    Virtualization Designs

    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:

    Structure of a common virtualization environment

    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.

    Unikernels

    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.

    Structure of a library operating system

    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.

    Hermit

    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.

    Performance

    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:

    Bandwidth of the Hermit's experimental network interface

    Especially for small messages, Hermit is faster than Linux.

    Research

    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.

    Getting Started

    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.

    Roadmap

    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 Month in Rust OSDev (December 2020) Thu, 07 Jan 2021 00:00:00 +0000 https://rust-osdev.com/this-month/2020-12/ https://rust-osdev.com/this-month/2020-12/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we will give a regular overview of notable changes in the Rust operating system development ecosystem.

    This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue or using our new comment form at the bottom of this page.

    Project Updates

    In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

    x86_64

    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 December, we published the following three new releases:

    v0.12.4

    v0.13.0 (breaking)

    v0.13.1

    Thanks to @mental32, @vinaychandra, @tomaka, @haraldh, @tscs37, and @toku-sa-n for their contributions!

    volatile

    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 December, we added to new methods for creating read/write-only Volatile instances:

    bootimage

    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. This month, we fixed a nightly breakage:

    cargo-xbuild

    The 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:

    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.

    bootloader

    The 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-rs

    The 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!

    acpi

    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. In December, we:

    Personal Projects

    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!

    Third Edition?

    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:

    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!

    Join Us?

    Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

    ]]>
    This Month in Rust OSDev (November 2020) Thu, 10 Dec 2020 00:00:00 +0000 https://rust-osdev.com/this-month/2020-11/ https://rust-osdev.com/this-month/2020-11/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we will give a regular overview of notable changes in the Rust operating system development ecosystem.

    This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue.

    Project Updates

    In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

    acpi

    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. 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_64

    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 November, we merged the following updates:

    Thanks to @toku-sa-n for their contribution!

    multiboot2

    The multiboot2 crate provides abstraction types for the boot information of multiboot2 bootloaders. We merged the following updates this month:

    Thanks to @CalebLBaker for their contribution!

    Personal Projects

    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:

    • Implemented a basic form of TLS for userspace tasks. Pebble doesn't have threads, but an Address Space can have multiple Tasks running from the same image, each of which need their copy of the master TLS record. TLS support is also needed very early in Rust's std, so this was the next step in creating a std implementation for Pebble.
    • Tried to fix a bug in Pebble's UEFI bootloader, where we crash if memory allocated to Boot Services is unmapped after 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!
    • Continued work on the USB XHCI driver
    • Improved detection of Intel microarchitectures - we can now differentiate Kaby Lake and Coffee Lake processors based on their cpuid steppings

    phil-opp/blog_os

    (Section written by @phil-opp)

    In November, we merged the following changes to the Writing an OS in Rust blog:

    Thanks 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!

    Join Us?

    Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

    ]]>
    This Month in Rust OSDev (October 2020) Sat, 07 Nov 2020 00:00:00 +0000 https://rust-osdev.com/this-month/2020-10/ https://rust-osdev.com/this-month/2020-10/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we will give a regular overview of notable changes in the Rust operating system development ecosystem.

    This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue.

    Project Updates

    In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

    x86_64

    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 October, we merged following changes:

    Thanks to @toku-sa-n for their contribution! We plan to publish the above changes as version 0.12.3 in the next few days.

    volatile

    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 October, we published a new version to fix the crate's unstable feature on newer Rust nightlies:

    Thanks to @vetio for this contribution!

    bootloader

    The 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-rs

    The 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_types

    The 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-xbuild

    The cargo-xbuild project provides cargo command wrappers to cross-compile the sysroot crates core and alloc. This month, we merged the following changes:

    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.

    Personal Projects

    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:

    • The memory mapping strategy gets more sophisticated and no longer identity maps the whole of the board's address space.
    • Instead, only ranges that are actually needed are mapped:
      • The kernel binary stays identity mapped for now.
      • Device 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!

    Join Us?

    Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

    ]]>
    This Month in Rust OSDev (September 2020) Sun, 04 Oct 2020 00:00:00 +0000 https://rust-osdev.com/this-month/2020-09/ https://rust-osdev.com/this-month/2020-09/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we will give a regular overview of notable changes in the Rust operating system development ecosystem.

    This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue.

    Project Updates

    In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

    acpi

    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. Lots of work happened this month:

    • Support for the 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!
    • Version 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.
    • A new crate, 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_64

    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.

    The crate received the following updates in September:

    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!

    volatile

    The 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_types

    pci_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-rs

    The 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!

    bootloader

    The 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-xbuild

    The 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:

    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_16550

    The 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.

    Personal Projects

    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!

    • The first, basic, version of Pebble's wire format, ptah has been completed. This first version is implemented as a Serde format, but libraries could be written for any language that can manipulate a byte stream.
    • Two system calls, 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.
    • Infrastructure for another of Pebble's key features, services, was added. This allows userspace tasks to advertise their ability to provide some kind of 'service' to other tasks. A task called echo was built to test this - it provides a service that simply echos any messages sent down it back to the sending task.
    • Work started on the Platform Bus, a concept inspired by another hobby OS managarm's 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.
    • The first Bus Driver was added to manage PCI devices. It uses a new system call, 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:

    Apart 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:

    QEMU output of new bootloader implementation, including local APIC and I/O APIC debug output, the timer interrupt dots, and the keyboard input "Hello!!!"

    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:

    • AArch64
    • RISC-V 64
    • x86_64

    If 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.

    Join Us?

    Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

    ]]>
    This Month in Rust OSDev (August 2020) Wed, 09 Sep 2020 00:00:00 +0000 https://rust-osdev.com/this-month/2020-08/ https://rust-osdev.com/this-month/2020-08/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we will give a regular overview of notable changes in the Rust operating system development ecosystem.

    This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue.

    Project Updates

    In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

    uefi-rs

    The 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:

    Thanks to @tomoyat1 for their contribution!

    multiboot2

    The 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!

    bootloader

    The 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_rgb

    The 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:

    Thanks to @hanmertens for their contributions!

    bootimage

    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. 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:

    Thanks to @Freax13 for their contribution!

    x86_64

    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 added some functions for reading and writing the FS and GS segment base registers:

    Thanks to @haraldh for this contribution!

    acpi

    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, support for more opcodes was added to the AML parser:

    spinning_top

    The 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:

    Thanks to @not-a-seagull for this contribution!

    cargo-xbuild

    The 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:

    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.

    Personal Projects

    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:

    Thanks to @RWOverdijk and @JohnTitor for their contributions!

    Japanese translations

    (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)!

    Join Us?

    Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

    ]]>
    This Month in Rust OSDev (July 2020) Sun, 02 Aug 2020 00:00:00 +0000 https://rust-osdev.com/this-month/2020-07/ https://rust-osdev.com/this-month/2020-07/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we give a regular overview of notable changes in the Rust operating system development ecosystem.

    This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue.

    Project Updates

    In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

    bootimage

    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. In July, the crate was updated to work with cargo's own build-std feature instead of relying on the cargo-xbuild crate:

    bootloader

    The 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:

    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.

    acpi

    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 saw some substantial improvements to our AML handling:

    • Objects defined by AML tables exist within a namespace, with objects referred to by paths such as \_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.
    • Some more opcodes were implemented: Target, DefShiftLeft, DefShiftRight, DefLOr, and DefAnd. These all appear in QEMU's tables.
    • A fairly large PR was merged that provides the ability to traverse the namespace and initialize devices - this is a mechanism that ACPI provides that allows an OS to initialize hardware that it does not have drivers for, and is a compulsory step in getting modern chipsets to function properly. This required us to build up a lot of functionality, including namespace traversal, reading and writing from operation regions, recursively invoking control methods, and asking the OS to perform hardware configuration for us (such as reading and writing to IO ports and PCI configuration space). There is still a lot of work in getting all of this working robustly, but this is a great start.

    uefi-rs

    The uefi-rs crate provides safe and performant wrappers for UEFI, the successor to the BIOS.

    The major changes which happened in this month are:

    • We've tested out support for AArch64. No updates to the code are needed, just add a custom target file for 64-bit ARM UEFI and then compile your project with it.
    • The LoadedImage protocol now exposes the handle for the device where the binary is stored.
    • Our CI is now green again! There is only one test which breaks QEMU, and it's going to stay disabled until it gets fixed.
    • Building the repository no longer requires cargo-xbuild, we've switched to nightly Cargo's build-std feature.
    • Updated documentation in various places.

    spinning_top

    The 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:

    Thanks to @akiekintveld for their contributions!

    volatile

    The volatile crate provides safe wrapper types for implementing volatile read and write operations. The crate received the following changes this month:

    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.

    multiboot2

    The 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:

    Thanks to @dlrobertson for this contribution!

    cargo-xbuild

    The 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.

    Personal Projects

    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:

    • The migration from Travis CI to Github Actions was completed, allowing Pebble to be emulated on CI.
    • Pebble uses a HAL (hardware abstraction layer) to separate hardware access from kernel logic. Various parts of the x86_64 implementation of the HAL were made common to support code-reuse across architectures.
    • Some tests were added to the buddy allocator (Pebble's physical memory manager). This was to rule out physical memory allocation as the cause of a bug where user stacks are occasionally corrupted at the userspace-kernel boundary, which unfortunately has still not been fixed.
    • Our algorithm for efficiently mapping arbitrary areas was rewritten and extended to support 1GiB pages.
    • Work has started on a topology layer - data structures that represent features of the platform such as processors, caches, NUMA nodes, and microarchitectural information. This will help in allowing Pebble to make more intelligent decisions about scheduling and resource usage in the future.

    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:

    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.

    Join Us?

    Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

    ]]>
    This Month in Rust OSDev (June 2020) Sun, 12 Jul 2020 00:00:00 +0000 https://rust-osdev.com/this-month/2020-06/ https://rust-osdev.com/this-month/2020-06/ Welcome to a new issue of "This Month in Rust OSDev". In these posts, we will give a regular overview of notable changes in the Rust operating system development ecosystem.

    This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue.

    Project Updates

    In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

    x86_64

    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, the crate received some smaller improvements:

    Thanks to @samueltardieu and @leecannon for their contributions!

    cargo-xbuild

    The 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:

    Thanks to @eggyal and @Eijebong for these contributions!

    bootloader

    The 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:

    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).

    acpi

    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, the crate received two small improvements to the RSDP-related code:

    uefi

    The 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:

    Personal Projects

    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!

    Join Us?

    Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

    ]]>
    This Month in Rust OSDev (May 2020) Sun, 07 Jun 2020 00:00:00 +0000 https://rust-osdev.com/this-month/2020-05/ https://rust-osdev.com/this-month/2020-05/ Welcome to the second issue of "This Month in Rust OSDev". In these posts, we will give a regular overview of notable changes in the Rust operating system development ecosystem.

    This series is openly developed on GitHub. Feel free to open pull requests there with content you would like to see in the next issue. If you find some issues on this page, please report them by creating an issue.

    Project Updates

    In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

    x86_64

    The x86_64 crate provides various abstractions for x86_64 systems, including wrappers for CPU instructions, access to processor-specific registers, and abstraction types for architecture-specific structures such as page tables and descriptor tables.

    In May, 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:

    Thanks to @haraldh and @mrll for their contributions!

    cargo-xbuild

    The 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:

    Thanks to @Nils-TUD for their contribution and to all the people that helped investigating the build errors!

    acpi

    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.

    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.

    bootloader

    The bootloader crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables. It received the following updates this month:

    Thanks to @mark-i-m and @Aaron1011 for their contributions!

    bootimage

    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 xrun and cargo xtest work using QEMU. In May, the crate was almost completely rewritten with a smaller API to make it more maintainable:

    uart_16550

    The uart_16550 crate provides basic support for serial port I/O for 16550-compatible UARTs. This month, the crate received the following updates:

    Thanks to @dbeckwith for their contribution!

    uefi

    The 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!

    Personal Projects

    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).

    Join Us?

    Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

    ]]>
    This Month in Rust OSDev (April 2020) Wed, 06 May 2020 00:00:00 +0000 https://rust-osdev.com/this-month/2020-04/ https://rust-osdev.com/this-month/2020-04/ Welcome to the first issue of "This Month in Rust OSDev". In these posts, we will give a regular overview of notable changes in the Rust operating system development community.

    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.

    News and Blog Posts

    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.

    Project Updates

    In this section, we give an overview of notable changes to the projects hosted under the rust-osdev organization.

    x86_64

    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.10.0 of x86_64, which includes some breaking changes:

    After v0.10.0, the following changes were merged:

    Thanks to @m-ou-se, @tomaka, @haraldh, and @imtsuki for their contributions!

    acpi and aml

    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. 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:

    Thanks to @tomaka for their contribution and congratulations to the creator and maintainer @IsaacWoods on the 1.0 release!

    bootloader

    The bootloader crate implements a custom Rust-based bootloader for easy loading of 64-bit ELF executables. It received the following updates this month:

    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.

    bootimage

    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 xrun and cargo xtest work using QEMU. In April, the crate received the following updates:

    Thanks to @Freax13 for their contribution!

    uart_16550

    The 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-xbuild

    The 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:

    uefi

    The 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:

    New Projects

    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.

    Personal Projects

    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:

    • Add tutorial 14: Exceptions Part 2: Peripheral IRQs.
      • We write device drivers for the two interrupt controllers on the Raspberry Pi 3 (Broadcom custom controller) and Pi 4 (ARM Generic Interrupt Controller v2, GICv2).
      • Modularity is ensured by interfacing everything through a trait named IRQManager.
      • Handling for our first peripheral IRQ is implemented: The UART's receive IRQ - one IRQ per received character.
    • Set chainloader relocation address to 32 MiB.
      • Enables booting on Pi3 A+ devices.
    • Run the chainloader natively on non-Linux Unix systems.
      • Adds experimental support for 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.

    Join Us?

    Are you interested in Rust-based operating system development? Our rust-osdev organization is always open to new members and new projects. Just let us know if you want to join! A good way for getting in touch is our Zulip chat.

    ]]>