summaryrefslogtreecommitdiff
path: root/kernel/src/devices/keyboard.c
blob: 105c3a81b9f2ad171d0c55186c2ac390df1db501 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <stdint.h>
#include <pic.h>
#include <io.h>
#include <graphics.h>
#include <debug.h>

#define KEYBOARD_DATA_PORT	0x60
#define KEYBOARD_STATUS_PORT	0x64

uint8_t i = 0;

void keyboard_handler(void)
{
	uint8_t status = inb(KEYBOARD_STATUS_PORT);
	if (!(status & 0x1)) {
		return;
	}
	uint8_t keycode = inb(KEYBOARD_DATA_PORT);
	fb_draw_character(fb, keycode, 0, 0, RED, BLACK);
}