From eea8c10a97f2aa32bc5e4d8c7111f79377a9a411 Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Tue, 18 Apr 2017 18:25:32 +0200 Subject: [PATCH] Create a interrupts::gdt submodule --- src/interrupts/gdt.rs | 13 +++++++++++++ src/interrupts/mod.rs | 2 ++ 2 files changed, 15 insertions(+) create mode 100644 src/interrupts/gdt.rs diff --git a/src/interrupts/gdt.rs b/src/interrupts/gdt.rs new file mode 100644 index 0000000..bf23aaf --- /dev/null +++ b/src/interrupts/gdt.rs @@ -0,0 +1,13 @@ +pub struct Gdt { + table: [u64; 8], + next_free: usize, +} + +impl Gdt { + pub fn new() -> Gdt { + Gdt { + table: [0; 8], + next_free: 1, + } + } +} diff --git a/src/interrupts/mod.rs b/src/interrupts/mod.rs index 643cf7a..78f4be8 100644 --- a/src/interrupts/mod.rs +++ b/src/interrupts/mod.rs @@ -3,6 +3,8 @@ use x86_64::structures::idt::{Idt, ExceptionStackFrame}; use x86_64::structures::tss::TaskStateSegment; use memory::MemoryController; +mod gdt; + lazy_static! { static ref IDT: Idt = { let mut idt = Idt::new();