Bootloader

Often in early carrier with embedded, we hear the jargon that feels overwhelming to cope up with. Going through them, one at a time is the only way to master this field.

One such term is Bootloader. You don't need to know the ins and outs of the term unless you are implementing it, but understanding its functionality can surely help in your overall perception about embedded systems.

So what is a Bootloader ?

First let's understand the term to get a feel of it. Bootloader is also called as Bootstrap loader. The term bootstrap as a metaphor, means to better oneself by one's own unaided efforts.

The process of starting a computer, specifically its software, is known as booting. The procedure consists of a chain of stages in which at each stage a smaller, simpler program loads and then executes a larger, more complicated program of the next stage.

In this sense, the computer "pulls itself up by its bootstraps" that is, it improves itself by its own efforts.

As we know the main memory (RAM) cannot hold its contents when there is no power. After a power cycle the application needs to be loaded in the RAM by some driver software. Bootloader fills those shoes; pun intended :)

A bootloader is a small program that resides in nonvolatile memory of the target hardware that loads the operating system kernel image from non volatile memory like flash to the RAM and hand over the control for it to carry on.

In embedded systems a bootloader can also facilitate various other operations needed during development (as per requirement). Following are some examples -

1. Download and run software in RAM to debug the program.

2. Incorporate some kind of command-line interface (CLI) where commands can be issued to the bootloader (e.g via serial port) for execution on the target hardware.

these commands can include downloading software, running the program, peeking (reading) and poking (writing) memory and processor registers, comparing or displaying blocks of memory, and setting initialization configurations for the hardware.

3. Update the firmware, to add new features or fix bugs after the unit is deployed.

Conclusion:

Bootloaders are small programs that helps in bootstrapping (starting a process that is supposed to continue and grow without external input) by loading the kernel in RAM after a power cycle and passing the control to it. Apart from that it can facilitate other features that we might need during development like peeking memory, poking memory and updating the firmware after the units are deployed.

References:

  1. "Programming Embedded Systems" book by Michael Barr.
  2. WikiPedia