blob: 85f2e8c6d20e45f5e7658b291c28919d7c1a713d [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);
swissChilie9289ee2021-03-20 21:54:28 -070025void strcpy(char *dest, char *src);
swissChilif5448622021-03-08 20:17:36 -080026int strcmp(char *a, char *b);
27uint strlen(char *a);
swissChili9b3584b2021-02-18 13:57:27 -080028
swissChili19ef4182021-02-21 17:45:51 -080029uchar kbd_scan_code();
30void kbd_handle_input(struct registers *registers);
31void init_kbd();