top of page

What is a firmware? How is it different from a kernel or OS?

Firmware, operating system, kernel... these are some common terminologies that an embedded system developer runs in to - a lot. For explaining clearly the difference between these, lets first explain the components in an embedded device or even a general purpose computer.

For simplicity, we can imagine a computer as a system consisting of CPU and a variety of peripheral devices. All the user programs run on CPU which a powerful general purpose execution engine, and the function that it does is totally defined by the program being executed. Now consider the case of peripheral devices, they will have a dedicated function, such as:

  • eMMC or similar secondary storage - managing of blocks, interpreting eMMC command sent from host, controlling the read-write operations etc.

  • Touch screen controller - to interpret commands from host; read the x & y coordinates where user has touched; send interrupt to host on identifying touch event etc.

  • GPUs (available in in System-on-Chips - SoCs) - manage the command ring-buffer between host CPU and GPU; interpret and execute the commands send from host via ring buffer; handle the buffers mapped; signalling completion of command execution(fences) etc.

  • BIOS (legacy) - to start, configure and initiate the execution of boot loader from boot device when computer is started.

For providing or fulfilling these functionality, the peripheral may have a small micro-controller(in case of ones with TSP controller, eMMC controller etc.) - in case of GPU it will be multi-core execution engine. All of which will have a CPU of varying capability.

As it is with all CPUs, it requires instructions to execute and perform its required function. It doesn't need capabilities like :

  • multi-tasking,

  • advanced interrupt handling,

  • segmentation & paging, etc.

Hence it will be a very minimal software package just enough to complete its intended functionality - which is called a FIRMWARE.

A Firmware:

  • usually resides in ROM(Read-only-memory) in case of self-contained devices. They will start execution in-place(from ROM itself by the micro-controller) when device is powered on.

  • Sometimes, it might be loaded to a small RAM - if device/controller is having one

  • Is usually frozen during production, but in some cases, it can be upgraded via special tools (if it is burned in to EEPROM or NOR flash)

  • There are cases in which the firmware resides in other secondary storage devices(Hard disk, SD card, etc.). The Host CPU will load the firmware on the peripheral device via some BUS(I2C, SPI etc.) after power-on & reset of peripheral devices(happens during boot up). After which firmware will start execution in the peripheral device. This happens in most of the modern GPUs embedded in SoCs Upgrading of firmware is quite straight forward in these kind of systems.

An Operating System is on the other hand

  • Provides a Kernel to interact with the underlying hardware components & associated userspace (programs, libc, libraries etc.) for user.

  • It provide (via kernel) standard functionality like multi-user, multi-programming, security, device drivers etc. which is needed to exploit the underlying hardware.

Basically firmware, kernel, operating system are abstractions intended at various applications. Hope the answer of difference between firmware, kernel & operating system is clear now.


 
 
 

Comentarios


bottom of page