I am trying to get DMAable memory in user space by allocating it in kernel space and mmaping it to the user space application. The requirement is that the application will keep on doing allocations for this memory and keep freeing it and it may not be for full size pages(eg a few bytes only). For this I have written a prototype driver and user application which I have attached with the mail. Basically, the steps I am following are: 1. implement the mmap() function in the driver 2. in user space the dma_malloc() call which is the wrapper function to get dmaable memory will do the following: a. call the mmap() on the driver where driver allocates the private house keeping data structure in vma(vma->vm_private_data) and initializes vmops, so that munmap() will call the close() implemented by driver b. does an ioctl with the start of vma address which it gets from mmap() call above and the allocation size. driver allocates the memory and calls remap_page_range() to map the allocated region directly in the user space and calls mem_map_reserve() to reserve this area before remap. it stores the pointer to the kmalloc'ed area in vma->vm_private_data so that it could be freed during close() of vma. Ioctl returns the offset into page for the allocated memory to the user space. c. the wrapper function returns the pointer of the kmalloced area by adding this offset to the page address returned by mmap(). This works fine for the first allocation in any page and the corresponding free. But it causes an oops if allocations are done more than once. Can anybody shed some light on what I am doing wrong which is causing this oops(divide error: 0000). What I have observed is that if I unmap the page and then free the kernel pointer(through the ioctl) this oops does not happen. Can someone please tell me why this behaviour, or am I mising something at the basic level itself. Thanks in advance for any information. Regards. __________________________________ Do you Yahoo!? Friends. Fun. Try the all-new Yahoo! Messenger. http://messenger.yahoo.com/