This commit is contained in:
Faynot
2026-06-26 22:12:02 +03:00
parent b59779ca4a
commit e3ac9612c9

View File

@@ -56,4 +56,14 @@ impl InterruptDescriptorTable {
self.entries[vector as usize].set_handler(handler, 0x28, 0x8E); self.entries[vector as usize].set_handler(handler, 0x28, 0x8E);
} }
pub unsafe fn load(&'static self) {
let ptr = IdtPtr {
limit: (core::mem::size_of::<Self>() - 1) as u16,
base: self as *const _ as u64,
};
unsafe {
asm!("lidt [{}]", in(reg) &ptr, options(readonly, nostack, preserves_flags));
}
}
} }