mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 14:27:49 +00:00
Create a interrupts::gdt submodule
This commit is contained in:
13
src/interrupts/gdt.rs
Normal file
13
src/interrupts/gdt.rs
Normal file
@@ -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,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,6 +3,8 @@ use x86_64::structures::idt::{Idt, ExceptionStackFrame};
|
|||||||
use x86_64::structures::tss::TaskStateSegment;
|
use x86_64::structures::tss::TaskStateSegment;
|
||||||
use memory::MemoryController;
|
use memory::MemoryController;
|
||||||
|
|
||||||
|
mod gdt;
|
||||||
|
|
||||||
lazy_static! {
|
lazy_static! {
|
||||||
static ref IDT: Idt = {
|
static ref IDT: Idt = {
|
||||||
let mut idt = Idt::new();
|
let mut idt = Idt::new();
|
||||||
|
|||||||
Reference in New Issue
Block a user