+ + 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.
+ +diff --git a/blog/config.toml b/blog/config.toml index 5c88a84b..75f944ef 100644 --- a/blog/config.toml +++ b/blog/config.toml @@ -21,6 +21,7 @@ disableKinds = ["section", "taxonomy", "taxonomyTerm"] [permalinks] post = "/:slug.html" + old-posts = "/:slug.html" additional-resource = "/:filename.html" page = "/:filename.html" diff --git a/blog/content/additional-resource/handling-exceptions-with-naked-fns.html b/blog/content/additional-resource/handling-exceptions-with-naked-fns.html new file mode 100644 index 00000000..757a067f --- /dev/null +++ b/blog/content/additional-resource/handling-exceptions-with-naked-fns.html @@ -0,0 +1,48 @@ ++++ +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.
+
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.
+ +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.
+ +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.