Driver porting: compiling external modules
Driver porting: compiling external modules
Posted Nov 9, 2004 21:25 UTC (Tue) by kabbalah (guest, #25930)In reply to: Driver porting: compiling external modules by madhavi_srinivas
Parent article: Driver porting: compiling external modules
thank you for your reply, I tried your code but when i compile it I still get plenty of errors:
cc hello.c -o hello
In file included from /usr/include/linux/sched.h:12,
from /usr/include/linux/module.h:9,
from hello.c:2:
/usr/include/linux/jiffies.h:16: error: parse error before "jiffies_64"
/usr/include/linux/jiffies.h:20: error: parse error before "get_jiffies_64"
In file included from /usr/include/linux/sched.h:21,
from /usr/include/linux/module.h:9,
from hello.c:2:
/usr/include/asm/mmu.h:13: error: field `sem' has incomplete type
In file included from /usr/include/linux/signal.h:4,
from /usr/include/linux/sched.h:25,
from /usr/include/linux/module.h:9,
from hello.c:2:
/usr/include/linux/list.h:604:2: warning: #warning "don't include kernel headers in userspace"
In file included from /usr/include/asm/siginfo.h:4,
from /usr/include/linux/signal.h:7,
from /usr/include/linux/sched.h:25,
from /usr/include/linux/module.h:9,
from hello.c:2:
/usr/include/asm-generic/siginfo.h:53: error: size of array `_pad' is too large
In file included from /usr/include/linux/sched.h:27,
from /usr/include/linux/module.h:9,
from hello.c:2:
/usr/include/linux/fs_struct.h:9: error: parse error before "rwlock_t"
/usr/include/linux/fs_struct.h:13: error: parse error before '}' token
In file included from /usr/include/linux/sched.h:29,
from /usr/include/linux/module.h:9,
from hello.c:2:
/usr/include/linux/completion.h:15: error: parse error before "wait_queue_head_t"
/usr/include/linux/completion.h: In function `init_completion':
/usr/include/linux/completion.h:26: error: dereferencing pointer to incomplete type
/usr/include/linux/completion.h:27: error: dereferencing pointer to incomplete type
In file included from /usr/include/linux/sched.h:30,
from /usr/include/linux/module.h:9,
from hello.c:2:
/usr/include/linux/pid.h: At top level:
/usr/include/linux/pid.h:18: error: field `task_list' has incomplete type
/usr/include/linux/pid.h:19: error: field `hash_chain' has incomplete type
/usr/include/linux/pid.h:24: error: field `pid_chain' has incomplete type
In file included from /usr/include/linux/module.h:9,
from hello.c:2:
/usr/include/linux/sched.h:93: error: parse error before "process_counts"
In file included from /usr/include/linux/sched.h:102,
from /usr/include/linux/module.h:9,
from hello.c:2:
/usr/include/linux/timer.h:10: error: field `entry' has incomplete type
hello.c:22: error: parse error before "__attribute_used__"
hello.c:22: warning: initialization makes integer from pointer without a cast
hello.c:22: warning: data definition has no type or storage class
hello.c:23: error: parse error before "__attribute_used__"
hello.c:23: error: redefinition of `__attribute_used__'
hello.c:22: error: `__attribute_used__' previously defined here
hello.c:23: warning: initialization makes integer from pointer without a cast
hello.c:23: warning: data definition has no type or storage class
hello.c:23:25: warning: no newline at end of file
make: *** [hello] Error 1
when i remove the #include <linux/modules.h> directive I get less errors but it still won't compile:
cc hello.c -o hello
hello.c:6: error: parse error before string constant
hello.c:6: warning: data definition has no type or storage class
hello.c:22: error: parse error before "__attribute_used__"
hello.c:22: warning: initialization makes integer from pointer without a cast
hello.c:22: warning: data definition has no type or storage class
hello.c:23: error: parse error before "__attribute_used__"
hello.c:23: error: redefinition of `__attribute_used__'
hello.c:22: error: `__attribute_used__' previously defined here
hello.c:23: warning: initialization makes integer from pointer without a cast
hello.c:23: warning: data definition has no type or storage class
make: *** [hello] Error 1
so that makes me pretty much desperate now :)
I guess I will have to forget about LKMs till the next Linux I install...
anyhow 10x again :)
