Skip to content

Commit

Permalink
Control key detection test #155
Browse files Browse the repository at this point in the history
  • Loading branch information
double-fault committed Jan 15, 2017
1 parent 34f321b commit bcf2939
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 16 deletions.
13 changes: 6 additions & 7 deletions arch/i386/mm/pmm.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
** along with BoneOS. If not, see <http://www.gnu.org/licenses/>.
**
** @main_author : Amanuel Bogale
**
**
** @contributors:
** Amanuel Bogale <amanuel2> : start
**/
**/

#include <misc/status_codes.h>
#include <boot/multiboot/multiboot.h>
Expand All @@ -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
};
Expand All @@ -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;
}

Expand All @@ -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
}

3 changes: 2 additions & 1 deletion include/platform/pc/drv/ps2/kbd/kbd.h
Original file line number Diff line number Diff line change
Expand Up @@ -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



Expand Down
3 changes: 3 additions & 0 deletions platform/pc/drv/ps2/kbd/kbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
17 changes: 9 additions & 8 deletions platform/pc/drv/ps2/kbd/kbd_layouts/scancodes_usa.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,24 @@
** along with BoneOS. If not, see <http://www.gnu.org/licenses/>.
**
** @main_author : Amanuel Bogale
**
**
** @contributors:
** Amanuel Bogale <amanuel2> : start_
**/
** Amanuel Bogale <amanuel2> : start
** Ashish Ahuja <Fortunate-MAN>
**/

#include <drv/ps2/kbd/kbd.h>

//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 */
Expand Down Expand Up @@ -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 */
Expand Down

0 comments on commit bcf2939

Please sign in to comment.