diff --git a/src/memory/mod.rs b/src/memory/mod.rs index ffd418e5..33e1f8d1 100644 --- a/src/memory/mod.rs +++ b/src/memory/mod.rs @@ -29,6 +29,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 dc598c5e..122ff2a4 100644 --- a/src/memory/paging/mod.rs +++ b/src/memory/paging/mod.rs @@ -20,6 +20,7 @@ const ENTRY_COUNT: usize = 512; pub type PhysicalAddress = usize; pub type VirtualAddress = usize; +#[derive(Debug, Clone, Copy)] pub struct Page { number: usize, }