Find the answer to your Linux question:
Results 1 to 4 of 4
Hello all, I am new to linux and i am sorry if i posted a silly question. I have an x86 pc and installed lucid these are the details of ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2010
    Posts
    3

    Cool Building and Running new kernel modules in an x86 pc


    Hello all,

    I am new to linux and i am sorry if i posted a silly question.

    I have an x86 pc and installed lucid these are the details of my distribution version
    DISTRIB_ID=Ubuntu
    DISTRIB_RELEASE=10.04
    DISTRIB_CODENAME=lucid
    DISTRIB_DESCRIPTION="Ubuntu 10.04.1 LTS"

    i am trying to build a kernel module i am getting the following error

    gcc -Wall -D__KERNEL__ -DMODULE -I/usr/src/linux/include -D__SMP__ -DSMP -DMODVERSIONS -include /usr/src/linux/include/linux/modversions.h -O2 -I.. -M *.c > .depend
    cc1: error: /usr/src/linux/include/linux/modversions.h: No such file or directory
    main.c:25:26: error: linux/config.h: No such file or directory

    Can somebody help me how to build kernel modules

  2. #2
    Linux Newbie
    Join Date
    Mar 2010
    Posts
    152
    Have a read of this book. It's very good, and of course covers how to build modules.

  3. #3
    Linux Engineer Segfault's Avatar
    Join Date
    Jun 2008
    Location
    Acadiana
    Posts
    877
    Methinks you need to enable CONFIG_MODVERSIONS in kernel conf and modversions.h will be created during kernel build.

  4. #4
    Linux Guru coopstah13's Avatar
    Join Date
    Nov 2007
    Location
    NH, USA
    Posts
    3,149
    also, make sure you have installed kernel headers package for your running kernel

Posting Permissions

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