The basic principle of any operating system (OS) is to provide the development of reliable application software by providing a convenient and safe abstraction of hardware resources. In PCs and servers, the OS allocates application processing threads to processors, virtual addresses to locations in memory, and manipulates disks, networks, and peripherals on the application's behalf. 

TinyOS in IoT - Overview

TinyOS was introduced by Jason Hill at the University of Berkeley in 2000. Since is an open-source, BSD-based operating system that uses the nesC programming lang to control and manage wireless sensor networks (WSN). The sensor devices (called m in such networks are characterized by low power, limited memory, and very small fr factor. TinyOS is essentially built on a "component-based architecture" to reduce co-size to around 400 to 500 bytes and an "events-based design" that eliminates even a command shell. The components-based architecture C programming language is designed for networking embedded systems. Each code site- consists of simple functions placed within components and complex functions integrating all the components together. TinyOS has been adopted by thousands of developers worldwide, on many platforms, for a broad range of wireless sensor networks. 

Applications of Tiny OS 

  1. Environmental Monitoring: TinyOS systems can be embedded in a small sensor, they are useful in monitoring air pollution, forest fires, and natural disaster prevention. 
  2. Smart Vehicles: smart vehicles are autonomous and can be understood as a network of sensors. These sensors communicate through low-power wireless area networks (LPWAN) which makes TinyOS a perfect fit. 
  3. Smart Cities: TinyOS is feasible for the low-power sensor requirements of smart cities' utilities, power grids, Internet infrastructure, and other applications. Wireless sensor networks (WSNS) are embedded but general-purpose, supporting a variety of applications, incorporating heterogeneous components, and capable of rapid deployment in new environments. A typical TinyOS 'mote platform has 10 KB of RAM, and 100 KB of RÓM, and consumes 10 LA to 25 mA, depending on which components are active. 

TinyOS was designed specifically for WSNS. It introduces a structured event-driven execution model and a component-based software design that supports a high degree of concurrency in a small footprint, enhances robustness, and minimizes power consumption while facilitating the implementation of sophisticated protocols and algorithms. 

TinyOS is an embedded, component-based operating system and platform for low-power wireless devices, such as those used in wireless sensor networks (WSNS), smartdust, ubiquitous computing, personal area networks, building automation, and smart meters. It is written in the programming language nesC, as a set of cooperating tasks and processes. It began as a collaboration between the University of California, Berkeley, Intel Research, and Crossbow Technology was released as free and open-source software under a BSD license, and has since grown into an international consortium, the TinyOS Alliance. nesC (pronounced "NES-see") is an extension to the C programming language designed to embody the structuring concepts and execution model of TinyOS. It is a work scheduler and a collection of drivers for microcontrollers and other ICS used in wireless embedded platforms. 

TinyOS programs are built of software components, some of which present hardware abstractions. Components are connected to each other using interfaces. TinyOS provides interfaces and components for common abstractions such as packet communication and routing. sensing, actuation, and storage. 

TinyOS is fully non-blocking: it has one call stack. Thus, all input/output (/O) operations that last longer than a few hundred microseconds are asynchronous and have a callback. TinyOS uses nesC's features to link these callbacks, called events, statically. To support larger computations, TinyOS provides tasks, which are similar to a Deferred Procedure Call and interrupt handler bottom halves. This simple concurrency model is typically sufficient for I/O centric applications, but its difficulty with CPU-heavy applications has led to the development of a thread library for the os, named TOSThreads. 

Also, learn coding - code-TheCScience

Comparisons with Contiki OS, Tiny OS, and RIOT OS 

There are two other OSs, called Contiki OS and Tiny Os, which are suitable for IoT applications. But RIOT fares better when it comes to memory usage and support.

FeaturesContiki OSTiny OSRIOT OS
Minimum RAM and ROM needed <2kb <30KB <1KB <4KB <1.5KB 5KB
C and C++ support Partial No support (nestC Compiler) Full Support
Multi-threading No (Proto threads are used here) No Yes
Real-time capabilities No No Yes