diff --git a/src/main.rs b/src/main.rs index 10b38955..0d3e0df6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,9 +4,12 @@ #![test_runner(blog_os::test_runner)] #![reexport_test_harness_main = "test_main"] +extern crate alloc; + use blog_os::println; use bootloader::{entry_point, BootInfo}; use core::panic::PanicInfo; +use alloc::boxed::Box; entry_point!(kernel_main); @@ -20,13 +23,7 @@ fn kernel_main(boot_info: &'static BootInfo) -> ! { let mut mapper = unsafe { memory::init(boot_info.physical_memory_offset) }; let mut frame_allocator = unsafe { BootInfoFrameAllocator::init(&boot_info.memory_map) }; - // map a previously unmapped page - let page = Page::containing_address(VirtAddr::new(0xdeadbeaf000)); - memory::create_example_mapping(page, &mut mapper, &mut frame_allocator); - - // write the string `New!` to the screen through the new mapping - let page_ptr: *mut u64 = page.start_address().as_mut_ptr(); - unsafe { page_ptr.offset(400).write_volatile(0x_f021_f077_f065_f04e) }; + let x = Box::new(41); #[cfg(test)] test_main();