mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 22:37:49 +00:00
Fix broken links in “Double Faults” (#275)
This commit is contained in:
committed by
GitHub
parent
1549e318a5
commit
f6a1faab96
@@ -366,8 +366,8 @@ impl MemoryController {
|
||||
```
|
||||
The `MemoryController` struct holds the three types that are required for `alloc_stack` and provides a simpler interface (only one argument). The `alloc_stack` wrapper just takes the tree types as `&mut` through [destructuring] and forwards them to the `stack_allocator`. The [ref mut]-s are needed to take the inner fields by mutable reference. Note that we're re-exporting the `Stack` type since it is returned by `alloc_stack`.
|
||||
|
||||
[destructuring]: http://rust-lang.github.io/book/chXX-patterns.html#Destructuring
|
||||
[ref mut]: http://rust-lang.github.io/book/chXX-patterns.html#ref-and-ref-mut
|
||||
[destructuring]: http://rust-lang.github.io/book/ch18-00-patterns.html#Destructuring
|
||||
[ref mut]: http://rust-lang.github.io/book/ch18-00-patterns.html#ref-and-ref-mut
|
||||
|
||||
The last step is to create a `StackAllocator` and return a `MemoryController` from `memory::init`:
|
||||
|
||||
@@ -500,7 +500,7 @@ pub fn init(memory_controller: &mut MemoryController) {
|
||||
We define that the 0th IST entry is the double fault stack (any other IST index would work too). We create a new TSS through the `TaskStateSegment::new` function and load the top address (stacks grow downwards) of the double fault stack into the 0th entry.
|
||||
|
||||
#### Loading the TSS
|
||||
Now that we created a new TSS, we need a way to tell the CPU that it should use it. Unfortunately, this is a bit cumbersome, since the TSS is a Task State _Segment_ (for historical reasons). So instead of loading the table directly, we need to add a new segment descriptor to the [Global Descriptor Table] (GDT). Then we can load our TSS invoking the [`ltr` instruction] with the respective GDT index.
|
||||
Now that we created a new TSS, we need a way to tell the CPU that it should use it. Unfortunately, this is a bit cumbersome, since the TSS is a Task State _Segment_ (for historical reasons). So instead of loading the table directly, we need to add a new segment descriptor to the [Global Descriptor Table] \(GDT). Then we can load our TSS invoking the [`ltr` instruction] with the respective GDT index.
|
||||
|
||||
[Global Descriptor Table]: http://www.flingos.co.uk/docs/reference/Global-Descriptor-Table/
|
||||
[`ltr` instruction]: http://x86.renejeschke.de/html/file_module_x86_id_163.html
|
||||
|
||||
Reference in New Issue
Block a user