I hope this isn't the dumbest question ever, but on my journey to learning about creating an OS, I thought about this and no amount of research is getting me anywhere.
How is it, when you install Windows on your computer, it just works, regardless of the underlying processor?
Let's say you have a 32-bit copy of Windows. How is it able to be run on every 32-bit CPU if the architecture is different per CPU? I see alot of resources saying bootloaders (where your OS starts booting), are written in assembly (which is tied to your processor instruction set). In that case, why is a Windows 32-bit OS able to run on Intel x86 as well as AMD?
For example, if I wrote a bootloader in x86, I can eventually make an ISO and boot it as my "primary" OS. But wouldn't that be tied to the CPU I wrote it for? So if I was a big company, how would I make my bootloader work for other CPUs?
Thanks! Sorry if it's a vague or repeated question, but I honestly could not find the answer.