At boot time, the CPU will do what the ROM says to do, which is first check for a firmware.bin file, which is a binary program which runs in RAM and re-programs the ROM; if that is found, then load and run it. Otherwise, check for a bootable OS, and boot it if found. Otherwise, boot to the ROM monitor talking over the serial port.