Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 13
Hai Guys,... As i had been assigned with a project reagarding the /proc file system.. I need to insert modules ... But i m facing a lot of troubles to ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Mar 2007
    Posts
    20

    Modules insertion in My kernel...


    Hai Guys,...
    As i had been assigned with a project reagarding the /proc file system.. I need to insert modules ... But i m facing a lot of troubles to compile them and insert them... A lot of version troubles...could some one help me to get out of it.....My kernel version is 2.6.15-1.2054_FC5

    I couldn compile my simple hello.c program to get a Hello.Ko output file.....


    Pease help me guys !!!!

  2. #2
    Linux User cyberinstru's Avatar
    Join Date
    Jan 2007
    Location
    India
    Posts
    362
    Whatz the error that you get?

    Do you have the source of your running kernel, itz required for building your module.
    ---------------------------------
    Registered Linux User #440311
    HI2ARUN _AT_ GMAIL _DOT_ COM
    ---------------------------------

  3. #3
    Just Joined!
    Join Date
    Mar 2007
    Posts
    20

    Modules !!!

    I don think i have the source....wer do i find themm.....

  4. $spacer_open
    $spacer_close
  5. #4
    Linux User cyberinstru's Avatar
    Join Date
    Jan 2007
    Location
    India
    Posts
    362
    You can get it from www.kernel.org

    Configure, compile, and have a running kernel.

    Then compile your module.
    ---------------------------------
    Registered Linux User #440311
    HI2ARUN _AT_ GMAIL _DOT_ COM
    ---------------------------------

  6. #5
    Just Joined!
    Join Date
    Mar 2007
    Posts
    42
    Quote Originally Posted by cyberinstru
    You can get it from www.kernel.org

    Configure, compile, and have a running kernel.

    Then compile your module.
    Don't forget backup you're running kernel first....
    Or don't override the running kernel.... while compiling the new kernel

  7. #6
    Just Joined!
    Join Date
    Mar 2007
    Posts
    20

    Thanx

    But how do i take a back up... and then re-compile a new kernel !!!!
    Gimme the steps yaar....
    Thanx for helping...

  8. #7
    Linux Guru Juan Pablo's Avatar
    Join Date
    Mar 2006
    Location
    /home/south_america/ecuador/quito
    Posts
    2,064
    You will need to do some research yourself, Google is your friend.
    There are a lot of tutorials detailing how to write a simple module that prints "Hello world" in dmesg out there
    Put your hand in an oven for a minute and it will be like an hour, sit beside a beautiful woman for an hour and it will be like a minute, that is relativity. --Albert Einstein
    Linux User #425940

    Don't PM me with questions, instead post in the forums

  9. #8
    Just Joined!
    Join Date
    Aug 2006
    Location
    india
    Posts
    57
    hi winifred,
    I am at the same situation where ur standing, when ur including the driver what is the makefile u wrote for it.
    look at my make:
    ************************************************** ***************************
    obj-m += hello.ko

    all:
    make -C /lib/modules/2.6.x.x/build M=$(PWD) modules
    ************************************************** ***************************
    it has to look into /usr/src for that source 2.6kernel that is not happening for me it is saying no rule in makefile
    pls give me ur makefile
    ****cyberinstructer please help buddy***

  10. #9
    Linux User cyberinstru's Avatar
    Join Date
    Jan 2007
    Location
    India
    Posts
    362
    Try this.

    Code:
    MYKERNEL=`uname -r`
    
    ifneq ($(KERNELRELEASE),)
    # call from kernel build system
    
    obj-m   := hello.o
    
    else
     
    KERNELDIR ?= /lib/modules/$(MYKERNEL)/build
    PWD       := $(shell pwd)
    
    default:
            $(MAKE) -C $(KERNELDIR) M=$(PWD) modules
    
    endif
    
    clean:
            rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions
    
    depend .depend dep:
            $(CC) $(CFLAGS) -M *.c > .depend
    
    
    ifeq (.depend,$(wildcard .depend))
    include .depend
    endif
    ---------------------------------
    Registered Linux User #440311
    HI2ARUN _AT_ GMAIL _DOT_ COM
    ---------------------------------

  11. #10
    Just Joined!
    Join Date
    Aug 2006
    Location
    india
    Posts
    57
    i am using ur makefile only cyberinstructer but one more pbm

    build link in my /lib/modules is looking for this source ,( it is a broken link)
    usr/src/kernels/2.6.15-1.2054_FC5-i686
    i included a wrong source i guess it is showing error as ...(kernel-2.6.15-1.2054_FC5.src is what i included)
    [root@localhost hello]# make -f Makefile.txt
    make -C /lib/modules/`uname -r`/build M=/home/rajasekhar/hello modules
    make: *** /lib/modules/2.6.15-1.2054_FC5/build: No such file or directory. Stop.
    make: *** [default] Error 2

    if so please send me the correct i686 source ,i search on kernel.org but i think i am a bad searcher

Page 1 of 2 1 2 LastLast

Posting Permissions

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