Speeding up system calls: Straightforward task. Store a pointer to struct usyscall in proc.h. Allocate a page and assign the PA of that page to the pointer. Add the requisite mappings in proc_pagetable
Print a pagetable: Again, straightorward task. Your method would be very similar to the walk function. About 95% similar.
Detecting which pages have been accessed: First read the privileged ISA document to find out how the Access bit is modified (grep for it). The pgaccess syscall is similar to other syscalls in how the args are parsed. In pgaccess impl, general idea is to find out the leaf PTE and then look at the Access bit, the privileged ISA doc has the instructions on how to do that. Find out for each page, the corresponding leaf PTE and get the access bit and store it in uint64 bitmask. Transfer this bitmask from kernel to userspace using copyout. That’s it.