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: [EMAIL PROTECTED] (W)
Network Engineer Email: [EMAIL PROTECTED] (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 [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message