mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 14:27:49 +00:00
Trigger a double fault through a stack overflow -> triple fault
This commit is contained in:
10
src/main.rs
10
src/main.rs
@@ -12,10 +12,12 @@ pub extern "C" fn _start() -> ! {
|
|||||||
|
|
||||||
blog_os::interrupts::init_idt();
|
blog_os::interrupts::init_idt();
|
||||||
|
|
||||||
// trigger a page fault
|
fn stack_overflow() {
|
||||||
unsafe {
|
stack_overflow(); // for each recursion, the return address is pushed
|
||||||
*(0xdeadbeef as *mut u64) = 42;
|
}
|
||||||
};
|
|
||||||
|
// trigger a stack overflow
|
||||||
|
stack_overflow();
|
||||||
|
|
||||||
println!("It did not crash!");
|
println!("It did not crash!");
|
||||||
loop {}
|
loop {}
|
||||||
|
|||||||
Reference in New Issue
Block a user