users
Newbie level 1
* I have Vmware5.0 installed with redhat linux 9.
* I have modified the "makefile" according to the name "/usr/src/linux-2.4.20-8" for INCLUDE statement.
How to solve
The Problem:
I am trying to compile the source code for chapter 21 and am getting many errors. Hello.c is the only one that is compiling (probably because of the simplicity). For example when I 'make' schar I get the following out put:
gcc -D__KERNEL__ -I/usr/src/linux/include -DMODULE -Wall -O2 -c -o schar.o schar.c
[root@localhost schar]# make
gcc -D__KERNEL__ -I/usr/src/linux/include -DMODULE -Wall -O2 -c -o
schar.o schar.c
schar.c:41: warning: initialization from incompatible pointer type
schar.c:42: warning: initialization from incompatible pointer type
schar.c:44: warning: initialization from incompatible pointer type
schar.c:45: warning: initialization from incompatible pointer type
schar.c:46: warning: initialization from incompatible pointer type
schar.c:47: warning: initialization from incompatible pointer type
schar.c:49: warning: initialization from incompatible pointer type
schar.c: In function `schar_mmap':
schar.c:167: structure has no member named `vm_offset'
schar.c: In function `init_module':
schar.c:449: warning: implicit declaration of function `MAP_NR'
schar.c:449: invalid type argument of `->'
schar.c:461: structure has no member named `fill_inode'
schar.c: In function `cleanup_module':
schar.c:482: invalid type argument of `->'
make: *** [schar.o] Error 1
* I have modified the "makefile" according to the name "/usr/src/linux-2.4.20-8" for INCLUDE statement.
How to solve
The Problem:
I am trying to compile the source code for chapter 21 and am getting many errors. Hello.c is the only one that is compiling (probably because of the simplicity). For example when I 'make' schar I get the following out put:
gcc -D__KERNEL__ -I/usr/src/linux/include -DMODULE -Wall -O2 -c -o schar.o schar.c
[root@localhost schar]# make
gcc -D__KERNEL__ -I/usr/src/linux/include -DMODULE -Wall -O2 -c -o
schar.o schar.c
schar.c:41: warning: initialization from incompatible pointer type
schar.c:42: warning: initialization from incompatible pointer type
schar.c:44: warning: initialization from incompatible pointer type
schar.c:45: warning: initialization from incompatible pointer type
schar.c:46: warning: initialization from incompatible pointer type
schar.c:47: warning: initialization from incompatible pointer type
schar.c:49: warning: initialization from incompatible pointer type
schar.c: In function `schar_mmap':
schar.c:167: structure has no member named `vm_offset'
schar.c: In function `init_module':
schar.c:449: warning: implicit declaration of function `MAP_NR'
schar.c:449: invalid type argument of `->'
schar.c:461: structure has no member named `fill_inode'
schar.c: In function `cleanup_module':
schar.c:482: invalid type argument of `->'
make: *** [schar.o] Error 1