From owner-freebsd-hackers Fri Mar 17 21:24:25 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from mail.rdc1.nj.home.com (ha1.rdc1.nj.home.com [24.3.128.66]) by hub.freebsd.org (Postfix) with ESMTP id A7FD537B620 for ; Fri, 17 Mar 2000 21:24:21 -0800 (PST) (envelope-from garycor@home.com) Received: from home.com ([24.3.185.85]) by mail.rdc1.nj.home.com (InterMail v4.01.01.00 201-229-111) with ESMTP id <20000318052417.ZRFW11747.mail.rdc1.nj.home.com@home.com>; Fri, 17 Mar 2000 21:24:17 -0800 Message-ID: <38D314B6.CEFED2E0@home.com> Date: Sat, 18 Mar 2000 00:31:34 -0500 From: "Gary T. Corcoran" X-Mailer: Mozilla 4.6 [en] (Win95; U) X-Accept-Language: en MIME-Version: 1.0 To: "Matthew N. Dodd" Cc: Alfred Perlstein , freebsd-hackers@FreeBSD.ORG Subject: Re: How to read a file from a device driver? References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG "Matthew N. Dodd" wrote: > > On Fri, 17 Mar 2000, Gary T. Corcoran wrote: > > I'm trying to initialize a network device, and I'm trying to download > > code *into* my device from some binary system files. There is no > > "user space" or user process, for that matter, to deal with at this > > point. I just want to (at this step) open a file(s) directly from my > > device driver, read the file(s), and download the relevant parts to my > > device. > > There isn't really any clean way of doing this so most drivers that need > to load firmware usually compile them in. :/ 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. You mean I really can't do a relatively simple thing like read a file (which the _kernel_ really does, if you think about it) in my favorite operating system?? There's gotta be a way for a driver to do a read(), isn't there? :) BTW, I did a search on the email archives, and Mike Smith implied that there *is* a way to read a file from a driver, but he only made a vague reference to a driver that did same, and I wasn't able to find any example code to give me a clue... Thanks, Gary To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message