Have you ever been the developed a bootloader

Thread Starter

Kittu20

Joined Oct 12, 2022
511
I am curious: have you ever been involved in the development of a bootloader?

I recently came across the concept of bootloaders being a program that initiates a computer system and loads the operating system into memory. However, I'm unsure about the role of a bootloader in the context of microcontrollers when there's no operating system involved in user application.
 

Thread Starter

Kittu20

Joined Oct 12, 2022
511
It seems that bootloaders make firmware updates possible without an external programmer. Could you share some practical scenarios or examples where this feature becomes particularly useful?
 

Thread Starter

Kittu20

Joined Oct 12, 2022
511
My general understanding about the process of dumping code into the memory of a microcontroller. From what I gather, it involves having a microcontroller, a programmer, and using specific software for that microcontroller to load the code (in hex file format) into its memory.

However, I'm a bit unclear about the necessity of a bootloader in this process.
 

Dave Lowther

Joined Sep 8, 2016
332
My general understanding about the process of dumping code into the memory of a microcontroller. From what I gather, it involves having a microcontroller, a programmer, and using specific software for that microcontroller to load the code (in hex file format) into its memory.

However, I'm a bit unclear about the necessity of a bootloader in this process.
Using a bootloader, e.g. in the Arduino case, means it's not necessary to use a programmer. Typically Arduino compatible microcontroller boards use a USB link to the host PC where the code is compiled. That USB link is used to download the compiled code to the microcontroller's flash memory. This means a programmer is not necessary. The same link can also be used to view text output by the code running on the microcontroller.
If one is developing code for a microcontroller that doesn't use a bootloader, then a programmer is required. For example, I've done some work with the ATtiny85 with no boot loader. For that case I used an ICSP programmer (similar to this) connected to the host PC and plugged into the ICSP header pins on the microcontoller PCB.
 
Last edited:

Papabravo

Joined Feb 24, 2006
22,058
The TigerSHARC line of digital signal processors runs the bulk of its code from onboard RAM which is volatile. The code is kept in an external 8-pin serial flash device. There is a small amount of flash memory that contains a bootloader that reads the serial flash and moves the contents into RAM and then jumps to the starting address. The bootloader must be customized for the particular serial flash device chosen.

TigerSHARC Processor Architectural Features | Analog Devices
 

BobTPH

Joined Jun 5, 2013
11,463
On early computer systems, there was no such thing as ROM or flash memory. To bring up the computer, you actually needed to enter a small program in binary through switches on the panel. That program would then read the OS from some medium like magnetic tape. That was the original meaning of a boot loader.

Consider today an embedded microcontroller deep inside a huge complex machine, but connected to the internet. When you want to update the firmware on it, you need to disassemble the machine at great cost.

Or, you could equip the controller with a bootloader that can update the firmware through the internet connection. That is the modern idea of a bootloader.
 

Papabravo

Joined Feb 24, 2006
22,058
On early computer systems, there was no such thing as ROM or flash memory. To bring up the computer, you actually needed to enter a small program in binary through switches on the panel. That program would then read the OS from some medium like magnetic tape. That was the original meaning of a boot loader.

Consider today an embedded microcontroller deep inside a huge complex machine, but connected to the internet. When you want to update the firmware on it, you need to disassemble the machine at great cost.

Or, you could equip the controller with a bootloader that can update the firmware through the internet connection. That is the modern idea of a bootloader.
The DEC mini-computes of the era 1964-1974 used paper tape readers and the small program keyed in through the front panel was called the Read In Mode (RIM) loader.
 

BobTPH

Joined Jun 5, 2013
11,463
The DEC mini-computes of the era 1964-1974 used paper tape readers and the small program keyed in through the front panel was called the Read In Mode (RIM) loader.
Yep, I worked at digital starting in ‘78. They could boot off a hard drive by then. We each had our own RP05 5 Mbyte removable disc with whatever OS we were using.
 

nsaspook

Joined Aug 27, 2009
16,249
The DEC mini-computes of the era 1964-1974 used paper tape readers and the small program keyed in through the front panel was called the Read In Mode (RIM) loader.
The military was using paper tape (Mylar actually) for boot loaders into the 80's on tactical computers.
1703175184048.png
I repaired and operated the UYK-20 data system. We used them for UHF satellite communications in the 70's. Core memory with EMP protection, solid as a tank.
 

