Keyboard handling with BIOS
Posted: Thu Aug 15, 2002 11:00 pm
I write my os keyboard handling using BIOS interrupt 0x16 subfunction
0x0.But when I call the get_keystroke function,the machine reboot
immediately,and in VMware this procedure cause a triple fault.This
function post below.
How can I handle my keyboard with BIOS?
And is there any interrupt I should use befor I call interrupt 0x16
subfunction 0x0 to initialize the keyboard?
Can I find some tutorial on Web?
Any idea?
Thanks!
/////////////////////////////////////////////
typedef unsigned short word;
word get_keystroke()
{
word _ax;
__asm__ __volatile__ ("movb $0x0,%%ah;
int $0x16;"
:"=a"(_ax));
return _ax;
}
/////////////////////////////////////////////
0x0.But when I call the get_keystroke function,the machine reboot
immediately,and in VMware this procedure cause a triple fault.This
function post below.
How can I handle my keyboard with BIOS?
And is there any interrupt I should use befor I call interrupt 0x16
subfunction 0x0 to initialize the keyboard?
Can I find some tutorial on Web?
Any idea?
Thanks!
/////////////////////////////////////////////
typedef unsigned short word;
word get_keystroke()
{
word _ax;
__asm__ __volatile__ ("movb $0x0,%%ah;
int $0x16;"
:"=a"(_ax));
return _ax;
}
/////////////////////////////////////////////