[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] Looking for advice/help on debugging a module in a live kernel



First off, printk()'s and other logging-like things are your friend for
kernel work.
On Sat, 2007-01-27 at 16:43 -0800, cm ko wrote:
> Hello all,
> I am new to Xen and would appreciate any help I can get.  I am working
> on a block device driver and I would like to be able to symbolically
> debug the module. (via break points, etc.)
> 
> I am a little bit confused on a couple of things and hoping someone
> can help me out.
> 
> 1) It appears that I have two choices - either paravirtualized or
> fully virtualized.  Do anyone have suggestions on how to determine
> which way to go?  At the moment, I am thinking using full
> virtualization and load my driver into the kernel running on the guest
> machine.  Am I off on this?

It's likely to be easier to work on purely paravirtualized guest domains
first, then port as a paravirtual driver for HVM domains.  Hopefully the
porting isn't too hard, at least for Linuxen in HVM guest domains.

> 
> 2) if I choose fully virtualized option, is it possible to attach
> debbuger on the live kernel running on the guest machine?  Does it
> mean that hvmloader has to be recompiled with -g option?

You definitely don't need to use '-g' for hvmloader.  It just has some
images for firmware that it loads into memory and then it goes away.

I'll bet that you can use the virtual serial port for HVM guest domains
and regular kernel debugging support for it.

> 
> 3) if I choose paravirtulaized kernel, which kernel should I install
> my module?  Kernel for Dom0 or DomU?

I never thought having a separation of dom0 and domU kernels was a
spectacular idea.  I'd just use the dom0 kernel for everything or a -xen
kernel (not -xen{0,u}).  The separation saves you a few Kb of RAM.
That's the only benefit of separate dom{0,u} kernels that I know about.

> 4) Where can I find the media for operating system for paravirtualized
> virtual system?

You mean how do you deploy an OS into a paravirtualized domain?

For SuSE, you do it with YaST, or you make a Xen installation initrd
with mkinstallinitrd (and some Xen-specific option that I've forgotten
but can look up if you need it).  Then you boot with one of the Xen
kernels and the installation initrd.  However, that's unlikely to match
the kernel you have from xen-unstable for modules in the initrd.  guest
bootloaders like pygrub may help with this type of mess soon if not
already.

For Redhat and Fedora, there are some need utilities built on top of
libvir(t)? .
I don't know what they are, but last time I saw them, they were
excellent.

> 
> Thanks in advance for you help,
> 

You're welcome.

> CM
> 
> 

Peace.
Andrew
===========
Andrew D. Ball
software engineer, IBM Systems and Technology Group
> 
> ______________________________________________________________________
> It's here! Your new message!
> Get new email alerts with the free Yahoo! Toolbar.
> _______________________________________________
> 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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.