Re: Issue in using mmap on ARM target

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi All ,,


I will add some more info as i debug further.

If i give offset in range 0- 1023 then it work for me.
#####################################################
# ./arm.out 1023 w 3
/dev/mem opened.
Memory mapped at address 0x40022000.
Value at address 0x3FF (0x400223ff): 0xE1
Written 0x3; readback 0xE1
^C
###################################################
# ./arm.out 1024 w 3
/dev/mem opened.
Memory mapped at address 0x40022000.
Value at address 0x400 (0x40022400): 0x3000000
Written 0x3; readback 0x3
^C
#################################################

Also If i open mmap as private then i can write at 0 offset.

##################################################

# ./arm_priv 0 w 9
/dev/mem opened.
Memory mapped at address 0x40022000.
Value at address 0x0 (0x40022000): 0xEA000006
Written 0x9; readback 0x9

#####################################################


thanks.

On Wed, Sep 22, 2010 at 8:06 AM, vinit dhatrak <vinit.dhatrak@xxxxxxxxx> wrote:
>
>
> On Tue, Sep 21, 2010 at 10:21 PM, Mulyadi Santosa
> <mulyadi.santosa@xxxxxxxxx> wrote:
>>
>> Hi....
>>
>> On Wed, Sep 22, 2010 at 01:01, vinit dhatrak <vinit.dhatrak@xxxxxxxxx>
>> wrote:
>> > I guess this issue has something to do with '/dev/mem' being physical
>> > memory. The address may have different value when data is set and
>> > different
>> > data when value is read due to page swapping or copy-on-write. I am just
>> > taking wild guess here, please correct me if I am wrong.
>>
>> I was thinking, it could be that /dev/mem is made as "read only" in
>> the architecture...or ...you're hitting memory region which is
>> protected.
>>
>
> then the program would have seg-faulted, no?
>
>>
>> --
>> regards,
>>
>> Mulyadi Santosa
>> Freelance Linux trainer and consultant
>>
>> blog: the-hydra.blogspot.com
>> training: mulyaditraining.blogspot.com
>
>

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux