GDT and IDT problems
Posted: Fri Apr 11, 2014 2:34 am
Hi guys, I am doing GDT and IDT, just wondering, what is the best way to check I have correctly make a GDT and IDT.(Will bochs debugger mention that they have been made?) Thanks
The Place to Start for Operating System Developers
http://f.osdev.org/
Yeah, when scientist finally invent working AI, Bochs will probably be able to tell the right GDT/IDT from the wrong. No, really, Bochs can't know whether or not what you've got is what you want and if it's somehow right. There's no single right here. You may have reasons for setting up unusable segment descriptors. Bochs wouldn't know that. But it will surely tell you of triple faults emanating from #GP's, #SS' and so on.hometue wrote:Hi guys, I am doing GDT and IDT, just wondering, what is the best way to check I have correctly make a GDT and IDT.(Will bochs debugger mention that they have been made?) Thanks
Triple Fault it is then. (for most cases like you'll maybe switch to an invalid segment (faulty GDT), CPU relaxes and says "Why should I bother?" searches for handler, faulty IDT, can't find the appropriate handler, then asks "Why should I bother?", goes finds the DF handler, faulty IDT, then asks "Why should I bother?", and reboots.) or it can be something beyond our imagination.(as in there is a faulty gdt/idt what will happen?)
Yes, it can do just this. Typically you'd want to set a breakpoint after the lidt and lgdt instructions, and then use the 'info gdt' and 'info idt' commands. The bochs debugger is a powerful tool if you learn to use it properly.hometue wrote:Hi guys, I am doing GDT and IDT, just wondering, what is the best way to check I have correctly make a GDT and IDT.(Will bochs debugger mention that they have been made?) Thanks
Rule #1 : Tutorials deal with a specific-implementation, You shouldn't rely much on them, basically it's like a ready made answer, from what I've learnt from my mistakes tutorials help you get started and that's it. What happens after is on your hands. Teachers will know the best about what I'm talking about.hometue wrote:Would that be the same as displaying the gdt and idt in the gui debugger. How would I tell a faulty gdt with a proper one then?
Btw, I came across this question which confuses me, when making a gdt and must i fill it for it to work(I see when switching to proteted mode they don't but in some gdt tutorial you actually have to)? And what do I fill it with (I am a visual learner, so if someone can provide me with a good diagram of the gdt and idt I will appreciate it as it would make it much simpler to understand, can't find a good visualization of the gdt and idt anywhere), while there is code provided to fill it I rather understand the structure of the gdt and not rely on other's code to do things for me. Thank you very much.