LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 12-23-2008, 02:15 PM   #1
ss729
LQ Newbie
 
Registered: Dec 2008
Posts: 2

Rep: Reputation: 0
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!!
 
Old 12-23-2008, 02:49 PM   #2
paulsm4
Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
"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.

Last edited by paulsm4; 12-23-2008 at 02:50 PM.
 
Old 12-23-2008, 03:02 PM   #3
ss729
LQ Newbie
 
Registered: Dec 2008
Posts: 2

Original Poster
Rep: Reputation: 0
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 View Post
"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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux shared memory segment access problem and x86 Virtual Memory layout. regmee Linux - Kernel 1 08-23-2008 12:11 AM
Physical Memory and Virtual Memory Murdock1979 Linux - General 1 01-28-2008 07:35 AM
how can i run 3 linux virtual machines without going out of physical memory asterik123 General 7 04-14-2007 05:51 PM


All times are GMT -5. The time now is 04:14 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration