From e6b507e6d20f0bb55eff59f270922ea607dbe672 Mon Sep 17 00:00:00 2001 From: Wilfred Mallawa Date: Thu, 4 May 2023 14:51:45 +1000 Subject: [PATCH] posts/06-double-faults/index: fixup deprecated fn The code segment from the example uses the newer function whilst the text segment refers to the old/deprecated `set_cs` fn. Let's fix that. Signed-off-by: Wilfred Mallawa --- blog/content/edition-2/posts/06-double-faults/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/blog/content/edition-2/posts/06-double-faults/index.md b/blog/content/edition-2/posts/06-double-faults/index.md index 6cc1a0d49..d65ff5ce7 100644 --- a/blog/content/edition-2/posts/06-double-faults/index.md +++ b/blog/content/edition-2/posts/06-double-faults/index.md @@ -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: