mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 22:37:49 +00:00
Fix internal links
This commit is contained in:
@@ -211,7 +211,7 @@ Instead of the expected _“It did not crash”_ message after the breakpoint ex
|
|||||||
### Debugging
|
### Debugging
|
||||||
Let's debug it using GDB. For that we execute `make debug` in one terminal (which starts QEMU with the `-s -S` flags) and then `make gdb` (which starts and connects GDB) in a second terminal. For more information about GDB debugging, check out our [Set Up GDB] guide.
|
Let's debug it using GDB. For that we execute `make debug` in one terminal (which starts QEMU with the `-s -S` flags) and then `make gdb` (which starts and connects GDB) in a second terminal. For more information about GDB debugging, check out our [Set Up GDB] guide.
|
||||||
|
|
||||||
[Set Up GDB]: ./extra/set-up-gdb.md
|
[Set Up GDB]: ./extra/set-up-gdb/index.md
|
||||||
|
|
||||||
First we want to check if our `iretq` was successful. Therefore we set a breakpoint on the `println!("It did not crash line!")` statement in `src/lib.rs`. Let's assume that it's on line 61:
|
First we want to check if our `iretq` was successful. Therefore we set a breakpoint on the `println!("It did not crash line!")` statement in `src/lib.rs`. Let's assume that it's on line 61:
|
||||||
|
|
||||||
@@ -299,7 +299,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/better-exception-messages.md#naked-functions
|
[naked fn post]: ./extra/handling-exceptions-with-naked-fns/02-better-exception-messages/index.md#naked-functions
|
||||||
|
|
||||||
### A naked wrapper function
|
### A naked wrapper function
|
||||||
|
|
||||||
|
|||||||
@@ -494,8 +494,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/returning-from-exceptions.md#the-iretq-instruct/indexion
|
[iretq]: ./extra/handling-exceptions-with-naked-fns/03-returning-from-exceptions/index.md#the-iretq-instruction
|
||||||
[_Returning from Exceptions_]: ./extra/handling-exceptions-with-naked-fns/returning-from-exceptions.md
|
[_Returning from Exceptions_]: ./extra/handling-exceptions-with-naked-fns/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:
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ Also, we will use the [information about kernel sections] to map the various sec
|
|||||||
|
|
||||||
## Preparation
|
## Preparation
|
||||||
There are many things that can go wrong when we switch to a new table. Therefore it's a good idea to [set up a debugger][set up gdb]. You should not need it when you follow this post, but it's good to know how to debug a problem when it occurs[^fn-debug-notes].
|
There are many things that can go wrong when we switch to a new table. Therefore it's a good idea to [set up a debugger][set up gdb]. You should not need it when you follow this post, but it's good to know how to debug a problem when it occurs[^fn-debug-notes].
|
||||||
[set up gdb]: ./extra/set-up-gdb.md
|
[set up gdb]: ./extra/set-up-gdb/index.md
|
||||||
|
|
||||||
We also update the `Page` and `Frame` types to make our lives easier. The `Page` struct gets some derived traits:
|
We also update the `Page` and `Frame` types to make our lives easier. The `Page` struct gets some derived traits:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user