Role of Operating System and Command Line Interface

Operating system


Section 1. 3

Addressing feedback provided in part 1 (4) 3

IoT OS for smart home. 4

Parameters used for selecting suitable IoT OS. 4

Advantages of suggested IoT OS with justification (4) 5

Hardware platform s for running IoT OS (2) 5

IoT –OS model and its main features for diverse applications (10) 5

Section 2. 8

Question 1: 8

Solution: 8

Question 2: 9

Solution. 9

Question 3: 9

Solution: 9

References. 10

Section 1

Addressing feedback provided in part 1 (4)           

Necessity of OS for IoT devices

IoT OS is the brain as well as central nervous system for IoT devices. OS is software that controls hardware. It manages system’s software, hardware and resources like storage, memory and processing [1]. OS for IoT devices are mainly designed based on specific demands and specifications. IoT OS is also called as embedded OS. It controls internet connectivity of the device, security, storage, networking, management of remote device and other needs of IoT device. Software and hardware can perform their operation through OS. IoT OS is important to enable the devices to run.  OS enables to connect devices with other devices as well as manages resources for collecting, transmitting and storing data. RIOT is real time operating system for IoT devices. It is an open source micro kernel OS. It is designed to support IoT and other embedded devices. It can provide support for low memory, low power hardware and high energy efficiency system.  It provides communication stack for wired and wireless network.

Essential features of OS tailored for IoT devices

IoT OS should support different hardware devices, architectures and boards. Various IoT OS are namely RIOT, Contiki OS and Zephyr [2]. The OS of IoT optimized with T-Transmission C-Control P-Protocol/I-Internet P-Protocol (TCP/IP) for connecting the device with global internet. OS should efficiently manage resources on communication layers. It also provides networking stack with UDP, TCP and HTTP. It gives support for IPv6 over L-Low P-Power W-Wireless P-Personal A-Area N-Networks -LoWPAN, R-Routing O-over L-Low Power and L-Lossy Networks-ROLL as well as Co-Constrained A-Application P-Protocol –CoAP. 

TinyOS is designed for W-Wireless S-Sensor N-Network –WSN and uses nesC. The language is hard for learning. Contiki is widely used among research community.  It requires low memory. It is well suited for low power devices. it is implemented suing the language C. It offers multithreading feature.  RIOT is developed for microkernel. It developed with the language C and C++. It supports multithreading, pre-emptive and priority based scheduling.

Zephyr developed by Intel. It gives microkernel for less power constrained devices and nanokernel for constrained devices. it supports for multithreading, pre-emptive, non-pre-emptive, priority based scheduling.

MbedOS is R-real T-time O-operating S-system-RTOS. It is designed by A-Advanced R-RISC M-Machine-ARM. MbedOS features are 6LoWPAN, Wi-Fi, multithreading, BLE, R-Radio F-Frequency ID- Identi?cation –RFI and so on [3]

Motivating applications of IoT devices

  • Smart home

The devices of home can be controlled through IoT devices. Security for home is most important when going for vocation or out of station. IoT can enable house owners to monitor their homes from remote location. The IoT enabled CCTV camera can send signals to home owners’ frequently which is used to detect abnormal activities in their home.

  • IoT in Agriculture

Watering for field is a regular activity for farmer. They cannot go to anywhere for their personal reasons.  He has to allocate alternate arrangements for watering their fields. IoT will become friend for farmer for doing such activities. Through mobile device, farmer can water their field by sending signals to the IoT enabled watering system.

IoT OS for smart home

Contiki is an operating system suitable for smart home. The OS invented in the year 2002 by research community. It is open source IoT OS [4]. It is suitable for running low power IoT devices and microcontroller. It supports both IPv4 and IPv6. It is implemented with the C language. It supports co-operative and pre-emptive scheduling for processes.  It offers network stacks that support IPv4, IPv6, RPL, 6LoWPAN as well as CoAP. It includes the features industry standard M-Medium A-Access- C-Control-MAC like Carrier Sense Multiple Access –CSMA, T-Time S-Slotted C-Channel H-Hopping-TSCH [5].

