Re: mmap problem

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

 



Thank you very much. I was bit over-confident on addressing :).
Now things are working fine. But still I wonder why didn't it throw bus error.

Now, I am facing a new problem
* When I map the same physical address to kernel virtual address using ioremap, it fails.
  I understand that ioremap is doing a sanity check to verify that the physical address belongs to IO device or system memory. I am working on that to remove this sanity check.
In the mean time, if you have any easy way to remove this. Please help

Thanks,
Prabhu



On Tue, Oct 5, 2010 at 10:33 AM, Arun KS <getarunks@xxxxxxxxx> wrote:
Hello Prabhu,

On Mon, Oct 4, 2010 at 3:55 PM, Prabhu nath <gprabhunath@xxxxxxxxx> wrote:
> Dear All,
>
>          I have an 512 MB RAM on an Intel desktop machine, of which Kernel
> uses 256M for all allocation for kernel as well as for user
>          programs. (by passing mem=256M as a boot parameter). Hence I have
> 256MB of memory which I can treat it as IO memory.
>
>          System memory is associated from 0x00000000 -  0x20000000 (512MB)
> in the physical address space.
>          Memory addresses from 0x00000000 - 0x10000000 (256 MB) are used by
> the Kernel - memory management. Subsystem
>          Memory addresses from 0x10000000 - 20000000 (256MB) is used as IO
> memory
>
>         For an experiment, I used mmap() to map a page (4K) in IO memory
> (page base address 0x20002000) to user virtual address

This physical address is above your 512MB ram address.

Arun
>         I used kernel function remap_pfn_range() in my kernel module's mmap
> function.
>
>         This is rightly mapping the physical page to a user virtual address.
> But when I write to that address and then read. I get junk
>         value.
>
>         To just verify, when I mapped the VGA controller memory to user
> virtual address things are working fine.
>
>         Can you please help me to resolve this problem.
>
> Regards,
> Prabhu
>
>
>


[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