MrChips

Joined Oct 2, 2009
34,625
From continually usage, I had committed to memory the binary bootstrap loaders for DEC PDP-8, PDP-15, and DG NOVA 2 mini-computers.

Before IDEs became readily available, I wrote my own code assemblers and bootloaders for MC6800, MC6809, MC68HC11, Atmel AVR MCUs.
 

MrChips

Joined Oct 2, 2009
34,625
What is a bootloader?

All computers require executable code in order for it to run. How do you get the first functional code into a computer's memory?

In the years before embedded MCU systems, the processor was separate from the memory. Thus, code was written into ROM, PROM, EPROM, or UV-EPROM chips from which the μP was able to receive its instructions. (This is the BIOS ROM in a PC.)

ROM - Read Only Memory
PROM - Programmable Read only Memory
EPROM - Erasable Programmable Read Only Memory
UV-EPROM - UV Erasable Programmable Read Only Memory
BIOS - Basic Input/Output System

Before the advent of IC memory, computer memory was created using tiny magnetic toroids, known as core memory. Since magnetized core retained its magnetization even without power, the stored program was intact on a power off and on cycle. This is known as non-volatile memory.

How does one get the code into the core memory in the first place? This was done manually by entering binary data via toggle switches on the computer's front panel (or console). Thus, the goal here is to create the shortest program (usually no more than 12 instructions) that will read data from a mechanical device (in this case, a paper tape reader) and load it into sequential locations of memory. This manually loaded program is called the Read-In Mode loader or bootstrap loader. The bootstrap loader loads in a program called the binary loader.

What is the function of the binary loader?

The binary loader is used to load the application program. The binary loader checks for errors and handles different memory allocations.

Microcontrollers

Microcontrollers have built-in memory. There is no way to access the internal memory directly. The MCU manufacturer has to provide a built-in mechanism in order to program the MCU's memory. This can be implemented via it's internal UART, SPI, or JTAG programming port. This mechanism is used to get the first functional program into SRAM or flash memory in order to then load an application program. This is the function of the binary loader or bootloader is it is known today.
 

nsaspook

Joined Aug 27, 2009
16,249
"As an illustration of the overall speed of the machine: Using Simple
Code, a 30 X 30 matrix can be inverted in 63 minutes."
Those were the days :)
A speed daemon.
https://www.tomshardware.com/pc-com...formance-computer-launched-sells-out-promptly

A newly launched single board computer (SBC) kit allows the buyer to assemble and run a 1-bit CPU. Japan’s Switch Science released the 1-bit CPU assembly kit last week, boasting that it is “one of the world's top-class low-performance computers.”
https://en.wikipedia.org/wiki/Motorola_MC14500B
 
Last edited:

Thread Starter

Kittu20

Joined Oct 12, 2022
511
Microcontrollers have built-in memory. There is no way to access the internal memory directly. The MCU manufacturer has to provide a built-in mechanism in order to program the MCU's memory. This can be implemented via it's internal UART, SPI, or JTAG programming port. This mechanism is used to get the first functional program into SRAM or flash memory in order to then load an application program. This is the function of the binary loader or bootloader is it is known today.
It seems when loading code into a microcontroller, we can use a bootloader or a hardware programmer. Bootloaders are software program that allows code updates without extra hardware, while programmers directly write code to the microcontroller's memory, offering more control but requiring additional hardware.
 

BobTPH

Joined Jun 5, 2013
11,463
offering more control
Not sure what you mean by this. The bootloader will reserve some memory that cannot be overwritten by the program loaded, but other than that is not more restricted in what it can do unless it was designed that way.
 

sagor

Joined Mar 10, 2019
1,046
Besides loading basic bootloader into PDP-11 systems, a similar function existed in early computers. Code would be stored in EPROM (ROM) that would execute when powered on (or reset) that would start the boot process. A common one that I wrote was a monitor/BIOS for CP/M 56k, where the boot code that was loaded was located at F000H. "Power on" or reset would make the cpu jump to that address.
 
Top