Unavoidable triple Fault

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
brodeur235
Member
Member
Posts: 86
Joined: Sat Jun 06, 2009 11:55 am

Unavoidable triple Fault

Post by brodeur235 »

Of course I know it's avoidable... The bugger just seems to be persistent. Here's what I do:

1.) Bootloader enters pmode, loads kernel, and jumps to it.

2.) Kernel disables interrupts, sets up stack, cs, ds, etc. (all segment regs)

3.) Kernel sets up IDT (with a single ISR (# 0) ) and loads it into idt register

4.) Kernel outputs offset of ISR, outputs offset and contents of IDT, outputs offset and contents of ISR descriptor

5.) Kernel disables interrupts

6.) **Seemingly** unavoidable triple fault is thrown (exception 13)

Everything seems to be correct judging by the kernels output of the ISR, IDT table, and IDTdescriptor. Yet, the triple fault is thrown IMMEDIATELY after I issue an "sti" statement. Heres the output of the kernel, comment for your readability in my own special way:
Image
Keep in mind that those bytes are stored in little endian. If you fix them visually, you can see that everything points to where it should.

Here is botchs log from the time I enter p-mode, to the time I triple fault: http://pastebin.ca/1507662

Thanks to bochs I now know what's that I have been triple faulting and that's the problem; with vbox I had absolutely no clue. However, I remain clueless to the cause of the triple fault... All help appreciated,

Brodeur235
User avatar
gzaloprgm
Member
Member
Posts: 141
Joined: Sun Sep 23, 2007 4:53 pm
Location: Buenos Aires, Argentina
Contact:

Re: Unavoidable triple Fault

Post by gzaloprgm »

Of course it will triple fault. As soon as you sti, the PIT fires. Because you havent remapped the interrupts, its int number 8.

Because there is no entry #8 in the IDT, it GPFs. Because there is no GPF handler it double faults. Because there is no double fault handler it will triple faults and reboot.

Cheers,
Gzaloprgm
Visit https://gzalo.com : my web site with electronic circuits, articles, schematics, pcb, calculators, and other things related to electronics.
brodeur235
Member
Member
Posts: 86
Joined: Sat Jun 06, 2009 11:55 am

Re: Unavoidable triple Fault

Post by brodeur235 »

Dude... You are a LIFE saver. Do you know how long I've been stressing over this? Over a week I've been stuck at the IDT. Suffice it to say that I'm excited, and thankful that you took the time to reply...

Brodeur235

(It works now... If you didn't already get that.)
Post Reply