All of lore.kernel.org
 help / color / mirror / Atom feed
* Access to raw keycodes in xen domU
@ 2008-08-14 13:58 Maxim Gorbachyov
  2008-08-14 14:07 ` Keir Fraser
  2008-08-14 14:10 ` Samuel Thibault
  0 siblings, 2 replies; 7+ messages in thread
From: Maxim Gorbachyov @ 2008-08-14 13:58 UTC (permalink / raw)
  To: xen-devel

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?

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-08-25  9:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-14 13:58 Access to raw keycodes in xen domU Maxim Gorbachyov
2008-08-14 14:07 ` Keir Fraser
2008-08-14 14:39   ` Ian Jackson
2008-08-14 15:09     ` Maxim Gorbachyov
2008-08-14 15:21       ` Samuel Thibault
2008-08-25  9:26         ` Maxim Gorbachyov
2008-08-14 14:10 ` Samuel Thibault

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.