Page 1 of 1

Slave PIC not fireing

Posted: Fri Jun 06, 2008 11:35 am
by wndproc
Hi everyone,

I've stopped dev'ing for a certain period but now I'm back with the same trouble as before. I have absolutely no troubles with the timer or keyboard IRQs, but I simply don't get any respond from my slave PIC.

Here's where I stand:

I've initialized the PICs with the code that appears everywhere:

Code: Select all

	out(PIC1_CTRL, 0x11); // Setup PIC1 for initialization
	out(PIC2_CTRL, 0x11); // Setup PIC2 for initialization

	out(PIC1_DATA, 0x20); // Set interrupt number for IRQ0
	out(PIC2_DATA, 0x28); // Set interrupt number for IRQ8

	out(PIC1_DATA, 0x04); // Link PIC1 & PIC2 over IRQ2
	out(PIC2_DATA, 0x02); // Link PIC1 & PIC2 over IRQ2

	out(PIC1_DATA, 0x01); // Prepare for 8086 operation
	out(PIC2_DATA, 0x01); // Prepare for 8086 operation

	out(PIC1_DATA, 0x00); // Clear data register
	out(PIC2_DATA, 0x00); // Clear data register
I've made a standard routine for interrupts 0 through 255.

And, for testing reasons, I've enabled every IRQ but the timer:

Code: Select all

	out(0x21, 0x01);
	out(0xA1, 0x00);
Result:
nothing...
no CGA vertical retrace, no CMOS Real time clock,...
I only get a response on key-down (cause it's a PIC1 IRQ).

Please help, I'm desperately trying to get my v-retrace routine to work.[/quote]

Posted: Fri Jun 06, 2008 11:43 am
by 01000101
do you even get an initial IRQ fire? because if you get one, and never get another, then you are not ACK'ing the PIC.

Re: Slave PIC not fireing

Posted: Fri Jun 06, 2008 12:05 pm
by Korona
wndproc wrote:no CGA vertical retrace, no CMOS Real time clock
Did you enable those devices? They don't fire interrupts until you tell them to do so.

Posted: Fri Jun 06, 2008 12:08 pm
by wndproc
my ISR is currently blanking the whole screen, so I would definitely recognize any interrupt.
Unfortunately, I don't get any.

Posted: Fri Jun 06, 2008 12:17 pm
by wndproc
Did you enable those devices? They don't fire interrupts until you tell them to do so.
You mean, the v-retrace aswell as the cmos clock need initialization?

If that's the case I feel pretty stupid about blaming the slave PIC.

Posted: Fri Jun 06, 2008 8:35 pm
by 01000101
=)
the RTC needs the (UI) bit set to enable update interrupts, there are other bits that do various interrupt routines, but their names elude me.

Posted: Mon Jun 09, 2008 8:17 am
by Combuster
The vsync interrupt is not present on standard VGA hardware. You need a really old machine to get it (and no, a 386 is *not* old enough)