LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   How to access physical (as opposed to virtual) memory in C language for a Linux app. (https://www.linuxquestions.org/questions/programming-9/how-to-access-physical-as-opposed-to-virtual-memory-in-c-language-for-a-linux-app-692547/)

ss729 12-23-2008 02:15 PM

How to access physical (as opposed to virtual) memory in C language for a Linux app.
 
Hi,

I am running Linux kernel on MPC5200 processor board and am developing a C application. The application needs to write to certain registers which are located at 0xf000xxxx physical memory address to utilize certain hardware functionality not available through operating system.

Does anyone know how can I access physical memory address directly, or alternatively, how can I allocate memory so that the MMU maps it to the desired physical memory?

I appreciate any advice or help you can provide.

Thanks!!

paulsm4 12-23-2008 02:49 PM

"mmap" is probably what you're looking for (your mileage might vary, depending on the specific hardware you're trying to interface to).

Google for "mmap" "linux" "embedded systems", etc: you'll find lots of great info.

ss729 12-23-2008 03:02 PM

Thank you very much!! It appears that is what I am looking for. I'll give it a shot. Thanks again!

Quote:

Originally Posted by paulsm4 (Post 3385364)
"mmap" is probably what you're looking for (your mileage might vary, depending on the specific hardware you're trying to interface to).

Google for "mmap" "linux" "embedded systems", etc: you'll find lots of great info.



All times are GMT -5. The time now is 10:48 PM.