Welcome! Log In Create A New Profile

Help needed: mmap and physical memory access

Posted by manaav 
Help needed: mmap and physical memory access
March 24, 2009 09:46AM
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
Re: Help needed: mmap and physical memory access
September 09, 2009 10:22PM
How about 1. Use a memory area (say void *buf, either a stack buffer or on-heap one) of your process; 2. Find out its physical address (a tiny kernel driver module might be needed); 3. Use the physical address as the offset when mapping.

Read/write this physical address is safe absolutely because it belong to you.

It is that what we had done, please visit [effogpled.googlecode.com] for

1. The driver module AddrMap: SVN/devel/effo/codebase/kmod

2. Find out the physical address of a user space buffer of the process and do write/read/verify test: SVN/devel/effo/codebase/applets/test/addrmap

Notes: 1. Filter of /dev/mem accessing should be off in kernel configuration; 2. You may need to lock (mlock) the memory area in the RAM to prevent it from being swapped out.

Hope it helpful

-The Effo Staff
Re: Help needed: mmap and physical memory access
October 14, 2009 11:07PM
Dear Effo Staff,

Can you please give me a URL where the code for "AddrMap" and "kmod" is available?

thank you
rushikesh.
Re: Help needed: mmap and physical memory access
October 15, 2009 10:16PM
Please visit
kmod folder and the AddrMap driver, [code.google.com]
user space usage, the mem_addrmap folder, [code.google.com]
and the concept verification and test code, the addrmap folder, [code.google.com].

If you download a Effo GPLed Framework sample, named gpled_framework.samples.tar.bz2, then you could run "make" to build and run the test.
Reference document, named EffoGPLedRef.pdf, concepts document EffoDesign_MemTest.pdf.
You could download samples and documents from [code.google.com].

-Pat
The Effo Staff
Effo Project, [effo.sourceforge.net]
Re: Help needed: mmap and physical memory access
December 10, 2009 12:41AM
Hello EffoStaff,

If possible can you please provide the steps to make necessary setup for the above and also
a sample program demonstrating a read/write operation.


Looking forward to hear from you.

Regards,
Vipul.
Author:

Your Email:


Subject:


Message: