Can't mmap the top 1MB of /dev/mem?

Dan Malek dan at
Fri Jun 23 03:43:03 EST 2000

"Mark S. Mathews" wrote:

> ...... One thing I've noticed is that it won't let me mmap the
> top 1MB of the address space.

That should work, I do this quite regularly.  What actually fails,
the mmap() or your access to the mapped region?

There is what I do:

	mem_addr = (u_char *)mmap(NULL, FLASH_MEM_SIZE,
			mem_fd, FLASH_MEM_ADDR);

#define FLASH_MEM_SIZE and FLASH_MEM_ADDR accordingly.  I hope there
isn't some weird arithmetic rounding problem when we hit the top.  I
just usually tell this to map the upper 8M bytes.

The MMU doesn't care, if the generic Linux VM subsystem creates the PTEs
it just loads them.  I don't remember any code in the mem driver that
would prevent this either.  None of this is unique to the 8xx.

	-- Dan

** Sent via the linuxppc-embedded mail list. See

More information about the Linuxppc-embedded mailing list