kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Using KVM for Windows kernel debugging
@ 2009-08-17 15:11 Tom Parkin
  2009-08-17 15:16 ` Tom Parkin
  0 siblings, 1 reply; 14+ messages in thread
From: Tom Parkin @ 2009-08-17 15:11 UTC (permalink / raw)
  To: kvm; +Cc: tom.parkin

Hi list,

I'm currently working on a project which involves Windows kernel
debugging.  Typically this is done using two PCs: one to run the code,
and the other to run the debugger.  The debug and target PCs are then
connected via serial, USB or 1394.

I'm trying to get the above configured using two KVM-based virtual
machines for the Windows hosts.  My research[1] suggests that this
should be possible, but so far I've not had much luck.  So far, I've
linked the two KVM hosts together using a virtualised serial
connection (that is: using the "-serial pipe" argument to kvm-qemu
with two pipes and socat acting as the interconnect[2]), and using
socat's debugging options I can see data passing between the hosts,
but the windows kernel debugger never achieves a connection.

Has anyone on the list got any experience of this kind of setup, or
any suggestions that might help ?

Thanks,
Tom

[1].  There are a few webpages which deal with the general principle,
even if they're not KVM-specific:

http://blogs.msdn.com/virtual_pc_guy/archive/2005/10/20/482413.aspx
http://blog.electric-cloud.com/2009/08/05/how-to-set-up-kernel-debugging-for-windows-in-vmware-esx/

[2].  To be precise,

socat config:

  $ socat PIPE:wdbg1 PIPE:wdbg2

KVM1:

  $ kvm-qemu -hda <image-1.img> -serial pipe:wdbg1

KVM2:

  $ kvm-qemu -hda <image-2.img> -serial pipe:wdbg2

-- 
Tom Parkin
www.thhp.org.uk
The worst moment for the atheist is when he is really thankful and has
nobody to thank /Rossetti/

^ permalink raw reply	[flat|nested] 14+ messages in thread
* Re: Using KVM for Windows kernel debugging
@ 2009-08-18 22:31 duck
  2009-08-19  7:42 ` Vadim Rozenfeld
  0 siblings, 1 reply; 14+ messages in thread
From: duck @ 2009-08-18 22:31 UTC (permalink / raw)
  To: kvm

I have never got this to work reliably. Occasionally I can get as far as 
making a debugger connection at boot-time, IIRC, but have never managed to 
use the deugger at all. You always seem to end up in some 
debugger-debuggee deadlock.

I suspect that the serial link simulation is imperfect enough (lost 
interrupts and thus lost characters?) that you are out of luck for 
serial-link-based remote debugging, even though userland serial comms, 
e.g. using Hyperterm, seem to work fine.

I was able to get debugging working, a year or two ago, under QEMU using 
the MIN_CYCLE_COUNT patch (I made a command line option called '-mcc' to 
allow this to be tuned at run-time) but IIRC this patch is irrelevant when 
KVM is used.

Can anyone suggest a KVM patch which might help, even if it slows the 
debuggee VM down?
 
Pity SoftICE got killed off :-) 

You could try http://www.sysersoft.com/ for a one-PC Windows kernel 
debugging solution. Seems to be a small Beijing software house which just 
sells on-line. Their product is not free, though there is a free trial. 
(I haven't tried it under KVM, though they advertise that it works 
under VxWxxx [censored]).
 

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

end of thread, other threads:[~2009-08-19  7:42 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-17 15:11 Using KVM for Windows kernel debugging Tom Parkin
2009-08-17 15:16 ` Tom Parkin
2009-08-17 15:20   ` Avi Kivity
2009-08-17 15:38   ` Yan Vugenfirer
2009-08-17 15:52     ` Tom Parkin
2009-08-18 10:52       ` Tom Parkin
2009-08-18 11:26         ` Vadim Rozenfeld
     [not found]         ` <4A8A8A22.105@redhat.com>
2009-08-18 11:15           ` Yan Vugenfirer
2009-08-18 14:00             ` Tom Parkin
2009-08-18 13:54           ` Tom Parkin
2009-08-18 14:28             ` Vadim Rozenfeld
     [not found]             ` <4A8AB829.1030008@redhat.com>
2009-08-18 14:40               ` Tom Parkin
  -- strict thread matches above, loose matches on Subject: below --
2009-08-18 22:31 duck
2009-08-19  7:42 ` Vadim Rozenfeld

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).