Page 1 of 1

Is it normal to be in a reboot loop after STI?

Posted: Sun Sep 18, 2022 6:38 pm
by KirkKD
I followed https://wiki.osdev.org/Interrupts_tutorial, and did not proceed to any of the "next steps". I did not want to move on until the reboot loop problem is solved, and spent a whole day searching around for a fix with no result. I'm starting to wonder if it is supposed to be like this, before Initialize the PIC like the "next steps" said?

Re: Is it normal to be in a reboot loop after STI?

Posted: Fri Sep 23, 2022 8:10 am
by devc1
The reboot at "STI" instruction means that a CPU Tripple fault happened. How do you initialize your IDT ?

When you activate irqs with STI, it is probably that a pending interrupt fires and you have not a correct handler for it, or you didn't setup your IDT Well.

Devc1,

Re: Is it normal to be in a reboot loop after STI?

Posted: Fri Sep 23, 2022 9:36 am
by iansjack
32-bit or 64-bit?

How are you booting your code?

Are you using a cross-compiler?

Which emulator are you using to run your code?

Re: Is it normal to be in a reboot loop after STI?

Posted: Fri Sep 23, 2022 11:15 am
by Octocontrabass
KirkKD wrote:I'm starting to wonder if it is supposed to be like this, before Initialize the PIC like the "next steps" said?
Since you haven't yet initialized the PIC, you have no control over which interrupts will arrive when you use the STI instruction, and it's very likely that it will either cause an exception or directly call one of the exception vectors. Your exception handlers should halt the CPU. Since the CPU doesn't halt, something isn't working correctly.