Fork us on GitHub Follow us on Facebook Follow us on Twitter

Opened 9 months ago

Last modified 7 months ago

#845 new enhancement

sparc64/ultra should support keyboard in Qemu

Reported by: Jiri Svoboda Owned by:
Priority: major Milestone:
Component: helenos/unspecified Version: mainline
Keywords: Cc:
Blocker for: Depends on:
See also:


sparc64/ultra supports graphical output + keyboard on some real Ultra models, but not on the model emulated by Qemu. Regardless whether the model emulated by Qemu is a real one or not, we should support it for better user experience in this emulator.

Attachments (1)

ultra-devices.png (5.0 KB) - added by Jiri Svoboda 8 months ago.
Screen dump of OpenFirmware? listing of devices in Qemu Ultra using test-all command

Download all attachments as: .zip

Change History (6)

Changed 8 months ago by Jiri Svoboda

Attachment: ultra-devices.png added

Screen dump of OpenFirmware? listing of devices in Qemu Ultra using test-all command

comment:1 Changed 8 months ago by Jiri Svoboda

The Qemu sun4u machine is a strange hybrid, instead of having a Sun keyboard connected to the ns16550 serial controller on the Ebus, it has a PC keyboard connected to an Intel 8042 connected to the Ebus.

The device name is 8042@0 (while the serial port is su@0). The I/O address is 0x60 (from the OpenFirmware? properties). The interrupt number is more difficult, due to the IRQ remapping. I was able to determine the keyboard interrupt is 2025 during my attempt to drive the device in the kernel, as the kernel can perform the interrupt number mapping. Since OFW device tree does not have an entry for the mouse, I was not able to determine the mouse interrupt number. By trial and error, I have determined it is 2026.

Making it work in userspace was a matter of adding the correct configuration of i8042 device to ebus.devs and adding i8042 and ps2kbd and ps2mouse to the ram disk. However, to process more than the first key, I had to (1) fix the clear interrupt handler in remote_hw_res_ops and (2) add the missing hw_res_clear_interrupt() call to the i8042 driver.

comment:2 Changed 8 months ago by Jiri Svoboda

I am keeping this open since we still need to implement kernel support - to make kernel console usable.

comment:3 Changed 8 months ago by Jakub Jermář

This is quite nice, however I do have some issues with the mouse. The cursor moves a little only on the initial move and then stops moving at all. I remember seeing a similar issue on the arm32/icp when I was testing with the latest QEMU before the release, so it can be unrelated.

I am also not sure if this change is safe on the real Ultra 5 which doesn't have the i8042 on the ebus.

comment:4 Changed 7 months ago by Jiri Svoboda

The sticking mouse problem is not new, it is exactly the same on amd64/ia32 - but you need to run -nousb -noxhci to actually use PS/2, it does not happen with USB tablet.

It goes away if you switch Qemu to fullscreen mode. I therefore thought it was a bug in Qemu. Looking at it again, it probably warrants investigation. Please see newly filed ticket #848. Very curious.

comment:5 Changed 7 months ago by Jiri Svoboda

I agree it's probably not very nice to try to communicate with i8042 on a real Ultra machine where it's not present. We should only communicate to the device if OpenFirmware? device tree tells us it's there.

We should probably create a separate E-bus driver (instead of misusing the ISA driver) that would, at the very least, filter devices based on the OFW device tree (it could of course, do much more, e.g. interrupt mapping, but this would be the minimum).

What do you think?

Note: See TracTickets for help on using tickets.