diff options
| author | Aleksa Vuckovic <aleksav013@gmail.com> | 2022-08-05 03:14:51 +0200 |
|---|---|---|
| committer | Aleksa Vuckovic <aleksav013@gmail.com> | 2022-08-05 03:14:51 +0200 |
| commit | be3274c49d0ca5e31daa855c4c109d830fdead67 (patch) | |
| tree | 7f097287c7917b5bf662c5d2322a437a15f2a2da /kernel/keyboard.c | |
| parent | f622bf0d79a7460cb160207bcd75f257deb872ea (diff) | |
interrupts
Diffstat (limited to 'kernel/keyboard.c')
| -rw-r--r-- | kernel/keyboard.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/kernel/keyboard.c b/kernel/keyboard.c new file mode 100644 index 0000000..105c3a8 --- /dev/null +++ b/kernel/keyboard.c @@ -0,0 +1,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); +} |
