All of lore.kernel.org
 help / color / mirror / Atom feed
* Send A Fake PS/2 Packet to QEMU and Mouse Pointer on PV OS
@ 2010-09-20 11:19 "涂堂訓(Tang-Hsun Tu)"
  2010-09-20 13:20 ` Felix Kuperjans
  2010-09-26  7:26 ` "涂堂訓(Tang-Hsun Tu)"
  0 siblings, 2 replies; 4+ messages in thread
From: "涂堂訓(Tang-Hsun Tu)" @ 2010-09-20 11:19 UTC (permalink / raw)
  To: Xen Devel

  Dear all:

       I am trying to send a fake event to input layer of QEMU,
i.e. keyboard and mouse.

       QEMU provides two API to send these input event,
that is, kbd_put_keycode() and kbd_mouse_event() for keyboard and mouse, 
respectively.
And these functions will make a suitable packet for low-level hardware, 
e.g. PS/2 or USB.

       For a PS/2 mouse, there is a call chain  ps2_mouse_event() => 
ps2_mouse_send_packet() => ps2_queue()
when the function kbd_mouse_event() is called.
However, when I make a fake PS/2 mouse packet and directly call ps2_queue()
to put the packet to PS/2 queue.
I store the PS2MouseState "s" when 8042 initializes and call ps2_queue() 
to send a event,
for example,
           ps2_queue(&s->common, 0x1001);
           ps2_queue(&s->common, 0);
           ps2_queue(&s->common, 0);

And I also insert some debug  message in ps2_read_data() function,
it works well and reads data from queue correctly..
But the mouse pointer does not move (even right/left click).
I also set the default mouse to "Mouse $0: QEMU PS/2 Mouse" in QEMU consloe,
but the result is the same. What else I forgot to signal? How could I 
fix it?


        The second question is when I create a PV Linux (Ubuntu),
the mouse pointer does not move correctly.
The screen (VNC) shows a black point and a mouse pointer,
and their speed does not the same.
In HVM XP, we can use usbdevice='tablet' to fix it,
but the same line does not work in PV Linux. How could I fix it?


       The last question is that does the sound can be shared (mixed) 
between multiple DomainUs?
(The device will be busy when I create a domain.) If can, how could I do?


      Thanks!

Best Regards,
Tang-Hsun Tu

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

* Re: Send A Fake PS/2 Packet to QEMU and Mouse Pointer on PV OS
  2010-09-20 11:19 Send A Fake PS/2 Packet to QEMU and Mouse Pointer on PV OS "涂堂訓(Tang-Hsun Tu)"
