Try to allocate something (causes a page fault)

This commit is contained in:
Philipp Oppermann
2016-04-11 22:13:38 +02:00
parent f25cb599c2
commit 9e46fb21c7

View File

@@ -61,6 +61,10 @@ pub extern "C" fn rust_main(multiboot_information_address: usize) {
enable_write_protect_bit();
memory::remap_the_kernel(&mut frame_allocator, boot_info);
use alloc::boxed::Box;
let heap_test = Box::new(42);
println!("It did not crash!");
loop {}
@@ -94,3 +98,8 @@ extern "C" fn panic_fmt(fmt: core::fmt::Arguments, file: &str, line: u32) -> ! {
println!(" {}", fmt);
loop {}
}
#[no_mangle]
pub extern fn _Unwind_Resume() -> ! {
loop{}
}