Add and call test_paging function

This commit is contained in:
Philipp Oppermann
2015-12-09 12:08:41 +01:00
parent 4fd8891aff
commit d8c6b6f5b7
4 changed files with 30 additions and 8 deletions

View File

@@ -59,13 +59,7 @@ pub extern fn rust_main(multiboot_information_address: usize) {
let mut frame_allocator = memory::AreaFrameAllocator::new(kernel_start as usize,
kernel_end as usize, multiboot_start, multiboot_end, memory_map_tag.memory_areas());
for i in 0.. {
use memory::FrameAllocator;
if let None = frame_allocator.allocate_frame() {
println!("allocated {} frames", i);
break;
}
}
memory::test_paging(&mut frame_allocator);
loop{}
}

View File

@@ -1,4 +1,5 @@
pub use self::area_frame_allocator::AreaFrameAllocator;
pub use self::paging::test_paging;
use self::paging::PhysicalAddress;
mod area_frame_allocator;

View File

@@ -143,3 +143,9 @@ impl RecursivePageTable {
allocator.deallocate_frame(frame);
}
}
pub fn test_paging<A>(allocator: &mut A)
where A: FrameAllocator
{
let page_table = unsafe { RecursivePageTable::new() };
}