03-01-2010 04:27 PM
The value of x at the end of these lines is zero, why isn't it 'a'?
char x, c='a';
ReadFromPhysicalMemory((unsigned int)&c, &x, 1);
03-01-2010 08:19 PM
Well... yes. &c is actually the address in virtual memory. and ReadFromPhysicalMemory uses actual memory addresses.
is there a way I can find out the physical address from a virtual one? in other words, can I find out the physical address of c in the above example?
Thanks.
03-02-2010 12:07 AM
Well, modern CPUs have extra hardware ( the MMU) to translate virtual addresses to physical adresses. Setting up the MMU is one basic task of the OS and you have to program at OS kernel level to do that. So I don't think that't possible within Labwindows/CVI. I think you have to look into the kernel device driver development environment for your OS to get an API for the mapping between physical and virtual addresses.
03-02-2010 12:25 AM
Uff... I hoped there is a quick and easy solution for this.
The problem is that if I use MapPhysicalMemory I have to specify the address myself.
I want to be able to know the physical address (as in the case when MapPhysicalMemory is used) but have the compiler select a vacant one for me. Is there a way to do that?
03-02-2010 03:45 AM
03-02-2010 07:00 AM
Frankly I'm just playing around, trying to figure out and expend the boundaries of my programming skills.
Let's say for example that I want several different applications to communicate directly through a word in memory.
Now I can of course use the physical memory library functions, but they all need me to come up with an address.
I don't know if the addresses that I come up with are available.
Thanks for your help so far, would love to hear what you think.
03-02-2010 09:48 AM