Rename naked exception handling section
@@ -17,7 +17,7 @@ As always, the complete source code is on [Github]. Please file [issues] for any
|
|||||||
|
|
||||||
> **Note**: This post describes how to handle exceptions using naked functions (see [“Handling Exceptions with Naked Functions”] for an overview). Our new way of handling exceptions can be found in the [“Handling Exceptions”] post.
|
> **Note**: This post describes how to handle exceptions using naked functions (see [“Handling Exceptions with Naked Functions”] for an overview). Our new way of handling exceptions can be found in the [“Handling Exceptions”] post.
|
||||||
|
|
||||||
[“Handling Exceptions with Naked Functions”]: ./extra/handling-exceptions-with-naked-fns/_index.md
|
[“Handling Exceptions with Naked Functions”]: ./extra/naked-exceptions/_index.md
|
||||||
[“Handling Exceptions”]: ./posts/09-handling-exceptions/index.md
|
[“Handling Exceptions”]: ./posts/09-handling-exceptions/index.md
|
||||||
|
|
||||||
## Exceptions
|
## Exceptions
|
||||||
|
Before Width: | Height: | Size: 9.7 KiB After Width: | Height: | Size: 9.7 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
@@ -18,7 +18,7 @@ As always, the complete source code is on [Github]. Please file [issues] for any
|
|||||||
|
|
||||||
> **Note**: This post describes how to handle exceptions using naked functions (see [“Handling Exceptions with Naked Functions”] for an overview). Our new way of handling exceptions can be found in the [“Handling Exceptions”] post.
|
> **Note**: This post describes how to handle exceptions using naked functions (see [“Handling Exceptions with Naked Functions”] for an overview). Our new way of handling exceptions can be found in the [“Handling Exceptions”] post.
|
||||||
|
|
||||||
[“Handling Exceptions with Naked Functions”]: ./extra/handling-exceptions-with-naked-fns/_index.md
|
[“Handling Exceptions with Naked Functions”]: ./extra/naked-exceptions/_index.md
|
||||||
[“Handling Exceptions”]: ./posts/09-handling-exceptions/index.md
|
[“Handling Exceptions”]: ./posts/09-handling-exceptions/index.md
|
||||||
|
|
||||||
## Exceptions in Detail
|
## Exceptions in Detail
|
||||||
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 8.3 KiB |
@@ -18,7 +18,7 @@ As always, the complete source code is on [Github]. Please file [issues] for any
|
|||||||
|
|
||||||
> **Note**: This post describes how to handle exceptions using naked functions (see [“Handling Exceptions with Naked Functions”] for an overview). Our new way of handling exceptions can be found in the [“Handling Exceptions”] post.
|
> **Note**: This post describes how to handle exceptions using naked functions (see [“Handling Exceptions with Naked Functions”] for an overview). Our new way of handling exceptions can be found in the [“Handling Exceptions”] post.
|
||||||
|
|
||||||
[“Handling Exceptions with Naked Functions”]: ./extra/handling-exceptions-with-naked-fns/_index.md
|
[“Handling Exceptions with Naked Functions”]: ./extra/naked-exceptions/_index.md
|
||||||
[“Handling Exceptions”]: ./posts/09-handling-exceptions/index.md
|
[“Handling Exceptions”]: ./posts/09-handling-exceptions/index.md
|
||||||
|
|
||||||
## Introduction
|
## Introduction
|
||||||
@@ -301,7 +301,7 @@ Unfortunately, Rust does not support such a calling convention. It was [proposed
|
|||||||
|
|
||||||
[interrupt calling conventions]: https://github.com/rust-lang/rfcs/pull/1275
|
[interrupt calling conventions]: https://github.com/rust-lang/rfcs/pull/1275
|
||||||
[Naked functions]: https://github.com/rust-lang/rfcs/blob/master/text/1201-naked-fns.md
|
[Naked functions]: https://github.com/rust-lang/rfcs/blob/master/text/1201-naked-fns.md
|
||||||
[naked fn post]: ./extra/handling-exceptions-with-naked-fns/02-better-exception-messages/index.md#naked-functions
|
[naked fn post]: ./extra/naked-exceptions/02-better-exception-messages/index.md#naked-functions
|
||||||
|
|
||||||
### A naked wrapper function
|
### A naked wrapper function
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.2 KiB |
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 6.7 KiB |
@@ -1,7 +1,7 @@
|
|||||||
+++
|
+++
|
||||||
title = "A minimal x86 kernel"
|
title = "A minimal x86 kernel"
|
||||||
order = 1
|
order = 1
|
||||||
url = "multiboot-kernel"
|
url = "multiboot-kernel/"
|
||||||
date = "2015-08-18"
|
date = "2015-08-18"
|
||||||
+++
|
+++
|
||||||
|
|
||||||
|
|||||||
@@ -490,8 +490,8 @@ _Congratulations_! You have successfully wrestled through this CPU configuration
|
|||||||
#### One Last Thing
|
#### One Last Thing
|
||||||
Above, we reloaded the code segment register `cs` with the new GDT offset. However, the data segment registers `ss`, `ds`, `es`, `fs`, and `gs` still contain the data segment offsets of the old GDT. This isn't necessarily bad, since they're ignored by almost all instructions in 64-bit mode. However, there are a few instructions that expect a valid data segment descriptor _or the null descriptor_ in those registers. An example is the the [iretq] instruction that we'll need in the [_Returning from Exceptions_] post.
|
Above, we reloaded the code segment register `cs` with the new GDT offset. However, the data segment registers `ss`, `ds`, `es`, `fs`, and `gs` still contain the data segment offsets of the old GDT. This isn't necessarily bad, since they're ignored by almost all instructions in 64-bit mode. However, there are a few instructions that expect a valid data segment descriptor _or the null descriptor_ in those registers. An example is the the [iretq] instruction that we'll need in the [_Returning from Exceptions_] post.
|
||||||
|
|
||||||
[iretq]: ./extra/handling-exceptions-with-naked-fns/03-returning-from-exceptions/index.md#the
|
[iretq]: ./extra/naked-exceptions/03-returning-from-exceptions/index.md#the
|
||||||
[_Returning from Exceptions_]: ./extra/handling-exceptions-with-naked-fns/03-returning-from-exceptions/index.md
|
[_Returning from Exceptions_]: ./extra/naked-exceptions/03-returning-from-exceptions/index.md
|
||||||
|
|
||||||
To avoid future problems, we reload all data segment registers with null:
|
To avoid future problems, we reload all data segment registers with null:
|
||||||
|
|
||||||
|
|||||||