diff --git a/src/memory/mod.rs b/src/memory/mod.rs index 7bfc85d8..7287b464 100644 --- a/src/memory/mod.rs +++ b/src/memory/mod.rs @@ -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 } } } diff --git a/src/memory/paging/mod.rs b/src/memory/paging/mod.rs new file mode 100644 index 00000000..ae5b85fd --- /dev/null +++ b/src/memory/paging/mod.rs @@ -0,0 +1,8 @@ +const ENTRY_COUNT: usize = 512; + +pub type PhysicalAddress = usize; +pub type VirtualAddress = usize; + +pub struct Page { + number: usize, +}