@ 2010-09-20 13:20 ` Felix Kuperjans
  2010-09-21  3:27   ` "涂堂訓(Tang-Hsun Tu)"
  2010-09-26  7:26 ` "涂堂訓(Tang-Hsun Tu)"
  1 sibling, 1 reply; 4+ messages in thread
From: Felix Kuperjans @ 2010-09-20 13:20 UTC (permalink / raw)
  To: xen-devel

[-- Attachment #1: Type: text/plain, Size: 2666 bytes --]

 I can only answer your third question:

You can switch to using ALSA with qemu (no idea why this is *not* the
default), e.g. by recompiling xen-tools with the attached patch. In KVM,
a QEMU_AUDIO_DRV="alsa" environment variable works, too. No idea whether
XEN accepts it or not.

Another way with further control would be to use PulseAudio in the Dom0
and in the DomUs (I think there is even a windows port), which is able
to send the audio data over network connections, so you won't need any
virtual sound cards. I have no setup/tutorial at hand, but it should be
easy to find on the internet.

Regards,
Felix

Am 20.09.2010 13:19, schrieb "涂堂訓(Tang-Hsun Tu)":
>  Dear all:
>
>       I am trying to send a fake event to input layer of QEMU,
> i.e. keyboard and mouse.
>
>       QEMU provides two API to send these input event,
> that is, kbd_put_keycode() and kbd_mouse_event() for keyboard and
> mouse, respectively.
> And these functions will make a suitable packet for low-level
> hardware, e.g. PS/2 or USB.
>
>       For a PS/2 mouse, there is a call chain  ps2_mouse_event() =>
> ps2_mouse_send_packet() => ps2_queue()
> when the function kbd_mouse_event() is called.
> However, when I make a fake PS/2 mouse packet and directly call
> ps2_queue()
> to put the packet to PS/2 queue.
> I store the PS2MouseState "s" when 8042 initializes and call
> ps2_queue() to send a event,
> for example,
>           ps2_queue(&s->common, 0x1001);
>           ps2_queue(&s->common, 0);
>           ps2_queue(&s->common, 0);
>
> And I also insert some debug  message in ps2_read_data() function,
> it works well and reads data from queue correctly..
> But the mouse pointer does not move (even right/left click).
> I also set the default mouse to "Mouse $0: QEMU PS/2 Mouse" in QEMU
> consloe,
> but the result is the same. What else I forgot to signal? How could I
> fix it?
>
>
>        The second question is when I create a PV Linux (Ubuntu),
> the mouse pointer does not move correctly.
> The screen (VNC) shows a black point and a mouse pointer,
> and their speed does not the same.
> In HVM XP, we can use usbdevice='tablet' to fix it,
> but the same line does not work in PV Linux. How could I fix it?
>
>
>       The last question is that does the sound can be shared (mixed)
> between multiple DomainUs?
> (The device will be busy when I create a domain.) If can, how could I do?
>
>
>      Thanks!
>
> Best Regards,
> Tang-Hsun Tu
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
>

[-- Attachment #2: xen-tools-ioemu-alsa.patch --]
[-- Type: text/plain, Size: 657 bytes --]

diff -ur xen-4.0.0/tools/ioemu-qemu-xen/xen-setup xen-4.0.0.alsa/tools/ioemu-qemu-xen/xen-setup
--- xen-4.0.0/tools/ioemu-qemu-xen/xen-setup	2010-03-24 18:16:51.000000000 +0100
+++ xen-4.0.0.alsa/tools/ioemu-qemu-xen/xen-setup	2010-04-09 16:13:21.006256114 +0200
@@ -16,8 +16,8 @@
 if test -z "${XEN_SCRIPT_DIR}"; then
 	XEN_SCRIPT_DIR="/etc/xen/scripts"
 fi

-./configure --disable-gfx-check --disable-curses --disable-slirp "$@" --prefix=${PREFIX}
+./configure --audio-drv-list=alsa --enable-mixemu --disable-gfx-check --disable-curses --disable-slirp "$@" --prefix=${PREFIX}

 if [ "x$XEN_ROOT" != x ]; then
 	echo "XEN_ROOT=$XEN_ROOT" >>config-host.mak

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

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

* Re: Send A Fake PS/2 Packet to QEMU and Mouse Pointer on PV OS
  2010-09-20 13:20 ` Felix Kuperjans
@ 2010-09-21  3:27   ` "涂堂訓(Tang-Hsun Tu)"
  0 siblings, 0 replies; 4+ messages in thread
From: "涂堂訓(Tang-Hsun Tu)" @ 2010-09-21  3:27 UTC (permalink / raw)
  To: Felix Kuperjans, Xen Devel


[-- Attachment #1.1: Type: text/plain, Size: 3078 bytes --]

  Hi,

        Thanks for your reply, the audio patch works.
I can play audio between DomUs.

於 2010/9/20 下午 09:20, Felix Kuperjans 提到:
>   I can only answer your third question:
>
> You can switch to using ALSA with qemu (no idea why this is *not* the
> default), e.g. by recompiling xen-tools with the attached patch. In KVM,
> a QEMU_AUDIO_DRV="alsa" environment variable works, too. No idea whether
> XEN accepts it or not.
>
> Another way with further control would be to use PulseAudio in the Dom0
> and in the DomUs (I think there is even a windows port), which is able
> to send the audio data over network connections, so you won't need any
> virtual sound cards. I have no setup/tutorial at hand, but it should be
> easy to find on the internet.
>
> Regards,
> Felix
>
> Am 20.09.2010 13:19, schrieb "涂堂訓(Tang-Hsun Tu)":
>>   Dear all:
>>
>>        I am trying to send a fake event to input layer of QEMU,
>> i.e. keyboard and mouse.
>>
>>        QEMU provides two API to send these input event,
>> that is, kbd_put_keycode() and kbd_mouse_event() for keyboard and
>> mouse, respectively.
>> And these functions will make a suitable packet for low-level
>> hardware, e.g. PS/2 or USB.
>>
>>        For a PS/2 mouse, there is a call chain  ps2_mouse_event() =>
>> ps2_mouse_send_packet() =>  ps2_queue()
>> when the function kbd_mouse_event() is called.
>> However, when I make a fake PS/2 mouse packet and directly call
>> ps2_queue()
>> to put the packet to PS/2 queue.
>> I store the PS2MouseState "s" when 8042 initializes and call
>> ps2_queue() to send a event,
>> for example,
>>            ps2_queue(&s->common, 0x1001);
>>            ps2_queue(&s->common, 0);
>>            ps2_queue(&s->common, 0);
>>
>> And I also insert some debug  message in ps2_read_data() function,
>> it works well and reads data from queue correctly..
>> But the mouse pointer does not move (even right/left click).
>> I also set the default mouse to "Mouse $0: QEMU PS/2 Mouse" in QEMU
>> consloe,
>> but the result is the same. What else I forgot to signal? How could I
>> fix it?
>>
>>
>>         The second question is when I create a PV Linux (Ubuntu),
>> the mouse pointer does not move correctly.
>> The screen (VNC) shows a black point and a mouse pointer,
>> and their speed does not the same.
>> In HVM XP, we can use usbdevice='tablet' to fix it,
>> but the same line does not work in PV Linux. How could I fix it?
>>
>>
>>        The last question is that does the sound can be shared (mixed)
>> between multiple DomainUs?
>> (The device will be busy when I create a domain.) If can, how could I do?
>>
>>
>>       Thanks!
>>
>> Best Regards,
>> Tang-Hsun Tu
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xensource.com
>> http://lists.xensource.com/xen-devel
>>
>>
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xensource.com
>> http://lists.xensource.com/xen-devel

[-- Attachment #1.2: Type: text/html, Size: 3790 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

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

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

* Re: Send A Fake PS/2 Packet to QEMU and Mouse Pointer on PV OS
  2010-09-20 11:19 Send A Fake PS/2 Packet to QEMU and Mouse Pointer on PV OS "涂堂訓(Tang-Hsun Tu)"
  2010-09-20 13:20 ` Felix Kuperjans
