Triple Fault when a key is pressed

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.
nullplan
Member
Member
Posts: 1790
Joined: Wed Aug 30, 2017 8:24 am

Re: Triple Fault when a key is pressed

Post by nullplan »

catOS wrote:I think I now have a General Protection Fault caused by a invalid opcode (I'm not sure), here's the log anyway
Oh come on, learn to read. I didn't write that litany last time for you to marvel at my knowledge, I actually did that so you could understand these outputs.

What do we have this time? v=06. As you have rightly identified, that is an undefined opcode exception. However, the instruction address here looks strange to me. 1bf is in the middle of the real mode IVT, which contains only data, not code. Is it possible that your IDT descriptor for the interrupt contained that address (or something before that) as handler address?
Carpe diem!
Octocontrabass
Member
Member
Posts: 5568
Joined: Mon Mar 25, 2013 7:01 pm

Re: Triple Fault when a key is pressed

Post by Octocontrabass »

My first thought when I see execution from a nonsense address is that the kernel's main function returned to its caller, and the caller isn't handling it correctly.

The HLT instruction does not stop the CPU forever.
User avatar
catOS
Member
Member
Posts: 28
Joined: Tue Mar 31, 2020 6:28 pm

Re: Triple Fault when a key is pressed

Post by catOS »

Interestingly when I comment out the hlt instruction, the system goes in a boot loop obviously but it's running keyboard interrupt handler code on each boot loop.
Visit ackOS's GitHub page:
>> https://github.com/ackOS-project/ackOS <<
Octocontrabass
Member
Member
Posts: 5568
Joined: Mon Mar 25, 2013 7:01 pm

Re: Triple Fault when a key is pressed

Post by Octocontrabass »

Well, yeah. If you don't stop the CPU at all, it'll keep going. It sounds like the code for your keyboard interrupt handler happens to be what's next in memory.
User avatar
catOS
Member
Member
Posts: 28
Joined: Tue Mar 31, 2020 6:28 pm

Re: Triple Fault when a key is pressed

Post by catOS »

Octocontrabass wrote:Well, yeah. If you don't stop the CPU at all, it'll keep going. It sounds like the code for your keyboard interrupt handler happens to be what's next in memory.
oh I see, so do you know what's causing the triple fault?
Visit ackOS's GitHub page:
>> https://github.com/ackOS-project/ackOS <<
Octocontrabass
Member
Member
Posts: 5568
Joined: Mon Mar 25, 2013 7:01 pm

Re: Triple Fault when a key is pressed

Post by Octocontrabass »

You're not stopping the CPU, so the CPU keeps running until it hits garbage and triple faults.
Post Reply