The BIOS sets the PIT up for 18.2 Hz. If you don't touch the PIT, then the PIT will be left in the state the BIOS left it in; and you'll get an IRQ from the PIT every 55 ms.Gogeta70 wrote:Ok, so i have things working a lot better now. But, i'm only receiving my keyboard interrupt once. I receive a system timer interrupt (IRQ0) constantly though :/
I haven't programmed the PIT. Should i be getting any IRQ0's?
It will go dead. The PS/2 controller has a 1-byte buffer. When a byte (from the keyboard) goes into that buffer the PS/2 controller generates an interrupt; and if the byte isn't read by software the buffer remains full, which prevents another byte (from the keyboard) from going into the "already full" buffer, which prevents a second IRQ.Combuster wrote:Also, you are not reading the keyboard buffer yet either so it might just fill up and go dead as well.
Those interrupts (numbers 0x00 - 0x1F) are exceptions. Exceptions are the only types of interrupts that have error codes.Gogeta70 wrote:I know some of the standard interrupts (numbers 0x00 - 0x1f) have error codes, but do any of the interrupts generated by the PIC have an error code associated with them?
The slave PIC is connected to the "input #2" of the master PIC. This means that when a device connected to the slave PIC generates an IRQ, the slave PIC tells the master PIC and the master PIC tells the CPU. This also means when a device connected to the slave PIC generates an IRQ, you have to send the EOI to both the master PIC and the slave PIC, like this:Gogeta70 wrote:Here are my pic_eoi functions:
Code: Select all
global pic2_eoi
pic2_eoi:
mov al, 0x20 ; set bit 4 of OCW 2
out 0x20, al ; write to primary PIC command register
out 0xA0, al ; write to secondary PIC command register
ret
Cheers,
Brendan