Skip to main content

Mac, Linux or BSD

The eternal question:
Which is better - EMACS or Vi?
OK, this post is actually about the other eternal question!
As I use Linux, Mac, Open and Free BSD (Yes, and that other ball of wax too...), I think I can answer objectively:
Both OpenBSD and FreeBSD are reasonably easy to download, install and run on pretty much anything. At least, I have not found a server/desktop/laptop computer that it would not run on.  I even ran OpenBSD on a Sparc Station - remember those?

OpenBSD

Theo De Raadt has a 'cut the nonsense' mentality so OpenBSD is simpler, with a smaller repository of programs, about 30,000 packages. However, with a little effort, you can install FreeBSD software on OpenBSD to get the rest. After a few days of use, you will know how.

The best OpenBSD book is Absolute OpenBSD: UNIX for the Practical Paranoid.

In general, OpenBSD feels a lot like Slackware Linux: Simple and very fast.

FreeBSD

FreeBSD can also with some effort, run Linux programs and you can use a virtualizer to run other systems, so you are never locked into one thing.

FreeBSD has a gigantic repository of about 50,000 programs and it has very good documentation in the online FreeBSD Handbook.

MacOS

Compared to OpenBSD, Dragonfly and Slackware, some distributions look fancy and are very slow - there are many reasons why - see below.  MacOS obviously falls into the fancy and slow category. So if you want a Mac replacement then you first need to decide whether you want a fancy or a fast system.
My preference is to install a reasonably fast system on the host, then use a virtualizer for experiments and work and I frequently run multiple systems at the same time.  All the BSDs are good for that, be it Open, Free or Mac.
My home use system is a Macbook Pro running the latest MacOS with the Macports and Homebrew software repositories.  I even have the XFCE desktop installed, so when I get annoyed with the overbearing Mac GUI, I run XFCE, to get a weirdly satisfying Linux-Mac hybrid.


Linux

Linux is the step child of UNIX, which took over the world.  Of the Top 500 Super Computers, all now run Linux.  My work engineering system is an ancient Dell T420 running the latest Fedora Linux on the host.  All my machines have Virtualbox and a zoo of virtual machines for the rest.

Note that the Mandatory Access Control security systems on Red Hat and Debian distributions slow them down a lot (in the order of 50%).  If you have to have a fast and responsive system and can afford to trade it for security, then turn SELinux or AppArmor off.

Latency

For the control and remote sensing systems of robots, aircraft and rockets, the worst case OS latency matters very much.  For low latency, nothing beats Linux, since the whole kernel and all spinlocks are pre-emptible.

On average, all OS's have the same interrupt service latency - a few tens of nanoseconds.  However, every once in a while, the latency will be much worse.  In the case of Linux, the worst case will be below 1 ms, but for Win10, it can can be 20 ms and for Win7, 800 ms.  The trouble in robotics and remote sensing, is that you need to design for the worst case.

I have observed a dotNet video player on Windows 7, after a couple days of uptime, stop dead for two seconds, every 8 seconds - obviously not good for a remote sensing application.  Windows 10 latency is much improved, though still a little worse than Mac OS, which has 2 orders of magnitude worse latency than Linux - see below for why this is.

See this very good real-time performance analysis: https://ennerf.github.io/2016/09/20/A-Practical-Look-at-Latency-in-Robotics-The-Importance-of-Metrics-and-Operating-Systems.html

(Intentional performance degradation was worst in Windows Vista and has been dialled back a bit since).

What is the Performance Problem with Windows and Mac OS?

It is not that MS and Apple don't know how to make a real-time OS.  They are not allowed to do it.

The reason why, is in the US export regulations.  Windows and Mac OS have a Mass Market Exemption (EAR 5D992.c).  This is necessary because MS, Apple and the US State Department simply cannot process billions of export licenses.

Some useful links:





The Mass Market exemption is described in the EAR (2-21.a., 1-5.A.4.a, 1-5.A.1.f, Cat 2, Cat 4, cat 6, cat 7) and MTCR (Group 6, 6-1.A., 6-19.A.1., 6-19.A.2.) regulations, and is defined in what a Mass Market OS is NOT allowed to do:
  • It is not allowed to do real-time processing of audio (Sonar).
  • It is not allowed to provide advanced networking and deep packet inspection (Network inspection).
  • It is not allowed to do precision tracking (of a missile or UAV).
  • It is not allowed to provide C4I video and meta data processing (Information from a missile, MALE or HALE UAV).
