diff --git a/src/memory/paging/entry.rs b/src/memory/paging/entry.rs new file mode 100644 index 0000000..6470195 --- /dev/null +++ b/src/memory/paging/entry.rs @@ -0,0 +1,13 @@ +use memory::Frame; + +pub struct Entry(u64); + +impl Entry { + pub fn is_unused(&self) -> bool { + self.0 == 0 + } + + pub fn set_unused(&mut self) { + self.0 = 0; + } +} diff --git a/src/memory/paging/mod.rs b/src/memory/paging/mod.rs index a06c073..9bcddfb 100644 --- a/src/memory/paging/mod.rs +++ b/src/memory/paging/mod.rs @@ -1,5 +1,7 @@ use memory::PAGE_SIZE; +mod entry; + const ENTRY_COUNT: usize = 512; pub type PhysicalAddress = usize;