Parameters used for selecting suitable IoT OS                   

Contiki is an OS mainly developed for IoT. It gives support for low power, memory, processing power devices [7].  It performs the operations like management of processes, programs, memory, communication and resources. It is lightweight, flexible and mature. It supports standard and recent protocols such as uIP, Rime, uIPv6, RPL, 6LoWPAN, CoAP.  The main features of Contiki OS are as follows:

  • P-process and M-memory management (P&M Management)

It performs memory allocation for program and process suing the method malloc(). Due to limited size and processing capability of devices, it follows proto threads that minimize multi thread overhead.

  • C-Communication M-Management-CM

It manages the communication of IoT devices with local and global through TCP, HTTP, UDP, 6LoWPAN, CoAP.

  • D-Document S-system C-control-DSC 

Network simulator of Contiki is Cooja. It simulates large and small networks. Programming in Contiki will be done with the Cooja simulation that has libraries written in C language for sensors and RFID chips. Customized environment can be created with Cooja to control as well as monitor remote  IoT devices.

Advantages of suggested IoT OS with justification (4)

Contiki is open source light weight system written in C language. It is portable OS and builds for event driven kernel. It supports pre-emptive multitasking for each process. It consumes RAM with 2 kilobytes and ROM with 40 kilobytes [8]. It offers the following features like proto-threads, TCP/IP networking, multithreading (pre-emptive), GUI, PWS, web browser, virtual network, telnet client, multitasking. It provides the following advantages:

  • Instant development

IoT application can be developed more quickly through available libraries and simulation environment.

  • Internet standards

It supports for various standard protocols that enable communication for IoT devices for both local and global

  • Open source

The operating system is light weight open source system. It is available for both commercial and non-commercial purpose. It offers full source code at free of cost. It consumes limited memory to install on the system. 

  • Low power hardware

It gives support of low power IoT enabled devices.

Architecture of Contiki

It is modular architecture. The kernel of Contiki has scheduler for dispatching event to processes for running. The events will trigger the process to execute.

Hardware platforms for running IoT OS (2)

The OS requires below 30KB to install and run. It includes web server, browser, shell, telnet, calculator, client & daemon, ftp, email client and vnc viewer.  It requires 10 kilobytes of memory for RAM and 30 kilobytes of memory for ROM.        

The main components of IoT OS are as follows:

  • Hardware platform
  • Hardware abstraction
  • Kernel
  • System libraries
  • Network stack
  • Application

The main components of the OS model are hardware, Driver, core, Node management.

The architecture of Contiki is based on modular. The architecture is based on event driven. It provides threading option for process. Kernel has scheduler for dispatching events to running processes. Execution of process is based on the event trigger. The polling method of OS avoids race condition. Event handlers handle the scheduled events to run. OS can support both synchronous as well as asynchronous events. Immediate dispatch will be performed for the synchronous events to the process that will be scheduled. Asynchronous events will be dispatched later. Based on priority of events, polling mechanism will process the events.

Facilities of OS are communication, sensor data handling, device drives are offered as services. Each service has implementation and interface

Programming model

Contiki follows proto threads. It is applicable for low memory and capacity devices. Two bytes are consumed for proto thread. It does not support for interrupt handling and synchronization of process. With the help of library, OS supports on top of kernel pre-emptive multithreading.  The library of multi-threading has two parts such as platform dependent and independent part. 


The architecture is based on event. Events will be fired when the target applications arrive. Interrupt hander will be executed based on the priority of the application.

OS supports memory management & protection, protocol stack, resource sharing and providing support for real time applications.

Network Stack

Application layer

The application layer of IoT devices runs business application that activates the communication with IoT enabled device. The layer has the following protocols such as HTTP, MQTT, AMPQP, CoAP and XMPP.  The layer runs the interface such as IoT application.

Transport layer

Transport layer performs segmentation, transportation and multiplexing. In divides the data into smaller pieces before transmitting. The protocol TCP and UDP are used to establish logical connecting between sending and receiving host. It is end-end connection. Through multiplexing, it allows application to send and receive data simultaneously.

Network layer

