I'm trying to learn to write kernel modules, as a start for writing device
drivers. I'm starting with a simple test. This is what I've done:
[cjmorlan@shredder moduletest]$ uname -a
Linux shredder 2.2.14-15mdk #1 Tue Jan 4 22:24:20 CET 2000 i586 unknown
[cjmorlan@shredder moduletest]$ cat greet.c
#define MODULE
#include <linux/module.h>
int init_module(void) {
printk("<1>Hello, world\n");
return 0;
}
void cleanup_module(void) {
printk("<1>Goodbye cruel world\n");
}
[cjmorlan@shredder moduletest]$ arm-linux-gcc -c greet.c
I then transfer greet.o to the Brutus.
[root@localhost /root]# uname -o
Linux localhost 2.3.35-rmk1-np7 #6 Thu Mar 16 10:58:40 EST 2000 armv4l
[root@localhost /root]# ls
greet.o
[root@localhost /root]# insmod greet.o
greet.o: not an object file
But if I recompile on the i586, it works fine and prints Hello/Goodbye
world on the console. (Without recompile it says 'greet.o: ELF file not
for this architecture'.)
Is this a difference between 2.2 kernels and 2.3, or is something funny
going on? I can compile user-space programs fine.
________________________
/
/ Wise words of the day:
Reporter: "What do you think of Western Civilisation?"
M.K. Gandhi: "I think it would be a good idea."
\ [EMAIL PROTECTED]
\________________________
unsubscribe: body of `unsubscribe linux-arm' to [EMAIL PROTECTED]
++ Please use [EMAIL PROTECTED] for ++
++ kernel-related discussions. ++