Find the answer to your Linux question:
Results 1 to 6 of 6
Hi, I m new for this forum. wrote a hello.c kernel program while insmod hello.o, i am getting the message like "couldn't find the kernel version the module was compiled ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jun 2007
    Posts
    4

    Unhappy couldn't find the kernel version the module was compiled for!


    Hi,

    I m new for this forum. wrote a hello.c kernel program while insmod hello.o, i am getting the message like "couldn't find the kernel version the module was compiled for".

    i didn't compile the kernel(2.4.20-, using already present with red hat linux.

    Please help me regarding this issue.

  2. #2
    Linux Enthusiast
    Join Date
    Aug 2006
    Posts
    631
    Linux introduces with version 2.6 a new file naming convention, kernel modules now have a .ko extension instead of the old .o extension.
    Try:

    Code:
    insmod hello.ko
    Regards

  3. #3
    Just Joined!
    Join Date
    Jun 2007
    Posts
    4
    Thanks for reply. but my kernel version is 2.4 and how to make .ko any option with gcc command or mv .o to .ko??

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Enthusiast
    Join Date
    Aug 2006
    Posts
    631
    I apologize, I didn't read the question well, you have to insmod the .o module in version 2.4.
    Did you compile the module with the source/headers that match your kernel version?
    Check the version number in /usr/src and compare it with the output of the command:
    Code:
    uname -r
    Regards

  6. #5
    Just Joined!
    Join Date
    Jun 2007
    Posts
    4
    I compile with below option, but i checked /lib/modules/2.4.20.8/build/include/ doesn't exist. 2.4.20.8 is the ouput of uname -r.

    Code:
    INCLUDE = -isystem /lib/modules/`uname -r`/build/include/
    
    CFLAGS = -O3 -DMODULE -D__KERNEL__ $(INCLUDE)
    in /usr/src nothing is there like 2.4.20.8, its the output of
    Code:
    uname -r
    i didn't compile the kernel, using already existing.

  7. #6
    Linux Enthusiast
    Join Date
    Aug 2006
    Posts
    631
    Do you have the kernel-headers/source installed? If not, try to Google for how to install the proper version for your distro.

    Regards

Posting Permissions

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