From owner-freebsd-hackers Sun Jul 13 05:43:32 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id FAA17028 for hackers-outgoing; Sun, 13 Jul 1997 05:43:32 -0700 (PDT) Received: from hda.hda.com (hda-bicnet.bicnet.net [208.220.66.37]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id FAA17023 for ; Sun, 13 Jul 1997 05:43:29 -0700 (PDT) Received: (from dufault@localhost) by hda.hda.com (8.8.5/8.8.5) id GAA10485; Sun, 13 Jul 1997 06:54:18 -0400 (EDT) From: Peter Dufault Message-Id: <199707131054.GAA10485@hda.hda.com> Subject: Re: DMA directly to user space? In-Reply-To: <199707130702.CAA12323@friley01.res.iastate.edu> from Chris Csanady at "Jul 13, 97 02:02:25 am" To: ccsanady@friley01.res.iastate.edu (Chris Csanady) Date: Sun, 13 Jul 1997 06:54:16 -0400 (EDT) Cc: hackers@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL25 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > The thing is, I am looking for a way to do this without copying any data. > Is this possible? Are there any existing devices that do such things? > DMAing to userspace seems ideal, but I'm not sure how you could ensure > that the memory is aligned and contiguous. Or how to deal with the > user/kernel space boundry crossing. All raw I/O works that way. Handle misaligned memory by faulting, punting the issue back to the application. Basically write a strategy function and hook it in as a raw device and you'll have read and write directly to the user space. Non-contiguous memory must be handled either by the device hardware via some flavor of scatter-gather hardware (hopefully you'll find the device in question already does that) or by allocating contiguous memory. -- Peter Dufault (dufault@hda.com) Realtime development, Machine control, HD Associates, Inc. Safety critical systems, Agency approval