Cloud Computing - How does a Computer work




How does a Computer work?


In this video we will take a look at how a Computer works. How does it start, what is the Boot Sequence and what is an operating system. This video will provide fundamentals about a computer so that you can proceed towards learning Cloud Computing.


We all saw that a Computer contains a System unit and Input/Output devices. Please check the video ‘What is a Computer?’ in this series if you haven’t already. We also saw that there are three main components in the System Unit called CPU or Processor, RAM or Memory and Hard Disk Drive.


One additional note is, in any computer, the CPU and RAM will generally be in a single circuit board called Motherboard. This motherboard will be inside the System Unit. I am itching towards teaching you Computer Hardware. But let me stay out of it so that I can quickly get to Cloud Computing. So, what happens where you power on the computer?


It is just a machine. Actually nothing should happen and nothing will happen. How did the computer manufacturers tackle this?


First the mother board manufacturers installed a chip that contained a piece of software code in it, permanently. The chip is made in such a way that once you engrave that software code into that chip while manufacturing, it resides in there permanently. It can never be modified. We can say that it is READ-ONLY. It can never be deleted or modified. Because of that, that chip is called Read Only Memory also known as ROM.  The piece of software code they engrave into it is called BIOS, which is an acronym for Basic Input Output System. Again, I am trying to keep things very simple. There are lots of variations of this ROM, from PROM, which is Programmable ROM to EEPROM, which is Electrically Erasable and Programmable ROM. Those are Out of scope for this video series.



Now coming back to powering on. When you power on a computer, you notice that it starts, takes few seconds or minutes to load some programs and presents you a login screen. This process is called Booting. Let’s go over the boot sequence. As soon as a computer is powered on, the CPU looks at the ROM, and finds the BIOS, which is the piece of code stored in it. It then loads it into the memory, which is RAM and executes it. The BIOS software code contains a section called POST, which is Power On Self Test. This gets executed first. As the name would imply, this routine or this section of the software, performs a self test of all the components connected to the processor. Like, it scans the whole RAM just to check if they are good, checks the Hard Disk to see if it can be accessible, checks for the input output devices etc. Once every device has been successfully scanned, then it looks for the bootable device. Generally the hard disk is the bootable device.



Now what is a bootable device. Bootable device is the device which contains the Operating System. In your PC or Laptop, it will be generally your hard disk and the operating system would be Windows. If you are using a Mac Laptop or desktop, then your operating system would be the Mac OS. The point it, the hard disk will be your bootable device and it will contain the operating system. For advanced students, pls note that I am ignoring Solid State Devices as I do not want to get into hardware in detail. Now, what is an operating system?



So, let me just call the computer as Hardware. And it needs software, which are sets of instructions to function. Now, a hardware can be made by multiple vendors with entirely different type of processors and architecture. If we were to write a code for each of these hardware, then we need to write them in an a way these hardware can understand. Or we need to write them in a language understood by these hardware.



So, if I have to write a piece of code for a hardware, I need to write it using a set of instructions understood by that particular Machine. And if I want that piece of program to run on a different hardware, then I might have a rewrite it using the set of instructions understood by that hardware. And these set of instructions are very difficult to understand and are very low level in nature. These are called Machine Languages and Assembly Languages in general. Like I said, I am combining a lot of things to move as fast as I can to get to Cloud. At the same time I do not want to skip any important information in between.



To standardize this, Operating Systems came into the picture. They said, Hey I will take care of interacting with the hardware. I will take care of managing the hardware. You just write your code to interact with me. And wherever I am, no matter what kind of hardware it is, I will run your code. Again, I am kind of simplifying it. But, I hope you get the gist of it.



So, for example, I will install the Operating System from Microsoft, called Windows which supports Intel based processor on the hardware made using Intel based processor. For an another hardware which is based on AMD processor, I may install Windows OS which supports that hardware. Once I have Windows running on both the computers, now I am free to write a code which will only interact with Windows. And Windows will take care of the communications to the hardware underlying.


Code for Multiple Hardware


So, if I write an application containing software codes, all I need to do is to use the set of instructions supported by the Operating System. It will run on any machine where the same Operating system is in. Generally there are lots of programming languages such as Visual Basic, C, JAVA, Python etc. These are called high level languages which allow you to write piece of code very easily as opposed to the low level machine languages. Using these high level languages you can write your programs.