Kernel: Make a portable wrapper for the breakpoint instruction

This commit is contained in:
apio 2022-11-01 11:10:55 +01:00
parent d2fb4a68ca
commit 06c7bbac0d
2 changed files with 5 additions and 3 deletions

View File

@ -25,3 +25,7 @@ pub fn halt() -> ! {
pub fn wait_for_interrupt() -> () { pub fn wait_for_interrupt() -> () {
unsafe { asm!("hlt"); } unsafe { asm!("hlt"); }
} }
pub fn breakpoint() -> () {
unsafe { asm!("int3"); }
}

View File

@ -15,8 +15,6 @@ mod log;
use arch::cpu; use arch::cpu;
use arch::interrupts; use arch::interrupts;
use x86_64::instructions::interrupts::int3;
use video::Color; use video::Color;
#[no_mangle] #[no_mangle]
@ -35,7 +33,7 @@ pub extern "C" fn _start() -> ! {
interrupts::enable(); interrupts::enable();
int3(); cpu::breakpoint();
println!("Still here!"); println!("Still here!");