IRQs not Working

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
HiGuys
Posts: 6
Joined: Sun Oct 24, 2010 7:54 pm

IRQs not Working

Post 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).
gerryg400
Member
Member
Posts: 1801
Joined: Thu Mar 25, 2010 11:26 pm
Location: Melbourne, Australia

Re: IRQs not Working

Post 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.
If a trainstation is where trains stop, what is a workstation ?
User avatar
~
Member
Member
Posts: 1228
Joined: Tue Mar 06, 2007 11:17 am
Libera.chat IRC: ArcheFire

Re: IRQs not Working

Post 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).
gerryg400
Member
Member
Posts: 1801
Joined: Thu Mar 25, 2010 11:26 pm
Location: Melbourne, Australia

Re: IRQs not Working

Post 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).
If a trainstation is where trains stop, what is a workstation ?
User avatar
Chandra
Member
Member
Posts: 487
Joined: Sat Jul 17, 2010 12:45 am

Re: IRQs not Working

Post by Chandra »

Posting the concerned code would make easier to figure out what actually is the problem.
Programming is not about using a language to solve a problem, it's about using logic to find a solution !
User avatar
KotuxGuy
Member
Member
Posts: 96
Joined: Wed Nov 25, 2009 1:28 pm
Location: Somewhere within 10ft of my favorite chubby penguin!

Re: IRQs not Working

Post 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...
Give a man Linux, you feed the nearest optician ( Been staring at the PC too long again? ).
Give a man OS X, you feed the nearest NVidia outlet ( I need more GPU power!! )
Give a man Windows, you feed the entire Tylenol company ( Self explanatory :D )
chibicitiberiu
Member
Member
Posts: 68
Joined: Thu May 28, 2009 11:46 pm

Re: IRQs not Working

Post by chibicitiberiu »

Did you enable interrupts?

asm volatile ("sti");
Tibi,
Currently working on the Lux Operating System
Post Reply