You definitely don&#x27;t have to write your own an OS. You use existing tools, for example FreeRTOS. It&#x27;s surprisingly simple.<p>With a microcontroller, you can have a pretty much complete understanding of the whole machine.<p>All you need is a basic knowledge of C, and most of the people who would solder stuff to a Raspberry Pi already have that or are willing to learn.<p>Say you&#x27;re making a thermostat. By convention, you leave address 0x0 empty, since dereferencing the NULL pointer is bad form :) At address 0x4 you have a int containing the target temperature. At address 0x8 you have a int containing the current measured temperature. Your whole app uses 8 bytes of memory, plus a few more for the stack.<p>You write a loop. It reads a few GPIOs, updates those two values, does a bit of logic to decide whether to turn on the heat, then writes one more GPIO to turn the heater on or off. GPIOs are &quot;general purpose IO&quot;, metal pins that can be individually set to, say, +5V or 0V.<p>The beauty of this is that if you write it cleanly and debug it and test it once, it will work perfectly forever.<p>It will never throw up a popup that says &quot;a new version of Ubuntu is available&quot;. It will never ask you to download 80MB of Java. It will never auto update. The server will never go down, because there is no server.<p>It feels totally different from typical software development. You&#x27;re writing a bit of C, but you&#x27;re not making an &quot;app&quot; with all the complexity and flakiness that entails. You&#x27;re creating an embedded device.<p>And a wise man once said... &quot;Hardware eventually fails. Software eventually works.&quot;<p>---<p>PS, here&#x27;s a fire alarm that runs Linux.
<a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=BpsMkLaEiOY" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=BpsMkLaEiOY</a><p>Complexity is cheap now. You can get a full Linux PC with systemd, X11, Gnome, DBus, Java installed, the full works for $5 and in a tiny form factor. You <i>could</i> make a thermostat that way---but just because you can doesn&#x27;t mean you should!