Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <blockquote> <p>I need to force Linux to create the buffer file at that exact memory location</p> </blockquote> <p>This is not possible. (Actually you have created an XY question.)</p> <p>Since you have hardware that <em>"streams data from a preset physical memory address"</em>, then you have to ensure that the Linux kernel does not use this memory region as part of its memory pool. You need to inform the kernel <em>when it boots</em> to not use this memory region. You will not be able to "reclaim" or allocate buffers in this specific physical memory region once it becomes part of the memory space controlled by the kernel. </p> <p>The most generic method to exclude a memory region is to use the <code>memmap=</code> parameter on the kernel command line. </p> <pre><code>memmap=nn[KMG]$ss[KMG] [KNL,ACPI] Mark specific memory as reserved. Region of memory to be used, from ss to ss+nn. Example: Exclude memory from 0x18690000-0x1869ffff memmap=64K$0x18690000 or memmap=0x10000$0x18690000 </code></pre> <p>Some architectures, such as ARM with its ATAGs, have other less visible and more secure methods of reserving regions of physical memory.</p> <p>Somehow you then have to provide the address and size of this memory region to the device driver. This could be obtained by parsing the command line, or (thumbs down) hardcoded using <code>#define</code>s.</p> <p>The driver should declare its use of the memory region by calling <code>request_mem_region()</code>.<br> The driver can map this memory region into virtual address space by calling <code>ioreamp()</code>.</p> <p>Since the driver is provided or knows the physical address already, that's done. Since physical memory was allocated, the memory is therefore contiguous. You will have to configure the MMU to disable caching on this memory region. The memory region will then be "DMAable".</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload