中断处理有三个阶段
1、进入阶段:栈保存(带出错码的中断、不带出错码的中断)
2、处理阶段:中断处理
3、退出阶段:恢复栈
80x86中有特权级的概念,不同的特权级有不同的栈,所以中断发生时要保存中断前的栈地址。
![](http://hi.csdn.net/attachment/201109/4/0_1315125999Ip8K.gif)
查看intel使用手册
![](http://hi.csdn.net/attachment/201109/4/0_1315126027MszB.gif)
interrupt.s源代码文件(参考linux 0.11源代码)
.global divide_error,debug_exception,nmi,breakpoint,overflow,bound,invalid_opcode
.global coprocessor_not_available,double_fault,coprocessor_segment_overrun,invalid_tss
.global segment_not_present,stack_exception,protection_exception,page_fault
.global intel_reserved,coprecessor_error,default_isr,timer
.include "kernel.inc"
divide_error:
pushl $do_divide_error
no_error_c