GeistHaus
log in · sign up

GitHub - phil-opp/blog_os: Writing an OS in Rust

github.com

Writing an OS in Rust. Contribute to phil-opp/blog_os development by creating an account on GitHub.

17 pages link to this URL
Writing an OS in Rust

This blog series creates a small operating system in the Rust programming language. Each post is a small tutorial and includes all needed code.

A Minimal Rust Kernel

In this post, we create a minimal 64-bit Rust kernel for the x86 architecture. We build upon the freestanding Rust binary from the previous post to cr…

A Freestanding Rust Binary

The first step in creating our own operating system kernel is to create a Rust executable that does not link the standard library. This makes it possi…

VGA Text Mode

The VGA text mode is a simple way to print text to the screen. In this post, we create an interface that makes its usage safe and simple by encapsulat…

Unit Testing

This post explores unit testing in no_std executables using Rust’s built-in test framework. We will adjust our code so that cargo test works and add s…

Integration Tests

To complete the testing picture we implement a basic integration test framework, which allows us to run tests on the target system. The idea is to run…

CPU Exceptions

CPU exceptions occur in various erroneous situations, for example, when accessing an invalid memory address or when dividing by zero. To react to them…

Double Faults

This post explores the double fault exception in detail, which occurs when the CPU fails to invoke an exception handler. By handling this exception, w…

Hardware Interrupts

In this post, we set up the programmable interrupt controller to correctly forward hardware interrupts to the CPU. To handle these interrupts, we add …

Introduction to Paging

This post introduces paging, a very common memory management scheme that we will also use for our operating system. It explains why memory isolation i…

Advanced Paging

This post explains techniques to make the physical page table frames accessible to our kernel. It then uses such a technique to implement a function t…

Paging Implementation

This post shows how to implement paging support in our kernel. It first explores different techniques to make the physical page table frames accessibl…

Testing

This post explores unit and integration testing in no_std executables. We will use Rust’s support for custom test frameworks to execute test functions…

Heap Allocation

This post adds support for heap allocation to our kernel. First, it gives an introduction to dynamic memory and shows how the borrow checker prevents …

Allocator Designs

This post explains how to implement heap allocators from scratch. It presents and discusses different allocator designs, including bump allocation, li…

Async/Await

In this post, we explore cooperative multitasking and the async/await feature of Rust. We take a detailed look at how async/await works in Rust, inclu…