You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// initialize the proc table at boot time.voidprocinit(void)
{
structproc*p;
initlock(&pid_lock, "nextpid");
for(p=proc; p<&proc[NPROC]; p++) {
initlock(&p->lock, "proc");
// Allocate a page for the process's kernel stack.// Map it high in memory, followed by an invalid// guard page.char*pa=kalloc();
if(pa==0)
panic("kalloc");
uint64va=KSTACK((int) (p-proc));
kvmmap(va, (uint64)pa, PGSIZE, PTE_R | PTE_W);
p->kstack=va;
}
kvminithart();
}
It will call kvminithart(), which will call w_satp() and flush TLB.
I'm wondering why kvminithart() is needed.It seems that procinit() just add PTEs to kernel pagetable but didn't change the physical address of it.So why call kvminithart() again here?
The text was updated successfully, but these errors were encountered:
I notice that in
procinit()
,there is code like:It will call
kvminithart()
, which will callw_satp()
and flush TLB.I'm wondering why
kvminithart()
is needed.It seems thatprocinit()
just add PTEs to kernel pagetable but didn't change the physical address of it.So why callkvminithart()
again here?The text was updated successfully, but these errors were encountered: