While the bare-metal, single-thread approach is still the most popular when designing embedded solutions, many systems can benefit from multitasking scheduling, centralized resource management, and a safer environment; several existing implementations are available to select an operating system that works well with the specific design.
Building a scheduler tailored to a custom solution from scratch is not impossible and, if done properly, would provide the closest approximation of the desired architecture, while focusing on the specific characteristics offered by the target hardware. In a real-life scenario, however, it is advisable to consider one of the many open source embedded operating systems available and ...