PIC remapping
Posted: Tue Apr 22, 2008 9:37 am
Hello,
I am currently working on the hardware interrupts, so I must remap the PIC .
I've read JamesM's tutorial but he dont describe clearly ( In other words : I'm dumb
) how to remap the PIC... After I've searched on Google, I've found some descriptions about the PIC, but I'm still not sure if my PIC remap function is correct, here's the code :
I want to use IRQ0 ( clock ) and IRQ1 ( keyboard ), so I have to use AND like this : " inb(0x21) && 0xFC " ( 0xFC = 11111100 ), Is that correct ?
Thanks .
I am currently working on the hardware interrupts, so I must remap the PIC .
I've read JamesM's tutorial but he dont describe clearly ( In other words : I'm dumb

Code: Select all
void remap_pic(){
outb(0x20, 0x11);
io_wait();
outb(0xA0, 0x11);
io_wait();
outb(0x21, 0x20);
io_wait();
outb(0xA1, 0x70);
io_wait();
outb(0x21, 0x04);
io_wait();
outb(0xA1, 0x02);
io_wait();
outb(0x21, 0x01);
io_wait();
outb(0xA1, 0x01);
io_wait();
outb(0x21, inb(0x21) && 0xFC);
io_wait();
outb(0xA1, 0xFF);
}
Thanks .