k-tana-zero/k/pic/pic.c

28 lines
577 B
C
Raw Normal View History

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-17 09:57:59 +00:00
outb(MASTER_PORT_B, PIC_PIN_2 | PIC_PIN_3 | PIC_PIN_4 |
PIC_PIN_5 | PIC_PIN_6 | PIC_PIN_7);
asm volatile("sti");
2021-07-15 14:52:19 +00:00
}