Tripple 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
n0ax
Posts: 10
Joined: Thu May 01, 2014 11:43 pm

Tripple Fault

Post by n0ax »

After the 1st stage boot loader relocates me and I setup protected mode I get a triple fault when I attempt to write to video memory at 0xb8000. ex mov [0xb8000], 'o' generates a triple fault
User avatar
Lionel
Member
Member
Posts: 117
Joined: Fri Jul 16, 2010 2:16 pm
Libera.chat IRC: ryanel
Location: California

Re: Tripple Fault

Post by Lionel »

Are you testing this in an emulator? What does it output? I assume you are using your own bootloader, in which case I would check to see if you disable interupts. I would also advise you to click here, so you can get some required reading to learn how to ask a question properly.

So far, based on your (lack) of information (seriously, you just went to a craftsmen with no knowledge of what you wanted crafted), it could be:
  • Your bootloader
  • Your kernel
  • No valid IDT
  • Invalid segments (protected mode not setup correctly)
  • Something else.
Please go though this basic itinerary and then, if not solved, learn to ask questions the smart way
I would also recommend reading (googling) on what a triple fault is, why it happens, and what you can do to fix it.
Thanks,
Lionel
User avatar
iansjack
Member
Member
Posts: 4711
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Tripple Fault

Post by iansjack »

This should be pretty trivial to debug. Single-step through the code until the faulting instruction and see what the fault is. You have, presumably, written some basic exception handlers to halt the processor as soon as an exception occurs. The exception triggered, plus the pushed error code, along with the state of the registers and memory, should tell you what the problem is.
User avatar
JAAman
Member
Member
Posts: 879
Joined: Wed Oct 27, 2004 11:00 pm
Location: WA

Re: Tripple Fault

Post by JAAman »

really you didn't give anywhere near enough information to even begin guessing on what is wrong, but the most common reason for new players to get this is either broken GDT (where triple-fault occurs first time you try to use an incorrect segment), or you have interrupts enabled but haven't yet installed an IDT, in which case its the timer interrupt, which automatically fires constantly that is causing the triple-fault

also, get yourself familiar with Bochs, using that will tell you lots of information about problems like this, especially in the stages where you don't yet have your own exception handlers working (though you should do that soon, as it will be great help tracking down other problems)
Post Reply