- 论坛徽章:
- 0
|
原帖由 xpl 于 2009-2-11 17:00 发表 ![]()
你能确定是“切换到另外的进程”吗?
Assuming that the kernel is bug free, most exceptions can occur only while the CPU is in User Mode. Indeed, they are either caused by programming errors or triggered by debuggers. However, the "Page Fault " exception may occur in Kernel Mode. This happens when the process attempts to address a page that belongs to its address space but is not currently in RAM. While handling such an exception, the kernel may suspend the current process and replace it with another one until the requested page is available. The kernel control path that handles the "Page Fault" exception resumes execution as soon as the process gets the processor again.
另外, 系统调用也是一种异常, 在执行它的时候也可以发生进程切换的啊.
另外在ULK第五章第一节也有一句话:
The above rules tell us that the kernel can be preempted only when it is executing an exception handler (in particular a system call) and the kernel preemption has not been explicitly disabled. |
|