<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-Hans-CN">
	<id>http://wiki.foofun.cn//index.php?action=history&amp;feed=atom&amp;title=Interrupts</id>
	<title>Interrupts - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.foofun.cn//index.php?action=history&amp;feed=atom&amp;title=Interrupts"/>
	<link rel="alternate" type="text/html" href="http://wiki.foofun.cn//index.php?title=Interrupts&amp;action=history"/>
	<updated>2026-04-07T18:38:50Z</updated>
	<subtitle>本wiki上该页面的版本历史</subtitle>
	<generator>MediaWiki 1.37.1</generator>
	<entry>
		<id>http://wiki.foofun.cn//index.php?title=Interrupts&amp;diff=812&amp;oldid=prev</id>
		<title>2022年3月8日 (二) 13:12 Zhang3</title>
		<link rel="alternate" type="text/html" href="http://wiki.foofun.cn//index.php?title=Interrupts&amp;diff=812&amp;oldid=prev"/>
		<updated>2022-03-08T13:12:40Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;zh-Hans-CN&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2022年3月8日 (二) 13:12的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;第1行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第1行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;“Interrupts 中断” 是从设备 (例如键盘或硬盘驱动器) &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;到CPU的信号，告诉CPU应当立即停止当前正在执行的操作并执行其他操作。 &lt;/del&gt;例如，键盘控制器可以在按下字符键时发送中断。 &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;然后，操作系统可以立即在屏幕上显示该字符，即使CPU之前正在做完全不相关的事情，然后CPU可以再返回到之后要做的事情。 &lt;/del&gt;当出现特定中断时，CPU会从操作系统提供的表中查找该特定中断的条目。 在 [[Protected Mode|x86保护模式]] 中，该表称为 [[IDT|中断描述符表 (Interrupt Descriptor Table)]]，最多可以有256个条目（Entry），但是该表的名称和它可以拥有的最大条目数可能会因CPU架构而异。 CPU找到中断的条目后，跳转到条目指向的代码。 响应中断而运行的此代码称为 [[Interrupt Service Routines| 中断服务例程 (ISR) 或中断处理程序]]。&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;“Interrupts 中断” 是从设备 (例如键盘或硬盘驱动器) &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;到CPU的信号，告诉CPU应当立即停止当前正在执行的操作并去执行其他操作。 &lt;/ins&gt;例如，键盘控制器可以在按下字符键时发送中断。 &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;然后，操作系统可以立即在屏幕上显示该字符，即使CPU之前正在做完全不相关的事情，然后CPU可以再返回到本来要做的事情。 &lt;/ins&gt;当出现特定中断时，CPU会从操作系统提供的表中查找该特定中断的条目。 在 [[Protected Mode|x86保护模式]] 中，该表称为 [[IDT|中断描述符表 (Interrupt Descriptor Table)]]，最多可以有256个条目（Entry），但是该表的名称和它可以拥有的最大条目数可能会因CPU架构而异。 CPU找到中断的条目后，跳转到条目指向的代码。 响应中断而运行的此代码称为 [[Interrupt Service Routines| 中断服务例程 (ISR) 或中断处理程序]]。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== 中断的类型 ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== 中断的类型 ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l17&quot;&gt;第17行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第17行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;基本上，当按键被按下时，键盘控制器会告诉被称为 [[PIC|可编程中断控制器（PIC）]] 的设备发起中断。 由于键盘和PIC的固有接线方式，IRQ #1是键盘中断，因此当按下一个键时，IRQ 1被发送到PIC。 PIC的作用是决定是否应立即通知CPU该IRQ，并将IRQ数转换为CPU表的 “中断向量” (即0和255之间的数字)。&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;基本上，当按键被按下时，键盘控制器会告诉被称为 [[PIC|可编程中断控制器（PIC）]] 的设备发起中断。 由于键盘和PIC的固有接线方式，IRQ #1是键盘中断，因此当按下一个键时，IRQ 1被发送到PIC。 PIC的作用是决定是否应立即通知CPU该IRQ，并将IRQ数转换为CPU表的 “中断向量” (即0和255之间的数字)。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;操作系统应该通过 &amp;lt;tt&amp;gt;in&amp;lt;/tt&amp;gt; 和 &amp;lt;tt&amp;gt;out&amp;lt;/tt&amp;gt; 指令 (或 &amp;lt;tt&amp;gt;inportb&amp;lt;/tt&amp;gt;/&amp;lt;tt&amp;gt;outportb&amp;lt;/tt&amp;gt;) &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;与键盘通话来处理中断，&lt;/del&gt;&amp;lt;tt&amp;gt;inportw&amp;lt;/tt&amp;gt;/&amp;lt;tt&amp;gt;outportw&amp;lt;/tt&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;，以及 &lt;/del&gt;&amp;lt;tt&amp;gt;inportd&amp;lt;/tt&amp;gt;/&amp;lt;tt&amp;gt;outportd&amp;lt;/tt&amp;gt; &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;在C中，见 &lt;/del&gt;[[Inline Assembly/Examples|内联汇编示例]])，询问按下了什么键，再对此做一些工作 (例如在屏幕上显示键，并通知当前应用程序已按下某个键)，然后返回到中断进入前正在执行的代码。 实际上，如果无法从缓冲区读取键将阻止键盘的任何后续IRQ。&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;操作系统应该通过 &amp;lt;tt&amp;gt;in&amp;lt;/tt&amp;gt; 和 &amp;lt;tt&amp;gt;out&amp;lt;/tt&amp;gt; 指令 (或 &amp;lt;tt&amp;gt;inportb&amp;lt;/tt&amp;gt;/&amp;lt;tt&amp;gt;outportb&amp;lt;/tt&amp;gt;) &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;与键盘通信来处理中断，&lt;/ins&gt;&amp;lt;tt&amp;gt;inportw&amp;lt;/tt&amp;gt;/&amp;lt;tt&amp;gt;outportw&amp;lt;/tt&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;，以及在C中使用&lt;/ins&gt;&amp;lt;tt&amp;gt;inportd&amp;lt;/tt&amp;gt;/&amp;lt;tt&amp;gt;outportd&amp;lt;/tt&amp;gt; &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;，见 &lt;/ins&gt;[[Inline Assembly/Examples|内联汇编示例]])，询问按下了什么键，再对此做一些工作 (例如在屏幕上显示键，并通知当前应用程序已按下某个键)，然后返回到中断进入前正在执行的代码。 实际上，如果无法从缓冲区读取键将阻止键盘的任何后续IRQ。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== 从PIC的角度来看 ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== 从PIC的角度来看 ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l45&quot;&gt;第45行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第45行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;每次CPU执行一条机器指令时，它都会检查PIC的引脚是否已通知中断。 如果是这种情况，它会在堆栈上存储一些当前状态信息(这样，当操作系统完成对INT中断的服务时，它就可以返回到当前正在做的任何事情)，并跳转到IDT所指向的位置。 操作系统从这里开始接管工作。&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;每次CPU执行一条机器指令时，它都会检查PIC的引脚是否已通知中断。 如果是这种情况，它会在堆栈上存储一些当前状态信息(这样，当操作系统完成对INT中断的服务时，它就可以返回到当前正在做的任何事情)，并跳转到IDT所指向的位置。 操作系统从这里开始接管工作。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;同时，当前程序可以通过“中断标志”（IF状态寄存器）来防止CPU再受到中断的干扰。 只要清除该标志，CPU就会忽略PIC的请求，持续运行当前程序。 汇编指令 &amp;lt;tt&amp;gt;cli&amp;lt;/tt&amp;gt; &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;and &lt;/del&gt;&amp;lt;tt&amp;gt;sti&amp;lt;/tt&amp;gt; 可以控制该标志。&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;同时，当前程序可以通过“中断标志”（IF状态寄存器）来防止CPU再受到中断的干扰。 只要清除该标志，CPU就会忽略PIC的请求，持续运行当前程序。 汇编指令 &amp;lt;tt&amp;gt;cli&amp;lt;/tt&amp;gt; &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;和 &lt;/ins&gt;&amp;lt;tt&amp;gt;sti&amp;lt;/tt&amp;gt; 可以控制该标志。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== 从操作系统的角度来看 ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== 从操作系统的角度来看 ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Zhang3</name></author>
	</entry>
	<entry>
		<id>http://wiki.foofun.cn//index.php?title=Interrupts&amp;diff=736&amp;oldid=prev</id>
		<title>2022年3月8日 (二) 02:44 Zhang3</title>
		<link rel="alternate" type="text/html" href="http://wiki.foofun.cn//index.php?title=Interrupts&amp;diff=736&amp;oldid=prev"/>
		<updated>2022-03-08T02:44:14Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;a href=&quot;http://wiki.foofun.cn//index.php?title=Interrupts&amp;amp;diff=736&amp;amp;oldid=394&quot;&gt;显示更改&lt;/a&gt;</summary>
		<author><name>Zhang3</name></author>
	</entry>
	<entry>
		<id>http://wiki.foofun.cn//index.php?title=Interrupts&amp;diff=394&amp;oldid=prev</id>
		<title>2022年2月8日 (二) 05:47 Zhang3</title>
		<link rel="alternate" type="text/html" href="http://wiki.foofun.cn//index.php?title=Interrupts&amp;diff=394&amp;oldid=prev"/>
		<updated>2022-02-08T05:47:35Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;a href=&quot;http://wiki.foofun.cn//index.php?title=Interrupts&amp;amp;diff=394&amp;amp;oldid=100&quot;&gt;显示更改&lt;/a&gt;</summary>
		<author><name>Zhang3</name></author>
	</entry>
	<entry>
		<id>http://wiki.foofun.cn//index.php?title=Interrupts&amp;diff=100&amp;oldid=prev</id>
		<title>Zhang3：创建页面，内容为“存根测试大小写敏感？”</title>
		<link rel="alternate" type="text/html" href="http://wiki.foofun.cn//index.php?title=Interrupts&amp;diff=100&amp;oldid=prev"/>
		<updated>2021-12-24T06:56:24Z</updated>

		<summary type="html">&lt;p&gt;创建页面，内容为“存根测试大小写敏感？”&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;存根测试大小写敏感？&lt;/div&gt;</summary>
		<author><name>Zhang3</name></author>
	</entry>
</feed>