LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   viewing and changing content in physical memory (https://www.linuxquestions.org/questions/programming-9/viewing-and-changing-content-in-physical-memory-552726/)

rsashok 05-09-2007 06:53 PM

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.

exvor 05-10-2007 05:05 PM

You probably would get a better response in the programming forum.
might wanna ask an admin to move it.

trickykid 05-10-2007 06:27 PM

Moved.....

syg00 05-10-2007 06:58 PM

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.


All times are GMT -5. The time now is 07:56 AM.