From 11a6be89b6c75b31f29c86136d53aac5044da7a2 Mon Sep 17 00:00:00 2001 From: Richard Qin Date: Sat, 2 May 2026 23:33:11 +0800 Subject: feat: refactor memory management and integrate memblock - Updated physical memory management (PMM) to utilize memblock for memory layout and frame allocation. - Enhanced the virtual memory manager (VMM) to allocate the frame map from memblock, ensuring it starts at the correct virtual address without relocation. - Improved frame allocation and deallocation functions to handle physical addresses more consistently. - Adjusted the slab allocator to correctly convert between physical and virtual addresses. - Refined page fault handling to ensure proper frame allocation and address translation. - Streamlined the initialization process for PMM and VMM, ensuring a more robust setup of memory structures. Co-authored-by: Copilot --- na/mm/vma.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'na/mm/vma.cc') diff --git a/na/mm/vma.cc b/na/mm/vma.cc index e27853e..02f92b0 100644 --- a/na/mm/vma.cc +++ b/na/mm/vma.cc @@ -158,7 +158,7 @@ int vmm_handle_page_fault(VmSpace* space, uint64 fault_addr, uint64 cause) { Frame* f = pmm_alloc_frame(); if (!f) return -ENOMEM; - uint64 pa = frame_to_pa(f); + uint64 pa = frame_to_pa(f).raw; /* Translate MI permission flags to hardware PTE bits (MD layer) */ uint64 pte_perm = pmap::vm_perm_to_pte(vma->perm); -- cgit v1.2.3