1) Why are you using CLI? this is dangerous, and should never be done. Instead, use a interrupt gate (which automatically disables interrupts for you), otherwise, it is possible to receive an interrupt after calling your handler, but before executing that first instruction (the CLI) -- this can lead to stack overflowKrotovOSdev wrote: I think the problem is stack overflow. When interrupt handler is called it calls resched() which leads to creating a stack frame. If I'm right (but i maybe not) I have somehow to bypass it. How can I do this?
2) Why do you have an STI instruction? The STI instruction should never be used. Ever. There is no place (beyond your bootloader) when an STI instruction should be used. Again, you should be using an interrupt gate which automatically disables interrupts when it is called (and will automatically restore them as part of the IRET). -- this can cause stack overflow