mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 22:37:49 +00:00
Create basic paging module
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
pub use self::area_frame_allocator::AreaFrameAllocator;
|
pub use self::area_frame_allocator::AreaFrameAllocator;
|
||||||
|
|
||||||
mod area_frame_allocator;
|
mod area_frame_allocator;
|
||||||
|
mod paging;
|
||||||
|
|
||||||
pub const PAGE_SIZE: usize = 4096;
|
pub const PAGE_SIZE: usize = 4096;
|
||||||
|
|
||||||
@@ -11,7 +12,7 @@ pub struct Frame {
|
|||||||
|
|
||||||
impl Frame {
|
impl Frame {
|
||||||
fn containing_address(address: usize) -> Frame {
|
fn containing_address(address: usize) -> Frame {
|
||||||
Frame{ number: address / PAGE_SIZE }
|
Frame { number: address / PAGE_SIZE }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
8
src/memory/paging/mod.rs
Normal file
8
src/memory/paging/mod.rs
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
const ENTRY_COUNT: usize = 512;
|
||||||
|
|
||||||
|
pub type PhysicalAddress = usize;
|
||||||
|
pub type VirtualAddress = usize;
|
||||||
|
|
||||||
|
pub struct Page {
|
||||||
|
number: usize,
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user