public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* mmaping /dev/mem
@ 2003-03-13  0:36 sridhar vaidyanathan
  2003-03-13 20:49 ` Alex Tomas
  0 siblings, 1 reply; 2+ messages in thread
From: sridhar vaidyanathan @ 2003-03-13  0:36 UTC (permalink / raw)
  To: linux-kernel



I have a problem mmaping /dev/mem on some address in RAM. I am aware of 
caveats,but I am trying to mmap a region which I am sure is not in use by the 
kernel(some additional code does this and returns a physical address which is 
what I use for mmap). The mmap call itself succeeds and /proc/pid/maps also 
shows that region, but I am unable to see what I write in target memory.I also 
tried with the O_SYNC flag as I was wondering is caching had anything to do 
with the results that I was seeing.No effect.
This however works with a mem= option and when the mmap region falls out of the 
mem= boundary.
any clues?
Please cc as I am not subscribed
sridhar


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: mmaping /dev/mem
  2003-03-13  0:36 mmaping /dev/mem sridhar vaidyanathan
@ 2003-03-13 20:49 ` Alex Tomas
  0 siblings, 0 replies; 2+ messages in thread
From: Alex Tomas @ 2003-03-13 20:49 UTC (permalink / raw)
  To: sridhar vaidyanathan; +Cc: linux-kernel

>>>>> sridhar vaidyanathan (sv) writes:

 sv> I have a problem mmaping /dev/mem on some address in RAM. I am
 sv> aware of caveats,but I am trying to mmap a region which I am sure
 sv> is not in use by the kernel(some additional code does this and
 sv> returns a physical address which is what I use for mmap). The
 sv> mmap call itself succeeds and /proc/pid/maps also shows that
 sv> region, but I am unable to see what I write in target memory.I
 sv> also tried with the O_SYNC flag as I was wondering is caching had
 sv> anything to do with the results that I was seeing.No effect.
 sv> This however works with a mem= option and when the mmap region
 sv> falls out of the mem= boundary.  any clues?  Please cc as I am
 sv> not subscribed sridhar

look at mm/memory.c:remap_pte_range():

		if ((!VALID_PAGE(page)) || PageReserved(page))
 			set_pte(pte, mk_pte_phys(phys_addr, prot));

so, your pages aren't mapped at all and pte'es contain zero ...


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-03-13 20:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-13  0:36 mmaping /dev/mem sridhar vaidyanathan
2003-03-13 20:49 ` Alex Tomas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox