Page 1 of 1

[SOLVED] Odd number in General Protection Fault error code?

Posted: Fri Apr 19, 2013 9:56 am
by HugeCode
Have you ever seen GPF error code to be odd?
When set up an invalid user-mode GDT entry, it threw me exception with error code with first three bits clear.
Is it possible since the GDT and IDT entries are 8 bytes long?

This happened to me:
Image
What can be wrong here?

Re: Odd number in General Protection Fault error code?

Posted: Fri Apr 19, 2013 10:12 am
by iansjack
Difficult to tell with such scant information, but I suspect it's a case of GIGO. Just single-step through the code to see what you are doing wrong.

Re: Odd number in General Protection Fault error code?

Posted: Fri Apr 19, 2013 10:20 am
by HugeCode
I'm not invoking any interrupt there. I tried to clear HW ints and it doesn't occur.... Interesting... The only thing I set is timer, and that is located on 0x100 (0 -timer mapped to 0x20). So if it's timer, why are there additional 3? Does it have something to do with user mode?

Re: Odd number in General Protection Fault error code?

Posted: Fri Apr 19, 2013 12:26 pm
by Gigasoft
Why is it that some people consider this forum as an alternative to reading the manual? If you had read it, you would have known what the error code meant, namely that there was a problem with IDT entry 0x20 when processing a hardware interrupt.