Try to create example mapping for page 0xdeadbeaf000

This commit is contained in:
Philipp Oppermann
2019-01-28 11:20:58 +01:00
parent f272785861
commit 818417d119
2 changed files with 2 additions and 2 deletions

View File

@@ -22,7 +22,7 @@ pub extern "C" fn _start() -> ! {
let mut recursive_page_table = unsafe { memory::init(LEVEL_4_TABLE_ADDR) }; let mut recursive_page_table = unsafe { memory::init(LEVEL_4_TABLE_ADDR) };
create_example_mapping(&mut recursive_page_table, &mut EmptyFrameAllocator); create_example_mapping(&mut recursive_page_table, &mut EmptyFrameAllocator);
unsafe { (0x1900 as *mut u64).write_volatile(0xf021f077f065f04e) }; unsafe { (0xdeadbeaf900 as *mut u64).write_volatile(0xf021f077f065f04e) };
println!("It did not crash!"); println!("It did not crash!");
blog_os::hlt_loop(); blog_os::hlt_loop();

View File

@@ -37,7 +37,7 @@ pub fn create_example_mapping(
) { ) {
use x86_64::structures::paging::PageTableFlags as Flags; use x86_64::structures::paging::PageTableFlags as Flags;
let page: Page = Page::containing_address(VirtAddr::new(0x1000)); let page: Page = Page::containing_address(VirtAddr::new(0xdeadbeaf000));
let frame = PhysFrame::containing_address(PhysAddr::new(0xb8000)); let frame = PhysFrame::containing_address(PhysAddr::new(0xb8000));
let flags = Flags::PRESENT | Flags::WRITABLE; let flags = Flags::PRESENT | Flags::WRITABLE;