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); |
swissChili | 0d24883 | 2021-04-08 18:16:02 -0700 | [diff] [blame] | 19 | void outl(ushort port, uint val); |
swissChili | d813792 | 2021-02-17 15:34:07 -0800 | [diff] [blame] | 20 | uchar inb(ushort port); |
| 21 | ushort inw(ushort port); |
swissChili | 0d24883 | 2021-04-08 18:16:02 -0700 | [diff] [blame] | 22 | uint inl(ushort port); |
swissChili | d813792 | 2021-02-17 15:34:07 -0800 | [diff] [blame] | 23 | |
swissChili | f544862 | 2021-03-08 20:17:36 -0800 | [diff] [blame] | 24 | /* Random string.h stuff, TODO: move to own header */ |
swissChili | d813792 | 2021-02-17 15:34:07 -0800 | [diff] [blame] | 25 | void *memset(void *s, int c, size_t n); |
| 26 | void *memcpy(void *dest, const void *src, size_t n); |
swissChili | e9289ee | 2021-03-20 21:54:28 -0700 | [diff] [blame] | 27 | void strcpy(char *dest, char *src); |
swissChili | f544862 | 2021-03-08 20:17:36 -0800 | [diff] [blame] | 28 | int strcmp(char *a, char *b); |
| 29 | uint strlen(char *a); |
swissChili | 9b3584b | 2021-02-18 13:57:27 -0800 | [diff] [blame] | 30 | |
swissChili | 19ef418 | 2021-02-21 17:45:51 -0800 | [diff] [blame] | 31 | uchar kbd_scan_code(); |
| 32 | void kbd_handle_input(struct registers *registers); |
| 33 | void init_kbd(); |