From owner-freebsd-hackers Sat Feb 1 09:52:22 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id JAA01865 for hackers-outgoing; Sat, 1 Feb 1997 09:52:22 -0800 (PST) Received: from sax.sax.de (sax.sax.de [193.175.26.33]) by freefall.freebsd.org (8.8.5/8.8.5) with SMTP id JAA01856 for ; Sat, 1 Feb 1997 09:52:18 -0800 (PST) Received: (from uucp@localhost) by sax.sax.de (8.6.12/8.6.12-s1) with UUCP id SAA10647; Sat, 1 Feb 1997 18:51:57 +0100 Received: (from j@localhost) by uriah.heep.sax.de (8.8.5/8.6.9) id SAA29372; Sat, 1 Feb 1997 18:48:15 +0100 (MET) Message-ID: 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... References: <199702011634.LAA10659@spoon.beta.com> X-Mailer: Mutt 0.55-PL10 Mime-Version: 1.0 X-Phone: +49-351-2012 669 X-PGP-Fingerprint: DC 47 E6 E4 FF A6 E9 8F 93 21 E0 7D F9 12 D6 4E Reply-To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch) In-Reply-To: <199702011634.LAA10659@spoon.beta.com>; from Brian J. McGovern on Feb 1, 1997 11:34:02 -0500 Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk 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. ;-)