LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Debian :trouble creating a kernel module (https://www.linuxquestions.org/questions/linux-newbie-8/debian-trouble-creating-a-kernel-module-297560/)

covertops 03-04-2005 07:40 AM

Debian :trouble creating a kernel module
 
Hi,

I'm trying to create a kernal module. I've come up with test code but it wont compile. I had no /usr/src/linux directroy so I downloaded the 2.4.18 kernel used make, then created a symbolic link to /usr/src/linux using the 2.4.18 kernel. When compiling it was missing version.h,stdarg.h.

At the moment i'm using the 2.4.25 kernel but I still cant figure out how to compile the test module. I've looked this up but it looks like almost all kernel module documentation is for red-hat

Any help on how I could do it ?

otoomet 03-04-2005 02:07 PM

Hi,

do you have a debian or custom kernel?

On my system the custom kernel sources are located at /usr/src/linux-2.6.7. I unpacked the modules into /usr/src and they compiled without problems. I have installed the following kernel-related packages:
Code:

siim@tibu:/etc/cups$ dpkg --list 'kernel*'
ii  kernel-image-2.4.27-1 2.4.27-2              Linux kernel image for version 2.4.27 on 386
ii  kernel-image-2.6.7-xt 20040913              Linux kernel binary image for version 2.6.7-xtops5.
ii  kernel-patch-scripts  0.99.35              Scripts to help dealing with packaged kernel patches
ii  kernel-pcmcia-modules 2.4.27-2              Mainstream PCMCIA modules 2.4.27 on 386
ii  linux-kernel-headers  2.5.999-test7-bk-17  Linux Kernel Headers for development

stdarg.h is located at
Code:

siim@tibu:/etc/cups$ locate stdarg.h
/usr/lib/gcc-lib/i486-linux/3.3.5/include/stdarg.h

I guess it is a part of gcc installation, perhaps there is something wrong with your gcc? Are you able to compile something else? There are several version.h-s around here:

Quote:

siim@tibu:/etc/cups$ locate /version.h
/usr/include/alsa/version.h
/usr/include/linux/dvb/version.h
/usr/include/linux/version.h
/usr/src/linux-2.6.7-xtops5/arch/i386/math-emu/version.h
/usr/src/linux-2.6.7-xtops5/include/linux/dvb/version.h
/usr/src/linux-2.6.7-xtops5/include/linux/version.h
/usr/src/linux-2.6.7-xtops5/include/pcmcia/version.h
/usr/src/linux-2.6.7-xtops5/include/sound/version.h
It seems that all of them are kernel related.

Perhaps it helps.

Ott

covertops 03-21-2005 08:31 AM

Hi,

Thanks for the information. i have a debian kernel, it was the first time i was going to recompile the kernel.


I'll try again ... thanks


All times are GMT -5. The time now is 09:56 AM.