Skip to content

Instantly share code, notes, and snippets.

@arush0311
Created February 18, 2017 16:02
Show Gist options
  • Save arush0311/bf4ccd8eb5bb5e3531b26c2aad281c9b to your computer and use it in GitHub Desktop.
Save arush0311/bf4ccd8eb5bb5e3531b26c2aad281c9b to your computer and use it in GitHub Desktop.

What the heck is an operating system?

A good question. Depending on who you ask it the definition may change. A general idea is an operating system is the middle man between underlying hardware and the programs that run on top of it. But an operating system can be something as small as 8MB(http://kolibrios.org/en/index) to something as complex as Distributed Operating Systems running on cloud. So in this paper we will discuss linux as traditional operating system and discuss why its insufficient for IOT purposes, and what is the need of RTOS'es.

OS as an ongoing old technology

The concept of Operating System is quite old when in 1964 when IBM developed IBM System/360 Operating System. Before then the computers did not have operating systems the programs had to be run directly on the hardware. Since then Operating Systems have come a long way handling different range tasks depending on user requirements. Here are some some environment where different types od operating systems are used:

- Mainframes
	Majorly used in past to schedule jobs from multiple users, the main task of the os was to reduce the waiting time processes and
	full utilization of CPU resources.
- General Purpose Computers
	The main focus of general purpose computers OS is to provide user friendly interface, responsive design as well as
	ease of use.
- Smartphones
	The os has to also focus on supporting different types of sensors (gps, gyroscope, accelerometer) in addition of a rich gui and 		ease of usage. One of the major problems is to maintain the response time of programs while using limited resources. 			Smartphones OS also have to account for energy efficiency to increase battery life.
- Virtualization
	Majorly used when we have to run more than one OS on the sam machine simultaneously. It is basically running a native guest OS 			inside another native OS (Virtual Machine manager). It is widely used in cloud computing. (eg Amazon EC2 has millions of 			virtual machines running on thousands of servers.
- Distributed Computing
	A large number of computers (can be of different architectures) come together to perform a single task in less time or more 			reliability using a network to communicate. A network operating sustem must provide efficient method for components to 			communicate among one another as well as an illusion of a single system to outside viewers.

Tasks of a typical Operating System

In general an operating systems should have the following capabilities:

- Memory Management
    All the running programs need access to Memory where they reside and get executed. Since memory is a limited resource, all the programs compete for the allocation of memory. Operating system is also responsible fro deallocation of memory when the program terminates or is causing problems.

- Process Management
    The processes also need access to processor for computation and Input/Output devices for IO. OS is the middleman responsible for this. It also allocates other resources to the processes and potentially manages deadlocks.

- Storage Management
    Apart from primary memory it also manages secondary memory such as hard drives and network storage and provides uniform interface to access storage.

- Input/Output Managegement
    It also provides an interface for accessing input/output devices.

Also it can have many other functionalities such as Mass Storage Management, Networking Protocols/Solution, Graphical and command line interface, Security etc. But we will mostly focus on the above functionalities

The interfaces provided by the operating system is accessed by a uniform set of API's called system calls, these system calls are same for all architectures running the same OS, thus providing portability to programs running on top of it.

Impact of IOT on OS

The IOT devices are very different from general purpose computers in the way that they have very low memory, low processing power, has to work very reliably in potentially harsh conditions, has to support a wide array of sensors and has to run on battery. This created a need for an operating system especially designed for these devices.

Need for a special OS

Now IOT devices have very specific set of requirements that the traditional os such as linux may not satisfy.

One example of that can be Real Time scheduling of processes. Often the jobs that are performed by the IOT "things" are time critical ie there are deadlines within which a process must be completed. Now these deadlines can be hard or soft deadlines, but they require a special type of process scheduling algorithm. These algorithms are typically not built in inside traditional OS's hence a need for custom operating system

Another thing is the low primary memory on these IOT devices, they typically have few kilobytes of RAM and for these types of devices a traditional os (linux) simply cannot run even if it's highly configured and many modules are removed.

Variety in architectures also play a role in choosing an OS in IOT device, since the architectures of different sensor nodes may be different, to improve portability of applications, we want a single OS that runs on all of these devices.

Moreover the os running on IOT device must be highly customizable, so that the modules that are not needed in a particular node can be removed, so that the memory footprint of the os can be reduced.

An IOT device may be run over a long period of time with little or no supervision on battery, in that case the operating system running on it must be reliable and must not crash. Also the OS must designed to be highly energy efficient, so that the life of the IOT node can be maximized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment