Date: Sat, 1 Feb 1997 18:48:15 +0100 From: j@uriah.heep.sax.de (J Wunsch) To: mcgovern@spoon.beta.com (Brian J. McGovern) Cc: hackers@freebsd.org, msmith@atrad.adelaide.edu.au Subject: Re: Device driver help... Message-ID: <Mutt.19970201184815.j@uriah.heep.sax.de> In-Reply-To: <199702011634.LAA10659@spoon.beta.com>; from Brian J. McGovern on Feb 1, 1997 11:34:02 -0500 References: <199702011634.LAA10659@spoon.beta.com>
next in thread | previous in thread | raw e-mail | index | archive | help
As Brian J. McGovern wrote: > void fooread(dev_t dev) > { > while (u.u_count) Uh. No such thing like u-dot in BSD... :) > I started checking out some of the drivers, such as sio.c, and a few others > for "how they did it". I ended up (to date) with something that looks like > this: tty-style drivers are certainly the worst you could look at. They use clists which greatly obfuscates the matter for you. Better look at a simple driver like the scanner drivers that are around. > Unfortunately, the uio structure doesn't seem to be the same as SCOs (hence, > things like uio->u_base don't exist). First, BSD supports scatter/gather IO, so there's not a single buffer in it, but an IO vector. Second, you ought to have uiomove(9) (man page yet to be written, of course -- but now you're a really good candidate to write it finally! :) do the dirty work for you. -- cheers, J"org joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE Never trust an operating system you don't have sources for. ;-)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Mutt.19970201184815.j>