MINIX3
进程转入中断的细节分为为三步:
1.硬件将进程的寄存器保存到其堆栈中
2.中断的硬件细节汇编代码将堆栈中的信息保存
1>保存寄存器信息及状态,到该进程对应PCB的entry中
2>调用中断剩余的具体实现的C代码程序
3.中断的C代码执行中断处理的实现
1>清除保留在堆栈保存的信息(包括进程的寄存器信息)
2>执行中断处理
3>发送消息,通知该进程等待,直到该中断执行完
4.中断的C代码返回,中断的硬件细节汇编代码恢复进程
1>中断处理完后,将由C代码返回
2>中断的硬件细节汇编代码,从进程对应PCB中entry恢复,进程的状态及信息
-
Hardware stacks program counter, etc.
-
Hardware loads new program counter from interrupt vector.
-
Assembly language procedure saves registers.
-
Assembly language procedure sets up new stack.
-
C interrupt service constructs and sends message.
-
Message passing code marks waiting message recipient ready.
-
Scheduler decides which process is to run next.
-
C procedure returns to the assembly code.
-
Assembly language procedure starts up new current process.