Problem in writing to physical memory through a module
Linux - KernelThis forum is for all discussion relating to the Linux kernel.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I want to write data to a physical address of my choice. For it I am writing a driver (just like parallel port driver). In my driver code I use check_region() function to check whether the address is free or not. Then I use request_region() to reserve that address for my driver. When the driver is loaded using insmod, it is loaded successfully (i-e the address is reserved for my driver). The corresponding /dev/<filename> opens successfully but when I write to the /dev/<filename>, I get segmentation fault.
Where can the problem be?
If an address has been reserved for me, I should be able to write on it. But I can not write.
The physical address space and the kernel's address space are not identical.
You did not mention that you mapped your physical address, so I guess you didn't.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.