MIT 6.828 Lab4
Notes of MIT 6.828 Lab4
kern/mpentry.S is compiled and linked to run above
KERNBASE, which means that its link address will be above
KERNBASE. However, it’s actually loaded at physical address
MPENTRY_PADDR and starts without virtual memory enabled. Therefore, it must use
MPBOOTPHYS to calculate absolute addresses of its symbols.
We still need separate kernel stack. Imagine a scenario that a cpu enters the kernel by a trap, it pushes a trapframe onto the kernel stack. If another cpu enters the kernel by a trap at the same time, it also pushes a trapframe onto the kernel stack. If they share the same stack, the two trapframes may overwrite each other.
eis located within the kernel stack, and this part of page table is the same among different address spaces.
Because the context switch relys on the saving and restoring of the register set. The saving happens at the
trap(). The restoring happens at