Creating physical memory from user space to use for DMA transfer

I want to create some memory to use for DMA transfer. (Using Linux 2.6.18-128.el5 # 1 SMP)

I have an API stack driver + kernel driver for my H / W that can do this for me, but it is very slow!

If I use the API to create a DMA transfer, it allocates some memory very high in System RAM (for example, 0x7373a6f8 in one pass). (I have an ICD device, so I have a mmap'd memory card, here is how I can find this address, and how in the end I want to set my own address and therefore / dev / mem on the cards below)

It seems that I can not interfere with the memory around this high address, apparently from my virtual memory space and it is blocked by the kernel?

What I want to do is either use (map) this address so that I can read / write to it, or create my own physical memory that I can read / write.

# cat /proc/iomem
00000000-0009fbff : System RAM
  00000000-00000000 : Crash kernel
000a0000-000bffff : Video RAM area
000c0000-000c7fff : Video ROM
000f0000-000fffff : System ROM
00100000-7fd64fff : System RAM        # Is this all of /dev/mem?
  00400000-00612916 : Kernel code
  00612917-006ef9db : Kernel data

# cat /proc/3450/maps
08207000-08228000 rw-p 08207000 00:00 0          [heap]
b7e7b000-b7f85000 rw-p b7e7b000 00:00 0
b7f89000-b7f8a000 rw-p b7f89000 00:00 0
b7f8a000-b7f8b000 rw-s 80114000 00:11 1541       /dev/mem
b7f8b000-b7f8d000 rw-p b7f8b000 00:00 0
bff70000-bff85000 rw-p bffea000 00:00 0          [stack]
+3
source share
1 answer

If I understand you correctly, do you have a device driver that behaves badly, and are you trying to get around this by manually allocating physical RAM from user space? Is there a reason you are not interested in fixing the driver?

, -, . , , .

( )

0

Source: https://habr.com/ru/post/1734076/


All Articles