When the system starts the BootROM has no idea about the external RAM. It can only access the Internal RAM of the the CPU. So the BootROM loads the primary bootloader from the boot media (flash memory) into the internal RAM. The main job of the primary bootloader is to detect the external RAM and load the secondary bootloader into it. After this, the secondary bootloader starts its execution.
Really a good answer thanks a lot
ReplyDeleteThat's not the main reason. The main reason for having two stage bootloaders is that in many systems you will not be able to fit the entire bootloader in the available internal SRAM space. If you can trim your bootloader to fit in the available SRAM space then you do not need two stage bootloaders. In case of multi-stage bootloaders, first stage bootloader will initialize DRAM and the further stage bootloader will do the rest of the initialization. If you have enough SRAM space or you can trim and have all the functionalities in single stage bootloader then there is no need for second stage, you can boot Linux Kernel straight away.
ReplyDelete