“Operating systems are like underwear – nobody really wants to look at them” Bill Joy
In this section we will introduce Operating Systems (OS) in general, why do we need them and what they do for applications and their connection with computer’s hardware.
Operating System like Windows 7 and 10, Linux, Android, and Mac etc. is software written by other developers and just like any other program they run on computers.
You can think of an Operating System (also known as OS) as other application’s personal assistant and at the same time the guardian of computer’s hardware against malicious software!
At the “computers in general” section we mentioned that a computer is a combination of multiple piece of hardware working together to run applications.
You should know that each of these modules most likely is built by different companies and each one of them has its own unique way of communication.
Imagine this: You are the CEO of a company and each employee in this company has different language and method of communication than yours!
It can be really difficult if not impossible for you to make a good relation with each and every employee because you need to learn their languages and their method of communication if you want to run a successful company.
Well even though such company might not seem realistic in real world, it’s very true in the world of computers!
The CEO is actually your program and employees are modules in the computer’s hardware.
Without OS we need to communicate with each and every piece of hardware in a computer when building an application.
For example if in our application there’s a service that calls to store some data into the hard-disk, we need to learn how to open the hard-disk using its language, how to communicate with processor, how to store data temporarily in RAM and finally how to move data from RAM to Hard-disk.
Not to mention there are multiple versions and models of hard-disk, Processor, RAM built in different companies and each one of them might have different method of communication.
So as you can see for just one simple storing service in our application we needed to learn multiple hardware language! That’s insane!
In such world I don’t think anyone would ever want to write code because of the amount of work and code needed for even the simplest task!
This is where the OS comes to the rescue!
As I mentioned above, OS is your application’s personal assistant!
They know how to communicate with computer’s hardware!
Also Operating Systems provide a set of interfaces and functions that we can use them in our services to communicate with underlying hardware.
For example if in our application there’s a service that needs to store data to the hard-disk, we can simply use a service that the OS provides for storing data into the hard-disk, within our application and let the OS do the dirty work for us.
Calling an OS’s service is like saying “Hey OS I want to communicate with underlying modules, here’s the data which includes everything you need, so do me a favor and work the rest”.
Operating Systems are smart and they know when and how to open hard-disk, how to send and receive data to the processors, how to store data in RAM and basically communicate with other piece of hardware in the computers.
As a matter of fact, when we run an application (ours or someone else’s application) it’s the OS that bring the application into the RAM (from hard-disk) and prepare it to be run by the processor!
So anytime we want to communicate with other computer’s hardware, we are simply asking the OS to do the job for us and return the result to our application.
Operating Systems other than making the life of programmers much easier and joyful, they also protect other software and hardware as well!
For example let’s say there’s a malicious application that tries to remove other applications currently sitting in the memory or even this application wants to remove the data that belongs to another application or even maybe wants to put a lot of pressure on the CPU in roder to break it down. In such cases, because it’s the operating system that is in charge of any communication between hard-wares, it is smart enough to stop this malicious application from hurting other applications and the hardware in general.
This is why OS is not just your personal assistant but somehow the guardian of computer as well.
Also you should know that an OS is not monolithic software but a combination of multiple application a services working together to represent the OS.
Some of these applications and services are auxiliary like Media-Player, Picture viewer etc. that help you to reach and view your data, perhaps add, remove and modify those (copy, paste, move, delete etc.); and some of the other application and services of the OS are used to help your own application or others to be run in the computer.