Why does Linux run well on so many different types of machines - desktops, laptops, servers, embedded devices, mobile phones, etc? Is it mainly because the system is open, so any part of it can be modified to work in different environments? Or are there other properties of the Linux kernel and/or system that make it easier for this OS to work on such a wide range of platforms?
While openness is certainly part of it, I think the key factor is Linus Torvald's continued insistence that all of the work, from big to small, has a place in the mainline Linux kernel, as long as it's well done. If he'd decided at some point to draw a line and say "okay, for that fancy super-computer hardware, we need a fork", then completely separate high-end and small-system variants might have developed. As it is, instead people have done the harder work of making it all play together relatively well.
And, kludges which enable one side of things at the detriment of the other aren't, generally, allowed in — again, forcing people to solve problems in a harder but more correct way, which turns out to usually be easier to go forward from once whatever required the kludge becomes a historical footnote.
From an interview several years ago:
Q: Linux is a versatile system. It supplies PC, huge servers, mobiles and ten or so of other devices. From your privileged position, which sector will be the one where Linux will express the highest potential?
A: I think the real power of Linux is exactly that it is not about one niche. Everybody gets to play along, and different people and different companies have totally different motivations and beliefs in what is important for them. So I’m not even interested in any one particular sector.
Linux scales to many different types of hardware because:
- it's very configurable
- the source is freely available, and can be built for any CPU that has a C compiler available
- processors in embedded devices and mobile phones have at least the same level or more power compared to the original 386 machines early Linux development was carried out on, and continue to gain power
- it works just fine with nothing but a network, some form of disk or disk-like device, and a serial port
The Linux Kernel scales well because that is what it is. The core kernel is relatively small and does what it need to do. Device drivers are optional and can be left out of the kernel for smaller systems. The beyond the minimal kernel requirements most functionality is implemented as optional features.
Take a look at the config file installed next to most kernels. It will list all the features which were turned on as well as which drivers are supported.
Drivers are supported either embedded in the kernel or as loadable modules. This allows a kernel to be dynamically configured to the hardware it is running on. This is the the approach used by many distributions.
Other than having the compilation tools, modifying the kernel for new hardware is relatively simple. For a new processor only the related code needs to be implemented as modifications to the existing functionality. New devices only require a new driver with the relevant hooks. New file systems are likewise relatively trivial modifications.
The code base has been well maintained to keep this flexibility without external forking. Conditional compilation drives a very flexible kernel which has been kept as minimal as possible.
I lack the detailed technical expertise to back up this answer, but my experience suggests that Linux scales well in comparison to other operating systems that I frequently use (primarily, Windows). So perhaps the question is why Windows does not scale as well as Linux.
If restating the question that way is still useful to you, I would suggest that market forces motivate Microsoft to add features and functionality geared to the latest and most capable hardware, because they sell more copies of the operating system primarily when end users buy new systems. So, at any point in time, I find that the latest release of Windows performs poorly on older, less capable hardware.
Forgive me if that oversimplifies your question.