Create a heap memory area

This commit is contained in:
Philipp Oppermann
2019-06-26 13:14:56 +02:00
parent d4623419b0
commit 06fc63028a
2 changed files with 37 additions and 2 deletions

View File

@@ -14,8 +14,8 @@ use alloc::boxed::Box;
entry_point!(kernel_main);
fn kernel_main(boot_info: &'static BootInfo) -> ! {
use blog_os::allocator;
use blog_os::memory::{self, BootInfoFrameAllocator};
use x86_64::{structures::paging::Page, VirtAddr};
println!("Hello World{}", "!");
blog_os::init();
@@ -23,6 +23,9 @@ 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) };
allocator::init_heap(&mut mapper, &mut frame_allocator)
.expect("heap initialization failed");
let x = Box::new(41);
#[cfg(test)]