Although the Internet of Things, or IoT, has provided great promises, it is always a challenge to build IoT systems solutions considering variable hardware platforms and user requirements. The use of an operating system, or OS, can solve this challenge. Further, most modern IoT devices run complex tasks that need an OS to manage resources and schedule tasks efficiently. Ryan discusses the motivation for using an OS and the advantages of employing an OS to build an IoT solution.
- [Instructor] The operating system is the most important computer software that manages hardware and software resources. IoT systems are essentially computer systems containing the key components, such as processors, memories and I/O devices, including storage devices, radio interfaces, sensors, actuators, et cetera. Many IoT and smart devices are using an OS for multiple applications across industry verticals.
With an OS, these devices today tend to do more complex jobs than before. These jobs need to be efficiently handled. An operating system takes the road of reducing the barrier of managing tasks and their resources, providing the interfaces for various hardware and software components. Let's see the scenario when no OS is used. Programmatically, it's possible to develop a program, up and running, without an OS.
But we need to handle everything, including different tasks ourselves. We basically need to take care of a program from its start to its end, before it is power cycled. If you view such program in a flow chart, we need to put all task logics into one infinite loop in order to keep it running. This approach is called super-loop. In this way, if you want to do two tasks, such as reading the ambient temperature values from the sensors as task A, and processing and displaying the temperature histogram over time as task B, we need to put the two tasks into one loop.
Of course, if we have more things to be done, we need to put them in the loop, as well. In this approach, if you want to respond to realtime events, which is usually the case, we can still do so through, for example, an interrup, which is an event triggered by the software or hardware component requiring immediate responses by the program. If we use another task C, like a service routine, to handle such interrupt, this can be illustrated in this flow chart, where the loop will be suspended in order to execute task C, and then resumed to run.
All seems fine, unless things get more complex. For example, we may have to deal with multiple interrupts and multiple tasks, where they often need to share data between them. All these need to be carefully scheduled. But with the super-loop approach, things are getting out of control easily, and codes get difficult to extend. Any changes made may cause your program unstable or erroneous.
That complex scenario we've mentioned is exactly what today's IoT systems are facing. Today's software on IoT systems required to run on a single device is sophisticated. For IoT applications, we need some network connectivity options such as wifi, Bluetooth, cellular, 6LoWPAN, CAMBAS, et cetera, as well as the device management capabilities.
We may also need to store data into our memory and a permanent storage device with a file system. We may need to have a graphic user interface on the display, and some mass-processing capabilities, et cetera. At the same time, we also want the program to run smoothly and efficiently on a processor. At a high level, using an OS will benefit our IoT solutions, in terms of the OS-centered technology ecosystems.
An OS-centered technology ecosystem can enable us to use an application development framework on top of an OS, able to be integrated with third-party software frameworks, libraries and device drivers. All these can help use a custom solution easier and better. Next, the ecosystem can allow us to get a range of the out-of-the-box support. For example, an OS port can be available for some processor and hardware platforms.
Third, with the ecosystem, we can get support from an OS or platform vendor and the user communities. These include tools, software updates, user guides, application notes, tutorials and support forums.
- OS characteristics for IoT
- OSs for resource-constrained devices
- Linux OSs and Windows 10 IoT Core
- Main features of FreeRTOS
- Task schedulers and task management
- Intertask communication
- Allocating dynamic memory
- Debugging your OS-based applications