From 186ce23e110a1248b0ad92116a6bf9e0ab7d8cae Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Tue, 2 May 2017 08:53:46 +0200 Subject: [PATCH] Move additional-resources/old-posts to a section named `extra` --- .../handling-exceptions-with-naked-fns.html | 48 ------------------- .../cross-compile-binutils.md | 2 + .../cross-compile-libcore.md | 2 + .../_index.md | 5 ++ .../better-exception-messages.md | 4 +- .../catching-exceptions.md | 4 +- .../returning-from-exceptions.md | 4 +- .../set-up-gdb.md | 2 + 8 files changed, 20 insertions(+), 51 deletions(-) delete mode 100644 blog/content/additional-resources/handling-exceptions-with-naked-fns.html rename blog/content/{additional-resources => extra}/cross-compile-binutils.md (97%) rename blog/content/{additional-resources => extra}/cross-compile-libcore.md (97%) create mode 100644 blog/content/extra/handling-exceptions-with-naked-fns/_index.md rename blog/content/{old-posts => extra/handling-exceptions-with-naked-fns}/better-exception-messages.md (99%) rename blog/content/{old-posts => extra/handling-exceptions-with-naked-fns}/catching-exceptions.md (99%) rename blog/content/{old-posts => extra/handling-exceptions-with-naked-fns}/returning-from-exceptions.md (99%) rename blog/content/{additional-resources => extra}/set-up-gdb.md (99%) diff --git a/blog/content/additional-resources/handling-exceptions-with-naked-fns.html b/blog/content/additional-resources/handling-exceptions-with-naked-fns.html deleted file mode 100644 index 757a067f..00000000 --- a/blog/content/additional-resources/handling-exceptions-with-naked-fns.html +++ /dev/null @@ -1,48 +0,0 @@ -+++ -title = "Handling Exceptions using Naked Functions" -+++ - -

These posts explain how to handle CPU exceptions using naked functions. - Historically, these posts were the main exception handling posts before the - x86-interrupt calling convention and the x86_64 crate existed. - Our new way of handling exceptions can be found in the - “Handling Exceptions” post. -

- -
- -
-

- - Catching Exceptions - -

- -

In this post, we start exploring exceptions. We set up an interrupt descriptor table and add handler functions. At the end of this post, our kernel will be able to catch divide-by-zero faults.

- -
- - -
-

- - Better Exception Messages - -

- -

In this post, we explore exceptions in more detail. Our goal is to print additional information when an exception occurs, for example the values of the instruction and stack pointer. In the course of this, we will explore inline assembly and naked functions. We will also add a handler function for page faults and read the associated error code.

- -
- - -
-

- - Returning from Exceptions - -

- -

In this post, we learn how to return from exceptions correctly. In the course of this, we will explore the iretq instruction, the C calling convention, multimedia registers, and the red zone.

