How can a operating system run on more than one CPU architecture?

Does the OS detect what type of architecture it is currently running on? If so, does it simply use a different set of code for that architecture?

How does the CPU detect the type of architecture?


Operating systems don't detect the CPU architecture. Instead, you have to ensure that you install the correct version of the operating system given its CPU architecture. If you make the wrong decision, then the OS won't boot, as the CPU won't understand (either reject or misinterpret) the machine code that you've provided.

The reason's that an operating system is just a program written as a series of instructions for the CPU to execute. Since different types of CPU's have different instructions, a procedure (program) written (compiled) for one CPU could be gibberish for another.

| cite | improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.