Keyboard interrupt handler for own kernel (C)

孤街浪徒 提交于 2019-12-04 13:15:04

If there is someone interested how I solved the problem, here is the solution

char c = 0;
init_pics(0x20, 0x28);
do
{

if(inb(0x60)!=c) //PORT FROM WHICH WE READ
{
    c = inb(0x60);
    if(c>0)
        {

            terminal_putinput(c); //print on screen

        }
    }


}
while(c!=1); // 1= ESCAPE

c variable contains the code of the pressed button. Creating a translation array by associating to each code, the corresponding ASCII code, I can print the letter/number which is written on button.

The buttons code can be found here: http://www.nondot.org/sabre/os/files/HCI/keyboard.txt

The ASCII here: http://www.ascii-code.com/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!