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-users

[Xen-users] Access to raw keycodes in xen domU

To: xen-users@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-users] Access to raw keycodes in xen domU
From: "Maxim Gorbachyov" <maxim.gorbachyov@xxxxxxxxx>
Date: Thu, 14 Aug 2008 13:24:53 +0400
Delivery-date: Thu, 14 Aug 2008 02:25:29 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type:content-transfer-encoding :content-disposition; bh=cdnYJru4adUrXKK+ofGVg0jNwhHHFKufCRDGGWgn+VI=; b=ec4tv6trBtPpMdSLVJjW/wM8Xo2aETc7SgIrhRock8ypFVCobGWaO4NHybOB8TNWrU U42QOX3XlQrm+7H0TrVDhILNNK7cxJN9jC/VnVbDw0VfKGDQnXmq2MJe2DM0VvEG74G3 Ajyeqs/AqWOJVeG0cM5RLUQWDMz175Z553T5k=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type :content-transfer-encoding:content-disposition; b=iAkoRyHcVPVP0yoyW9TO1ixXchTU0cnTHA/FYgH7URm4Gz+Bazc+IrPCaHwrbLLGyy duEGAY7Ga/muEaMhy9MQmfd+i4q62f4q2fHUU3IkOxzuKx89PRGX+mWJmwTBtT5DtRxw MSBH0n/hul6buk9m6m9YjQLBDEq+vodwLc9pk=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-users-request@lists.xensource.com?subject=help>
List-id: Xen user discussion <xen-users.lists.xensource.com>
List-post: <mailto:xen-users@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
Hello.
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;
        struct kbd_struct * kbd;
        unsigned int console;
        struct vc_data * vc;
        long val;

        vc = (struct vc_data *)tty->driver_data;
        console = vc->vc_num;
        kbd = kbd_table + console;

        switch (cmd) {
        case KDGKBTYPE:
                ucval = KB_101;
                return put_user(ucval, (char __user *)arg);

        case KDGKBMODE:
                val = ((kbd->kbdmode == VC_RAW) ? K_RAW :
                        (kbd->kbdmode == VC_MEDIUMRAW) ? K_MEDIUMRAW :
                        (kbd->kbdmode == VC_UNICODE) ? K_UNICODE :
                        K_XLATE);
                return put_user(val, (long __user *)arg);
        }
        return -ENOIOCTLCMD;
}
, but I get tty->driver_data set to NULL. It seems like I have to get
some data from hypervisor / dom0, but it's not clear for me now how to
do it.

Could you please suggest how to get that access?

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-users] Access to raw keycodes in xen domU, Maxim Gorbachyov <=