diff --git a/arch/pic.c b/arch/pic.c index 352e787..cc800db 100644 --- a/arch/pic.c +++ b/arch/pic.c @@ -3,18 +3,28 @@ #include "logger.h" #include "asm.h" +#define PIC_MASTER_COMMAND 0x20 +#define PIC_MASTER_DATA 0x21 + +#define PIC_SLAVE_COMMAND 0xA0 +#define PIC_SLAVE_DATA 0xA1 + void pic_initialize() { logger_info_from("pic", "Remap the IRQ table."); - outportb(0x20, 0x11); - outportb(0xA0, 0x11); - outportb(0x21, 0x20); - outportb(0xA1, 0x28); - outportb(0x21, 0x04); - outportb(0xA1, 0x02); - outportb(0x21, 0x01); - outportb(0xA1, 0x01); - outportb(0x21, 0x00); - outportb(0xA1, 0x00); + outportb(PIC_MASTER_COMMAND, 0x11); + outportb(PIC_SLAVE_COMMAND, 0x11); + + outportb(PIC_MASTER_DATA, 0x20); + outportb(PIC_SLAVE_DATA, 0x28); + + outportb(PIC_MASTER_DATA, 0x04); + outportb(PIC_SLAVE_DATA, 0x02); + + outportb(PIC_MASTER_DATA, 0x01); + outportb(PIC_SLAVE_DATA, 0x01); + + outportb(PIC_MASTER_DATA, 0x00); + outportb(PIC_SLAVE_DATA, 0x00); }