I'm aware that as a part of the startup / booting process the firmware initializes the peripheral devices' BARs to assign them address ranges in the CPU's memory space. The CPU then sends those addresses to the memory controller to "talk" to those devices just like the CPU would send an address to the memory controller to grab data from RAM.
So, for example, if you write a program that tells the CPU to grab some data from a peripheral and put that data into a register the source code for that instruction would compile into a simple 'mov' instruction in machine code.
But, how can you run the same program over and over after rebooting the system when the firmware might not assign the same address for the pertinent peripheral?
What I mean is, if you want to grab the data from a register on peripheral device A and this time the register has been assigned address a12f, but after the next boot it has been assigned the address c03b, how can the same precompiled code run successfully?
So, for example, if you write a program that tells the CPU to grab some data from a peripheral and put that data into a register the source code for that instruction would compile into a simple 'mov' instruction in machine code.
But, how can you run the same program over and over after rebooting the system when the firmware might not assign the same address for the pertinent peripheral?
What I mean is, if you want to grab the data from a register on peripheral device A and this time the register has been assigned address a12f, but after the next boot it has been assigned the address c03b, how can the same precompiled code run successfully?
Last edited: