-1

I have the IPCORE which needs the physical address to communicate with the RAM. I know that When I do MALLOC in the user space it allocates the portion of memory. Now all I need to know is the address of this allocated memory. So that I can assign it to the IPCORE and let it perform an operation on it.

I hope there will be some way to do it in user space. I am not good in drivers in kernel space.

Thanks

1 Answers1

0

A userspace program works as if it is a single program working on a machine. The program egotistically occupies all the entire address space without distinguishing between virtual and physical memory. The Virtual Memory is entirely managed by the kernel transparently to the program. If you don't have a special API for interacting with the kernel, you can never know whether you are running in a virtualized environment or on a bare metal.

So the answer depends on the OS you are using.

Also, normally you can't communicate between kernel and user space via the shared memory without a special mechanism. This may be dangerous, because VM pages may be moved to another location in the physical memory while the application is running, or even may be moved out of the physical memory to a disk (swap or pagefile). So perhaps you need to search a more proper way for your task, or at least lock shared pages of memory.

Community
  • 1
  • 1
Dmitry
  • 1,995
  • 1
  • 11
  • 10