LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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 05-09-2007, 06:53 PM   #1
rsashok
Member
 
Registered: Nov 2006
Location: USA, CA
Distribution: RedHat, Debian
Posts: 202

Rep: Reputation: 31
viewing and changing content in physical memory


My device is mapped into specific memory address (I think it is on PCI bus if it make any difference). In order to debug it I need to view/modify certain addresses. Is it possible to have some utility to do this from the command line. If I have something like:

void memset(int offset)
{
int *ptr = 0xffff0100;

cache_invalidate();
ptr[offset]= 0x1234678;
// cache_purge(); /* this might be better instead of
* cache_invalidate() before changing
* memory content */
}

Does it really write to address 0xffff0100 or some virtual DRAM location? Are there standard library functions which deal with cache management? (I don't want to learn cache internals, and another assembly just for this purpose).

BTW: on my target there is no /dev/mem - it is very lean embedded Linux.

Thanks to everybody who could shed a light on the topic.
 
Old 05-10-2007, 05:05 PM   #2
exvor
Senior Member
 
Registered: Jul 2004
Location: Phoenix, Arizona
Distribution: LFS-Version SVN-20091202, Arch 2009.08
Posts: 1,488

Rep: Reputation: 67
You probably would get a better response in the programming forum.
might wanna ask an admin to move it.
 
Old 05-10-2007, 06:27 PM   #3
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 199Reputation: 199
Moved.....
 
Old 05-10-2007, 06:58 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,353

Rep: Reputation: 1042Reputation: 1042Reputation: 1042Reputation: 1042Reputation: 1042Reputation: 1042Reputation: 1042Reputation: 1042
Have a look at (Corbett et al) LDD3.
Has a section just describing exactly this - including the memory update.
Might give you some ideas.

Uses kdb though - might be a bit tough to arrange in an embedded environment.
 
  


Reply

Tags
cache, memory


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
Viewing cd content Nau Linux - Software 2 01-04-2006 03:06 PM
Less physical memory? ariek Debian 5 07-21-2005 02:23 PM
How to access physical memory in C? cyu021 Programming 6 03-27-2005 04:16 AM
get Physical memory in C/C++ Dreampainter Programming 1 10-30-2004 08:54 PM
How Much Physical Memory ? tied2 Linux - Newbie 3 06-17-2002 01:30 AM


All times are GMT -5. The time now is 11:22 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