Currently I'm on a Win8.1 Host using cygwin and a cross compiler, and emulating in bochs. I'm loading the kernel through GRUB (Grub 2 I think?).
I think I've followed all the steps required to get interrupts up and running, which is:
- - Make and load my own GDT (Just a flat 4GiB code and flat 4GiB data entry)
- Make and load my own IDT, with an entry at 0x21 for my routine (I haven't written handlers to service any of the other interrupts)
- Re-mapped the interrupts on the PICS with an offset of 0x20 and 0x28, so the hardware IRQs range from 0x20 to 0x2f
- Cleared the mask for line 1 on the master PIC
- And finally, to test the interrupt, I do asm("INT $0x21") and my routine runs (it outputs "Key pressed\n")
- Then I put the kernel in an infinite loop, which I'm hoping to handle keyboard interrupts from, just to test them out.
I also have a slight hunch that maybe a virtual machine isn't the best thing to test this on, seeing as when I ran it on real hardware, I had to use a USB keyboard, my PS/2 one didn't do anything, even in the GRUB menu. I'm going to do some tests by writing an ISR for the Timer, which apparently fires 18 times every second? So hopefully, if that works, I'll make an edit which talks about the results, and I'll know it's an issue with the keyboard. In the meantime, if you think you have a solution or any other tests I could try, let me know. (Try to keep in mind I'm a bit new to this, so you may need to explain something to me if I'm not sure what you're talking about.)
In summary, I think I set up interrupts correctly, but the keyboard won't fire an IRQ? Any ideas?
Thanks for the nice forum,
Mikumiku747