Announcement

Collapse
No announcement yet.

Need help creating a Loadable Kernel Module

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Need help creating a Loadable Kernel Module

    I'm trying to create a loadable kernel module for Kubuntu 7.10 which has the 2.6 KDE kernel. The file is a serial speed enhancer for my motherboard. It's name is viahss-0.92 and within the file are the following text files:

    file:///home/jacatone/Desktop/Module/viahss-0.92/Makefile
    file:///home/jacatone/Desktop/Module/viahss-0.92/Makefile-2.6
    file:///home/jacatone/Desktop/Module/viahss-0.92/viahss.c

    The instructions are:

    If you have a working kernel build environment then you'll need to do
    following things:

    1) Edit viahss.c in viahss-0.92 directory remove following line (15):
    #include <linux/config.h>

    2) Copy Makefile for 2.6 on top of 2.4 for makefile
    # cp Makefile-2.6 Makefile

    3) Compile package with make

    # make

    This worked at least with my Ubuntu 8.04 based mythbuntu machine (also
    with my CentOS4 machine. If this doesn't work most likely you don't
    have full kernel build environment."


    Could someone explain this to me in plainer language and maybe walk me through the process? Many thanks.

    #2
    Re: Need help creating a Loadable Kernel Module

    Plain English translation follows each quote.

    Originally posted by jacatone
    1) Edit viahss.c in viahss-0.92 directory remove following line (15):
    #include <linux/config.h>
    There is a file called 'config.h', in the subdirectory 'linux'. viahss.c does not need to include this file, provided your build environment is as the module would be expecting. Presumably there are kernel headers installed for the kernel which is the target of this build. viahss.c can just read those. On the other hand, if they're not installed, the build will likely fail.

    Originally posted by jacatone
    2) Copy Makefile for 2.6 on top of 2.4 for makefile
    # cp Makefile-2.6 Makefile
    The Makefile, a set of instructions for the build, was written for 2.4 series kernels. If you are using a 2.6 kernel, we have another set of instructions available. However, GNU make only knows to look in the file 'Makefile' when you type 'make'. Let's trick it by replacing Makefile with the one we want.

    Originally posted by jacatone
    3) Compile package with make
    Make then follows the instructions in the file and attempts to build the targets. If it stops with an error, then post the messages leading up to the crash, and someone will likely spot the problem.

    Originally posted by jacatone
    If this doesn't work most likely you don't
    have full kernel build environment.
    If this works, the next thing in your instructions should be some sort of install procedure. Let's handle the build problem first
    Jamendo | Wordpress | Dandelife | ccMixter | Csound

    Comment


      #3
      Re: Need help creating a Loadable Kernel Module

      If I do a diff, I get the following:

      jacatone@eMax:~/Desktop/Module/viahss-0.92$ diff viahss.c{.bak,}
      15d14
      < #include <linux/config.h>

      Does this mean the linux/config.h file is still there? If so, how do I remove it?

      Comment

      Working...
      X