Go to previous topic
Go to next topic
Last Post 09 Apr 2008 04:30 AM by  rbunce
Linux 2.6.19 loadable modules?
 1 Replies
Author Messages
rbunce
New Member
New Member
Posts:


--
09 Apr 2008 03:51 AM
    Has anyone tried using loadable modules yet? I've created modules for older versions of Linux (on other projects) but I understand that there is now a new method which generates *.ko files using kbuild.

    I have set up the kernel to support modules, but so far I can't work out how to build the modules themselves. I'm happy with the "C" code, it's just the build process I'm stuck on.

    If any of you has an example Make file or any other tips it would be appreciated.

    Thanks in advance,

    Roy
    rbunce
    New Member
    New Member
    Posts:


    --
    09 Apr 2008 04:30 AM
    I answered my own question. Here is an example of a very simple makefile in case anyone else needs this info:


    CC = (path to your cross compiler)/arm-none-linux-gnueabi-gcc

    obj-m += my_module.o

    all:
    make -C /home/roy/imx31/kernel/linux-2.6.19 M=$(PWD) modules


    The path in the "make" should be to the source tree of the kernel which is loaded onto the iMX31. This is the bit I was getting wrong, because it originally pointed to the source tree of the kernel running on the host PC. I'm still kicking myself!


    Roy


    ---