Re: Driver module access to filesystem

Rick Richardson (rick@dgii.com)
Thu, 3 Apr 1997 04:58:10 -0600 (CST)


Theodore Y. Ts'o wrote:
>
> From: rick@dgii.com (Rick Richardson)
> Date: Wed, 2 Apr 1997 22:01:10 -0600 (CST)
>
> We'd like to be able to read firmware files to be downloaded
> to boards from the init_module() call of a device driver.
> Then there is no need for gratuitous daemons to download
> firmware through the device driver nor for linking large firmware
> loads into the device driver. One could simply do:
>
>
> Umm.... it adds kernel bloat? Why have initialization code that needs
> to be able open files and read them? A much simpler way is to have an
> ioctl which loads the firmware, and then having a program which handles
> the firmware load. This is hardly a "gratuitous daemon" which has to be
> running all the time.

The ioctl is the traditional way of doing this. The daemon does have to be
running all the time in many cases such as the Digi C/X products where the
concentrators are remote and could be power cycled by accident. The driver
has to be prepared to give the box a firmware download at any time. The
daemon adds its own sort of bloat - another program in the filesystem,
another program that is always in the process table, you still need kernel
code to implement the ioctl, if its missing then you get a support call,
etc. etc.

The actual code to do this is on the order of 30 lines. I just tested it
out using the set_fs() trick that Tom Dyas pointed me at. This is highly
acceptable to me.

-Rick

-- 
Rick Richardson        Sr. Principal Engr.    Can you be sure I'm really me
Digi Intl.             Email: rick@dgii.com   and not my clone???  Has anybody
11001 Bren Rd. East    Fax:   (612) 912-4955  seen The Leader's nose???
Minnetonka, MN 55343   Tel:   (612) 912-3212  http://www.dgii.com/people/rick/