qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v5] Emulate dip switch language layout settings on SUN keyboa


From: Henrik Carlqvist
Subject: Re: [PATCH v5] Emulate dip switch language layout settings on SUN keyboard
Date: Mon, 23 Jan 2023 20:09:37 +0100

On Sun, 22 Jan 2023 18:07:47 +0000
Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> wrote:
> Did you see my comments re: OpenBIOS for the earlier version of this patch?

Thanks for your replies! Sorry, I missed that reply... To make sure that I
wouldn't miss any reply I subscribed to the mailing list, but that made many
mails to me drown in mails from the list...

On Tue, 10 Jan 2023 23:08:27 +0000
Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> wrote:
> Thanks for the patch. I think what you're effectively doing here is
> equivalent to creating a qdev property that is used to set the keyboard
> layout, which is a nicer approach because it enables better control from the
> command line and also handles the default value.

I must admit that I am not very familiar with "qdev properties", to me it
seemed like a rather intuitive solution to use the existing -k switch for this
purpose as it is intended to use for keyboard layouts. Would you prefer some
other implementation?

> Does changing the keyboard layout work with other OSs?

To my knowledge only Solaris and the SUN sparc openboot bios cares about those
dip switch settings in the 32 bit SUN sparc machine keyboards.

This post on a forum makes me think that it doesn't work with NetBSD:
https://www.linuxquestions.org/questions/%2Absd-17/netbsd-sparc-non-us-keyboard-layout-issue-367601/

It does seem as if the Linux kernel supports those layout dip switches,
however I don't know if it is used in any Linux distribution. I have never run
any Linux distribution on sparc myself. From the Linux kernel source file
sunkbd.c:

-8<--------------------
        if (sunkbd->type == 4) {        /* Type 4 keyboard */
                sunkbd->layout = -2;
                serio_write(sunkbd->serio, SUNKBD_CMD_LAYOUT);
                wait_event_interruptible_timeout(sunkbd->wait,
                                                 sunkbd->layout >= 0, HZ / 4);
                if (sunkbd->layout < 0)
                        return -1;
                if (sunkbd->layout & SUNKBD_LAYOUT_5_MASK)
                        sunkbd->type = 5;
        }
-8<--------------------

> It may also be that OpenBIOS will be difficult to use if the layout
> defaults to anything other than en-us since I suspect it will be hardcoded
> there too.

Today qemu is hardcoded to emulate dip switch setting 0x21 (en-us layout). My
patch keeps 0x21 (en-us layout) as default value, but also makes it possible
to give other values with the -k option. From may experience it seems as if
OpenBIOS does not care about the settings of the dip switch and allways uses
en-us layout. Suns openboot bios (which is possible to find for download and
use with qemu) supports some, but not all layout dip switch settings which are
supported by Solaris.

regards Henrik



reply via email to

[Prev in Thread] Current Thread [Next in Thread]