From owner-freebsd-hackers Fri Mar 17 21:44:37 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from sasami.jurai.net (sasami.jurai.net [63.67.141.99]) by hub.freebsd.org (Postfix) with ESMTP id C980B37B598 for ; Fri, 17 Mar 2000 21:44:33 -0800 (PST) (envelope-from winter@jurai.net) Received: from localhost (winter@localhost) by sasami.jurai.net (8.9.3/8.8.7) with ESMTP id AAA89655; Sat, 18 Mar 2000 00:44:29 -0500 (EST) Date: Sat, 18 Mar 2000 00:44:28 -0500 (EST) From: "Matthew N. Dodd" To: "Gary T. Corcoran" Cc: Alfred Perlstein , freebsd-hackers@FreeBSD.ORG Subject: Re: How to read a file from a device driver? In-Reply-To: <38D314B6.CEFED2E0@home.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sat, 18 Mar 2000, Gary T. Corcoran wrote: > Ugh. This isn't the answer I was looking for... :-( ;-) I can do > this in Windows (the original driver), I can do this in Linux (our new > port) via a slight kluge which temporarily fiddles with the segment > pointers (via standard system routines) to make it seem as if our > driver's buffer is in user space so that the standard system read() > can be called. Again, your best bet is to look at how the QUOTA stuff works; it reads and writes to the quota files. Heres the problem though; If you compile your kernel in, the root filesystem isn't mounted until after your drivers probe/attach routines have been called. It would be better if you made your firmware a KLD so that it can be loaded by the loader or demand loaded by the kernel linker when your driver is loaded. -- | Matthew N. Dodd | '78 Datsun 280Z | '75 Volvo 164E | FreeBSD/NetBSD | | winter@jurai.net | 2 x '84 Volvo 245DL | ix86,sparc,pmax | | http://www.jurai.net/~winter | This Space For Rent | ISO8802.5 4ever | To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message