Hello Kernel Compiling Error
I've been trying to implement the hello world code from the device
drivers chapter of "Beginning Linux Programming". I'm trying to create
module that I can test with the insmod command. I keep getting errors
because I'm compiling using the wrong header:
In file included from /usr/include/linux/module.h:10,
/usr/include/linux/config.h:5:2: #error Incorrectly using glibc headers
for a kernel module
However, I've invoked the compiler as follows:
gcc -D__KERNEL__ -DMODULE -DMODVERSIONS -O2 -Wall -I /usr/src/linux/include -o samplerw.o -c samplerw.c
But, despite my providing what I think should be a directory in which to
search for *.h files (which I believe are the correct ones for my
system, a Fedora Core 3 install) for kernel compilations, I keep getting
the error above based on gcc including the wrong header file
My system details are as below.
# uname -a
Linux wiprosdm 2.6.11-1.1369_FC4 #1 Thu Jun 2 22:55:56 EDT 2005 i686 i686 i386 GNU/Linux
If some body could help that would be appreciable.
Thanks in advance.