mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 22:37:49 +00:00
49 lines
1.7 KiB
HTML
49 lines
1.7 KiB
HTML
+++
|
|
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>
|