1
0
Fork 0
mirror of https://github.com/tailix/kernel.git synced 2025-04-14 17:33:13 -04:00

Remove keyboard driver

This commit is contained in:
Braiden Vasco 2017-11-09 16:19:18 +00:00
parent 912a622ad4
commit 0a0f3f6e1a
3 changed files with 0 additions and 92 deletions

View file

@ -33,7 +33,6 @@ OBJS += strncpy.c.o
OBJS += console.c.o
OBJS += pic.c.o
OBJS += timer.c.o
OBJS += keyboard.c.o
# For debugging
OBJS += logger.c.o

View file

@ -1,82 +0,0 @@
#include "keyboard.h"
#include "hwint.h"
#include "asm.h"
static keyboard_handler_t handler = 0;
static void internal_handler();
unsigned char keyboard_map[128] = {
0, 27, '1', '2', '3', '4', '5', '6', '7', '8', /* 9 */
'9', '0', '-', '=', '\b', /* Backspace */
'\t', /* Tab */
'q', 'w', 'e', 'r', /* 19 */
't', 'y', 'u', 'i', 'o', 'p', '[', ']', '\n', /* Enter key */
0, /* 29 - Control */
'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', ';', /* 39 */
'\'', '`', 0, /* Left shift */
'\\', 'z', 'x', 'c', 'v', 'b', 'n', /* 49 */
'm', ',', '.', '/', 0, /* Right shift */
'*',
0, /* Alt */
' ', /* Space bar */
0, /* Caps lock */
0, /* 59 - F1 key ... > */
0, 0, 0, 0, 0, 0, 0, 0,
0, /* < ... F10 */
0, /* 69 - Num lock*/
0, /* Scroll Lock */
0, /* Home key */
0, /* Up Arrow */
0, /* Page Up */
'-',
0, /* Left Arrow */
0,
0, /* Right Arrow */
'+',
0, /* 79 - End key*/
0, /* Down Arrow */
0, /* Page Down */
0, /* Insert Key */
0, /* Delete Key */
0, 0, 0,
0, /* F11 Key */
0, /* F12 Key */
0, /* All other keys are undefined */
};
void keyboard_register_handler(keyboard_handler_t new_handler)
{
if (!new_handler) {
keyboard_unregister_handler();
return;
}
handler = new_handler;
hwint_register_handler(1, internal_handler);
}
void keyboard_unregister_handler()
{
hwint_unregister_handler(1);
handler = 0;
}
void internal_handler()
{
for (unsigned char status = inportb(0x64);
status & 1;
status = inportb(0x64)
) {
char keycode = inportb(0x60);
if (keycode < 0) {
continue;
}
if (handler) {
handler(keyboard_map[(unsigned char)keycode]);
}
}
}

View file

@ -1,9 +0,0 @@
#ifndef KERNELMQ_INCLUDED_KEYBOARD
#define KERNELMQ_INCLUDED_KEYBOARD 1
typedef void(*keyboard_handler_t)(char);
void keyboard_register_handler(keyboard_handler_t handler);
void keyboard_unregister_handler();
#endif