Date: Mon, 14 Apr 1997 14:15:03 +0200 (MET DST) From: Luigi Rizzo <luigi@labinfo.iet.unipi.it> To: dufault@hda.com (Peter Dufault) Cc: hasty@rah.star-gate.com, hackers@FreeBSD.org, dyson@root.org Subject: Re: file i/o from device driver? Message-ID: <199704141215.OAA25773@labinfo.iet.unipi.it> In-Reply-To: <199704141055.GAA09057@hda.hda.com> from "Peter Dufault" at Apr 14, 97 06:55:22 am
next in thread | previous in thread | raw e-mail | index | archive | help
> > We have a couple of video capture drivers and was wondering what would it > > take to pass a file handle to a driver so it can write the captured frames > > to a file? > > IMHO: You don't want to do that. You want some way of > synchronizing between a capturer and a logger. the meteor driver has such a mechanism, it can acquire a bunch of frames in a region of mmapped memory, and issues a signal to the controlling process at every frame or when a low water mark is exceeded (I believe). I assume the same can work (if it is not already there) in the bktr driver (the ones amancio was referring to were /dev/meteor and /dev/bktr). Note that the above procedure needs data to be copied (when the logger process issues the write()), some as it happens for "cp" which reads the file using mmap, but does the write explicitly. Perhaps it would be nice to have a method (in mmap() ?) such that the page is read from the source and then passed directly to the sink bypassing the copy. In other words, deep down write(), when a page has a certain flag set (READONLY ?), when the page is in core, it is locked and passed to the low level routines without copying ? Cheers Luigi -----------------------------+-------------------------------------- Luigi Rizzo | Dip. di Ingegneria dell'Informazione email: luigi@iet.unipi.it | Universita' di Pisa tel: +39-50-568533 | via Diotisalvi 2, 56126 PISA (Italy) fax: +39-50-568522 | http://www.iet.unipi.it/~luigi/ _____________________________|______________________________________
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199704141215.OAA25773>