2021-07-15 14:52:19 +00:00
|
|
|
#include "pic.h"
|
|
|
|
#include "io.h"
|
|
|
|
|
|
|
|
void remap_pic(void)
|
|
|
|
{
|
|
|
|
// ICW1
|
|
|
|
outb(MASTER_PORT_A, ICW1_INIT | ICW1_ICW4);
|
|
|
|
outb(SLAVE_PORT_A, ICW1_INIT | ICW1_ICW4);
|
|
|
|
|
|
|
|
// ICW2
|
|
|
|
outb(MASTER_PORT_B, ICW2_M_OFFSET);
|
|
|
|
outb(SLAVE_PORT_B, ICW2_S_OFFSET);
|
|
|
|
|
|
|
|
// ICW3
|
|
|
|
outb(MASTER_PORT_B, PIC_PIN_2);
|
|
|
|
outb(SLAVE_PORT_B, 2);
|
|
|
|
|
|
|
|
// ICW4
|
|
|
|
outb(MASTER_PORT_B, ICW4_INIT);
|
|
|
|
outb(SLAVE_PORT_B, ICW4_INIT);
|
|
|
|
|
|
|
|
// OCW1
|
2021-07-26 12:55:31 +00:00
|
|
|
outb(MASTER_PORT_B, PIC_PIN_3 | PIC_PIN_4 | PIC_PIN_5 |
|
|
|
|
PIC_PIN_6 | PIC_PIN_7);
|
|
|
|
outb(SLAVE_PORT_B, PIC_PIN_0 | PIC_PIN_1 | PIC_PIN_2 | PIC_PIN_3 |
|
2021-07-28 21:43:48 +00:00
|
|
|
PIC_PIN_4 | PIC_PIN_5);
|
2021-07-16 01:18:43 +00:00
|
|
|
|
|
|
|
asm volatile("sti");
|
2021-07-15 14:52:19 +00:00
|
|
|
}
|