From 1034c884ac0c89d60eacd599b76d9e1ab2186c75 Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Sun, 27 Jan 2019 17:58:30 +0100 Subject: [PATCH] Add source code link to each post --- .../posts/01-freestanding-rust-binary/index.md | 6 ++++++ .../second-edition/posts/02-minimal-rust-kernel/index.md | 3 ++- .../second-edition/posts/03-vga-text-buffer/index.md | 3 ++- blog/content/second-edition/posts/04-unit-testing/index.md | 3 ++- .../second-edition/posts/05-integration-tests/index.md | 3 ++- .../content/second-edition/posts/06-cpu-exceptions/index.md | 3 ++- blog/content/second-edition/posts/07-double-faults/index.md | 3 ++- .../second-edition/posts/08-hardware-interrupts/index.md | 3 ++- .../second-edition/posts/09-paging-introduction/index.md | 3 ++- 9 files changed, 22 insertions(+), 8 deletions(-) diff --git a/blog/content/second-edition/posts/01-freestanding-rust-binary/index.md b/blog/content/second-edition/posts/01-freestanding-rust-binary/index.md index 39de7f4a..a68f74c9 100644 --- a/blog/content/second-edition/posts/01-freestanding-rust-binary/index.md +++ b/blog/content/second-edition/posts/01-freestanding-rust-binary/index.md @@ -12,6 +12,12 @@ The first step in creating our own operating system kernel is to create a Rust e +This blog is openly developed on [Github]. If you have any problems or questions, please open an issue there. You can also leave comments [at the bottom]. The complete source code for this post can be found [here][post branch]. + +[Github]: https://github.com/phil-opp/blog_os +[at the bottom]: #comments +[post branch]: https://github.com/phil-opp/blog_os/tree/post-01 + ## Introduction To write an operating system kernel, we need code that does not depend on any operating system features. This means that we can't use threads, files, heap memory, the network, random numbers, standard output, or any other features requiring OS abstractions or specific hardware. Which makes sense, since we're trying to write our own OS and our own drivers. diff --git a/blog/content/second-edition/posts/02-minimal-rust-kernel/index.md b/blog/content/second-edition/posts/02-minimal-rust-kernel/index.md index d052981d..fd41aa94 100644 --- a/blog/content/second-edition/posts/02-minimal-rust-kernel/index.md +++ b/blog/content/second-edition/posts/02-minimal-rust-kernel/index.md @@ -12,10 +12,11 @@ In this post we create a minimal 64-bit Rust kernel for the x86 architecture. We -This blog is openly developed on [Github]. If you have any problems or questions, please open an issue there. You can also leave comments [at the bottom]. +This blog is openly developed on [Github]. If you have any problems or questions, please open an issue there. You can also leave comments [at the bottom]. The complete source code for this post can be found [here][post branch]. [Github]: https://github.com/phil-opp/blog_os [at the bottom]: #comments +[post branch]: https://github.com/phil-opp/blog_os/tree/post-02 ## The Boot Process When you turn on a computer, it begins executing firmware code that is stored in motherboard [ROM]. This code performs a [power-on self-test], detects available RAM, and pre-initializes the CPU and hardware. Afterwards it looks for a bootable disk and starts booting the operating system kernel. diff --git a/blog/content/second-edition/posts/03-vga-text-buffer/index.md b/blog/content/second-edition/posts/03-vga-text-buffer/index.md index f87f7115..b9cfc54e 100644 --- a/blog/content/second-edition/posts/03-vga-text-buffer/index.md +++ b/blog/content/second-edition/posts/03-vga-text-buffer/index.md @@ -13,10 +13,11 @@ The [VGA text mode] is a simple way to print text to the screen. In this post, w -This blog is openly developed on [Github]. If you have any problems or questions, please open an issue there. You can also leave comments [at the bottom]. +This blog is openly developed on [Github]. If you have any problems or questions, please open an issue there. You can also leave comments [at the bottom]. The complete source code for this post can be found [here][post branch]. [Github]: https://github.com/phil-opp/blog_os [at the bottom]: #comments +[post branch]: https://github.com/phil-opp/blog_os/tree/post-03 ## The VGA Text Buffer To print a character to the screen in VGA text mode, one has to write it to the text buffer of the VGA hardware. The VGA text buffer is a two-dimensional array with typically 25 rows and 80 columns, which is directly rendered to the screen. Each array entry describes a single screen character through the following format: diff --git a/blog/content/second-edition/posts/04-unit-testing/index.md b/blog/content/second-edition/posts/04-unit-testing/index.md index 0e76651b..bfd1e63e 100644 --- a/blog/content/second-edition/posts/04-unit-testing/index.md +++ b/blog/content/second-edition/posts/04-unit-testing/index.md @@ -10,10 +10,11 @@ This post explores unit testing in `no_std` executables using Rust's built-in te -This blog is openly developed on [Github]. If you have any problems or questions, please open an issue there. You can also leave comments [at the bottom]. +This blog is openly developed on [Github]. If you have any problems or questions, please open an issue there. You can also leave comments [at the bottom]. The complete source code for this post can be found [here][post branch]. [Github]: https://github.com/phil-opp/blog_os [at the bottom]: #comments +[post branch]: https://github.com/phil-opp/blog_os/tree/post-04 ## Unit Tests for `no_std` Binaries Rust has a [built-in test framework] that is capable of running unit tests without the need to set anything up. Just create a function that checks some results through assertions and add the `#[test]` attribute to the function header. Then `cargo test` will automatically find and execute all test functions of your crate. diff --git a/blog/content/second-edition/posts/05-integration-tests/index.md b/blog/content/second-edition/posts/05-integration-tests/index.md index 6f3596dc..0712ae58 100644 --- a/blog/content/second-edition/posts/05-integration-tests/index.md +++ b/blog/content/second-edition/posts/05-integration-tests/index.md @@ -10,10 +10,11 @@ To complete the testing picture we implement a basic integration test framework, -This blog is openly developed on [Github]. If you have any problems or questions, please open an issue there. You can also leave comments [at the bottom]. +This blog is openly developed on [Github]. If you have any problems or questions, please open an issue there. You can also leave comments [at the bottom]. The complete source code for this post can be found [here][post branch]. [Github]: https://github.com/phil-opp/blog_os [at the bottom]: #comments +[post branch]: https://github.com/phil-opp/blog_os/tree/post-05 ## Overview diff --git a/blog/content/second-edition/posts/06-cpu-exceptions/index.md b/blog/content/second-edition/posts/06-cpu-exceptions/index.md index 1e84d3de..c886d5bf 100644 --- a/blog/content/second-edition/posts/06-cpu-exceptions/index.md +++ b/blog/content/second-edition/posts/06-cpu-exceptions/index.md @@ -12,10 +12,11 @@ CPU exceptions occur in various erroneous situations, for example when accessing -This blog is openly developed on [Github]. If you have any problems or questions, please open an issue there. You can also leave comments [at the bottom]. +This blog is openly developed on [Github]. If you have any problems or questions, please open an issue there. You can also leave comments [at the bottom]. The complete source code for this post can be found [here][post branch]. [Github]: https://github.com/phil-opp/blog_os [at the bottom]: #comments +[post branch]: https://github.com/phil-opp/blog_os/tree/post-06 ## Overview An exception signals that something is wrong with the current instruction. For example, the CPU issues an exception if the current instruction tries to divide by 0. When an exception occurs, the CPU interrupts its current work and immediately calls a specific exception handler function, depending on the exception type. diff --git a/blog/content/second-edition/posts/07-double-faults/index.md b/blog/content/second-edition/posts/07-double-faults/index.md index 2bfb7ae3..522ffaf2 100644 --- a/blog/content/second-edition/posts/07-double-faults/index.md +++ b/blog/content/second-edition/posts/07-double-faults/index.md @@ -10,10 +10,11 @@ This post explores the double fault exception in detail, which occurs when the C -This blog is openly developed on [Github]. If you have any problems or questions, please open an issue there. You can also leave comments [at the bottom]. +This blog is openly developed on [Github]. If you have any problems or questions, please open an issue there. You can also leave comments [at the bottom]. The complete source code for this post can be found [here][post branch]. [Github]: https://github.com/phil-opp/blog_os [at the bottom]: #comments +[post branch]: https://github.com/phil-opp/blog_os/tree/post-07 ## What is a Double Fault? In simplified terms, a double fault is a special exception that occurs when the CPU fails to invoke an exception handler. For example, it occurs when a page fault is triggered but there is no page fault handler registered in the [Interrupt Descriptor Table][IDT] (IDT). So it's kind of similar to catch-all blocks in programming languages with exceptions, e.g. `catch(...)` in C++ or `catch(Exception e)` in Java or C#. diff --git a/blog/content/second-edition/posts/08-hardware-interrupts/index.md b/blog/content/second-edition/posts/08-hardware-interrupts/index.md index 7155dbec..2b4b8a90 100644 --- a/blog/content/second-edition/posts/08-hardware-interrupts/index.md +++ b/blog/content/second-edition/posts/08-hardware-interrupts/index.md @@ -10,10 +10,11 @@ In this post we set up the programmable interrupt controller to correctly forwar -This blog is openly developed on [Github]. If you have any problems or questions, please open an issue there. You can also leave comments [at the bottom]. +This blog is openly developed on [Github]. If you have any problems or questions, please open an issue there. You can also leave comments [at the bottom]. The complete source code for this post can be found [here][post branch]. [Github]: https://github.com/phil-opp/blog_os [at the bottom]: #comments +[post branch]: https://github.com/phil-opp/blog_os/tree/post-08 ## Overview diff --git a/blog/content/second-edition/posts/09-paging-introduction/index.md b/blog/content/second-edition/posts/09-paging-introduction/index.md index 60b9295c..711c5541 100644 --- a/blog/content/second-edition/posts/09-paging-introduction/index.md +++ b/blog/content/second-edition/posts/09-paging-introduction/index.md @@ -10,10 +10,11 @@ This post introduces _paging_, a very common memory management scheme that we wi -This blog is openly developed on [GitHub]. If you have any problems or questions, please open an issue there. You can also leave comments [at the bottom]. +This blog is openly developed on [GitHub]. If you have any problems or questions, please open an issue there. You can also leave comments [at the bottom]. The complete source code for this post can be found [here][post branch]. [GitHub]: https://github.com/phil-opp/blog_os [at the bottom]: #comments +[post branch]: https://github.com/phil-opp/blog_os/tree/post-09 ## Memory Protection