WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] Access to raw keycodes in xen domU

To: Maxim Gorbachyov <maxim.gorbachyov@xxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] Access to raw keycodes in xen domU
From: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Date: Thu, 14 Aug 2008 15:07:38 +0100
Cc:
Delivery-date: Thu, 14 Aug 2008 07:08:11 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <291f35090808140658i41ef68acx50ebb15e12f237be@xxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Acj+FxuNWe4pXmoKEd29zQAX8io7RQ==
Thread-topic: [Xen-devel] Access to raw keycodes in xen domU
User-agent: Microsoft-Entourage/11.4.0.080122
Keyboard is owned by dom0. There's not really an easy way to propagate the
raw keycodes to a pv domU. For an hvm domU we reverse-map to the raw
keycodes in qemu-dm and send those via the emulated pckeyboard.

 -- Keir

On 14/8/08 14:58, "Maxim Gorbachyov" <maxim.gorbachyov@xxxxxxxxx> wrote:

> Hi.
> 
> There is a need to have access to raw keycodes in xen domU (like
> showkey (1)). Using xen-hypervisor-3.2 and linux-2.6.18-xen-3.2.0 with
> these parameters:
> 
> kernel = "/my/vmlinuz"
> memory = 128
> name = "dn1"
> vif = [ '' ]
> disk = [ 'tap:aio:/my/img,hda1,w' ]
> root = "/dev/hda1 ro"
> extra = "2 xencons=tty"
> 
> I run "# strace showkey" inside domU and get this:
> ...
> open("/dev/tty", O_RDWR)                = 3
> ioctl(3, KDGKBTYPE, 0x7fff91e9da17)     = -1 EINVAL (Invalid argument)
> ...
> 
> Indeed there is no ioctl() implementation assigned to
> xencons_ops.ioctl in
> linux-2.6.18-xen-3.2.0/drivers/xen/console/console.c
> 
> I've tried assigning xencons_ops.ioctl to something like that:
> 
> static int xencons_ioctl(struct tty_struct *tty, struct file * file,
>         unsigned int cmd, unsigned long arg)
> {
>         unsigned char ucval;
>         long val;
> 
>         switch (cmd) {
>         case KDGKBTYPE:
>                 ucval = KB_101;
>                 return put_user(ucval, (char __user *)arg);
> 
>         case KDGKBMODE:
>                 val = K_UNICODE;
>                 return put_user(val, (long __user *)arg);
> 
>         case KDSKBMODE:
>                 return 0;
>         }
>         return -ENOIOCTLCMD;
> }
> 
> It's enough to make showkey run, but it does not report correct
> keycodes. I think I have to do something like
> 
> HYPERVISOR_console_io(CONSOLEIO_ioctl, ... )
> 
> but there is no CONSOLEIO_ioctl.
> 
> Could you please suggest what can I do to access raw keycodes?
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel