Hi,
I have resently extended my OS by a interrupt handler for IRQ1, and keyboard input works perfectly with qemu. However when I boot from USB on my netbook, the interrupt handler is never called. Other interrupt handler (IRQ0 for timer) are called.
(The same also with a second notebook)
I'm not sure how to even check what keyboard type (PS/2, USB, other?) the netbook has. I do have a file (in ubuntu) `/dev/input/by-path/platform-i8042-serio-0-event-kbd` if that says anything to anyone.
Is it possible that I have to somehow activate my keyboard in a way that is not necessary in qemu? What could be the problem?
Thanks for help.
Activate keyboard on real hardware (notebook)
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: Activate keyboard on real hardware (notebook)
You can use to find out what USB devices are connected. If you find your keyboard or touchpad on there you'll know it's not connected using PS/2. Some machines might allow emulating USB keyboards as PS/2 ones via a BIOS setting, but those tricks tend to be iffy.
If the keyboard actually is a native PS/2, then there's probably something wrong with the specific handling.
Code: Select all
lsusb
If the keyboard actually is a native PS/2, then there's probably something wrong with the specific handling.
Re: Activate keyboard on real hardware (notebook)
Adding the following before installing the keyboard IRQ handler fixed the problem:
Thanks, Combustor. Seeing that my keyboard is not USB lead me to the direction to improve on my PS/2 initialization.
Code: Select all
/* don't let devices send data at the wrong time and mess up initialisation */
outb(PS2_COMMAND, PS2_DISABLE_FIRST_PORT);
outb(PS2_COMMAND, PS2_DISABLE_SECOND_PORT); /* ignored if not supported */
/* flush device buffer */
while (inb(PS2_COMMAND) & PS2_OUTPUT_FULL) {
inb(PS2_DATA);
}
/* finilize PS/2 initialization by reenabling devices */
outb(PS2_COMMAND, PS2_ENABLE_FIRST_PORT);
outb(PS2_COMMAND, PS2_ENABLE_SECOND_PORT); /* ignored if unsupported? */