swissChili | d813792 | 2021-02-17 15:34:07 -0800 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include "kint.h" |
swissChili | 19ef418 | 2021-02-21 17:45:51 -0800 | [diff] [blame] | 4 | #include "registers.h" |
| 5 | |
| 6 | #define KBD_CMD_PORT 0x64 |
| 7 | #define KBD_DATA_PORT 0x60 |
| 8 | |
| 9 | struct kbd_scan_code_info |
| 10 | { |
| 11 | bool pressed; |
| 12 | bool escape; |
| 13 | char key; |
| 14 | }; |
| 15 | |
| 16 | extern struct kbd_scan_code_info scan_code_table[0xff]; |
swissChili | d813792 | 2021-02-17 15:34:07 -0800 | [diff] [blame] | 17 | |
| 18 | void outb(ushort port, uchar val); |
| 19 | uchar inb(ushort port); |
| 20 | ushort inw(ushort port); |
| 21 | |
| 22 | void *memset(void *s, int c, size_t n); |
| 23 | void *memcpy(void *dest, const void *src, size_t n); |
swissChili | 9b3584b | 2021-02-18 13:57:27 -0800 | [diff] [blame] | 24 | |
| 25 | void io_wait(); |
swissChili | 19ef418 | 2021-02-21 17:45:51 -0800 | [diff] [blame] | 26 | |
| 27 | uchar kbd_scan_code(); |
| 28 | void kbd_handle_input(struct registers *registers); |
| 29 | void init_kbd(); |