@ 2010-09-26  7:26 ` "涂堂訓(Tang-Hsun Tu)"
  1 sibling, 0 replies; 4+ messages in thread
From: "涂堂訓(Tang-Hsun Tu)" @ 2010-09-26  7:26 UTC (permalink / raw)
  To: Xen Devel

  Dear all:

      For the question1, I try to use the function ps2_queue() to send a 
PS/2 "keyboard" packet, and it works fine.
But the PS/2 mouse still cannot work. Does QEMU use a USB mouse and not 
support a PS/2 mouse?

於 2010/9/20 下午 07:19, "涂堂訓(Tang-Hsun Tu)" 提到:
>  Dear all:
>
>       I am trying to send a fake event to input layer of QEMU,
> i.e. keyboard and mouse.
>
>       QEMU provides two API to send these input event,
> that is, kbd_put_keycode() and kbd_mouse_event() for keyboard and 
> mouse, respectively.
> And these functions will make a suitable packet for low-level 
> hardware, e.g. PS/2 or USB.
>
>       For a PS/2 mouse, there is a call chain  ps2_mouse_event() => 
> ps2_mouse_send_packet() => ps2_queue()
> when the function kbd_mouse_event() is called.
> However, when I make a fake PS/2 mouse packet and directly call 
> ps2_queue()
> to put the packet to PS/2 queue.
> I store the PS2MouseState "s" when 8042 initializes and call 
> ps2_queue() to send a event,
> for example,
>           ps2_queue(&s->common, 0x1001);
>           ps2_queue(&s->common, 0);
>           ps2_queue(&s->common, 0);
>
> And I also insert some debug  message in ps2_read_data() function,
> it works well and reads data from queue correctly..
> But the mouse pointer does not move (even right/left click).
> I also set the default mouse to "Mouse $0: QEMU PS/2 Mouse" in QEMU 
> consloe,
> but the result is the same. What else I forgot to signal? How could I 
> fix it?
>
>
>        The second question is when I create a PV Linux (Ubuntu),
> the mouse pointer does not move correctly.
> The screen (VNC) shows a black point and a mouse pointer,
> and their speed does not the same.
> In HVM XP, we can use usbdevice='tablet' to fix it,
> but the same line does not work in PV Linux. How could I fix it?
>
>
>       The last question is that does the sound can be shared (mixed) 
> between multiple DomainUs?
> (The device will be busy when I create a domain.) If can, how could I do?
>
>
>      Thanks!
>
> Best Regards,
> Tang-Hsun Tu

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

end of thread, other threads:[~2010-09-26  7:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-20 11:19 Send A Fake PS/2 Packet to QEMU and Mouse Pointer on PV OS "涂堂訓(Tang-Hsun Tu)"
2010-09-20 13:20 ` Felix Kuperjans
2010-09-21  3:27   ` "涂堂訓(Tang-Hsun Tu)"
2010-09-26  7:26 ` "涂堂訓(Tang-Hsun Tu)"

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.