Voodlaz

Untitled

Dec 2nd, 2020
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rust 0.32 KB | None | 0 0
  1. pub fn init_idt() {
  2.     let idt = Box::new(InterruptDescriptorTable::new());
  3.     let static_ref = Box::leak(idt);
  4.     static_ref.breakpoint.set_handler_fn(breakpoint_handler);
  5.     static_ref.load();
  6. }
  7.  
  8. extern "x86-interrupt" fn breakpoint_handler(
  9.     stack_frame: &mut InterruptStackFrame)
  10. {
  11.     writer("we're fine");
  12. }
Add Comment
Please, Sign In to add comment