Sunday, 20 May 2018

What is operating systems and why it is needed

Operating Systems is a computer program that manages computer hardware. 

This is a very simple line but it has a very deep meaning. If you can understand this simple yet powerful line, journey to understand internal of OS would be much more easier.

OS is an intermediate layer between user and hardware of computer. Roughly, you can divide computer system in four components :
  • Hardware - CPU, Input output devices , memory etc
  • OS
  • Application Program - word, web-browser,notepad etc
  • User
Operating system controls and coordinates the use of hardware among various application resources. In itself operating system does not do anything. It just manages and coordinates various resources so that all application program can run smoothly.

Just to give you an idea of how important OS is for us, let us assume that we don't have an OS . 

We have all hardware resources and say we want to run multiple programs on it. We want to listen to songs while writing my blog in web-browser and at the same time I also want that my email client keeps on checking for new email in background. How would you do it?  For now, forget about how all this will work in parallel. Let us assume that I want to write blog for sometime and then want to listen music for sometime and then again want to switch to my blog

We have one CPU, I will load "writing blog" program into it and run it  (for now don't go into details of How program is loaded and run). After sometime, I will load media player for playing songs and again I will load "writing blog" program into memory. 

Isn't switching from one program to another a tedious task? OS does this tedious task for you. This is just one example, OS does so many such things for you. 


Coming back to question of running multiple applications in parallel, you might be surprised that how is it possible when we have one processing Unit. It does not seem possible to run multiple Applications on one processor/Hardware. Confused?

You are right that at one point of time, CPU can run only one program. It is just illusion when you see multiple applications running on one processor and this illusion is created by OS. OS keeps on switching between different application and this switching happens so fast that it appears like parallel processing.
Could we manually do switching so fast? I don't think so.

There is much more in OS than this. I hope now you can appreciate the concept of OS.

Although there is no well defined/accepted definition of OS, OS is everything that your OS provider like Microsoft windows, Linux etc provide you. But now it is becoming important to define what constitutes Operating Systems.
Did you know? In 1998, the United States Department of  justice filed suit against Microsoft, in essence claiming that Microsoft included too much functionality in its OS that prevents competition from application vendors.


References:
sixth edition of Operating System Concepts by Silberschatz, Galvin and Gagne

1 comment:

what is array

Array is one of the simplest and most  sophisticated data structures. In array data is stored at contiguous memory locations. E.g. say you h...