From 7954a9f424194379da5ff6496987707943612732 Mon Sep 17 00:00:00 2001 From: Ford Smith <41210901+Programatic@users.noreply.github.com> Date: Thu, 17 Mar 2022 23:42:00 -0400 Subject: [PATCH 1/3] Set CS register with non-deprecated function set_cs is deprecated and CS::set_reg is preferred. Update the blog to reflect this change according to the docs. --- blog/content/edition-2/posts/06-double-faults/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 02a13d01..16ea0d05 100644 --- a/blog/content/edition-2/posts/06-double-faults/index.md +++ b/blog/content/edition-2/posts/06-double-faults/index.md @@ -368,7 +368,7 @@ pub fn init() { GDT.0.load(); unsafe { - set_cs(GDT.1.code_selector); + CS::set_reg(GDT.1.code_selector); load_tss(GDT.1.tss_selector); } } From c393e4442dc6cbe55507a69ace11fed9581fd9c5 Mon Sep 17 00:00:00 2001 From: Ford Smith <41210901+Programatic@users.noreply.github.com> Date: Sat, 19 Mar 2022 13:02:16 -0400 Subject: [PATCH 2/3] Update blog/content/edition-2/posts/06-double-faults/index.md Accidentally forgot to update the use statements. Co-authored-by: ruhuang --- blog/content/edition-2/posts/06-double-faults/index.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 16ea0d05..6997a36b 100644 --- a/blog/content/edition-2/posts/06-double-faults/index.md +++ b/blog/content/edition-2/posts/06-double-faults/index.md @@ -365,7 +365,8 @@ Now we can use the selectors to reload the `cs` segment register and load our `T pub fn init() { use x86_64::instructions::segmentation::set_cs; use x86_64::instructions::tables::load_tss; - +// use x86_64::instructions::segmentation::set_cs; +use x86_64::instructions::segmentation::{CS, Segment}; GDT.0.load(); unsafe { CS::set_reg(GDT.1.code_selector); From f56b4a0a32cdfa230351e1b086950bc64be46035 Mon Sep 17 00:00:00 2001 From: Ford Smith <41210901+Programatic@users.noreply.github.com> Date: Sat, 19 Mar 2022 13:03:40 -0400 Subject: [PATCH 3/3] Fix formatting and remove commented use statements --- blog/content/edition-2/posts/06-double-faults/index.md | 5 ++--- 1 file changed, 2 insertions(+), 3 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 6997a36b..972468b7 100644 --- a/blog/content/edition-2/posts/06-double-faults/index.md +++ b/blog/content/edition-2/posts/06-double-faults/index.md @@ -363,10 +363,9 @@ Now we can use the selectors to reload the `cs` segment register and load our `T // in src/gdt.rs pub fn init() { - use x86_64::instructions::segmentation::set_cs; use x86_64::instructions::tables::load_tss; -// use x86_64::instructions::segmentation::set_cs; -use x86_64::instructions::segmentation::{CS, Segment}; + use x86_64::instructions::segmentation::{CS, Segment}; + GDT.0.load(); unsafe { CS::set_reg(GDT.1.code_selector);