<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
    <channel>
        <title>Interrupt - 標籤 - Yan-Hao Wang&#39;s Blog</title>
        <link>https://kola.ink/tags/interrupt/</link>
        <description>Interrupt - 標籤 - Yan-Hao Wang&#39;s Blog</description>
        <generator>Hugo -- gohugo.io</generator><language>zh-TW</language><managingEditor>bses30074@gmail.com (Yan-Hao Wang)</managingEditor>
            <webMaster>bses30074@gmail.com (Yan-Hao Wang)</webMaster><copyright>This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.</copyright><lastBuildDate>Sun, 07 Jun 2026 15:34:53 &#43;0800</lastBuildDate><atom:link href="https://kola.ink/tags/interrupt/" rel="self" type="application/rss+xml" /><item>
    <title>FreeBSD Interupt 介紹</title>
    <link>https://kola.ink/freebsd-kernel-interrupt/</link>
    <pubDate>Sun, 07 Jun 2026 15:34:53 &#43;0800</pubDate>
    <author>bses30074@gmail.com (Yan-Hao Wang)</author>
    <guid>https://kola.ink/freebsd-kernel-interrupt/</guid>
    <description><![CDATA[<h2 id="基礎分類">基礎分類</h2>
<ul>
<li>Hardware interrupt: 非同步的產生，像是硬體鍵盤，收到封包等</li>
<li>Hardware trap/Exception: 由 CPU 指令產生的事件，像是 Page Fault/除與 0/無效指令，同步的事件</li>
<li>Software trap: 軟體故意觸發的 Exception</li>
</ul>
<h2 id="上半部下半部">上半部下半部</h2>
<ol>
<li>Top half（硬中斷 context）
<ol>
<li>ISR（interrupt service routine）</li>
<li>很短</li>
<li>不能 sleep</li>
<li>會關閉中斷</li>
</ol>
</li>
<li>下半部，可以把 interrupt handler 轉成 kernel thread 來跑
<ol>
<li>ithread = interrupt handling thread</li>
</ol>
</li>
</ol>
<p>所以 FreeBSD 會用一個 kernel thread 放入 task queue 來作下半部的事情，有點類似 Linux workqueue。</p>]]></description>
</item>
</channel>
</rss>
