diff --git a/src/main.rs b/src/main.rs index a531da1eb3..a027100a18 100644 --- a/src/main.rs +++ b/src/main.rs @@ -10,6 +10,7 @@ use rmm::{ FrameAllocator, MemoryArea, PageEntry, + PageFlushAll, PageMapper, PageTable, PhysicalAddress, @@ -218,13 +219,16 @@ unsafe fn new_tables(areas: &'static [MemoryArea]) { let mut mapper = PageMapper::::current( &mut allocator ); + let flush_all = PageFlushAll::new(); for i in 0..16 { let virt = VirtualAddress::new(MEGABYTE + i * A::PAGE_SIZE); let flush = mapper.map( virt, A::ENTRY_FLAG_USER | A::ENTRY_FLAG_WRITABLE ).expect("failed to map page"); + flush_all.consume(flush); } + flush_all.flush(); } unsafe fn inner() {