Skip to content

Commit

Permalink
Merge pull request #1218 from twilfredo/wilfred/fixup_deprecated_fn
Browse files Browse the repository at this point in the history
posts/06-double-faults/index: fixup deprecated fn
  • Loading branch information
phil-opp authored Jun 2, 2023
2 parents f38c11a + e6b507e commit c728cf8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions blog/content/edition-2/posts/06-double-faults/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -374,9 +374,9 @@ pub fn init() {
}
```

We reload the code segment register using [`set_cs`] and load the TSS using [`load_tss`]. The functions are marked as `unsafe`, so we need an `unsafe` block to invoke them. The reason is that it might be possible to break memory safety by loading invalid selectors.
We reload the code segment register using [`CS::set_reg`] and load the TSS using [`load_tss`]. The functions are marked as `unsafe`, so we need an `unsafe` block to invoke them. The reason is that it might be possible to break memory safety by loading invalid selectors.

[`set_cs`]: https://docs.rs/x86_64/0.14.2/x86_64/instructions/segmentation/fn.set_cs.html
[`CS::set_reg`]: https://docs.rs/x86_64/0.14.5/x86_64/instructions/segmentation/struct.CS.html#method.set_reg
[`load_tss`]: https://docs.rs/x86_64/0.14.2/x86_64/instructions/tables/fn.load_tss.html

Now that we have loaded a valid TSS and interrupt stack table, we can set the stack index for our double fault handler in the IDT:
Expand Down

0 comments on commit c728cf8

Please sign in to comment.