Hi, On Fri, 2010-12-24 at 11:37 +0530, Hemanth Kumar wrote:
> >
The mutex initialization is missing. Adding mutex_init(&timer); in the driver init will make it work.
Thanks, Mukti
Hi All,
Can anybody please share some idea ,why I am getting segmentation fault & kernel oops,
Regards,
I tried it, and it seems adding mutex_init() works as Mukti mentioned. I did get a kernel oops before (but no segfault). After adding mutex_init() there is no oops/segfault. The code, however, is reading the garbage, that needs to be fixed. pun-nilesht-dt0:/home/nilesh/Documents/handson # !mknod mknod /dev/mytimer c 300 0 pun-nilesht-dt0:/home/nilesh/Documents # dmesg [ 2193.684735] Register timer maj = 300 pun-nilesht-dt0:/home/nilesh/Documents/handson # ./my_app.o a = -30048 b = -23975 c = 32582 ... See the attachments in case something is missing the code.
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
-- Thanks, Nilesh