mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 14:27:49 +00:00
Zero and recursive map inactive table on creation
This commit is contained in:
@@ -10,6 +10,7 @@
|
|||||||
pub use self::entry::*;
|
pub use self::entry::*;
|
||||||
use memory::{PAGE_SIZE, Frame, FrameAllocator};
|
use memory::{PAGE_SIZE, Frame, FrameAllocator};
|
||||||
use self::table::{Table, Level4};
|
use self::table::{Table, Level4};
|
||||||
|
use self::temporary_page::TemporaryPage;
|
||||||
use core::ptr::Unique;
|
use core::ptr::Unique;
|
||||||
|
|
||||||
mod entry;
|
mod entry;
|
||||||
@@ -161,8 +162,17 @@ pub struct InactivePageTable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl InactivePageTable {
|
impl InactivePageTable {
|
||||||
pub fn new(frame: Frame) -> InactivePageTable {
|
pub fn new(frame: Frame,
|
||||||
// TODO zero and recursive map the frame
|
active_table: &mut ActivePageTable,
|
||||||
|
temporary_page: &mut TemporaryPage)
|
||||||
|
-> InactivePageTable {
|
||||||
|
{
|
||||||
|
let table = temporary_page.map_table_frame(frame.clone(), active_table);
|
||||||
|
table.zero();
|
||||||
|
table[511].set(frame.clone(), PRESENT | WRITABLE);
|
||||||
|
}
|
||||||
|
temporary_page.unmap(active_table);
|
||||||
|
|
||||||
InactivePageTable { p4_frame: frame }
|
InactivePageTable { p4_frame: frame }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user