码迷,mamicode.com
首页 > 系统相关 > 详细

General protection fault Exceptions in Linux/IA32 Systems

时间:2016-12-15 20:50:16      阅读:211      评论:0      收藏:0      [点我收藏+]

标签:ber   virtual   occurs   edit   except   floating   segment   use   prot   

 Computer Systems A Programmer‘s Perspective Second Edition

 

Exception number Description Exception class
0 Divide error Fault
13 General protection fault Fault
14 Page fault Fault
18 Machine check Abort
32–127 OS-de?ned exceptions Interrupt or trap
128 (0x80) System call Trap
129–255 OS-de?ned exceptions Interrupt or trap
Figure 8.9 Examples of exceptions in IA32 systems.

 

Linux/IA32 Faults and Aborts
Divide error. A divide error (exception 0) occurs when an application attempts to
divide by zero, or when the result of a divide instruction is too big for the destina-
tion operand. Unix does not attempt to recover from divide errors, opting instead
to abort the program. Linux shells typically report divide errors as “Floating ex-
ceptions.”
General protection fault. The infamous general protection fault (exception 13)
occurs for many reasons, usually because a program references an unde?ned area
of virtual memory, or because the program attempts to write to a read-only text
segment. Linux does not attempt to recover from this fault. Linux shells typically
report general protection faults as “Segmentation faults.”
Page fault. A page fault (exception 14) is an example of an exception where
the faulting instruction is restarted. The handler maps the appropriate page of
physical memory on disk into a page of virtual memory, and then restarts the
faulting instruction. We will see how page faults work in detail in Chapter 9.
Machine check. A machine check (exception 18) occurs as a result of a fatal
hardware error that is detected during the execution of the faulting instruction.
Machine check handlers never return control to the application program.

 

General protection fault Exceptions in Linux/IA32 Systems

标签:ber   virtual   occurs   edit   except   floating   segment   use   prot   

原文地址:http://www.cnblogs.com/yuanjiangw/p/6184553.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!