diff --git a/src/memory/paging/address.rs b/src/memory/address.rs similarity index 100% rename from src/memory/paging/address.rs rename to src/memory/address.rs diff --git a/src/memory/mod.rs b/src/memory/mod.rs index c53ba40..16e15a8 100644 --- a/src/memory/mod.rs +++ b/src/memory/mod.rs @@ -1,7 +1,8 @@ pub use self::area_frame_allocator::AreaFrameAllocator; pub use self::paging::remap_the_kernel; pub use self::stack_allocator::Stack; -use self::paging::{PhysicalAddress, FromToVirtualAddress}; +pub use self::address::*; + use multiboot2::BootInformation; use consts::KERNEL_OFFSET; @@ -9,6 +10,7 @@ mod area_frame_allocator; pub mod heap_allocator; mod paging; mod stack_allocator; +mod address; pub const PAGE_SIZE: usize = 4096; diff --git a/src/memory/paging/mapper.rs b/src/memory/paging/mapper.rs index 4f6986f..5117fb5 100644 --- a/src/memory/paging/mapper.rs +++ b/src/memory/paging/mapper.rs @@ -1,7 +1,7 @@ -use super::{VirtualAddress, PhysicalAddress, Page, ENTRY_COUNT, FromToVirtualAddress}; +use super::{Page, ENTRY_COUNT}; use super::entry::*; use super::table::{self, Table, Level4, Level1}; -use memory::{PAGE_SIZE, Frame, FrameAllocator}; +use memory::*; use core::ptr::Unique; pub struct Mapper { diff --git a/src/memory/paging/mod.rs b/src/memory/paging/mod.rs index cf00716..e217e6d 100644 --- a/src/memory/paging/mod.rs +++ b/src/memory/paging/mod.rs @@ -1,19 +1,15 @@ pub use self::entry::*; pub use self::mapper::Mapper; use core::ops::{Deref, DerefMut, Add}; -use core::ptr::Unique; -use memory::{PAGE_SIZE, Frame, FrameAllocator}; +use super::*; use multiboot2::BootInformation; -use self::table::{Table, Level4}; use self::temporary_page::TemporaryPage; -pub use self::address::*; use consts::KERNEL_OFFSET; mod entry; mod table; mod temporary_page; mod mapper; -mod address; const ENTRY_COUNT: usize = 512; diff --git a/src/memory/paging/temporary_page.rs b/src/memory/paging/temporary_page.rs index 4b06bca..0c9d8c4 100644 --- a/src/memory/paging/temporary_page.rs +++ b/src/memory/paging/temporary_page.rs @@ -1,6 +1,6 @@ -use super::{Page, ActivePageTable, VirtualAddress}; +use super::{Page, ActivePageTable}; use super::table::{Table, Level1}; -use memory::{Frame, FrameAllocator}; +use memory::{Frame, FrameAllocator, VirtualAddress}; pub struct TemporaryPage { page: Page,