Understanding the linux kernel-ch4-Exception Handling
来源:互联网 发布:充话费软件下载 编辑:程序博客网 时间:2024/05/01 16:26
3. Exit from the handler by means of the ret_from_exception( ) function.
trap_init( )//i386/kernel/traps.c
doublefault_fn() //i386/kernel/doublefault.c
Saving the Registers for the Exception Handler
handler_name:
pushl $0 /* only for some exceptions */
pushl $do_handler_name
jmp error_code
error_code:
1. Saves the registers that might be used by the high-level C function on the stack.
2. Issues a cld instruction to clear the direction flag DF of eflags ,
thus making sure that autoincreases on the edi and esi registers will be used with string instructions 3. Copies the hardware error code saved in the stack at location esp+36 in edx.
Stores the value -1 in the same stack location
this value is used to separate 0x80 exceptions from other exceptions.
4. Loads edi with the address of the high-level do_handler_name( ) C function
saved in the stack at location esp+32; writes the contents of es in that stack location
5. Loads in the eax register the current top location of the Kernel Mode stack.
This address identifies the memory cell containing the last register value saved in step 1
6. Loads the user data Segment Selector into the ds and es registers.
7. Invokes the high-level C function whose address is now stored in edi
Entering and Leaving the Exception Handler
do_trap()
store the hardware error code and the exception vector in the process descriptor of current,
and then send a suitable signal to that process:
current->thread.error_code = error_code;
current->thread.trap_no = vector;
force_sig(sig_number, current);
ret_from_exception()
most exceptions are handled simply by sending a Unix signal to the process that caused the exception.
The action to be taken is thus deferred until the process receives the signal; as a result, the kernel is able to process the exception quickly
- Understanding the linux kernel-ch4-Exception Handling
- Understanding the linux kernel-ch4-Interrupt Handling
- Understanding the linux kernel-ch4-Interrupt and exception
- Understanding the linux kernel-ch4-Nested Execution
- Understanding the linux kernel-ch4-Initializing the Interrupt Descriptor Table
- Understanding the linux kernel-ch4-Interrupts and Exceptions
- Understanding the Linux Kernel
- understanding the linux kernel
- Notes Understanding the Linux kernel
- Understanding the Linux Kernel (2nd Edition)
- Understanding the linux kernel-ch1-overview
- Understanding the linux kernel-ch2-Memory addressing
- Understanding the linux kernel-ch3-Process descriptor
- Understanding the linux kernel-ch3-Process Switch
- Understanding the linux kernel-ch3-Creating Processes
- Understanding the linux kernel-ch3-Destroying Processes
- Understanding the linux kernel-ch6-Timing Measurements
- Understanding the linux kernel-ch6-Timing Measurements
- 狮子座女性
- Flash+PHP+Mysql简单留言本制作
- CISCO路由器配置手册
- Java基础学习(01学习方法与学习心态)
- 用PHP编程语言开发动态WAP页面
- Understanding the linux kernel-ch4-Exception Handling
- VB基础——变量和数据类型
- JSP用webservice
- 分析:全球千亿美元市值IT企业榜单及点评
- Understanding the linux kernel-ch4-Interrupt Handling
- 将Tomcat 5.5的Admin部署到Tomcat 6 中
- 编写简练代码是程序员的职业修养之本
- 强制类型转换函数使用说明
- jquery+ajax实现二级级联查询