-2

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?

9
  • The answer is yes, and communication is done via device drivers.
    – DavidPostill
    Commented Jul 2, 2020 at 8:45
  • So if for example AMD has a new architecture, should they wait for Linux, Windows and MAC to "specialize" in that architecture too before they can sell their new architecture?
    – isma
    Commented Jul 2, 2020 at 9:27
  • The motherboard and chip manufactures provide device drivers initially with their products.
    – DavidPostill
    Commented Jul 2, 2020 at 9:31
  • See Where to Find Intel® Processor Software and Drivers for example.
    – DavidPostill
    Commented Jul 2, 2020 at 9:32
  • "Software support for your processor is included in your motherboard's BIOS. Contact your motherboard vendor for your board's latest BIOS."
    – DavidPostill
    Commented Jul 2, 2020 at 9:33

1 Answer 1

1

Intel and AMD x86 (and x86_64) are the same processor "architecture" as far as an operating system is concerned. The "core" instruction sets are identical and define a minimal level of processor functionality.

The processors may operate completely differently internally or even physically, but as far as the machine code (hex bytes) for instructions are concerned they are identical. They have the same external architecture (x86), but different internal architectures, (often referred to a uArch or microarchitectures).

As a result the initial handover from system firmware (UEFI), which does basic motherboard bring-up and processor initialisation, to operating system is identical across AMD and Intel as the same instructions to load bytes and choose code paths will be the same. Once the boot code is run it can begin to load libraries which can detect CPU extensions and run optimised code depending on what it finds.

ARM and x86 are entirely different architectures both internally and externally and the same machine code bytes will produce entirely different or non-functional code, as such the boot executable will have to be compiled to target the specific architecture it is run on in order to generate the correct machine code.

8
  • But ARM has it's own operating system, right? I mean, you can't use Ubuntu in an ARM processor, right? And where is the firmware of a hardware located? Is it located in the motherboard?
    – isma
    Commented Jul 2, 2020 at 10:15
  • 1
    ARM is a processor architecture and you can indeed run Ubuntu on it but as I say it must be compiled to run on that architecture. Processor architectures don't have operating systems, we write operating systems to run on them. The firmware is indeed a motherboard component, usually a memory device containing initial instructions for the system to begin initialising components and hand over to an operating system in a predictable and manageable way so that operating systems don't have to know about how to bring up a processor from absolutely nothing.
    – Mokubai
    Commented Jul 2, 2020 at 10:20
  • And when is that compilation to ARM done? Is it done when you download Ubuntu software (I mean, you download ubuntu software compiled for ARM)? Is it done 1 time manually? Is it auto-compiled each time you turn on the computer? Is it auto-compiled the day you install the OS for the first time?
    – isma
    Commented Jul 2, 2020 at 10:26
  • 1
    Compilation is done long before you get near the data that is the operating system you run. It is the image that is supplied for you to install the computer operating system. You don't compile anything, the people who know how to make their system run on that platform do.
    – Mokubai
    Commented Jul 2, 2020 at 10:37
  • And that mean that the compilation is auto-done AFTER the download of the OS (and IN THE MOMENT of the installation of the OS) or, when you download the OS, you are downloading an ALREADY compilated version for the architecture you are choosing?
    – isma
    Commented Jul 2, 2020 at 10:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .