mbr_asm/irq_handler.c

23 lines
556 B
C
Raw Normal View History

2018-06-30 01:03:40 +02:00
#include "interrupt.h"
2018-07-17 23:02:27 +02:00
#include "vga.h"
#include "io.h"
2018-06-30 01:03:40 +02:00
// Need GCC > 6
__attribute__((interrupt)) void keyboard_handler(struct interrupt_frame *frame)
{
2018-07-17 23:02:27 +02:00
printString("Keyboard!", RED, BLACK, 0, 7);
char c = 0;
if (inb(0x60) != c) {
c = inb(0x60);
if (c > 0)
printChar(c, RED, BLACK, 0, 8);
}
(void)frame;
}
__attribute__((interrupt)) void timer_handler(struct interrupt_frame *frame)
{
printString("Timer!", RED, BLACK, 0, 9);
(void)frame;
2018-06-30 01:03:40 +02:00
}