Beispiel #1
0
//interrupt service procedure for keyboard
void inthandler21(int *esp)
{
  struct  boot_info *binfo=(struct boot_info *)ADDR_BOOT;
  boxfill(0,0,0,32*8-1,15);//一个黑色的小box
  puts8((char *)binfo->vram ,binfo->xsize,0,0,7,"int 21(IRQ-1):PS/2 keyboard");
  while(1)
  io_halt();
  
}
Beispiel #2
0
static void test_keyboard()
{
	s32 k_x = 60, k_y = 80;
    while (TRUE)
    {
        if (get_tick_count() % 10)
            io_halt();

        mouse_read();

        u32 key = 0;	
        keyboard_read(&key);
        if (key == 0 || KEY_TYPE(key) != KT_ASCII)
            continue;

        draw_asc16((char)key, k_x, k_y, color);
        k_x += 8;
        if (k_x + 100 > 1000)
        {
            k_x  = 60;
            k_y += 20;
        }
    }
}