Page 1 of 1

what are the gpf "error codes?"

Posted: Sat Sep 30, 2006 11:56 am
by earlz
I am attempting to debug my OS a bit
but I have no idea what the gpf error code is I just know it exists
it is what is automatically pushed onto the stack when a gpf happens..

Re:what are the gpf "error codes?"

Posted: Sat Sep 30, 2006 2:18 pm
by bluecode
There are exceptions that push a certain exception-specific error code one the stack. Examples therefore is the gpf and the page fault. Look into the intel manuals to find out what these error codes contain.

Re:what are the gpf "error codes?"

Posted: Sat Sep 30, 2006 8:10 pm
by Ryu
To refresh my memory.. The error code has 4 field which is TI, IDT, EXT and the Selector Index field. EXT=1 when the fault was caused by external device, I believe anything but the CPU. When IDT=1 then Selector Index field simply gives you information which IDT Index caused the GPF. If IDT=0 then TI would indicate Selector Index field corresponds to either GDT/LDT. A senerio that I went through making error code information useful is when the PIC was firing spurious interrupts and I did not have a interrupt handler for it, however I had a NP exception handler which I thought would of fired in those circumstances, but insted GPFs were generated. Looking at the error code gives me EXT=1 and IDT=1 Selector Index = 27h which was mapped as IRQ7 and very easy assume the PIC to be causing GPFs. Hope this information helps with debugging with error codes.

Re:what are the gpf "error codes?"

Posted: Sat Sep 30, 2006 8:46 pm
by earlz
yes thank you.. I found it in volume 3,chapter 5 of the intel manual