LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Files in /lib/firmware (https://www.linuxquestions.org/questions/linux-newbie-8/files-in-lib-firmware-623708/)

YellowOrange 02-25-2008 09:47 AM

Files in /lib/firmware
 
Hi,

I have a general question about the files that are stored in the folder "/lib/firmware" (I am using Ubuntu). I have bought a USB device for viewing television and I need to obtain a firmware file for my particular device. But what is this firmware? I only know firmware in the context of uploading firmware into the memory of a hardware device (e.g. updating the firmware in a router). But I have the suspicion that the files in "/lib/firmware" are not uploaded into the hardware. But what are the firmware files good for? I have also read that I need a kernel module along with a firmware file for my device. Is there any relationship between a firmware file and a kernel module for my device?

Thanks,
YellowOrange

b0uncer 02-25-2008 09:56 AM

Not going to go in-depth here (I'm no professional on this), but let's take an example of a wireless network card, more precisely, Broadcom's BCM4318 (that uses bcm43xx in some kernels as the kernel module/driver; some kernels have newer b43 for that).

Not going to repeat this text for the b43 kernel module, I'll just speak about bcm43xx module below.

The Linux kernel contains a module, or a driver, for Broadcom 43xx cards - the module is called bcm43xx, and is typically loaded if the appropriate hardware is present. However that native Linux driver doesn't (at least with my card) know what to do with the bcm43xx cards, and Broadcom has not released a Linux driver for this chipset - so some folks wrote a driver. But what to do with it if it can't handle the card by itself? Answer: firmware. In other words, it needs some pieces from the driver written for Windows to work. Another solution is to use NDISwrapper which wraps the Windows drivers and then that information can be used to handle the hardware device.

Well, with bcm43xx loaded, a "link" is missing between the kernel module and the real hardware. That "link" is in the Windows drivers (because Broadcom didn't provide a nice complete Linux driver). There's a special program, "fwcutter", that reads in some information from the Windows driver files, "cuts" it off and produces some "firmware files" for your Linux system. Then you copy those firmware files and put them into /lib/firmware, where bcm43xx kernel module finds them. With the "firmware files" the kernel module then knows how to work with the hardware, and from the end-user's point of view it looks like the kernel module, the driver, just works with the card.

I don't have other devices that needed firmware files in /lib/firmware, but that's what they are generally for I guess - to work in cooperation with the kernel module to be able to work with the hardware.

YellowOrange 03-01-2008 09:12 AM

Thank you, b0uncer, for your reply.

H_TeXMeX_H 03-01-2008 10:53 AM

The firmware need not always be uploaded to a device ROM or similar memory storage. Sometimes it's simply stored on the HDD, why not, nothing wrong with that, data is data wherever it may reside. Typically this happens if there is nowhere to upload the data to, such as when there is no ROM on the device. And, yes the driver needs the firmware to know how to work with the device, and as the firmware is not available on the device ROM (because there is none), it should be stored in '/lib/firmware' where drivers will look for it.


All times are GMT -5. The time now is 07:23 AM.