|
|
@ -40,8 +40,6 @@ pub fn init(boot_info: &BootInformation) -> MemoryController {
|
|
|
|
let mut active_table = paging::remap_the_kernel(&mut frame_allocator,
|
|
|
|
let mut active_table = paging::remap_the_kernel(&mut frame_allocator,
|
|
|
|
boot_info);
|
|
|
|
boot_info);
|
|
|
|
|
|
|
|
|
|
|
|
println!("{:?}", active_table);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
use self::paging::Page;
|
|
|
|
use self::paging::Page;
|
|
|
|
use {HEAP_START, HEAP_SIZE};
|
|
|
|
use {HEAP_START, HEAP_SIZE};
|
|
|
|
|
|
|
|
|
|
|
@ -131,4 +129,13 @@ impl MemoryController {
|
|
|
|
stack_allocator.alloc_stack(active_table, frame_allocator,
|
|
|
|
stack_allocator.alloc_stack(active_table, frame_allocator,
|
|
|
|
size_in_pages)
|
|
|
|
size_in_pages)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn map_page_identity(&mut self, addr: usize) {
|
|
|
|
|
|
|
|
use self::paging::{WRITABLE};
|
|
|
|
|
|
|
|
let frame = Frame::containing_address(addr);
|
|
|
|
|
|
|
|
let flags = WRITABLE;
|
|
|
|
|
|
|
|
self.active_table.identity_map(frame, flags, &mut self.frame_allocator);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn print_page_table(&self) {
|
|
|
|
|
|
|
|
debug!("{:?}", self.active_table);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|