mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jiri Bohac <jbohac@suse.cz>
To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Jiri Bohac <jbohac@suse.cz>,
	Andrew Morton <akpm@linux-foundation.org>,
	lkml <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] console keyboard mapping broken by 04c71976
Date: Wed, 11 Jun 2008 17:10:28 +0200	[thread overview]
Message-ID: <20080611151028.GB11462@midget.suse.cz> (raw)
In-Reply-To: <20080611140304.GM4244@implementation.uk.xensource.com>

On Wed, Jun 11, 2008 at 03:03:04PM +0100, Samuel Thibault wrote:
> Err, at quick look it looks to me rather like a bug kbd, which doesn't
> cope with the console being in unicode mode.  Which distribution are you
> using?
> 
> In unicode mode, k_self is really meant to hold unicode values (there is
> no other way to provide an arbitrary unicode value in keyboard maps),
> and thus kbd should translate KT_LETTER's value from the map file's
> encoding (set by the charset directive) to unicode.

I am actually hunting down a bug this causes in openSUSE. We use
kbd-1.12. kbd does not translate anything to unicode - there is
no space for that in the 8 bits the keycode uses for the value.
The kernel needs to take care for the conversion.

I'll demonstrate the problem on tracing kbd_keycode() in
drivers/char/keyboard.c when the key "2" (keycode 3) is pressed.
The expected result is the letter letter "e" with a caron [CARON]
accent, code 0xec in iso-8859-2 [88592].

The keysym for this key in the Czech keyboard is set to 0xbec
by a call to KDSKBENT, which stores it as 0xfbec in the map.

	...
	type = KTYP(keysym);		// 0xfb
	...
	type -= 0xf0;			// 0xb
        if (type == KT_LETTER) {	// true
                type = KT_LATIN;	// 0
 
	...
        (*k_handler[type])(vc, keysym & 0xff, !down); 
		// calls k_self, note there is really no space for a 
		// full unicode representation ;-)

So, we need to perform the conversion in k_self (or later).  Your
patch removed it from k_unicode, but only does it in k_self when
the keyboard mode is not VC_UNICODE.

[CARON]: http://en.wikipedia.org/wiki/Caron
[88592]: http://en.wikipedia.org/wiki/Iso-8859-2

Regards,

-- 
Jiri Bohac <jbohac@suse.cz>
SUSE Labs, SUSE CZ


  reply	other threads:[~2008-06-11 15:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-11 13:48 Jiri Bohac
2008-06-11 14:03 ` Samuel Thibault
2008-06-11 15:10   ` Jiri Bohac [this message]
2008-06-11 15:23     ` Samuel Thibault
2008-06-12  1:18 ` Samuel Thibault
2008-06-12  1:27   ` Andrew Morton
2008-06-12  1:36     ` Samuel Thibault

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080611151028.GB11462@midget.suse.cz \
    --to=jbohac@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=samuel.thibault@ens-lyon.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®