Why FreeBSD is the right choice for embedded devices
klarasystems.comI clicked thru to read what is it about FreeBSD that makes it better for embedded systems programming. What I got was a rant against the GPL. That tells me nothing to why I should use FreeBSD for my next project.
The BSD vs. GPL "war" has been going on for over 30 years now. There's nothing new to see here.
Embedded systems builders prefer non-GPL foundations in order to legally restrict access to their custom source code. Of course, that is a business decision. Tech-savvy buyers often prefer open access to the source code of the stuff they buy.
Apple, for example, uses an old derivative of FreeBSD and has added numerous proprietary extensions. For the majority of buyers that is fine.
I'm sure FreeBSD is amazing but this article is light on important details for embedded engineers.
Which chips support FreeBSD? How do you build an embedded computer with FreeBSD?
Case in point, I know Microchips SAM9x line has large 0.8mm pitch BGA and is relatively easy DDR2 support with exceptionally easy startup / power sequencing. Finally, https://www.linux4sam.org/ has Linux builds and device drivers such that GPIO and ADC is as easy as reads and writes to /dev/ADC device files.
Does any chip manufacturer offer FreeBSD BSP support that makes life that easy?
Many, many embedded devices run Linux and the GPL does not matter.
The OS is usually generic, it does not matter whether it is GPL or BSD as long as specific drivers and apps can be proprietary. That's how many embedded devices work: they run proprietary apps in generic Linux with perhaps some proprietary drivers.
Where the OS licence matters is if/when you want to modify the OS/kernel for whatever reason.
You could edit replace FreeBSD with NetBSD or OpenBSD and deliver a comparable message.
I prefer NetBSD because it runs on more hardware.
Other than the GPL issue, the many variants of BSD are tuned to specific requirements, e.g. OpenBSD for greater emphasis on security out of the box, Dragonfly BSD for multiprocessor systems.
The Wikipedia page: https://en.wikipedia.org/wiki/Comparison_of_BSD_operating_sy... provides a good overview of the numerous options.
The question that is coming increasingly urgent for me is, what is the simplest system that can meet my need for X over Y time period?
Systems in the field might run for ten years and get patched only rarely even as the line cards or PSUs or whatever get replaced underneath them. I need things like A/B OS images, bulletproof but grokable IP stack and tools, and a userspace that can be shrunk down to as little as I want, when I want. No little obscure binaries left on the disk, everything must only be there because I want it there.
I am increasingly drawn to the BSDs, as the idea of subtracting big chunks of Linux in order to build an OS base for such platforms is frankly terrifying. (Hence, busybox and friends, but thats only a small part of the solution.) BSDs seem to do a better job of identifying what is essential and what is not, and the development seems less gigantically complex (Linux is rather Borg-like today, not like in 1995.)
This is less a pro-FreeBSD in embedded systems article and more of an anti-GPL in embedded systems piece.
If that’s not what you’re here for, then saved you a click.
I might agree somewhat with the comments so far about the article lacking specificity for why FreeBSD is a far better choice that Linux. Of course, I cannot write an entire article in my comments but this topic has been floated to me recently as a article I should write.
I've been a user of FreeBSD since the mid 1990's when I used it on servers that powered the ISP I ran. For operational environments I love that you can simply take FreeBSD to the bank everytime because it always has your back. It purrs like a kitten once configured and unlike people believe, its very easy to configure. It combines brick wall stability, top of the line performance, and incredible flexibility if you can program.
FreeBSD follows a clean separation of the base OS and userland, making it very easy to strip down unnecessary components for embedded use. So is a minimalist customizable kernel a reason that makes it an excellent embedded systems programming candidate? You betcha. For fun I used to rewrite large parts of the UNIX kernel customizing so many different functions.
TinyBSD/NanoBSD offer specialized FreeBSD-based lightweight distributions that are already optimized for embedded applications. Linux? Fails.
Free BSD offers a monolithic kernel with modular components that are optimized for performance while allowing dynamic module loading. FreeBSD offers advanced file systems (ZFS & UFS2) so your choice of high reliability and/or lightweight and stable. The FreeBSD TCP/IP is well-optimized over many decades making it ideal for embedded networking devices. The low jitter & deterministic performance are ideal for real-time or latency-sensitive applications such as industrial control systems.
Yes, the Open-Source & Permissive licensing are important but not as important as FreeBSD's preemptive multitasking, which is essential for real-time applications. Some real-time OSes, like RTEMS integrate FreeBSD's networking stack because it so darn near perfection. Common Address Redundance Protocol (CARP) provides high availability, which is useful for mission-critical embedded systems.
Now I could go on and on or we could start getting down to bits and bytes but FreeBSD is used by people IN THE KNOW who want performance and stability. It's simply a fact.
If you are interested, there is also a new startup built on FreeBSD but built for desktop users who want the GUI. It's better than Ubuntu by far and still comes with the built in stability of FreeBSD that just works day after day, week after week, year after year.
However, it has some drawbacks. No reinstalling the OS everytime you turn around because some new - heedlessly written - code has hosed up the operation so bad reinstallation is the only choice.
One thing for sure, its not about the true Open-Source licensing. Nope.