Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
Freax13 committed Nov 10, 2021
1 parent 597ff85 commit a20c8da
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions testing/src/gdt.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use lazy_static::lazy_static;
use x86_64::structures::gdt::{Descriptor, GlobalDescriptorTable, SegmentSelector};
use x86_64::structures::tss::TaskStateSegment;
use x86_64::VirtAddr;
use x86_64::{Singleton, VirtAddr};

pub const DOUBLE_FAULT_IST_INDEX: u16 = 0;

Expand All @@ -18,12 +18,12 @@ lazy_static! {
};
tss
};
static ref GDT: (GlobalDescriptorTable, Selectors) = {
static ref GDT: (Singleton<GlobalDescriptorTable>, Selectors) = {
let mut gdt = GlobalDescriptorTable::new();
let code_selector = gdt.add_entry(Descriptor::kernel_code_segment());
let tss_selector = gdt.add_entry(Descriptor::tss_segment(&TSS));
(
gdt,
gdt: Singleton::new(gdt),
Selectors {
code_selector,
tss_selector,
Expand All @@ -41,7 +41,7 @@ pub fn init() {
use x86_64::instructions::segmentation::{CS, Segment};
use x86_64::instructions::tables::load_tss;

GDT.0.load();
GDT.try_get_mut().unwrap().load();
unsafe {
CS::set_reg(GDT.1.code_selector);
load_tss(GDT.1.tss_selector);
Expand Down

0 comments on commit a20c8da

Please sign in to comment.