luxos/Kernel/hal/cpu/pic.c

24 lines
439 B
C
Raw Permalink Normal View History

#include <stdio.h>
2021-09-14 15:34:14 +00:00
#include "pic.h"
void PicRemap(int pic1, int pic2)
2021-09-14 15:34:14 +00:00
{
// Send ICW1
outportb(0x20, 0x11);
outportb(0xA0, 0x11);
// send ICW2
outportb(0x21, pic1); // remap pics
outportb(0xA1, pic2);
// send ICW3
outportb(0x21, 4);
outportb(0xA1, 2);
// Send ICW4
outportb(0x21, 0x01);
outportb(0xA1, 0x01);
outportb(0x21, 0x00);
}