I think this lab is mainly used to understand how Virtual Memory maps to physical memory. In csapp, MMU and TLB circuits are used for conversion. X86 uses a Level 2 page table.
We also need to understand stack frame (such as lab1 project 4.1.1): switch_to_u2k and swith_to_k2u. There are two methods. One is to rewrite the stackframe TSS. One is to directly use ASM to rewrite gate descriptor.
Csapp: each process has a VM and page table.
But why does the BIOS have different positions in xv6 and ucore? (Kernal. LD) both specify the entry at 0x100000 (physical address ).
In the csapp, it explains the user/kernal stack and how the process directly shares global variables and kernel (xv6 book: each process has 2 stacks: User stack, and kernel stack)
As mentioned in xv6, ing two VMS to the same physical address is a common method of page table!
// Return addressreturn & (pte_t *) kaddr (pde_addr (* pdepage) [PTX (LA)];