Using RedHat 5.0 and following KHG I performed the following steps in developing a driver 'x': 1) created x.o with gcc -O -DMODULE -D__KERNEL__ 2) created /dev/x crw-r--r-- 126 0 3) insmod ./x.o 4) lsmod listed it but ksyms did not 5) user root: fildef = open('/dev.x',O_RDWR); (fildef = 17) 6) user root:ioctl(fildef,_IOW(126,1,sizeof(daud)),(int)&daud) returns -1 as well as does all other ioctl's and write's I try from user app and do not print "printk's".
7) rmmod removes it OK. It seems that 'open' and 'release' are the only functions that work (perform as expected and "printk's" work).
I copied device file_operations, ioctl and write parameter lists from KHG, basically replacing 'foo' with 'x'.
I copied 'x.o' to /lib/modules/2.0.31/char and added 'alias char-major-126 x' to conf.module. Depmod -a does not add it to modules.dep and Modprobe doesn't know that 'x' exists.