blob: f2517170edfe7e09a9660f713553e62a5b7466b8 [file] [log] [blame]
swissChilid8137922021-02-17 15:34:07 -08001#pragma once
2
3#include "kint.h"
swissChili19ef4182021-02-21 17:45:51 -08004#include "registers.h"
5
6#define KBD_CMD_PORT 0x64
7#define KBD_DATA_PORT 0x60
8
9struct kbd_scan_code_info
10{
11 bool pressed;
12 bool escape;
13 char key;
14};
15
16extern struct kbd_scan_code_info scan_code_table[0xff];
swissChilid8137922021-02-17 15:34:07 -080017
18void outb(ushort port, uchar val);
19uchar inb(ushort port);
20ushort inw(ushort port);
21
swissChilif5448622021-03-08 20:17:36 -080022/* Random string.h stuff, TODO: move to own header */
swissChilid8137922021-02-17 15:34:07 -080023void *memset(void *s, int c, size_t n);
24void *memcpy(void *dest, const void *src, size_t n);
swissChilif5448622021-03-08 20:17:36 -080025int strcmp(char *a, char *b);
26uint strlen(char *a);
swissChili9b3584b2021-02-18 13:57:27 -080027
28void io_wait();
swissChili19ef4182021-02-21 17:45:51 -080029
30uchar kbd_scan_code();
31void kbd_handle_input(struct registers *registers);
32void init_kbd();