Maybe this is a basic theoric question, but I have no idea of the answer and haven't found information of this.
Do Operating Systems (imagine Windows or Linux distros) need to know if they are executed in one microarchitecture or in another one (for example on Intel Sandy Bridge architecture or on Intel Haswell architecture)? Or the OS has no idea of this details?
The fact that the operating system is the "bridge" between the user and the microprocessor architecture has made me think that the OS does need to know those details because perhaps there are certain things about the OS that do not run identically on an Intel Sandy Bridge than in an AMD Bulldozer.
If the answer is yes, how does the hardware communicate to the OS which is its architecture?