The layer adds logical address with the data segment. Logical address has network and host address. Logical address is used to uniquely identify the system in the network.  After adding logical address, segment will be called as packet. Router in the network forwards the packet with the help of IP address.

Link layer

Data link layer has two parts such as LLC and MAC. M-Media A-Access C-Control provides the physical address of the system through NIC. The address is used to identify the system in local network. L-logical L-link L-Layer –LLC identifies network layer protocol. 

Physical layer

The layer includes media, technologies, techniques used to transmit data over internet.  The network stack of IoT has radio transmission at physical layer.

Section 2

Question 1:

See the shell scripting Unix commands below and answer accordingly

echo "Hello      World";                #This is a comment tool

echo "Hello World"

echo "Hello * World"

echo Hello * World

echo Hello      World

echo "Hello" World

echo Hello " " World

echo "Hello "*" World"

echo `hello` World

echo 'hello' World


  1. Type in the above script. You run it and verify running the script.


Hello      World

Hello World

Hello * World

Hello main.bash World

Hello World

Hello World

Hello   World

Hello * World

main.bash: line 14: hello: command not found


hello World



Question 2:


  1. Shell script that performs basic arithmetic operations (+, _, *, /)





add_result=$(echo $(( x + y )))

sub_result=$(echo $(( x - y )))

mul_result=$(echo $(( x * y )))

div_result=$(echo $(( x / y )))

echo "The sum of $x and $y is : $add_result"

echo "The sum of $x and $y is : $sub_result"

echo "The sum of $x and $y is : $mul_result"

echo "The sum of $x and $y is : $div_result"


Question 3:

  1. Shell script that displays a list of files in current directory to which the user has read, write and execute permissions


for File in *


            if [ -r $File -a -w $File -a -x $File ]


                    echo $File





[1].     T. Arampatzis,  A survey of security issues in wireless sensors networks, in intelligent Control. Proceeding of the IEEE International Symposium on, Mediterranean Conference on Control and Automation, p. 719-724, Nov. 2015.

[2].      D. Fitton, Smart objects as building blocks for the internet of things. IEEE Internet Computing, vol. 14, no. 1, p. 44-51. Oct. 2017

[3].      K. Kaushik, Performance evaluation of proactive and reactive routing protocols in wireless sensor networks. International Journal of Computer Applications. vol. 10, no. 16, p. 35-84, March. 2017.

[4].      S. Krco, A comprehensive study of parameters in physical environment that impact students ' focus during lecture using Internet of Things. Computers in Human Behavior, vol. 53, no. 2, p. 427–434, Sept. 2018.

lecture using Internet of Thing s. Computers in Human Behavior,53,

lecture using Internet of Thing s. Computers in Human Behavior,53,

parameters in physical e nviron ment that impac t stu dents ' focus during

parameters in physical e nviron ment that impac t stu dents ' focus during

Uzelac, A., Gligoric, N., & Krco, S. (2015). A comprehensive study of

Uzelac, A., Gligoric, N., & Krco, S. (2015). A comprehensive study of

[5].      R. Varghese,  A SDN controller with energy efficient routing in the Internet of Things (IoT). Procedia Computer Science, vol. 8, no. 3, p. 218-27. Sept. 2018

[6].      Zhengmin Wang et al , Review on open source operating systems for internet of things, Journal of Physics: Conference Series, 2017

[7].      Hicham Aberbach et al, A Comparative Study between Operating Systems (Os) for the Internet of Things (IoT), Transactions on Machine Learning and Artificial intelligence, vol 4, 2017.

[8].      Yousaf Bin Zikria, Sung Won Kim 1, Oliver Hahm, Muhammad Khalil Afzal and Mohammed Y. Aalsalem, Internet of Things (IoT) Operating Systems Management: Opportunities, Challenges, and Solution, sensors, 2019.

No Need To Pay Extra
  • Turnitin Report

  • Proofreading and Editing

    Per Page
  • Consultation with Expert

    Per Hour
  • Live Session 1-on-1

    Per 30 min.
  • Quality Check

  • Total


New Special Offer

Get 25% Off


Call Back