Question: This is a good opportunity for someone who has taken an OS class to summarize all the things an OS needed to do to swap a thread back onto a processor during a context switch.
bojianh
Context switch (If I rmb correctly)
Called from kernel scheduler
Set %cr3 to point to the new page directory => Result in TLB flush
Push all existing registers onto the kernel stack
Switch kernel stack to the new kernel's process by changing %esp
Return from context switch as the new function
[Note %eip is not changed because there is only one source of context switch]
Question: This is a good opportunity for someone who has taken an OS class to summarize all the things an OS needed to do to swap a thread back onto a processor during a context switch.
Context switch (If I rmb correctly)
Called from kernel scheduler
Set %cr3 to point to the new page directory => Result in TLB flush
Push all existing registers onto the kernel stack
Switch kernel stack to the new kernel's process by changing %esp
Return from context switch as the new function
[Note %eip is not changed because there is only one source of context switch]