mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 22:37:49 +00:00
Create a index page for handling exceptions using naked fns
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
+++
|
||||
title = "Handling Exceptions using Naked Functions"
|
||||
+++
|
||||
|
||||
<p>These posts explain how to handle CPU exceptions using naked functions.
|
||||
Historically, these posts were the main exception handling posts before the
|
||||
<code>x86-interrupt</code> calling convention and the <code>x86_64</code> crate existed.
|
||||
Our new way of handling exceptions can be found in the
|
||||
<a href="/handling-exceptions.html">“Handling Exceptions”</a> post.
|
||||
</p>
|
||||
|
||||
<div class="posts exceptions">
|
||||
|
||||
<article class="post">
|
||||
<h2 class="post-title">
|
||||
<a href="/catching-exceptions.html">
|
||||
Catching Exceptions
|
||||
</a>
|
||||
</h2>
|
||||
|
||||
<p>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.</p>
|
||||
|
||||
</article>
|
||||
|
||||
|
||||
<article class="post">
|
||||
<h2 class="post-title">
|
||||
<a href="/better-exception-messages.html">
|
||||
Better Exception Messages
|
||||
</a>
|
||||
</h2>
|
||||
|
||||
<p>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.</p>
|
||||
|
||||
</article>
|
||||
|
||||
|
||||
<article class="post">
|
||||
<h2 class="post-title">
|
||||
<a href="/returning-from-exceptions.html">
|
||||
Returning from Exceptions
|
||||
</a>
|
||||
</h2>
|
||||
|
||||
<p>In this post, we learn how to return from exceptions correctly. In the course of this, we will explore the <code>iretq</code> instruction, the C calling convention, multimedia registers, and the red zone.</p>
|
||||
|
||||
</article>
|
||||
</div>
|
||||
@@ -440,7 +440,7 @@ The documentation of the [`Idt`] struct and the [OSDev Wiki][osdev wiki exceptio
|
||||
## Too much Magic?
|
||||
The `x86-interrupt` calling convention and the [`Idt`] type made the exception handling process relatively straightforward and painless. If this was too much magic for you and you like to learn all the gory details of exception handling, we got you covered: Our [“Handling Exceptions with Naked Functions”] series shows how to handle exceptions without the `x86-interrupt` calling convention and also creates its own `Idt` type. Historically, these posts were the main exception handling posts before the `x86-interrupt` calling convention and the `x86_64` crate existed.
|
||||
|
||||
[“Handling Exceptions with Naked Functions”]: {{% relref "handling-exceptions-with-naked-fns.md" %}}
|
||||
[“Handling Exceptions with Naked Functions”]: {{% relref "handling-exceptions-with-naked-fns.html" %}}
|
||||
|
||||
## What's next?
|
||||
We've successfully caught our first exception and returned from it! The next step is to add handlers for other common exceptions such as page faults. We also need to make sure that we never cause a [triple fault], since it causes a complete system reset. The next post explains how we can avoid this by correctly catching [double faults].
|
||||
|
||||
Reference in New Issue
Block a user