diff --git a/src/memory/mod.rs b/src/memory/mod.rs index 98b36e0..daa3478 100644 --- a/src/memory/mod.rs +++ b/src/memory/mod.rs @@ -19,6 +19,10 @@ impl Frame { fn start_address(&self) -> PhysicalAddress { self.number * PAGE_SIZE } + + fn clone(&self) -> Frame { + Frame { number: self.number } + } } pub trait FrameAllocator { diff --git a/src/memory/paging/mod.rs b/src/memory/paging/mod.rs index a096654..8273feb 100644 --- a/src/memory/paging/mod.rs +++ b/src/memory/paging/mod.rs @@ -11,6 +11,7 @@ const ENTRY_COUNT: usize = 512; pub type PhysicalAddress = usize; pub type VirtualAddress = usize; +#[derive(Debug, Clone, Copy)] pub struct Page { number: usize, }