Thread: linux kernel module programming

  1. #1
    Registered User
    Join Date
    Aug 2007
    Posts
    1

    Question having same error as CIRCUIT

    hi,

    i m using same program and makefile as CIRCUIT and compiling the way NYDA says.Still I m Stuck on same error

    insmod: error inserting './hello.ko': -1 Invalid module format

    i m getting a ko file so y the error.

    i m using 2.6.22 kernel.

    Any help is welcome :-)

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    Split from http://cboard.cprogramming.com/showthread.php?t=59182
    Removed size abuse - we can read normal sized text thanks.
    Don't bump ancient threads in future.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    I'm pretty sure the problem here is that you are using "old" style compilation. The thread where this appears to have come from is pretty old and refers to a 2.4 kernel - not so long ago, I found that making my own module wasn't working as the book I was reading. Reason: Book talked about 2.4 kernel, and I had a 2.6.13 or so kernel. 2.6 has a different kernel format.

    There are a few different solutions - in my case, I choose to just add my module to the normal kernel build.

    Try searching for some info based on 2.6 kernel.

    --
    Mats

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compiling Linux kernel on Windows
    By jmd15 in forum Linux Programming
    Replies: 9
    Last Post: 04-10-2006, 07:28 AM
  2. linux kernel module programming
    By circuit in forum Linux Programming
    Replies: 10
    Last Post: 12-01-2004, 06:08 PM
  3. Linux kernel not compiling
    By frenchfry164 in forum Tech Board
    Replies: 2
    Last Post: 04-29-2003, 04:10 PM
  4. linux kernel 2.5
    By ygfperson in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 07-31-2002, 11:17 PM
  5. Function basics
    By sjleonard in forum C++ Programming
    Replies: 15
    Last Post: 11-21-2001, 12:02 PM