LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   character driver . (https://www.linuxquestions.org/questions/linux-newbie-8/character-driver-4175410969/)

zaffer 06-12-2012 01:18 AM

character driver .
 
hi,
i have written a character driver which works fine...when i run the application again with using rmmod it crashes that is:
[char_driver]#make
[char_driver]#insmod ./modules/lkm.ko
[char_driver]#mknod node c 250 0
[char_driver]#./a.out node
till here it works but when i type the following line
[char_driver]#./a.out node
it crashes .....
any solution......
waiting for reply.

bsat 06-13-2012 01:02 AM

please post it only in one forum..

zaffer 06-13-2012 02:17 AM

Quote:

Originally Posted by bsat (Post 4701959)
please post it only in one forum..

thanks for the answer suggestion i have any how solved the problem .....it was just a small thing my driver was nt trimming the quantams now i have adjusted it so now it is fine.

zaffer 06-25-2012 02:07 AM

completions in character driver in linux
 
hi,
i am trying o implement completion. i have to simple applications one for read and other for write.
my code is as follows
struct sculldev{
...........
...........
struct completiom my_completion;
.......
............
};

scullread(........)
{declare vriables......struct sculldev *lsculldev;
wait_for_completion(lsculldev->my_completion);
.............
}
scull_write(...........)
{
declare vriables......struct sculldev *lsculldev;
............................................
............code........................
............code.......................
complete(&lsculldev->my_completion);
return 0;
}
HOWEVER WHEN I RUN THE APPLICATION THE SYSTEM CRASHES.
the messages in var/log/messages is
BUG: sleeping function called from invalid context at arch/x86/mm fault.c
in_atomic(): 0, irqs_disabled:1, pid 2207

i would appreciate if any one could help

bsat 06-26-2012 01:11 AM

please create a new thread for a new problem.


All times are GMT -5. The time now is 09:14 AM.