Hi jah,
just some hints:
when you allocate the buffer you can forward the address to the user application via the copy_to_user().
In the user application you can open the /dev/mem device and map via mmap() the memory area of the kernel buffer.
So you can think to have two address, the physical address and the user space address and you know the offset between the two address. Each time you must use a location in the kernel buffer you can translate it to a user space address using this offset.
Here some C lines of code on how to open the /dev/mem device and how to map a buffer positioned in BaseBufPhyAddr
...
DevMemFD = open("/dev/mem", O_RDWR);
BaseBufVirtAdd = mmap(NULL, Size, PROT_READ | PROT_WRITE, MAP_SHARED, DevMemFD, BaseBufPhyAddr);
...
Paolo
p.s. I allocate the kernel buffer via dma_alloc_coherent() function, and the right address to map is the physical address not the virtual kernel address
Message Edited by Paolo Treffiletti on
2007-09-21 09:29 AMMessage Edited by Paolo Treffiletti on
2007-09-21 09:41 AM