Skip to contentSkip to conversation

How to compile a module for dom0 or domU kernel?

DISCUSSION ashutosh mehra 3 participants 8 messages Oct 30, 2007 – Nov 1, 2007

lore
Share & tools
lore
#0 lore raw

Hi,

I am trying to create a new module for a domU kernel (which FYI, includes the xen/xenbus.h header file), but I'm unable to figure out how to compile it. What should be the command and the Makefile for compiling the module? I tried compiling it like a linux kernel module, but I guess I didn't give the correct path. None of the paths I tried with -C worked.

Regards,
Ashutosh

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw

Hi,

Quoted 5 lines

I am trying to create a new module for a domU kernel (which FYI, includes the xen/xenbus.h header file), but I'm unable to figure out how to compile it. What should be the command and the Makefile for compiling the module? I tried compiling it like a linux kernel module, but I guess I didn't give the correct path. None of the paths I tried with -C worked.

Did you use different vmlinuxs between dom0 and domU?
If using the same vmlinux, you can compile it on dom0 with the same way as linux. For example, like the below.
"make -C /lib/modules/uname -r/build M=pwd V=1 modules"

If no, I think you should be able to use like the below.
"make -C /home/hoge/xen-unstable.hg/build-linux-2.6.18-xenU_ia64 M=pwd V=1 modules"

Best Regards,

Akio Takebe

#2 lore raw

Is there a method which i can use to compile a raid card driver inside the dom0 kernel ? I have been trying to get centos5 bundled xen working on a quad core dual xeon 1.86 where the hard drivers are running raid 1 on a hardware raid card (areca). To be able to boot up, i need to compile the areca drivers inside the kernel. When i go to /usr/src/kernel source, and try to issue a make oldconfig, it works, however next make command gives errors.

Any ideas on how it can be resolved ?

Quoted 32 lines · Akio Takebe

Hi,

Quoted 2 lines

I am trying to create a new module for a domU kernel (which FYI, includes the xen/xenbus.h header file), but I'm unable to figure out how to

compile

Quoted 1 line

it. What should be the command and the Makefile for compiling the module?

I

Quoted 1 line

tried compiling it like a linux kernel module, but I guess I didn't give

the

Quoted 1 line

correct path. None of the paths I tried with -C worked.

Did you use different vmlinuxs between dom0 and domU?
If using the same vmlinux, you can compile it on dom0 with the same way as linux.
For example, like the below.
"make -C /lib/modules/uname -r/build M=pwd V=1 modules"

If no, I think you should be able to use like the below. "make -C /home/hoge/xen-unstable.hg/build-linux-2.6.18-xenU_ia64 M=pwd V=1
modules"

Best Regards,

Akio Takebe

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

Signature · 3 lines
regards,

Anand Gupta

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#3 lore raw

Hi,

Quoted 9 lines

Is there a method which i can use to compile a raid card driver inside the dom0 kernel ? I have been trying to get centos5 bundled xen working on a quad core dual xeon 1.86 where the hard drivers are running raid 1 on a hardware raid card (areca). To be able to boot up, i need to compile the areca drivers inside the kernel. When i go to /usr/src/kernel source, and try to issue a make oldconfig, it works, however next make command gives errors.

Any ideas on how it can be resolved ?

The method of compiling a module for dom0 is the same as linux. I think there is not any special method.

Best Regards,

Akio Takebe

#4 lore raw
Quoted 4 lines · Akio Takebe

The method of compiling a module for dom0 is the same as linux. I think there is not any special method.

When i try to issue a make command inside the kernel-xen source, it gives me error :( I had posted the error in another thread, let me try to get it out.

Signature · 3 lines
regards,

Anand Gupta

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#5 lore raw

Hi,

Quoted 9 lines · Akio Takebe
Quoted 4 lines

The method of compiling a module for dom0 is the same as linux. I think there is not any special method.

When i try to issue a make command inside the kernel-xen source, it gives me error :( I had posted the error in another thread, let me try to get it out.

I have never used centos.
But I think kernel-xen-devel you used don't include kernel sources. When you used kernel-devel, can you compile it?
It also don't include sources, I think.

Best Regards,

Akio Takebe

#6 lore raw

As far as i can recall i was able to see the entire kernel source tree in /usr/src

when i issued a make command, it was giving me error, still searching for the error (since i don't use the centos5 xen package, i need to dig out the old mail, however if it still works, i would use the centos5 packages, as i then don't need to bother about updates etc)

Quoted 24 lines · Akio Takebe

Hi,

Quoted 7 lines · Akio Takebe
Quoted 4 lines

The method of compiling a module for dom0 is the same as linux. I think there is not any special method.

When i try to issue a make command inside the kernel-xen source, it gives

me

Quoted 1 line

error :( I had posted the error in another thread, let me try to get it

out.

Quoted 1 line

I have never used centos.
But I think kernel-xen-devel you used don't include kernel sources. When you used kernel-devel, can you compile it?
It also don't include sources, I think.

Best Regards,

Akio Takebe

Signature · 3 lines
regards,

Anand Gupta

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#7 lore raw
In reply to Akio Takebe

Hi Akio,

I was trying the same command as the second one you mentioned. But I had moved the xen-3.1.0-src directory after compiling xen to some other folder. On specifying the new path, make was still trying to access files in the old path. Creating a symlink to the new path fixed the problem :)

But I'm not able to load the module, dmesg gives an error: Unknown symbol xenbus_write(). I have included xen/xenbus.h, do I need to do anything in addition to that?

Regards,
Ashutosh

Quoted 17 lines · Akio Takebe

Hi,

Quoted 2 lines

I am trying to create a new module for a domU kernel (which FYI, includes the xen/xenbus.h header file), but I'm unable to figure out how to

compile

Quoted 1 line

it. What should be the command and the Makefile for compiling the module?

I

Quoted 1 line

tried compiling it like a linux kernel module, but I guess I didn't give

the

Quoted 1 line

correct path. None of the paths I tried with -C worked.

Did you use different vmlinuxs between dom0 and domU?
If using the same vmlinux, you can compile it on dom0 with the same way as linux.
For example, like the below.
"make -C /lib/modules/uname -r/build M=pwd V=1 modules"

Quoted 10 lines

If no, I think you should be able to use like the below. "make -C /home/hoge/xen-unstable.hg/build-linux-2.6.18-xenU_ia64 M=pwd V=1
modules"

Best Regards,

Akio Takebe

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel