public inbox for linux-8086@vger.kernel.org
 help / color / mirror / Atom feed
From: "Riley Williams" <Riley@Williams.Name>
To: JinuM <jinum@esntechnologies.co.in>, linux-8086@vger.kernel.org
Subject: Re: open file in kernel model
Date: Fri, 9 May 2003 07:19:44 +0100	[thread overview]
Message-ID: <BKEGKPICNAKILKJKMHCACEHDCLAA.Riley@Williams.Name> (raw)
In-Reply-To: <AF572D578398634881E52418B28925670EFF1E@mail.esn.activedirectory>

Hi Jinu.

 > I am trying to write a firmware loader driver. Instead of reading
 > the firmware as a buffer (predefined array)  we would like to read
 > the firmware from a file (say /root/firmware).

Are you assuming that there is only one piece of firmware to be loaded
in the entire system, or is this driver for a specific device?

 > Do we have some function which reads the file contents in kernel
 > mode.

There probably is (I'm no expert on that part of the system), but I
doubt using such a function is appropriate for your declared task:

 1. If this is a generic driver, it would probably need to handle
    multiple firmware blobs, so would need to have access to more
    than one file.

 2. Even if it is for a specific device, the filename it needs to
    read will vary from one system to another.

There have been quite a few discussions recently regarding firmware
loading in the kernel, and at least one major Linux distributor now
rips ANY "binary blobs" out of the kernel because of legal issues.
The kernel developers are essentially moving over to the following
general scheme:

 1. The kernel itself neither contains the "binary blob" that is the
    firmware, nor knows where to obtain it. This is the requirement
    to avoid several hot legal issues, and also allows any updated
    firmware to be installed far easier than any other method.

 2. The kernel provides an interface usable by any driver requiring
    firmware, where that driver can state its requirement. There are
    currently several candidates for this interface and it is unclear
    which will eventually be decided on.

 3. A usermode program checks that the relevant requirement has been
    met, then feeds the relevant firmware to the driver. /sbin/hotplug
    is apparently a prime candidate for this interface.

You may wish to consider such a scheme if you are working on a driver
for a particular device. From the driver's viewpoint, this basically
comes down to registering some means for a usermode program to supply
the driver with the relevant firmware. This could be an ioctl that the
usermode program can call with an open file handle as parameter, and
the driver then reads the contents of that file into the firmware, or
it could be a special node in the file system that the usermode program
writes to and the driver copies anything written to that file straight
into the firmware slot.

Best wishes from Riley.
---
 * Nothing as pretty as a smile, nothing as ugly as a frown.

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.478 / Virus Database: 275 - Release Date: 6-May-2003


  reply	other threads:[~2003-05-09  6:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-09  5:45 open file in kernel model JinuM
2003-05-09  6:19 ` Riley Williams [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-05-09  7:16 JinuM
2003-05-09  7:35 ` Riley Williams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BKEGKPICNAKILKJKMHCACEHDCLAA.Riley@Williams.Name \
    --to=riley@williams.name \
    --cc=jinum@esntechnologies.co.in \
    --cc=linux-8086@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox