-3

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.

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
Nassim Assaf
  • 773
  • 5
  • 5
  • 1
    The x86 and AMD chips have a common set of compatible CPU instructions (as well as some chip-specific extensions). Windows doesn't run on an arbitrary CPU and it would take significant effort to port it to one not compatible with one of the architectures it currently supports. – Eric J. May 09 '20 at 06:12

1 Answers1

3

"32 bit Windows" only runs on PC's with X86 32 bit processors. Windows includes drivers for various motherboards and devices, and can install drivers from CD or USB for devices not already supported by drivers included with the Windows install.

Some versions of Windows can run on multiple platforms, but require a Windows built specifically for that platform. The most common case of this is current versions of Windows that are either 32 bit (runs on X86) or 64 bit (runs on X86 X64). Windows NT 4.0 has versions for Alpha, MiPs, PowerPCs and PCs in 32 bit mode. XP was the first Windows to have a X64 version, and it can also run on Itanium. Windows 10 has versions for ARMV7 and ARM64 in addition to its 32 bit (X86) and 64 bit (X86 X64) builds.

rcgldr
  • 27,407
  • 3
  • 36
  • 61