Linux now supports real time too, even mainline. And there are open source RTOSes for smaller chips and critical applications like FreeRTOS.