Re: IRQ1 never gets fired
Posted: Sat Jan 14, 2017 4:58 pm
Are you reading the scancode from the data port during your interrupt handler? If not you will get just the one interrupt no matter how many key presses you make.
The Place to Start for Operating System Developers
http://f.osdev.org/
Yes, i am.iansjack wrote:Are you reading the scancode from the data port during your interrupt handler? If not you will get just the one interrupt no matter how many key presses you make.
I do send it in all routines.iansjack wrote:You send the EOI command in int irq0(), but not in any of the other irqn() routines.
Where did you see anything like that? Neither the wiki page nor the datasheet agree with that statement.DixiumOS wrote:0x21 is IRQ1, and 0x20 is an EOI code
So where should i send? Is it 0x28?Octocontrabass wrote:Where did you see anything like that? Neither the wiki page nor the datasheet agree with that statement.DixiumOS wrote:0x21 is IRQ1, and 0x20 is an EOI code
0x28, 0x27 or 0x21.
Then at the end of your keyboard handler do:End of Interrupt
Perhaps the most common command issued to the PIC chips is the end of interrupt (EOI) command (code 0x20). This is issued to the PIC chips at the end of an IRQ-based interrupt routine. If the IRQ came from the Master PIC, it is sufficient to issue this command only to the Master PIC; however if the IRQ came from the Slave PIC, it is necessary to issue the command to both PIC chips.Code: Select all
#define PIC_EOI 0x20 /* End-of-interrupt command code */ void PIC_sendEOI(unsigned char irq) { if(irq >= 8) outb(PIC2_COMMAND,PIC_EOI); outb(PIC1_COMMAND,PIC_EOI); }
PIC_EOI and PIC1_COMMAND is 0x20, 0x20. This is sending to IRQ0 and not IRQ1.octacone wrote:Then at the end of your keyboard handler do:End of Interrupt
Perhaps the most common command issued to the PIC chips is the end of interrupt (EOI) command (code 0x20). This is issued to the PIC chips at the end of an IRQ-based interrupt routine. If the IRQ came from the Master PIC, it is sufficient to issue this command only to the Master PIC; however if the IRQ came from the Slave PIC, it is necessary to issue the command to both PIC chips.Code: Select all
#define PIC_EOI 0x20 /* End-of-interrupt command code */ void PIC_sendEOI(unsigned char irq) { if(irq >= 8) outb(PIC2_COMMAND,PIC_EOI); outb(PIC1_COMMAND,PIC_EOI); }
PIC_sendEOI(1);
I didn't told you that. I told you that, based on how you remapped the PIC, IRQ0 has interrupt number 0x20, IRQ1 has interrupt number 0x21, and IRQ2 has interrupt number 0x22 (and not 0x28). Nothing concerning what to send to the PIC on an EOI.DixiumOS wrote:So where should i send? Is it 0x28?Octocontrabass wrote:Where did you see anything like that? Neither the wiki page nor the datasheet agree with that statement.DixiumOS wrote:0x21 is IRQ1, and 0x20 is an EOI code
Glaux told me, btw.
You send the EOI command to the PIC(s), not to an IRQ.DixiumOS wrote:This is sending to IRQ0 and not IRQ1.
That rather illustrates the danger of telling you anything.DixiumOS wrote:Glaux told me, btw.
Ahh, okay. But what port do I send an EOI to?glauxosdever wrote:Hi,
I didn't tell you that. I told you that, based on how you remapped the PIC, IRQ0 has interrupt number 0x20, IRQ1 has interrupt number 0x21, and IRQ2 has interrupt number 0x22 (and not 0x28). Nothing concerning what to send to the PIC on an EOI.
Regards,
glauxosdever