I am creating an OS for the x86 processor, and have a program executing in user space (with paging enabled). Right before the program goes to make a syscall ('int $0x80'), the IDTR points to my IDT, and the entry for 0x80 points correctly to my the function I would like to have executed. In gdb, after an 'si', the processor ends up at address 0xe05b with the IDTR completely cleared (set to 0).
Note that before entering user space, the 'int $0x80' call works perfectly, it gets to my function call. After executing an artificial iret to get to userspace, the next 'int $0x80' causes this strange behavior.
If it helps, this all started happening after I made changes to my filesystem code, but I don't see where that could have anything to do with the IDTR.
It also seeems to clear every other register, including the stack, data, and code selector. Like it's some kind of panic
Does anyone know what could cause the processor to do this?
Thanks in advance!