From the course: IoT Foundations: Operating Systems Fundamentals

Why do we need OSs?

- [Instructor] The operating system, or OS, is the important computer software that manages hardware and the software resources. IoT systems are, at their core, computer systems that incorporate key components such as processors, memory, and input/output or I/O devices. These include the storage devices, radio interfaces, sensors, and actuators. Among them, sensors and actuators form the foundation of IoT systems, enabling a wide range of practical applications. Many IoT and smart devices rely on an OS to support multiple applications across verticals. With the integration of an OS, these devices are now capable of performing more complex tasks than ever before. To ensure efficiency, these tasks must be efficiently managed. The OS plays a critical role in handling system resources and the task scheduling, while also providing interfaces for both hardware and software components. Let's consider a scenario where no operating system is used. It's entirely possible to write a program that runs without an OS. However, in this case, we have to manage everything manually, including handling multiple tasks and their coordination. Essentially, we're responsible for controlling the entire lifecycle of the program from start to end. When visualized in a flowchart, such as a program requires placing all task logic within a single infinite loop to keep it running continuously. This approach is called the super-loop architecture. For example, if we have two tasks, task A, reading ambient temperature values from a sensor and the task B processing and displaying a temperature histogram over time, both tasks will be placed within that single loop. As more tasks are added, they're also included in the same loop. In this approach, we can still respond to real-time events using interrupts, signals from hardware or software that require immediate attention. A separate task like task C can handle the interrupt, temporarily suspending the main loop before resuming. These works for simple cases, but as complexity grows with multiple interrupts and the tasks sharing data, scheduling becomes tricky. The super-loop approach quickly becomes hard to manage, making the code difficult to scare and prompt to instability with any change. The complexity we mentioned earlier reflects the reality of today's IoT systems where software and the tasks are more sophisticated than before and the various functionalities are expected on a single IoT device. Modern IoT devices often require advanced software to handle networking such as Bluetooth, 6LoWPAN, wifi, cellular and canvas, device management, data storage with file systems, graphical user interfaces, AI, and the data processing, all while running efficiently on limited hardware. Additionally, the wide variety of IoT devices brings diverse system requirements that must be considered. At a high level, using an OS will benefit our IoT solutions in terms of the OS centered technology ecosystem. An OS centered technology ecosystem enables the use of application development frameworks built on top of the OS with support for integration with third party software frameworks, libraries, and device drivers. These simplifies and enhances the development of custom IoT solutions. Next, the ecosystem can provide a range of out of the box support. For example, OS ports may be readily available for specific processors and hardware platforms. Third, the ecosystem offers support from the OS or platform vendor as well as the user community. These include tools, software updates, documentation, application nodes, tutorials, and access to support platforms. Last, it supports faster product prototyping, shortens the time to market and allows for better adaptation to evolving user requirements. In summary, as IoT systems grow more sophisticated, relying on an OS becomes essential, and OS not only manages the increasing complexity of task and hardware interactions, but also unlocks the benefits of a rich supportive ecosystem.

Contents