adds a queue library, work for keyb driver
This commit is contained in:
@ -31,6 +31,7 @@ void exception_handler(unsigned int i)
|
||||
//kinfo("Sending EOI instruction to KEYB");
|
||||
#endif
|
||||
unsigned char in = inb(0x60);
|
||||
|
||||
char to_print = decode_key_enum(decode_scancode(in));
|
||||
if (to_print != '\0')
|
||||
printf("%c", to_print);
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <kernel/x86/keyb.h>
|
||||
|
||||
|
@ -3,6 +3,20 @@
|
||||
#ifndef ARCH_KEYB_H
|
||||
#define ARCH_KEYB_H
|
||||
|
||||
#define KEYB_DATA_PORT (0x60)
|
||||
#define KEYB_STATUS_PORT (0x64)
|
||||
#define KEYB_COMMAND_PORT (0x64)
|
||||
|
||||
|
||||
#define KEYB_RESP_ERR (0x00)
|
||||
#define KEYB_RESP_SELF_TEST_PASSED (0xAA)
|
||||
#define KEYB_RESP_ECHO (0xEE)
|
||||
#define KEYB_RESP_ACK (0xFA)
|
||||
#define KEYB_RESP_SELF_TEST_FAILED (0xFC)
|
||||
#define KEYB_RESP_SELF_TEST_FAILED_TWO (0xFD)
|
||||
#define KEYB_RESP_RESEND (0xFE)
|
||||
#define KEYB_RESP_ERR_TWO (0xFF)
|
||||
|
||||
typedef enum {
|
||||
KEY_ESC = 0x01,
|
||||
KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, KEY_7, KEY_8, KEY_9, KEY_0,
|
||||
@ -58,8 +72,10 @@ typedef enum {
|
||||
KEY_F12_R,
|
||||
} kb_key_press_t;
|
||||
|
||||
kb_key_press_t decode_scancode(uint8_t scancode);
|
||||
|
||||
|
||||
|
||||
kb_key_press_t decode_scancode(uint8_t scancode);
|
||||
char decode_key_enum(kb_key_press_t keycode);
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user