Model page table entries

This commit is contained in:
Philipp Oppermann
2015-12-08 22:15:32 +01:00
parent d827f51bb6
commit 14384fb27f
5 changed files with 58 additions and 0 deletions

View File

@@ -1,4 +1,5 @@
pub use self::area_frame_allocator::AreaFrameAllocator;
use self::paging::PhysicalAddress;
mod area_frame_allocator;
mod paging;
@@ -14,6 +15,10 @@ impl Frame {
fn containing_address(address: usize) -> Frame {
Frame { number: address / PAGE_SIZE }
}
fn start_address(&self) -> PhysicalAddress {
self.number * PAGE_SIZE
}
}
pub trait FrameAllocator {