Help needed: mmap and physical memory access
Hi All,
For some testing purpose I need to use mmap having file descriptor received out of /dev/mem. But, I have no idea about what offset I should use. It would certainly be very helpful if someone could suggest as what offset should I use. The required (desired) length is 1MB. And, system I am using is FC9. Regards, Manav Swargiary |
Based on the mmap man page: "offset must be a multiple of the page size as returned by sysconf(_SC_PAGE_SIZE)."
For sysconf itself see 'man sysconf'. The suggested solution is: #include <unistd.h> offset = sysconf(_SC_PAGE_SIZE); Linux Archive |
I will read and try out this solution. Thanks a lot.
Regards, Manav |
offset = sysconf(_SC_PAGE_SIZE);
This does not return the offset, instead it returns the size of a page. I need a portion of a physical memory (preferably 1 MB) which is unused and can be accessed from user space using mmap. Offset (relative to base address) should point to an unused physical memory segment. |
All times are GMT -5. The time now is 02:14 PM. |