|
发表于 2003-4-6 03:53:51
|
显示全部楼层
this is because the kernel code u compile with your helliworld is the different with u running code.
1) from "uname -a" u can know the version of u running kernel, here we know that u are using the 2.4.18-4, a redhat hacked one.
2) you use gcc only, let's assume u code use /usr/src/linux. since /usr/src/linux is usually a symbol link to a real kernel source code, for example /usr/src/linux-2.4.x-x, pls check what actual linux kernel code u are using. i guess u are using 2.4.9-9.
3) we seldom use gcc directly, most of the time we will use a Makefile. I will post a sample makefile later.
4) i recommend u run your system with a standard(vanilla) kernel download from kernel.org directly. since mant people dislike the hacked one from redhat. you need download, recompile, and install the kernel source and use the new compiled kernel as u running kernel.
5) u can add a newline at the end of u .c file to remove that newline warning.
6) u can add "MODULE_LICENSE("GPL");' at the end of u .c file to remove that license warning. |
|