Linux firmware and drivers

In my opinion, firmware is what controls the hardware, and drivers interact with the firmware to control the hardware. It is right?

On Linux, which APIs or features interact with the firmware? Is the firmware code independent of any OS (e.g. Linux or Windows)?

+4
source share
2 answers

Firmware is software that runs on the device. A driver is software that tells your operating system how to contact the device. All devices with firmware are usually programmed to the device (either with a ROM chip or with a programmable ROM chip), but there are some devices in which the firmware is loaded into the device during initialization. There is no frimware on each device .

  • More technically, β€œFirmware is software that loads onto a microprocessor or programmable logic on the hardware device itself. Examples of hardware that use the firmware are HP printers that receive their code from the USB port when they turn on the power, the wireless network interfaces that load firmware at startup, routers that can update themselves from the Internet, etc. In general, the ability to download firmware to the device is a plus, which allows you to add improvements to Product after the initial sale. These include correcting product errors by answering security questions or responding to regulatory changes. Examples: FCC opens or limits acceptable bandwidths, power consumption, security. "
  • In general: a driver is a kernel module that talks about hardware; firmware is software that runs on hardware that speaks to the driver.
+6
source

It depends on how you connect the device and the PC. For PCI cards, there is a set of Linux kernel mode APIs. Another set of kernel-mode APIs is used to communicate with a device connected via a USB port. To connect Ethernet and WiFi, you can use the socket API, the connection is completely in user mode. Devices connected via the serial port are also processed using the user-mode API - they are considered as files in the Linux OS.

As a rule, the firmware of the device does not depend on the OS of the host system. It depends, however, on the OS (if any) running on the device itself. The firmware code can be written in simple C without any OS or run under real-time OS. Modern devices may contain full-featured operating systems, such as embedded Linux or Windows. In this case, the entire OS with programs specific to this device is considered the firmware of the device. For example, Android OS for a specific mobile device.

0
source

All Articles