Page 1 of 1

Passing through keyboard LEDs in QEMU

Posted: Thu Mar 08, 2018 12:33 pm
by SarahIsWeird
Hello everyone, glad to see such an active OS Development forum! :o

Anyways, I want to test my keyboard LEDs where I actually want to output some debug info when in that mode. Only problem is that QEMU doesn't seem to create a direct tunnel from the emulated OS to the keyboard. I don't really want to keep moving the new compiled OS to a thumb drive and restart my computer just to see if a tiny change did the trick. Is there any way to fix/do this?

(If there is a possibility, it apparently is quite obscure, couldn't find anything on that subject... :| )

Re: Passing through keyboard LEDs in QEMU

Posted: Thu Mar 08, 2018 2:02 pm
by BenLunt
I like Qemu for a lot of things, probably the most is that it is quick. Hence the name. However, in my opinion, it lacks quite a few things.

I also use Bochs, and have even written a lot of the "external" parts of it, namely the USB as well as some of the floppy and hard drive stuff. The advantage to bochs is that it has a considerable amount of debugging capabilities as well as a single step capable debugger. The disadvantage, it is quite slow, in fact it is probably the slowest of all the emulators I know and use.

For you, the advantage would be that the LED state is displayed on the status bar of the Bochs window. i.e.:, when the Caps Lock is pressed within the quest, the Host shows it on the status bar of the Host Window. No need to reboot each time you make a small modification.

However, please note that Bochs is quite a bit slower than Qemu, though it is much faster than the process of writing to a USB drive, rebooting to test, then rebooting back to your development environment.

Try it and see what you think
Ben
-- http://www.fysnet.net/osdesign_book_series.htm

Bochs SVN:
https://sourceforge.net/p/bochs/code/HEAD/tree/
or a downloadable executable:
https://sourceforge.net/projects/bochs/

Re: Passing through keyboard LEDs in QEMU

Posted: Thu Mar 08, 2018 10:27 pm
by linuxyne
QEMU exposes the guest LED state when using vnc (or spice) protocol.

TigerVNC commit shows that it intends to synchronize the led state between the client and the server.

Re: Passing through keyboard LEDs in QEMU

Posted: Fri Mar 09, 2018 1:54 pm
by BenLunt
I figured there would be some way to do it, though I have not dug far into Qemu other than as an end-user product. I have not compiled, nor modified it in anyway. Bochs, on the other hand, well....

Since there was no response from the OP, I figured/was hoping that he/she had found Bochs and was too enthralled in it to respond. :-)

Ben