Find the answer to your Linux question:
Results 1 to 3 of 3
Hi every one Can anyone please help me in Compiling a Kernel module for 2.6 any where iam not able to get a clear idea of the compilation n about ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Apr 2008
    Posts
    1

    How to compile module?


    Hi every one
    Can anyone please help me in Compiling a Kernel module for 2.6
    any where iam not able to get a clear idea of the compilation n about writing Makefile .
    Please help me out

  2. #2
    Just Joined!
    Join Date
    Feb 2008
    Posts
    17
    here is the sample Makefile:
    ---------------------
    obj-m += test.o # test.c is the source of your module.
    KDIR := /lib/modules/$(shell uname -r)/build
    PWD := $(shell pwd)
    default:
    $(MAKE) -C $(KDIR) M=$(PWD) modules
    ---------------------
    if your module has multiple source files test1.c and test2.c and you need 1 module test
    then you will have:
    obj-m = test.o
    test-objs = test1.o test2.o
    Nice place to start:
    http://www.faqs.org/docs/kernel/

  3. #3
    Just Joined!
    Join Date
    Feb 2008
    Posts
    17
    obj-m += test.o
    test-objs += test1.o test2.o

    (My bad)

  4. $spacer_open
    $spacer_close

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •