Linux has the largest collection of various hardware drivers, and a rather wide community of kernel developers who know how to produce them.
Linux has a number of specialty filesystems, some pretty important for embedded development.
Linux kernel has real-time extensions, which is not entirely a commodity, AFAICT.
Also, stuff like io_uring, BPF VM inside the kernel, namespaces (see "containers"), etc.
No, I don't think you can easily replace Linux kernel with whatever BSD kernel, Darwin, VxWorks, Contiki, FreeRTOS, etc, or, well, Windows. Much of the larger embedded stuff is Linux-specific, and much of big server stuff is either Linux-only or has extensive specific support.
> Various versions of NT family operating systems have been released for a variety of processor architectures, initially IA-32, MIPS, and DEC Alpha, with PowerPC, Itanium, x86-64 and ARM supported in later releases.
> In order to prevent Intel x86-specific code from slipping into the operating system, due to developers being used to developing on x86 chips, Windows NT 3.1 was initially developed using non-x86 development systems and then ported to the x86 architecture. This work was initially based on the Intel i860-based Dazzle system and, later, the MIPS R4000-based Jazz platform. Both systems were designed internally at Microsoft.
Tell that to your BIOS or the firmware that runs on your WLAN or NVMe. Hell, tell that to the CPU itself[^1].
[^1]: https://en.m.wikipedia.org/wiki/Intel_Management_Engine
Sour grapes.
> Linux is the go to choice when you could just as well be using something else that’s really cheap, like BSD.
You actually couldn't be just as well using BSD. Corporations would love to be able to take Linux and not contribute their changes back (and that's frequently what happens when they use it internally but don't distribute it). They don't use a BSD licensed kernel in many such places (e.g., Android) because Linux is more advanced.
More advanced in what sense? There are lots of devices using BSD, so that's entirely possible.
Taking one off the top of my head that was relevant around the time Android was being developed, dynamic ticks which is important for low power operation. Linux supported this in 2007 about 5 years before FreeBSD and I think NetBSD still doesn't support it. Could not field a phone OS without that, at least not back in those days.
However, desktop Linux is where the product is 100% OSS. That’s the apples to apples comparison. And that’s where it can’t compete without vendors writing property code to put in front of it to make it actually work well.
Server side Linux gets a lot of support from professional programmers paid by big corps. They have improved it beyond hobbyist level, and it works pretty well. And of course cheap makes up for a lot.