- -
-
diff --git a/blog/content/additional-resources/cross-compile-binutils.md b/blog/content/extra/cross-compile-binutils.md similarity index 97% rename from blog/content/additional-resources/cross-compile-binutils.md rename to blog/content/extra/cross-compile-binutils.md index 3f8d99a4..53ae157f 100644 --- a/blog/content/additional-resources/cross-compile-binutils.md +++ b/blog/content/extra/cross-compile-binutils.md @@ -1,5 +1,7 @@ +++ title = "Cross Compile Binutils" +description = "" +slug = "cross-compile-binutils" +++ The [GNU Binutils] are a collection of various binary tools such as `ld`, `as`, `objdump`, or `readelf`. These tools are platform-specific, so you need to compile them again if your host system and target system are different. In our case, we need `ld` and `objdump` for the x86_64 architecture. diff --git a/blog/content/additional-resources/cross-compile-libcore.md b/blog/content/extra/cross-compile-libcore.md similarity index 97% rename from blog/content/additional-resources/cross-compile-libcore.md rename to blog/content/extra/cross-compile-libcore.md index 3e3084ee..5bea13eb 100644 --- a/blog/content/additional-resources/cross-compile-libcore.md +++ b/blog/content/extra/cross-compile-libcore.md @@ -1,5 +1,7 @@ +++ title = "Cross Compiling: libcore" +description = "" +slug = "cross-compile-libcore" +++ If you get an `error: can't find crate for 'core'`, you're probably compiling for a different target (e.g. you're passing the `target` option to `cargo build`). Now the compiler complains that it can't find the `core` library. This document gives a quick overview how to fix this problem. For more details, see the [rust-cross] project. diff --git a/blog/content/extra/handling-exceptions-with-naked-fns/_index.md b/blog/content/extra/handling-exceptions-with-naked-fns/_index.md new file mode 100644 index 00000000..c5f74fb2 --- /dev/null +++ b/blog/content/extra/handling-exceptions-with-naked-fns/_index.md @@ -0,0 +1,5 @@ ++++ +title = "Handling Exceptions using naked Functions" +description = "" +template = "handling-exceptions-with-naked-fns.html" ++++ diff --git a/blog/content/old-posts/better-exception-messages.md b/blog/content/extra/handling-exceptions-with-naked-fns/better-exception-messages.md similarity index 99% rename from blog/content/old-posts/better-exception-messages.md rename to blog/content/extra/handling-exceptions-with-naked-fns/better-exception-messages.md index d2451765..1efbbc8e 100644 --- a/blog/content/old-posts/better-exception-messages.md +++ b/blog/content/extra/handling-exceptions-with-naked-fns/better-exception-messages.md @@ -1,12 +1,14 @@ +++ title = "Better Exception Messages" +description = "" +slug = "better-exception-messages" date = "2016-08-03" updated = "2016-11-01" +++ In this post, we explore exceptions in more detail. Our goal is to print additional information when an exception occurs, for example the values of the instruction and stack pointer. In the course of this, we will explore inline assembly and naked functions. We will also add a handler function for page faults and read the associated error code. - + As always, the complete source code is on [Github]. Please file [issues] for any problems, questions, or improvement suggestions. There is also a [gitter chat] and a [comment section] at the end of this page. diff --git a/blog/content/old-posts/catching-exceptions.md b/blog/content/extra/handling-exceptions-with-naked-fns/catching-exceptions.md similarity index 99% rename from blog/content/old-posts/catching-exceptions.md rename to blog/content/extra/handling-exceptions-with-naked-fns/catching-exceptions.md index 475fa03a..9d7e7b60 100644 --- a/blog/content/old-posts/catching-exceptions.md +++ b/blog/content/extra/handling-exceptions-with-naked-fns/catching-exceptions.md @@ -1,12 +1,14 @@ +++ title = "Catching Exceptions" +description = "" +slug = "catching-exceptions" date = "2016-05-28" updated = "2016-06-25" +++ In this post, we start exploring exceptions. We set up an interrupt descriptor table and add handler functions. At the end of this post, our kernel will be able to catch divide-by-zero faults. - + As always, the complete source code is on [Github]. Please file [issues] for any problems, questions, or improvement suggestions. There is also a comment section at the end of this page. diff --git a/blog/content/old-posts/returning-from-exceptions.md b/blog/content/extra/handling-exceptions-with-naked-fns/returning-from-exceptions.md similarity index 99% rename from blog/content/old-posts/returning-from-exceptions.md rename to blog/content/extra/handling-exceptions-with-naked-fns/returning-from-exceptions.md index bf0b568f..f1db1d2e 100644 --- a/blog/content/old-posts/returning-from-exceptions.md +++ b/blog/content/extra/handling-exceptions-with-naked-fns/returning-from-exceptions.md @@ -1,12 +1,14 @@ +++ title = "Returning from Exceptions" +description = "" +slug = "returning-from-exceptions" date = "2016-09-21" updated = "2016-11-01" +++ In this post, we learn how to return from exceptions correctly. In the course of this, we will explore the `iretq` instruction, the C calling convention, multimedia registers, and the red zone. - + As always, the complete source code is on [Github]. Please file [issues] for any problems, questions, or improvement suggestions. There is also a [gitter chat] and a [comment section] at the end of this page. diff --git a/blog/content/additional-resources/set-up-gdb.md b/blog/content/extra/set-up-gdb.md similarity index 99% rename from blog/content/additional-resources/set-up-gdb.md rename to blog/content/extra/set-up-gdb.md index 177a46cd..2f8f6197 100644 --- a/blog/content/additional-resources/set-up-gdb.md +++ b/blog/content/extra/set-up-gdb.md @@ -1,5 +1,7 @@ +++ title = "Set Up GDB" +description = "" +slug = "set-up-gdb" +++ There are a lot of things that can go wrong when developing an OS. So it's a good idea to add a debugger to our toolset, which allows us to set breakpoints and examine variables. We will use [GDB](https://www.gnu.org/software/gdb/) as QEMU supports it out of the box.