The HyperNews Linux KHG Discussion Pages

Question: DMA to user allocated buffer ?

Forum: The Linux Kernel Hackers' Guide
Keywords: DMA user buffer physio
Date: Mon, 22 Jun 1998 17:07:54 GMT
From: Chris Read <>

I am porting an application from Solaris and NT to Linux

I need to DMA fairly large ( >1 MByte ) data areas to a user 
assigned buffer (assigned using malloc). I thus need to either

1) Lock down the pages manually in the driver and generate
a physical scatter/gather table for the DMA (I assume that
the malloc'ed pages will not be contiguous in physical memory)

2) Remap the user buffer into physically contiguous memory, 
without changing the user virtual mapping (i.e. same user
virtual address)

3) Implement a Unix (Solaris) like physio routine to perform
the DMA in chunks, akin to the read entry point uoi->buf

Any pointers or ideas ?