0

I'm developing on an FPGA/SoC and need to access procfs via DMA. I understand it's a pseudo filesystem located in memory, and am wondering if it's possible to obtain its address (similar to how the syscall table address is accessible in System.map) I'd like to have access to memory utilization and other stats.

A. Michael
  • 73
  • 1
  • 1
  • 6
  • 3
    It's not in memory anywhere, it's a virtual filesystem implemented entirely in code. – Barmar Aug 16 '18 at 20:14
  • Thank you. This answer still seems somewhat contradictory since the code and data must be in memory, yes? I understand the "files" containing the desired information do not actually exist but are provided by kernel code. Is it correct to say this information truly resides in internal data structures scattered about in memory? – A. Michael Aug 17 '18 at 16:18
  • 1
    I thought you were looking for something formatted like what you see in the `/proc/XXX` files. Those are generated on the fly, based on data scattered in kernel memory. – Barmar Aug 17 '18 at 18:05
  • Your comments have clarified my understanding of procfs and answered my poorly articulated question. Thanks again! – A. Michael Aug 17 '18 at 18:56

1 Answers1

1

You already got the answer from @Barmar comment. I just want to add some more information about procfs.

Actually pesudo is something pretend to. It means pesudo filesystem that doesn't have actual files, it has virtual entries that the filesystem available to access.

Is it possible to obtain address of DMA?

Answer is yes.

  1. There are several kinds of addresses involved in the DMA API, and it’s important to understand the differences.

  2. The kernel normally uses virtual addresses. Any address returned by kmalloc(), vmalloc(), and similar interfaces is a virtual address and can be stored in a void *.

  3. From a device’s point of view, DMA uses the bus address space, but it may be restricted to a subset of that space. For example, even if a system supports 64-bit addresses for main memory and PCI BARs, it may use an IOMMU so devices only need to use 32-bit DMA addresses.

Read this kernel document for more info about DMA-API-HOWTO.txt

danglingpointer
  • 4,708
  • 3
  • 24
  • 42