Using /lib/modules/2.4.20-8/misc/chard.o
Warning: loading /lib/modules/2.4.20-8/misc/chard.o will taint the kernel: no license
See http://www.tux.org/lkml/#export-tainted for information about tainted modules
Module chard loaded, with warnings <=========总觉得不太安心 once the /dev/null and /dev/zero is inited, it never been cleanuped. so it never needs cleanup code. but u code need do that.
read scull and that chapter again. it is very clear in book that what value should put there. u also need a small script to create device for u in /dev. as well, find it in book.
u can not tell me u do not understand that book, and u only want to have a char dev driver code. since u are coding a kernel module, u have to know it. why not tell us " do not discuss c language problem with me, i do not want to know that, i only need a chr dev code?"
u have better write a makefile although u gcc is workable.
u need not cp to /lib/mo.../, u can insmod chard.o directly. #insmod chard
Using /lib/modules/2.4.20-8/misc/chard.o
Warning: loading /lib/modules/2.4.20-8/misc/chard.o will taint the kernel: no license
See http://www.tux.org/lkml/#export-tainted for information about tainted modules
Module chard loaded, with warnings <=========总觉得不太安心
ok, so what u change?
add MODULE_LICENSE("GPL"); to the end of u code to remove warning 谢谢Dragonfly if u can read LDD and scull example carefully, u can see that it has
#ifndef __KERNEL__
#define __KERNEL__
#endif
#ifndef MODULE
#define MODULE
#endif
#include <linux/config.h>
#include <linux/module.h>
#include <linux/kernel.h> /* printk() */
code in kernel is not 100% same as an external driver code. if u can read the post from that link, u also can know it. 谢谢各位的帮助
编译的问题解决了
设备驱动我也试过了
但我如何把我的模块变为开机自动加载的? which linux u use?
for my gentoo , add its name to /etc/modules.autoload
i guess u are using rh, then u need modify u /etc/rc.sysinit i believe 你猜对了
谢
Dragonfly welcome
页:
1
[2]