2011-02-04

Hello from USB keyboard to HelenOS

I am proud to announce that today we were able to control HelenOS with plugged in USB keyboard. Although the abilities of the keyboard and host controller drivers are very limited, it is a huge step forward in our project.

First, a bit about the limitations.

  • We have run it only in QEMU so far because the host controller driver is not yet in state where we can deploy it onto real hardware.
  • The keyboard driver accepts only the boot protocol so far (the report protocols are really awful things to parse and process) and is not able to processes composed key sequences (e.g. Shift+<key>) and has no knowledge of automatic key repeat etc.

And before I forgot. We have problems with testing hub driver - we were not able to bridge real USB hubs to QEMU.

Today, you can buy only hubs for USB 2.0 (or better) and although the hubs are backwards compatible (i.e. they support USB 1.1), QEMU refuses to connect them to its emulated UHCI because they are USB 2.0 hubs. And we do not know how to downgrade it. Thus we are looking for some older USB hub that supports only USB 1.1 (or some wizard who knows how to force QEMU to bridge host USB 2.0 hub through its UHCI controller). Doesn't anybody have such hub? Or the knowledge (we have quite a wide range of USB hubs to test with but they are 2.0)?

Now onto more positive stuff: if you want to try it out, get our branch

bzr branch bzr://helenos-usb.bzr.sourceforge.net/bzrroot/helenos-usb/development/ helenos-usb
and compile it for amd64 or ia32.

Running it is a bit trickier. Although one would expect that newer versions of some software are better than the old ones, this is quite not true with the QEMU emulator. Experimentally, we found out several differences between versions 0.13 and 0.11 and the version 0.11 came out better (the simulated keyboard is closer to the real hardware). So, if you want to try it with the emulated keyboard in QEMU, I recommend QEMU 0.11.1. If you trust us and want to try with real keyboard, it worked even with QEMU 0.13 (although I cannot confirm it now as I do not have a USB keyboard at home).

So, let's run it.

qemu-system-x86_64 -m 256 \
    -usb -usbdevice keyboard \
    -cdrom image.iso
If you run it with QEMU 0.11.1, the AT keyboard is not disabled immediately but only after the USB one is properly initialized, so you can switch to virtual console 8 and watch what is going on. In QEMU 0.13, the AT keyboard is disabled once you leave GRUB, but you can switch the consoles with mouse. However, I recommend QEMU 0.11 (I experienced some very weird hung-ups with newer versions of QEMU).

There is a lot of messages, but they should stop and you shall see image similar to the following:

If you see this, everything went fine and HelenOS is now controlled by the USB keyboard. Try pressing F1 to get into some free console and type ls<Enter>.

You might encounter some problems described above, but on a very rough level, HelenOS is controllable by USB keyboard. Isn't that wonderful? Of course it isn't, I hear you there is still a lot of things to be done but, please, do not spoil this very special moment ;-).

Stay tunned for updates.

Žádné komentáře:

Okomentovat