mirror of
https://github.com/tailix/kernel.git
synced 2024-12-11 11:35:39 -05:00
Some refactoring
This commit is contained in:
parent
17e96678c1
commit
9b192a6780
1 changed files with 20 additions and 10 deletions
30
arch/pic.c
30
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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue