From 48d96243eaaec8a9dffabe85ad52c068fb74052d Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Tue, 19 Mar 2019 13:01:25 +0100 Subject: [PATCH] Add an inline table of contents to all posts --- .../second-edition/posts/01-freestanding-rust-binary/index.md | 2 ++ .../second-edition/posts/02-minimal-rust-kernel/index.md | 2 ++ blog/content/second-edition/posts/03-vga-text-buffer/index.md | 2 ++ blog/content/second-edition/posts/04-unit-testing/index.md | 2 ++ blog/content/second-edition/posts/05-integration-tests/index.md | 2 ++ blog/content/second-edition/posts/06-cpu-exceptions/index.md | 2 ++ blog/content/second-edition/posts/07-double-faults/index.md | 2 ++ .../second-edition/posts/08-hardware-interrupts/index.md | 2 ++ .../second-edition/posts/09-paging-introduction/index.md | 2 ++ .../second-edition/posts/10-paging-implementation/index.md | 2 ++ 10 files changed, 20 insertions(+) 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 ac92ea0b..d30e8f15 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 @@ -18,6 +18,8 @@ This blog is openly developed on [GitHub]. If you have any problems or questions [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 98a5f2eb..23674624 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 @@ -18,6 +18,8 @@ This blog is openly developed on [GitHub]. If you have any problems or questions [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 8a82780f..4f811e70 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 @@ -19,6 +19,8 @@ This blog is openly developed on [GitHub]. If you have any problems or questions [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 3fbdf18c..7267fc5b 100644 --- a/blog/content/second-edition/posts/04-unit-testing/index.md +++ b/blog/content/second-edition/posts/04-unit-testing/index.md @@ -16,6 +16,8 @@ This blog is openly developed on [GitHub]. If you have any problems or questions [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 4a50cc04..900c3f41 100644 --- a/blog/content/second-edition/posts/05-integration-tests/index.md +++ b/blog/content/second-edition/posts/05-integration-tests/index.md @@ -16,6 +16,8 @@ This blog is openly developed on [GitHub]. If you have any problems or questions [at the bottom]: #comments [post branch]: https://github.com/phil-opp/blog_os/tree/post-05 + + ## Overview In the previous post we added support for unit tests. The goal of unit tests is to test small components in isolation to ensure that each of them works as intended. The tests are run on the host machine and thus shouldn't rely on architecture specific functionality. 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 2f5eb05f..b102671a 100644 --- a/blog/content/second-edition/posts/06-cpu-exceptions/index.md +++ b/blog/content/second-edition/posts/06-cpu-exceptions/index.md @@ -18,6 +18,8 @@ This blog is openly developed on [GitHub]. If you have any problems or questions [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 ff44432c..876b71d9 100644 --- a/blog/content/second-edition/posts/07-double-faults/index.md +++ b/blog/content/second-edition/posts/07-double-faults/index.md @@ -16,6 +16,8 @@ This blog is openly developed on [GitHub]. If you have any problems or questions [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 b4a00203..2103d52f 100644 --- a/blog/content/second-edition/posts/08-hardware-interrupts/index.md +++ b/blog/content/second-edition/posts/08-hardware-interrupts/index.md @@ -16,6 +16,8 @@ This blog is openly developed on [GitHub]. If you have any problems or questions [at the bottom]: #comments [post branch]: https://github.com/phil-opp/blog_os/tree/post-08 + + ## Overview Interrupts provide a way to notify the CPU from attached hardware devices. So instead of letting the kernel periodically check the keyboard for new characters (a process called [_polling_]), the keyboard can notify the kernel of each keypress. This is much more efficient because the kernel only needs to act when something happened. It also allows faster reaction times, since the kernel can react immediately and not only at the next poll. 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 7474ae53..c9dbec7e 100644 --- a/blog/content/second-edition/posts/09-paging-introduction/index.md +++ b/blog/content/second-edition/posts/09-paging-introduction/index.md @@ -16,6 +16,8 @@ This blog is openly developed on [GitHub]. If you have any problems or questions [at the bottom]: #comments [post branch]: https://github.com/phil-opp/blog_os/tree/post-09 + + ## Memory Protection One main task of an operating system is to isolate programs from each other. Your web browser shouldn't be able to interfere with your text editor, for example. To achieve this goal, operating systems utilize hardware functionality to ensure that memory areas of one process are not accessible by other processes. There are different approaches, depending on the hardware and the OS implementation. diff --git a/blog/content/second-edition/posts/10-paging-implementation/index.md b/blog/content/second-edition/posts/10-paging-implementation/index.md index f5596535..7e2483f1 100644 --- a/blog/content/second-edition/posts/10-paging-implementation/index.md +++ b/blog/content/second-edition/posts/10-paging-implementation/index.md @@ -15,6 +15,8 @@ This blog is openly developed on [GitHub]. If you have any problems or questions [at the bottom]: #comments [post branch]: https://github.com/phil-opp/blog_os/tree/post-10 + +