mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 22:37:49 +00:00
Test the unmap function (it doesn't work correctly)
This commit is contained in:
@@ -50,7 +50,7 @@ impl FrameAllocator for AreaFrameAllocator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn deallocate_frame(&mut self, _frame: Frame) {
|
fn deallocate_frame(&mut self, _frame: Frame) {
|
||||||
unimplemented!()
|
//unimplemented!()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -167,4 +167,15 @@ pub fn test_paging<A>(allocator: &mut A)
|
|||||||
page_table.map_to(page, frame, EntryFlags::empty(), allocator);
|
page_table.map_to(page, frame, EntryFlags::empty(), allocator);
|
||||||
println!("Some = {:?}", page_table.translate(addr));
|
println!("Some = {:?}", page_table.translate(addr));
|
||||||
println!("next free frame: {:?}", allocator.allocate_frame());
|
println!("next free frame: {:?}", allocator.allocate_frame());
|
||||||
|
|
||||||
|
println!("{:#x}", unsafe {
|
||||||
|
*(Page::containing_address(addr).start_address() as *const u64)
|
||||||
|
});
|
||||||
|
|
||||||
|
page_table.unmap(Page::containing_address(addr), allocator);
|
||||||
|
println!("None = {:?}", page_table.translate(addr));
|
||||||
|
|
||||||
|
println!("{:#x}", unsafe {
|
||||||
|
*(Page::containing_address(addr).start_address() as *const u64)
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user