Hello Everyone,
I tried to implement IDT in my kernel (adapted from Bran's Kernel Development Tutorial/IDT).
I have setup the IDT and installed the keyboard and mouse handler. It was working well with both BOCHS and QEMU.
Then, I realized that I should test my kernel under real BIOS so I created floppy disk image for my OS and rebooted under my real BIOS. Then came the hiccup.
As soon as my kernel tries to setup the IDT my fault handler displays the message "General Protection Fault". I searched the forum and found that some other guys had similar problem with IDT but my problem was the "General Protection Fault".
So, if anybody knows what is causing the "General Protection Fault" when I setup the IDT, please help!
Interrupts not working under real BIOS [SOLVED]
Interrupts not working under real BIOS [SOLVED]
Last edited by Chandra on Wed Sep 29, 2010 8:43 pm, edited 1 time in total.
Programming is not about using a language to solve a problem, it's about using logic to find a solution !
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: Interrupts not working under real BIOS
Did you run the exact same floppy contents under bochs where you *can* debug? Did you zero out the memory where needed?
Statler: Did he make any attempt to narrow down the problem?
Waldorf: No, he attempted to narrow down his prose.
Statler: Did he make any attempt to narrow down the problem?
Waldorf: No, he attempted to narrow down his prose.
Re: Interrupts not working under real BIOS
If you get a GPF you must look at the cs, eip and error code. The error code will tell you if a selector was involved. The cs:eip will tell you the faulting instruction. Should be easy to solve the problem from there.
By the way what do you mean by "real BIOS" ? Do you mean you tested on actual hardware ?
By the way what do you mean by "real BIOS" ? Do you mean you tested on actual hardware ?
If a trainstation is where trains stop, what is a workstation ?
Re: Interrupts not working under real BIOS
Yes, I was trying to tell that I tested on actual hardware ( trying to use a typical term "real BIOS"...). And of course, several tests showed that the problem was actually with my bootloader GDT. As soon as I loaded the kernel, I setup another GDT and replaced my bootloader GDT which solved the problem. It's working fine now.gerryg400 wrote: By the way what do you mean by "real BIOS" ? Do you mean you tested on actual hardware ?
Thanks both of you.
Programming is not about using a language to solve a problem, it's about using logic to find a solution !