LiteOS is an open-source, interactive, UNIX-like operating system designed for wireless sensor networks. With the tools that come with LiteOS, we can operate one or more wireless sensor networks in a Unix-like manner, transferring data, installing programs, retrieving results, or configuring sensors. LiteOS is written in C and runs on the Atmel AVR-based MicaZ and IRIS sensor networking platform. 

In 2015 Chinese telecoms giant Huawei developed an embedded operating system for the IoT also named LiteOS. The company says that its "LiteOS" is the "lightest" software of its kind and can be used to power a range of smart devices from wearables to cars LiteOS was not an attempt to compete with smartphone operating systems like Android or iOS either, but would instead be used to power a range of gadgets - for both businesses and consumers.

Huawei LiteOS

Huawei LiteOS is a real-time kernel-based lightweight operating system developed by Huawei for the IoT. The basic kernel of Huawei LiteOS is compatible with basic operating system components, such as task, memory, time, interrupt, queue, and event management components, communication mechanisms, and timers, to better support low power consumption scenarios. 

Currently, Huawei LiteOS has cooperated with more than 30 MCU and solution partners to launch a series of open source development kits and industry solutions, which help customers quickly launch IoT terminals and services. Such customers are involved in multiple industries, such as meter reading, parking, street lamp, environmental protection, bicycle-sharing, and logistics. Moreover, Huawei LiteOS provides developers with a one-stop software platform, lowering development requirements and improving development efficiency. 

Huawei LiteOS is an IoT-oriented software platform integrating an IoT operating system and middleware. It is an open-source operating system for IoT smart terminals. It supports ARM (M0/3/4/7, A7/17/53, ARM9/11), X86, RISC-V, and Microcontrollers of different architectures, following the BSD 3. 

Huawei LiteOS enables IoT terminals to quickly access the network. It will make intelligent hardware development easier. It provides a unified open-source API that can be used in IoT domains as diverse as smart homes, wearables, Internet of Vehicles (IoV), and intelligent manufacturing. It enables an open IoT ecosystem, helping partners to quickly develop IoT products and accelerate IoT development. 
liteos
Fig. LiteOS

Features 

  • Lightweight Kernels: Smaller Kernel Size, Lower Power Consumption, and Faster Response
  • Sensor Frameworks: Lower Delay, Higher Precision, and Intelligent sensing 
  • Connectivity Engine: More Protocols, Wider Connectivity, Intelligent Connection (Support NB-IoT, Wifi, Ethernet, BLE, Zigbee, and other different IoT protocols 
  • Operating Engine: Lighter Frameworks, Better Performance, and Intelligent Applications 
  • Optimizes performance and reduces power consumption by coordinating s frameworks, JS VMs, and OS 
  • Small-sized ROM with low memory usage: 
  • Provides independent user space and application separation to ensure application security 

The kernel of Huawei's LiteOS weighs in at a very light 10KB. Because of the compact size, the OS's fast start is down to milliseconds. The device is energy-efficient, helps devices conserve power, and can be powered by a single AA battery for five years, according to Huawei. Protocols supported for IoT devices include Zigbee and BLE, along with a number of cloud platforms. In contrast with Google's Android Things OS, LiteOS can be run on devices with much less powerful hardware. 

huawei liteos kernel
Fig. Huawei LiteOS Kernel

It contains operating system components based on task management, memory management time management, communication mechanism, interrupts management, and queue management. event management, timer, etc. It can run independently. 
  • Highlight real-time and stable
  • Ultra-small kernel, basic kernel size of less than 10 KB 
  •  Low power consumption 
  • Capable of Static function compaction 

Types of Modules 

Task 

Creates, deletes, delays, suspends, and resumes tasks, and can lock or unlock task scheduling. High-priority tasks preempt resources from low-priority ones. Tasks of the same priority share resources in a round-robin setup using time slicing. 

Task Synchronization 

  • Semaphore: creates, deletes, pends on, and releases semaphores. 
  • Mutex: creates, deletes, pends on, and releases mutexes. 

Hardware Related Functions 

Provides the following functions:
  • Interrupt: Creates, deletes, enables, and disables interrupts; clears interrupt request flags. 
  • Timer: Creates, deletes, starts, and stops timers. 

Inter-Process Communication (IPC) 

Provides the following functions: 
  • Event: Reads and writes events. 
  • Message queue: Creates, deletes, reads from and writes into message queues.

Time Management 

  • System time: Generated when an output pulse of a timer/counter triggers an interrupt. 
  • Tick time: The basic time unit used in OS scheduling. The tick length is user-configurable. Typically, it is determined by the system clock speed and represented in the form of ticks per second. 
  • Software timer: The timer length is measured in ticks. The Timer_Callback function (a function used to process timer expiry) is called when a soft tick interrupt is generated.

Memory Management

  • Provide two algorithms of dynamic memory and static memory. Allocates or frees memory statically using the Membox algorithm or dynamically using the SLAB algorithm and DLINK algorithm. 
  • Provides memory statistics, and cross-border detection memory.