From bcf29395b315eb7a92d3eb0618452b03bd91579e Mon Sep 17 00:00:00 2001 From: Fortunate-MAN Date: Sun, 15 Jan 2017 16:01:17 +0530 Subject: [PATCH] Control key detection test #155 --- arch/i386/mm/pmm.c | 13 ++++++------- include/platform/pc/drv/ps2/kbd/kbd.h | 3 ++- platform/pc/drv/ps2/kbd/kbd.c | 3 +++ .../pc/drv/ps2/kbd/kbd_layouts/scancodes_usa.c | 17 +++++++++-------- 4 files changed, 20 insertions(+), 16 deletions(-) diff --git a/arch/i386/mm/pmm.c b/arch/i386/mm/pmm.c index 54d6e9a..757be30 100644 --- a/arch/i386/mm/pmm.c +++ b/arch/i386/mm/pmm.c @@ -15,11 +15,11 @@ ** along with BoneOS. If not, see . ** ** @main_author : Amanuel Bogale - ** + ** ** @contributors: ** Amanuel Bogale : start - **/ + **/ #include #include @@ -34,7 +34,7 @@ static bool pmm_initalized = false; static multiboot_info_pmm_t mb_info; - allocation_scheme_t *alloc_schemes[] = + allocation_scheme_t *alloc_schemes[] = { &bitmap_pmm_allocation }; @@ -47,15 +47,15 @@ int pmm_init(multiboot_info_t* multiboot_structure) mb_info.multiboot_structure = multiboot_structure; mb_info.multiboot_structure->mmap_addr += HIGHER_KERNEL_ADDRESS_LOAD; //Higher half - + _mmngr_mem_size.MiB = mem_amt(mb_info.multiboot_structure,MiB,false); _mmngr_mem_size.GiB = mem_amt(mb_info.multiboot_structure,GiB,false); _mmngr_mem_size.KiB = mem_amt(mb_info.multiboot_structure,KiB,false); _mmngr_mem_size.B = mem_amt(mb_info.multiboot_structure,B,false); - + if(alloc_schemes[_BITMAP_PAGE_FRAME_ALLOCATION_SCHEME]->init(multiboot_structure)) panik("Error Initalizing bitmap allocation system"); - + return STATUS_OK; } @@ -68,7 +68,6 @@ void __debug_print_memory_size() printk("KiB : %.7f\n",_mmngr_mem_size.KiB); printk("MiB : %.7f\n",_mmngr_mem_size.MiB); printk("B : %.7f\n",_mmngr_mem_size.B); - #endif } diff --git a/include/platform/pc/drv/ps2/kbd/kbd.h b/include/platform/pc/drv/ps2/kbd/kbd.h index 11c770b..f030a1b 100644 --- a/include/platform/pc/drv/ps2/kbd/kbd.h +++ b/include/platform/pc/drv/ps2/kbd/kbd.h @@ -63,7 +63,8 @@ #define KBD_LEFT_KEY_ID 0x101004 #define KBD_RIGHT_KEY_ID 0x101005 #define KBD_CAPS_PRESS_ID 0x101005 -#define KBD_ENTER_PRESS_ID 0x101007 +#define KBD_ENTER_PRESS_ID 0x101007 +#define KBD_CONTROL_PRESS_ID 0x101008 diff --git a/platform/pc/drv/ps2/kbd/kbd.c b/platform/pc/drv/ps2/kbd/kbd.c index 1dd8e45..7fd6842 100644 --- a/platform/pc/drv/ps2/kbd/kbd.c +++ b/platform/pc/drv/ps2/kbd/kbd.c @@ -333,6 +333,9 @@ void key_handler() printk("%s" , cmd_active.value); } break; + case KBD_CONTROL_PRESS_ID: + printk ("CONTROL!"); + break; case KBD_ENTER_PRESS_ID: kbd_info.is_enter = true; active_scank = false; diff --git a/platform/pc/drv/ps2/kbd/kbd_layouts/scancodes_usa.c b/platform/pc/drv/ps2/kbd/kbd_layouts/scancodes_usa.c index 4d9edba..4f50fe1 100644 --- a/platform/pc/drv/ps2/kbd/kbd_layouts/scancodes_usa.c +++ b/platform/pc/drv/ps2/kbd/kbd_layouts/scancodes_usa.c @@ -15,23 +15,24 @@ ** along with BoneOS. If not, see . ** ** @main_author : Amanuel Bogale - ** + ** ** @contributors: - ** Amanuel Bogale : start_ - **/ + ** Amanuel Bogale : start + ** Ashish Ahuja + **/ #include //USA Scancode No Shift Pressed -int const QWERTY_USA_NOSHIFT_VAL[] = +int const QWERTY_USA_NOSHIFT_VAL[] = { 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', '[', ']', KBD_ENTER_PRESS_ID, /* Enter key */ - 0, /* 29 - Control */ + KBD_CONTROL_PRESS_ID, /* 29 - Control */ 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', ';', /* 39 */ '\'', '`', KBD_LEFT_SHIFT_PRESS_ID, /* Left shift */ '\\', 'z', 'x', 'c', 'v', 'b', 'n', /* 49 */ @@ -65,14 +66,14 @@ int const QWERTY_USA_NOSHIFT_VAL[] = }; //USA Scancode Shift Pressed - int const QWERTY_USA_SHIFT_VAL[] = + int const QWERTY_USA_SHIFT_VAL[] = { 0, 27, '!', '@', '#', '$', '%', '^', '&', '*', /* 9 */ '(', ')', '_', '+', '\b', /* Backspace */ - '\t', /* Tab */ + '\t', /* Tab */ 'Q', 'W', 'E', 'R', /* 19 */ 'T', 'Y', 'U', 'I', 'O', 'P', '{', '}', KBD_ENTER_PRESS_ID, /* Enter key */ - 0, /* 29 - Control */ + KBD_CONTROL_PRESS_ID, /* 29 - Control */ 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K' ,'L', ':', /* 39 */ '\"' , '~', KBD_LEFT_SHIFT_PRESS_ID, /* Left shift */ '|', 'Z', 'X', 'C', 'V', 'B', 'N', /* 49 */