Did you know LQ has a Linux Hardware Compatibility List?
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 05-09-2007, 06:53 PM   #1
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;

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
Senior Member
Registered: Jul 2004
Location: Phoenix, Arizona
Distribution: Gentoo, LFS, Debian,Ubuntu
Posts: 1,529

Rep: Reputation: 74
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
LQ Guru
Registered: Jan 2001
Posts: 24,147

Rep: Reputation: 229Reputation: 229Reputation: 229
Old 05-10-2007, 06:58 PM   #4
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 13,479

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


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 06:28 AM.

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