Is there a way to share memory between OAL and kernel driver? Between OAL and kernel there is NKGlobal structure which can be used to share memory. I would like a similar approach to share the memory. I am using Windows Embedded Compact 2013 on Xilinx board.
Thus far, in the OAL layer I did VirtToPhys to an allocated memory to get the physical address. In the kernel driver I tried VirtualAllocCopyEx but I dont know what to pass in the pAddr.
LPVOID VirtualAllocCopyEx (
HANDLE hSrcProc,
HANDLE hDstProc,
LPVOID pAddr,
DWORD cbSize,
DWORD dwProtect
);
If the driver is running in kernel mode it's sharing the same address space of the OAL, so you can pass pointers directly. You can allocate your buffer in the driver or in the OAL and share a value using an IOCTL implemented in OEMIoControl in your OAL (if your BSP uses the common production quality layer you may check how other IOCTLs are implemented, usually you need to add a record in a table of structs and implement a function to manage your specific IOCTL). Both components can access the memory using that pointer.