割り込みハンドラ(ISR)がどのように実行されるかを見ると、混乱が生じます。Wiki http://en.wikipedia.org/wiki/Context_switchでは、2つのステップで割り込み処理について説明しています。
1)コンテキストスイッチング
When an interrupt occurs, the hardware automatically switches a part of the
context (at least enough to allow the handler to return to the interrupted code).
The handler may save additional context, depending on details of the particular
hardware and software designs.
2)ハンドラーの実行
The kernel does not spawn or schedule a special process to handle interrupts,
but instead the handler executes in the (often partial) context established at
the beginning of interrupt handling. Once interrupt servicing is complete, the
context in effect before the interrupt occurred is restored so that the
interrupted process can resume execution in its proper state.
割り込みハンドラーが上半分であり、カーネルスペースデバイスドライバー用であるとしましょう(ユーザースペースデバイスドライバーの割り込みは同じロジックに従うと仮定します)。
割り込み発生時:
1)現在のカーネルプロセスが一時停止されています。しかし、context
ここの状況はどうですか?Wikiの説明に基づくと、カーネルはISRを実行するための新しいプロセスを生成せず、はcontext established at the beginning of interrupt handling
、中断されたプロセス内の別の関数呼び出しのように聞こえます。では、割り込みハンドラーはinterrupted process
's stack(context)を使用して実行しますか?または、カーネルはそれを実行するために他のメモリスペース/リソースを割り当てますか?
2)ここでは、ISRはスケジューラによってスリープ状態にできる「プロセス」タイプではないためです。何があっても終わらせなきゃいけないの?タイムスライスバウンドによっても制限されませんか?ISRがハングした場合、システムはそれをどのように処理しますか?
質問が基本的なものである場合は申し訳ありません。私はその主題を十分に深く掘り下げていません。
ありがとう、