mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 14:27:49 +00:00
Try to allocate something (causes a page fault)
This commit is contained in:
@@ -61,6 +61,10 @@ pub extern "C" fn rust_main(multiboot_information_address: usize) {
|
|||||||
enable_write_protect_bit();
|
enable_write_protect_bit();
|
||||||
|
|
||||||
memory::remap_the_kernel(&mut frame_allocator, boot_info);
|
memory::remap_the_kernel(&mut frame_allocator, boot_info);
|
||||||
|
|
||||||
|
use alloc::boxed::Box;
|
||||||
|
let heap_test = Box::new(42);
|
||||||
|
|
||||||
println!("It did not crash!");
|
println!("It did not crash!");
|
||||||
|
|
||||||
loop {}
|
loop {}
|
||||||
@@ -94,3 +98,8 @@ extern "C" fn panic_fmt(fmt: core::fmt::Arguments, file: &str, line: u32) -> ! {
|
|||||||
println!(" {}", fmt);
|
println!(" {}", fmt);
|
||||||
loop {}
|
loop {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[no_mangle]
|
||||||
|
pub extern fn _Unwind_Resume() -> ! {
|
||||||
|
loop{}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user