<p dir="ltr"><br>
On Sep 20, 2013 2:25 PM, "Niroj Pokhrel" <<a href="mailto:nirojpokhrel@gmail.com">nirojpokhrel@gmail.com</a>> wrote:<br>
><br>
> Hi all,<br>
> I want to implement a device driver with mmap operations. However, I am not using ioctl call.<br>
> My approach:<br>
> i. I have created a sysfs bin files (because it support mmap)<br>
Why you want to implement mmap for sysfs file?<br>
What are you trying to mmap?Do you unserstand the reason why we do mmap?<br>
Please answer these questions and once you find out the answers to this question i think you will understand where you are going wrong.<br>
> ii. Now, I have implemented my mmap in my driver and assign this attribute to the sysfs file I have created.<br>
> However, I am facing the problem. The mmap is being called properly, however mmap_fault my implementation is not being called as a result of which the memory is not mapped. So, when I try to access this file I get segmentation fault.<br>
> <br>
> Can you please suggest what I should modify or is there anyother way to do it other than this ??<br>
> Thanking you in advance.<br>
> <br>
> Thanks and Regards,<br>
> Niroj Pokhrel <br>
><br>
> _______________________________________________<br>
> Kernelnewbies mailing list<br>
> <a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
> <a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
><br>
</p>