what are the gpf "error codes?"

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
earlz

what are the gpf "error codes?"

Post 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..
bluecode

Re:what are the gpf "error codes?"

Post 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.
Ryu

Re:what are the gpf "error codes?"

Post 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.
earlz

Re:what are the gpf "error codes?"

Post by earlz »

yes thank you.. I found it in volume 3,chapter 5 of the intel manual
Post Reply