task2 finished

This commit is contained in:
2025-05-27 15:59:57 +08:00
parent 5292fdc6ac
commit bd21012f73
6 changed files with 70 additions and 4 deletions

View File

@@ -101,6 +101,9 @@ walk(pagetable_t pagetable, uint64 va, int alloc)
for(int level = 2; level > 0; level--) {
pte_t *pte = &pagetable[PX(level, va)];
if(*pte & PTE_V) {
if (*pte & PTE_PS) { // 如果是 Superpage
return pte;
}
pagetable = (pagetable_t)PTE2PA(*pte);
#ifdef LAB_PGTBL
if(PTE_LEAF(*pte)) {