Re: Reading a physical memory location

From: Helge Hafting
Date: Tue Jul 24 2007 - 09:06:32 EST


vraghavan3@xxxxxxxxxxxxxxx wrote:
Thanks for the quick reply. But I was wondering as to why I would have to map
the physical address to the virtual address when I know that the string is
permanently in the physical memory because its loaded into flash.
Because that is how any CPU with a MMU works.
All accesses to memory goes through page tables (virtual memory) -
there is no alternative. But this is not a problem, as the kernel can
map any physical address for you.

Is there a way
to directly read from the physical memory location?
The way is to map the page containing that address. You can
then read whatever you want from that page. Nothing is ever accessed
by physical address, physical addresses is only used indirectly
to set up the page tables.

Helge Hafting
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/