Find the answer to your Linux question:
Results 1 to 4 of 4
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    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_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
    Have a read of this book. It's very good, and of course covers how to build modules.

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

  4. $spacer_open
  5. #4
    Linux Guru coopstah13's Avatar
    Join Date
    Nov 2007
    NH, USA
    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