Kernel: Make a portable wrapper for the breakpoint instruction
This commit is contained in:
parent
d2fb4a68ca
commit
06c7bbac0d
@ -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"); }
|
||||||
|
}
|
@ -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!");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user