Page 1 of 1
IRQs not Working
Posted: Sun Oct 24, 2010 8:29 pm
by HiGuys
After I remap the IRQs and get the PIT started up, it doesn't show me which tick it's on as I programmed it to do. Also, when I call an IRQ manually, via __asm__ __volatile__("int $0x32");, it throws interrupt 0x0d, the General Fault Protection. I can't figure out the problem, I've looked at all my code. Hopefully you experts can tell me what I'm doing wrong. Could this be a problem with bochs and VirtualBox(I've tried them both).
Re: IRQs not Working
Posted: Sun Oct 24, 2010 8:38 pm
by gerryg400
HiGuys wrote:After I remap the IRQs and get the PIT started up, it doesn't show me which tick it's on as I programmed it to do. Also, when I call an IRQ manually, via __asm__ __volatile__("int $0x32");, it throws interrupt 0x0d, the General Fault Protection. I can't figure out the problem, I've looked at all my code. Hopefully you experts can tell me what I'm doing wrong. Could this be a problem with bochs and VirtualBox(I've tried them both).
There is an error in your code.
Re: IRQs not Working
Posted: Sun Oct 24, 2010 10:06 pm
by ~
I think you shouldn't call IRQs manually. They should occur by themselves.
I also think this can help you. All of the basic sequences of performing things for getting you started are here:
http://f.osdev.org/viewtopic.php?f=1&t=22664
If you need any more help just tell. I'll be glad to help as I'm currently trying to get a brief tutorial done about it and the next steps (like properly handling PS/2 mouse and keyboard simultaneously).
Re: IRQs not Working
Posted: Sun Oct 24, 2010 11:12 pm
by gerryg400
I sometimes call my int functions manually to debug them. It should be okay. Note that you need to make sure that the DPL of the idt entry is low enough privilege that you can call it manually. Hardware interrupts can vector to any privilege IDT entry but the 'int' instruction can only vector to entries with DPL numerically greater or equal to the CPL (I think ?!?).
Also I note you were calling int $0x32. I wonder whether you meant int $0x20 (== int $32).
Re: IRQs not Working
Posted: Wed Oct 27, 2010 2:11 am
by Chandra
Posting the concerned code would make easier to figure out what actually is the problem.
Re: IRQs not Working
Posted: Sat Nov 06, 2010 10:07 am
by KotuxGuy
It sounds like he's following
JamesM's kernel tutorial, though I could be wrong.
EDIT: Kind of a stretch for time from the last post, but I think it's alright for me to post...
Re: IRQs not Working
Posted: Sat Nov 06, 2010 10:11 am
by chibicitiberiu
Did you enable interrupts?
asm volatile ("sti");