If you're considering embedded OS options, please look at these two (completely free) projects from the Linux Foundation:
Yocto project creates a custom embedded distro based on your needs https://www.yoctoproject.org/
Zephyr supports hardware that can't easily run Linux https://www.zephyrproject.org/