Visit Jeremy's Blog.
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, 07: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, 06:05 PM   #2
Senior Member
Registered: Jul 2004
Location: Phoenix, Arizona
Distribution: Gentoo, LFS, Debian,Ubuntu
Posts: 1,537

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

Rep: Reputation: 235Reputation: 235Reputation: 235
Old 05-10-2007, 07:58 PM   #4
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,939

Rep: Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210
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 04:06 PM
Less physical memory? ariek Debian 5 07-21-2005 03:23 PM
How to access physical memory in C? cyu021 Programming 6 03-27-2005 05:16 AM
get Physical memory in C/C++ Dreampainter Programming 1 10-30-2004 09:54 PM
How Much Physical Memory ? tied2 Linux - Newbie 3 06-17-2002 02:30 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:19 PM.

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