Items not specifically controlled, can also be controlled under section 744.3 of the EAR ("catch-all", or EPCI, controls). Items require an export license if they will be used in the design, development, production, or use of:
  • Rocket systems (including ballistic missile systems, space launch vehicles, and sounding rockets) or unmanned aerial vehicles (including cruise missile systems, target drones, and reconnaissance drones) capable of a range of at least 300 km for use in or by a country listed in Country Group D:4 (see  Supplement No. 1 to Part 738 of the EAR).
  • Any rocket system or unmanned aerial vehicles in a D:4 country where system characteristics or use are unknown.
  • Any rocket systems or unmanned aerial vehicles for the delivery of chemical, biological, or nuclear weapons to anywhere in the world, except by governmental programs for nuclear weapons delivery of the Nuclear Non-Proliferation Treaty Nuclear Weapons States that are also members of NATO.
So, in the extreme, if you use US chewing gum to glue together parts of a big missile, then the gum may need an export license.

Windows and Mac OS therefore contain special code to degrade the performance slightly when you try to process multiple video and audio streams - see the above paragraphs on latency.  With a single stream it works, so it is good for home use, or for a musical band, but it is not great for high performance systems.

If you would use Windows or Mac OS for one of the above disallowed functions, then MS and Apple are not allowed to support you and in the extreme, they may even be forced to completely boycott your country (North Korea, Iran...).

Free Open Source Software (BSD, Linux...) is covered under ITAR (120.10(b)) and EAR (734.3(b)(3)(iii)) and is allowed to do the above without requiring export licenses.  (The horse bolted, so there is no point in trying to close the gate now).


So, which OS is best? 
It depends on what exactly you need to do with your system...
:)
Herman

Comments

Popular posts from this blog

Parasitic Quadrifilar Helical Antenna

This article was reprinted in OSCAR News, March 2018:  http://www.amsat-uk.org If you want to receive Satellite Weather Pictures , then you need a decent antenna, otherwise you will receive more noise than picture. For polar orbit satellites, one needs an antenna with a mushroom shaped radiation pattern .  It needs to have strong gain towards the horizon where the satellites are distant, less gain upwards where they are close and as little as possible downwards, which would be wasted and a source of noise.  Most satellites are spin stabilized and therefore the antenna also needs circular polarization, otherwise the received signal will flutter as the antennas rotate through nulls. The helical antenna, first proposed by Kraus in 1948, is the natural solution to circular polarized satellite communications.  It is a simple twisted wire - there seems to be nothing to it.  Various papers have been published on helix antennas, so the operation is pretty well ...

To C or not to C, That is the Question

As most would know, the Kernighan and Ritchie C Programming Language is an improved version of B, which is a simplified version of BCPL, which is derived from ALGOL, which is the Ur computer language that started the whole madness, when Adam needed an operating system for his Abacus, to count Eve's apples in the garden of Eden in Iraq.  The result is that C is my favourite, most hated computer language , which I use for everything. At university, I learned FORTRAN with punch cards on a Sperry-Univac, in order to run SPICE, to simulate an operational amplifier.  Computers rapidly lost their glamour after that era! Nobody taught me C.  I bought the book and figured it out myself. Over time, I wrote a couple of assemblers, a linker-locator, various low level debuggers and schedulers and I even fixed a bug in a C compiler - not because I wanted to, but because I had to, to get the job done!   Much of my software work was down in the weeds with DSP and radio modems...

Unlock CRA PDF Forms

Unlock Canada Revenue Agency PDF Forms It appears that there is a relatively new PDF feature to prevent casual copying and saving of a file and that some programs save PDF files with these foolish features active by default.  Many forms from the Canada Revenue Agency are locked in this way, which makes it difficult to do one's taxes, since one can fill the form, but cannot save it.  One can only print the form.  It should be possible to print to a file or export it to a new PDF file, but it is far better to reset the annoying anti-taxpayer flags, since the 'printed' form cannot be edited easily any more and I always manage to make a mistake or three that need to be corrected after review. If there is a Linux (virtual) machine handy, install qpdf and use it to reset the silly flags: $ su - password # dnf update # dnf install qpdf # exit $ qpdf --decrypt lockedfile.pdf unlockedfile.pdf One doesn't need a password to unlock these flags, so the fix is instant. La voila! He...