Open jinzhec2 opened 1 year ago
Helped me a lot, thanks!
However, why wrote this line if((pte & PTE_V) && (pte & (PTE_R|PTE_W|PTE_X)) == 0)
in task two, it seemed useless.
I wrote like this.
if(depth==2)
continue;
else
vmprint((pagetable_t)child,depth+1);
__
Helped me a lot, thanks!
However, why wrote this line
if((pte & PTE_V) && (pte & (PTE_R|PTE_W|PTE_X)) == 0)
in task two, it seemed useless. I wrote like this.if(depth==2) continue; else vmprint((pagetable_t)child,depth+1);
I believe this line comes from the freewalk
to determine whether the current PTE points to a lower page table and does exactly the same thing as depth==2
@Echomo-Xinyu __
Helped me a lot, thanks!
However, why wrote this line
if((pte & PTE_V) && (pte & (PTE_R|PTE_W|PTE_X)) == 0)
in task two, it seemed useless. I wrote like this.if(depth==2) continue; else vmprint((pagetable_t)child,depth+1);
I believe this line comes from the
freewalk
to determine whether the current PTE points to a lower page table and does exactly the same thing asdepth==2
I remember feeling that some parts of this judgment were somewhat redundant at the time. However, I have paused my xv6'lab for over a month now due to other commitments, so I have forgotten some details. Thank you for your reply.
It gave me the below error in the first task of "Speed up system calls"
"kernel/proc.c:187:24: error: ‘USYSCALL’ undeclared (first use in this function)
187 | if(mappages(pagetable, USYSCALL, PGSIZE,
| ^~~~
kernel/proc.c:187:24: note: each undeclared identifier is reported only once for each function it appears in
make: *** [
Anyone who can help on that error please. Thank you in advance.
https://jinzhec2.github.io/blog/post/6.s081_2022_lab3/?
Speed up system calls Print a page table Detect which pages have been accessed Speed up system calls According to the hints, we need to map a struct usyscall to the USYSCALL address in kernel/memlayout.h. First, we make the following modification to kernal/proc.h: struct proc { ... struct usyscall *usyscallpage; }; The mapping process is performed through proc_pagetable in kernel/proc.c, which requires the use of the mappages (with read-only permissions for the userspace):