2

I need to reserve a large buffer of physically contiguous RAM from the kernel and be able to read /write to that hard-coded physical address.I have total of 512MB RAM out of which i need to reserve 300-400MB for application.

I have written a uio driver as an interface for accessing this memory from user space. I have mapped the physical address in device tree like below ,

    uio_mem: uiomem {
       compatible = "ti,uio-module-drv";
       mem = <0x8000000 0x17C00000>;
    };

But i am not able to access beyond 100MB memory.

Below is my virtual Mapping ,

Memory: 486136K/524288K available (6311K kernel code, 271K rwdata, 1948K rodata, 1024K init, 223K bss, 21768K reserved, 16384K cma-reserved, 0K highmem)
Virtual kernel memory layout:
vector  : 0xffff0000 - 0xffff1000   (   4 kB)
fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
vmalloc : 0xe0800000 - 0xff800000   ( 496 MB)
lowmem  : 0xc0000000 - 0xe0000000   ( 512 MB)
pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
modules : 0xbf000000 - 0xbfe00000   (  14 MB)
  .text : 0xc0008000 - 0xc0910dc4   (9252 kB)
  .init : 0xc0a00000 - 0xc0b00000   (1024 kB)
  .data : 0xc0b00000 - 0xc0b43e10   ( 272 kB)
   .bss : 0xc0b43e10 - 0xc0b7ba64   ( 224 kB) code here

can anyone explain in detail how this virtual memory map is framed to access the physical Memory of 512MB

I have series of Queries,

  1. kernel mapping starts at 0xc0b43e10 and ends at 0xffff1000( almost 1GB ) .But i have only 512 MB ram and how it fits in this virtual mapping .

  2. Will i be able to access the physical memory with direct address from user space. If so, up to how much memory size i can be able to access. And how to know about it.

1

I've successfully used the kernel argument mem=48M (as an example) to limit the amount of physical RAM that the kernel uses. You can then use the remainder of RAM in your kernel driver, where you'll need to memory map it.

See the kernel documentation in Documentation/memory.txt

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.