How do i get my keyboard handler to work?
Re: IRQ1 never gets fired
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.
Re: IRQ1 never gets fired
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'll update my GitHub now.
Re: How do i get my keyboard handler to work?
You send the EOI command in int irq0(), but not in any of the other irqn() routines.
Re: How do i get my keyboard handler to work?
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.
0x21 is IRQ1, and 0x20 is an EOI code (if you want to send an EOI to IRQ0, do outb(0x20, 0x20) ).
-
- Member
- Posts: 5587
- Joined: Mon Mar 25, 2013 7:01 pm
Re: How do i get my keyboard handler to work?
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
Re: How do i get my keyboard handler to work?
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.
Re: How do i get my keyboard handler to work?
0x28, 0x27 or 0x21.
None of them make IRQ1 get EOI's.
Re: How do i get my keyboard handler to work?
It doesn't say that at all. Read section 4.2 of the page referenced.
You must learn to read, and understand, documentation.
You must learn to read C code and create it.
You must stop expecting others to spoonfeed you with every little detail.
Otherwise, what's the point?
You must learn to read, and understand, documentation.
You must learn to read C code and create it.
You must stop expecting others to spoonfeed you with every little detail.
Otherwise, what's the point?
Re: How do i get my keyboard handler to work?
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);
OS: Basic OS
About: 32 Bit Monolithic Kernel Written in C++ and Assembly, Custom FAT 32 Bootloader
About: 32 Bit Monolithic Kernel Written in C++ and Assembly, Custom FAT 32 Bootloader
Re: How do i get my keyboard handler to work?
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);
-
- Member
- Posts: 501
- Joined: Wed Jun 17, 2015 9:40 am
- Libera.chat IRC: glauxosdever
- Location: Athens, Greece
Re: How do i get my keyboard handler to work?
Hi,
Regards,
glauxosdever
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.
Regards,
glauxosdever
Re: How do i get my keyboard handler to work?
You send the EOI command to the PIC(s), not to an IRQ.DixiumOS wrote:This is sending to IRQ0 and not IRQ1.
Re: How do i get my keyboard handler to work?
That rather illustrates the danger of telling you anything.DixiumOS wrote:Glaux told me, btw.
I think it would be better all round if we all ignore you completely from now on and not give you even the smallest nugget of information (which you will misquote). That way you will have to work it out for yourself by reading the documentation (if you can ever break the habit of copying what every Tom, **** - Jeez, what a swearword filter! - , and Harry has written in some crap tutorial).
Then perhaps - one day, many years from now - you may understand what you are doing.
Re: How do i get my keyboard handler to work?
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
EDIT: 0x20. I was a bit confused. It now works. I thought it differed when the IRQ was different. Thanks!
Last edited by DixiumOS on Sun Jan 15, 2017 5:37 am, edited 2 times in total.