mirror of
https://github.com/tailix/kernel.git
synced 2024-11-27 11:24:34 -05:00
Add functions "pic_enable_all" and "pic_disable_all"
This commit is contained in:
parent
d18a31eec2
commit
ebc05296af
3 changed files with 20 additions and 0 deletions
16
arch/pic.c
16
arch/pic.c
|
@ -14,6 +14,22 @@
|
|||
static unsigned char master_irq_start = 0;
|
||||
static unsigned char slave_irq_start = 8;
|
||||
|
||||
void pic_enable_all()
|
||||
{
|
||||
logger_info_from("pic", "Enable all IRQs.");
|
||||
|
||||
outportb(MASTER_DATA, 0);
|
||||
outportb(SLAVE_DATA, 0);
|
||||
}
|
||||
|
||||
void pic_disable_all()
|
||||
{
|
||||
logger_info_from("pic", "Disable all IRQs.");
|
||||
|
||||
outportb(MASTER_DATA, 0xFF);
|
||||
outportb(SLAVE_DATA, 0xFF);
|
||||
}
|
||||
|
||||
void pic_remap(const unsigned char new_master_irq_start, const unsigned char new_slave_irq_start)
|
||||
{
|
||||
logger_info_from("pic", "Remap the IRQ table.");
|
||||
|
|
|
@ -3,6 +3,9 @@
|
|||
|
||||
void pic_remap(unsigned char master_irq_start, unsigned char slave_irq_start);
|
||||
|
||||
void pic_enable_all();
|
||||
void pic_disable_all();
|
||||
|
||||
unsigned char pic_end_of_interrupt(unsigned char irq);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -54,6 +54,7 @@ void idt_flush(const struct IdtPointer *pointer);
|
|||
void protected_initialize(const struct KernelMQ_Info *const kinfo)
|
||||
{
|
||||
pic_remap(32, 40);
|
||||
pic_enable_all();
|
||||
|
||||
logger_info_from("protected", "Setup GDT.");
|
||||
|
||||
|
|
Loading…
Reference in a new issue