Issue in using mmap on ARM target
Russell King - ARM Linux
linux at arm.linux.org.uk
Tue Sep 28 15:13:15 EDT 2010
On Mon, Sep 20, 2010 at 10:41:20AM +0530, naveen yadav wrote:
> Hi all,
>
> I am facing one issue when executing below progmra on ARM target. The
> same program work well on X86 host machine,
>
> When execute on Host(x86). the result are as expected.
> [root at localhost naveen]# ./a.out 0000 b 2
> /dev/mem opened.
> Memory mapped at address 0xb7f00000.
> Value at address 0x0 (0xb7f00000): 0x24
> Written 0x2; readback 0x2
>
> But when execute on Target(ARM):
> # ./a.out 0 w 20
> /dev/mem opened.
> Memory mapped at address 0x40003000.
> Value at address 0x0 (0x40003000): 0xEA000006
> Written 0x14; readback 0xEA000006
> #
> The value does not change. any idea ....
You are probably trying to write to some read-only memory.
On ARM systems, the boot loader is probably at location zero, and being
stored in flash or mask ROM, will probably not be (immediately) writable.
On x86, location zero tends to be RAM, and so can be written.
More information about the linux-arm-kernel
mailing list