嗯,这个我明白。
我本来的疑问是为什么对页面设置的权限(PTE_U)会向上传递到页目录上去。
我还查了一下,发现2007年的lab是没有这个检测的: assert(kern_pgdir[0] & PTE_U);
后来看到注释里说:
// Hint 2: the x86 MMU checks permission bits in both the page directory
// and the page table, so it's safe to leave permissions in the page
// more permissive than strictly necessary.
所以我将页目录的权限直接设置为了: *ptp = PTE_ADDR(PADDR(pte)) | PTE_U | PTE_W | PTE_P;
然后该检测就通过了,因此我推测:不存在权限向上传递的问题。页目录这样设置也许是伏笔”... :-)