Create basic paging module

This commit is contained in:
Philipp Oppermann
2015-12-08 22:14:42 +01:00
parent dabef43db9
commit d827f51bb6
2 changed files with 10 additions and 1 deletions

View File

@@ -1,6 +1,7 @@
pub use self::area_frame_allocator::AreaFrameAllocator;
mod area_frame_allocator;
mod paging;
pub const PAGE_SIZE: usize = 4096;
@@ -11,7 +12,7 @@ pub struct Frame {
impl Frame {
fn containing_address(address: usize) -> Frame {
Frame{ number: address / PAGE_SIZE }
Frame { number: address / PAGE_SIZE }
}
}

8
src/memory/paging/mod.rs Normal file
View File

@@ -0,0 +1,8 @@
const ENTRY_COUNT: usize = 512;
pub type PhysicalAddress = usize;
pub type VirtualAddress = usize;
pub struct Page {
number: usize,
}