⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 interrupt_and_exception.htm

📁 编写自己的操作系统
💻 HTM
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0066)http://www.huihoo.com/gnu_linux/own_os/interrupt_and_exception.htm -->
<HTML><HEAD><TITLE></TITLE><!-- saved from url=(0061)http://pagoda-ooos.51.net/os_book/interrupt_and_exception.htm -->
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.2800.1106" name=GENERATOR></HEAD>
<BODY>
<P><FONT face="Times New Roman Greek" size=7><STRONG>2. Interrupt &amp; 
Exception</STRONG></FONT></P>
<P><SPAN 
style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><FONT 
face="Times New Roman" size=5><STRONG></STRONG></FONT></SPAN><FONT 
face="Times New Roman Greek" color=#000000>[<A 
href="index.htm" 
tppabs="http://pagoda-ooos.51.net/os_book/index.htm">Home</A>]</FONT></P>
<P><FONT face="Times New Roman Greek">
<P>
<HR width="100%" noShade SIZE=2>
</FONT>
<P></P>
<P align=right><FONT face="Times New Roman TUR"><EM><STRONG>Interrupt is the 
only entrance of an OS.</STRONG></EM></FONT></P>
<P><FONT face="Courier New" 
size=2>从某种意义上来说,Interrupt是OS的唯一入口,是一个OS运行的驱动力,如果没有Interrupt,OS则是静态的;OS的各种功能,都是通过Interrupt来激活的。而Exception则是使OS具备容错能力,保证OS稳定性的一个重要因素。所以Interrupt和Exception的处理是我们在设计和开发一个OS的首要和重要部分。</FONT></P>
<P><FONT face="Courier New" 
size=2>在典型的情况下,Interrupt是为了响应一个来自于硬件的信号,而随机发生的。Interrupts被用来处理处理器外部的事件,比如敲击键盘事件。软件也可以通过执行INT 
n指令产生一个Interrupt。</FONT></P>
<P><FONT face="Courier New" 
size=2>当处理器执行一个指令的时候,如果发现一个错误条件,比如被0除,则产生一个Exception。</FONT></P>
<P><FONT face="Courier New" 
size=2>当一个Interrupt被接收,或者一个Exception被检测到的时候,CPU会暂时中止当前程序的运行,并把执行权移交给用来处理当前Interrrupt或Exception的程序模块,这个程序模块被称作Interrupt 
Service Routine(ISR)。当ISR被执行结束之后,CPU会恢复之前程序或任务的执行。这一切都被透明的执行。</FONT></P>
<P><FONT face="Courier New" 
size=2>本章的主要内容定位于Interrupt和Exception的产生机制,处理方法。</FONT></P>
<DIV class=Section1 style="LAYOUT-GRID-CHAR: none; LAYOUT-GRID-LINE: 15.6pt">
<HR width="100%" noShade SIZE=2>
</DIV>
<P class=MsoNormal 
style="LAYOUT-GRID-CHAR: none; MARGIN: 0cm 0cm 0pt; LAYOUT-GRID-LINE: 15.6pt">&nbsp;</P>
<P class=MsoNormal 
style="LAYOUT-GRID-CHAR: none; MARGIN: 0cm 0cm 0pt; LAYOUT-GRID-LINE: 15.6pt"><FONT 
face="Times New Roman Greek"><STRONG>Table of Contents</STRONG></FONT></P>
<P class=MsoNormal 
style="LAYOUT-GRID-CHAR: none; MARGIN: 0cm 0cm 0pt; LAYOUT-GRID-LINE: 15.6pt"><FONT 
face="Times New Roman Greek"><A 
href="interrupt-sources_1.htm" 
tppabs="http://pagoda-ooos.51.net/os_book/interrupt/interrupt-sources_1.htm">2.1 
Sources &amp; Classification</A></FONT><FONT 
face="Times New Roman Greek"></FONT></P>
<P class=MsoNormal 
style="LAYOUT-GRID-CHAR: none; MARGIN: 0cm 0cm 0pt; LAYOUT-GRID-LINE: 15.6pt"><FONT 
face="Times New Roman Greek"><A 
href="interrupt-vectors_2.htm" 
tppabs="http://pagoda-ooos.51.net/os_book/interrupt/interrupt-vectors_2.htm">2.2 
Vectors &amp; IDT</A></FONT></P>
<P class=MsoNormal 
style="LAYOUT-GRID-CHAR: none; MARGIN: 0cm 0cm 0pt; LAYOUT-GRID-LINE: 15.6pt"><FONT 
face="Times New Roman Greek"><A 
href="interrupt-priority_3.htm" 
tppabs="http://pagoda-ooos.51.net/os_book/interrupt/interrupt-priority_3.htm">2.3 
Priority &amp; Control</A></FONT></P>
<P class=MsoNormal 
style="LAYOUT-GRID-CHAR: none; MARGIN: 0cm 0cm 0pt; LAYOUT-GRID-LINE: 15.6pt"><FONT 
face="Times New Roman Greek"><A 
href="interrupt-handling_4.htm" 
tppabs="http://pagoda-ooos.51.net/os_book/interrupt/interrupt-handling_4.htm">2.4 
Handling &amp; Error Code</A></FONT></P>
<P class=MsoNormal 
style="LAYOUT-GRID-CHAR: none; MARGIN: 0cm 0cm 0pt; LAYOUT-GRID-LINE: 15.6pt"><FONT 
face="Times New Roman Greek"><A 
href="interrupt-8259_5.htm" 
tppabs="http://pagoda-ooos.51.net/os_book/interrupt/interrupt-8259_5.htm">2.5 
PIC-8259A</A></FONT></P>
<P class=MsoNormal 
style="LAYOUT-GRID-CHAR: none; MARGIN: 0cm 0cm 0pt; LAYOUT-GRID-LINE: 15.6pt"><FONT 
face="Times New Roman Greek"><A 
href="interrupt-sys_call_6.htm" 
tppabs="http://pagoda-ooos.51.net/os_book/interrupt/interrupt-sys_call_6.htm">2.6 
System Call</A></FONT></P></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -