Common Exceptions and Interrupt Numbers – Using .trap

You may notice within call stacks, some traps occur as a result of a certain exception, using the .trap command with the address of the the trap frame specified within the call stack, you may notice a small segment from the output called Error Code = # The number associated with the predefined interrupt number within the IDT. You can use the !idt extension to view the IDT.

There are 19 different interrupt numbers for 32-bit operating systems:

0 = Divide Error

This is usually when a instruction has attempted to divide data by zero. This is caused by device drivers.

1 = Debug (Single Step)

This is a debugging feature used by compilers, each line of code is reviewed for any errors, and then line before and after the line of code can be checked to see how the error occurred. 

2 = Non-Maskable Interrupt (NMI)

A very high priority interrupt, and usually indicates a unrecoverable hardware error.

3 = Breakpoint

Another debugging feature, breakpoints can inserted into code, when a breakpoint is reached, it pauses the program to allow the programmer to check for any errors, and examine the current state of the program.

4 = Overflow 

Buffer Overflow is when the device driver has overwritten it’s allocated buffer.

Stack Overflow is when a  program has made too many calls, running outside of the call stack.

5 = Bounds Check 

Checking that a array or variable is within the correct allocated range, and doesn’t overrun this boundary (device drivers or programs).

6 = Invalid Opcode

Invalid operation code, a invalid assembly or machine code instruction was called.

7 = NPX Not Available

http://www.gsp.com/cgi-bin/man.cgi?section=4&topic=npx

8 = Double Fault

A exception has occurred while processing and handling a another exception.  

9 = NPX Segement Overrun

http://www.rcollins.org/secrets/NPXError.html

10 = Invalid TSS (Task State Segment)

http://wiki.osdev.org/Exceptions#Invalid_TSS

11 = Segment Not Present

http://wiki.osdev.org/Exceptions#Segment_Not_Present

12 = Stack Fault

http://wiki.osdev.org/Exceptions#Stack-Segment_Fault

13 = General Protection Fault

Covers several different exceptions, I would view the call stack for more information.

http://en.wikipedia.org/wiki/General_protection_fault

14 = Page Fault

A device driver accesses a page which is not available within physical memory. The Memory Manager makes the page available. This is a exception when a invalid memory address has been referenced.

15 = Intel Reserved

16 = Floating Point 

http://wiki.osdev.org/Exceptions#x87_Floating-Point_Exception 

17 = Alignment Check

http://wiki.osdev.org/Exceptions#Alignment_Check

18 = Machine Check

The CPU has found a hardware error and has raised the exception.   

19 = SIMD Floating Point

http://wiki.osdev.org/Exceptions#SIMD_Floating-Point_Exception

 








Advertisements

About 0x14c

I'm a Computer Science student and writer. My primary interests are Graph Theory, Number Theory, Programming Language Theory, Logic and Windows Debugging.
This entry was posted in Debugging. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s