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

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
KirkKD
Posts: 1
Joined: Sun Sep 18, 2022 6:33 pm

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

Post 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?
devc1
Member
Member
Posts: 439
Joined: Fri Feb 11, 2022 4:55 am
Location: behind the keyboard

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

Post 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,
User avatar
iansjack
Member
Member
Posts: 4703
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

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

Post 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?
Octocontrabass
Member
Member
Posts: 5563
Joined: Mon Mar 25, 2013 7:01 pm

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

Post 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.
Post Reply