I know that Linux is available and has been ported for many different platforms such as for X86, ARM, PowerPC etc.

However, in terms of porting, what is required exactly?

My understanding is that Linux is software written in C. Therefore when porting Linux originally from X86 to ARM or others for example, is it not just a matter of re-compiling the code with the compiler for the specific target architecture?

Putting device drivers for different peripherals aside, what else would need to be done when porting Linux to a new architecture. Does the compiler not take care of everything for us?