#include "MMU.h" #include void MMU::access(Kernel &kernel, std::vector *page_table, const unsigned int index, const AccessType type) { if (!(*page_table)[index].P) kernel.page_fault(page_table, index); (*page_table)[index].R = true; if (type == WRITE) (*page_table)[index].M = true; switch (type) { case READ: std::cout << std::format("[mmu:read] pt[{}] -> ppn {}", index, (*page_table)[index].PPN) << std::endl; break; case WRITE: std::cout << std::format("[mmu:write] pt[{}] -> ppn {}", index, (*page_table)[index].PPN) << std::endl; } }