Page 1 of 1

How do I get key pressed without INT 16h?

Posted: Sun Aug 13, 2017 7:46 am
by stevewoods1986
Hello.

How do I get key pressed without INT 16h on a keyboard? Do I have to communicate with PS/2 and make a keyboard driver? Anyway, how do you communicate? Can you get input or do you have to read the scan codes?

Do I need to know if 0x1E (A) is pressed for example? Do I do something with the

Code: Select all

in
or

Code: Select all

out
instructions?
Yes, I've checked out the PS2_Keyboard page.

I might just experiment.

Any help would be appreciated.

Thanks
Steve.

@Geri I don't accept answers from you. Sorry.

Re: How do I get key pressed without INT 16h?

Posted: Sun Aug 13, 2017 7:57 am
by LtG
There's two ways you get keyboard input:
1) You do it yourself, which means you write drivers. This is the proper solution after boot is done, after which you should not rely on firmware (BIOS/UEFI).
2) Use a "library" to do it for you, BIOS or UEFI.

Since you said you don't want BIOS, then you have to do it yourself.

Check the wiki for PS/2 controller and PS/2 keyboard. They are two different things, so you should make two separate drivers, one for controller and one for keyboard.

A keyboard doesn't really have an "a" key or a "b" (etc) key, it just has keys. In different countries those keys have different labels printed on them. In Windows for example you can easily switch the keyboard layout that Windows uses. So you get the key presses from the keyboard and you map them to what ever you want, for instance "char"'s, but remember that not all keys are printable characters, for instance backspace.

There are also USB keyboards, most (all?) MoBo's support translating USB keyboard into a PS/2, so you don't have to deal with USB. USB is significantly more complex and takes a lot more effort. PS/2 I think is pretty simple, read the wiki and the specs.