mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 22:37:49 +00:00
Create a memory::paging::entry submodule with an Entry struct
This commit is contained in:
13
src/memory/paging/entry.rs
Normal file
13
src/memory/paging/entry.rs
Normal file
@@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
use memory::PAGE_SIZE;
|
use memory::PAGE_SIZE;
|
||||||
|
|
||||||
|
mod entry;
|
||||||
|
|
||||||
const ENTRY_COUNT: usize = 512;
|
const ENTRY_COUNT: usize = 512;
|
||||||
|
|
||||||
pub type PhysicalAddress = usize;
|
pub type PhysicalAddress = usize;
|
||||||
|
|||||||
Reference in New Issue
Block a user