


So... I'm rewriting another time my kernel.
A bug I've never seen is destroying my neurons:
The kernel uses a JM similar method to handle interrupt. An NOERRORCODE and an ERRORCODE macros that defines all the interrupts and pushes the int number and a false error code in case there isn't one. Then a jump to a common routine. When the handler gives the IRET, bochs signals a not valid code segment. And a GPF fires. Then the GPF handle gives the IRET and another GPF fires. That's wanderful...
Hacking the bochs source, it now show wich segment is it trying to use. It's trying to use segment 0x202.

It's very strange. Also because 0x202 is the eflags mask!!!

I've also checked the ESP value immediately after the int and before the iret. The two values are equal.
What's the problem?
Thanks.