Date: Sat, 18 Mar 2000 18:20:11 +1030 From: Mark Newton <newton@internode.com.au> To: "Gary T. Corcoran" <garycor@home.com> Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: How to read a file from a device driver? Message-ID: <20000318182011.B74104@internode.com.au> In-Reply-To: <38D2FF48.CE3E396B@home.com> References: <38D2FF48.CE3E396B@home.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Mar 17, 2000 at 11:00:08PM -0500, Gary T. Corcoran wrote: > Can someone please tell me how I can read a file from a device driver > in FreeBSD? I need to download 2 or 3 relatively-large code files to > my device, choosing from amongst several different files depending on > which mode I'm operating in. Therefore compiling-in the code is not > a reasonable choice. Defer the initialization of the device until a user-mode process opens it and performs an ioctl() on it. The ioctl should take a (void *) to a buffer containing a structure which says how long the code is, followed by the code itself. That avoids the whole problem of reading a file from your driver, you can do it with a user-mode helper process. > If you can either tell me how to be able to read a file from my driver, > or point me to an example driver which does this, I would appreciate it. I think the Stallion serial port drivers do something kinda similar. - mark -- Mark Newton Email: newton@internode.com.au (W) Network Engineer Email: newton@atdot.dotat.org (H) Internode Systems Pty Ltd Desk: +61-8-82232999 "Network Man" - Anagram of "Mark Newton" Mobile: +61-416-202-223 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000318182011.B74104>