kernel(一) interrupts
the keyboard controller(the hardware device) =======================> processor=============>operating system
an electrical signal signal
Different devices can be associated with different interrupts by means of a unique value associated with each interrupt.
the unique value called interrupt request lines( IRQ ). for example, on the classic PC, IRQ zero is the timer interrupt
and IRQ one is the keyword interrupt.
Exceptions:
exceptions occur synchronously with respect to the processor clock, indeed, they are often called synchronous
interrupts.Exceptions are produced by the processor while executing instructions either in respon to a programming error.
Interrupt Handlers
The function the kernel runs in response to a specific interrupt is called an interrupt handler or interrupt service routine(ISR).
the interrupt handlers run in a special context called interrupt context.
Interrupt Context
interrupt context is time-critical because the interrupt handler interrupts other code. it can't sleep. so this limits the
functions that one can call from an interrupt handler.
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,携手博客园推出1Panel与Halo联合会员
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步