mbr_asm/core/irq_handler.c

23 lines
521 B
C
Raw Permalink Normal View History

2018-06-30 01:03:40 +02:00
#include "interrupt.h"
2018-07-17 23:02:27 +02:00
#include "io.h"
2018-07-18 01:41:10 +02:00
#include "irq.h"
#include "keyboard.h"
2018-07-18 15:35:49 +02:00
#include "pic.h"
#include "vga.h"
2018-06-30 01:03:40 +02:00
// Need GCC > 6
__attribute__((interrupt)) void keyboard_handler(struct interrupt_frame *frame)
{
2018-07-18 01:41:10 +02:00
EOIIrq(IRQ_KEYBOARD);
keyboard_do_irq();
2018-07-17 23:02:27 +02:00
(void)frame;
}
__attribute__((interrupt)) void timer_handler(struct interrupt_frame *frame)
{
2018-07-18 01:41:10 +02:00
static int timeCnt = 0;
EOIIrq(IRQ_TIMER);
2018-07-18 15:35:49 +02:00
printIntDetails(timeCnt++, RED, BLACK, 20, VGA_HEIGHT - 1);
2018-07-17 23:02:27 +02:00
(void)frame;
2018-06-30 01:03:40 +02:00
}