Anyone who has used a computer has used an Operating System. As you may know, Windows can be called the most popular Operating System(although, not the best). There are other Operating Systems like various distributions of Linux(Ubuntu, Fedora, Red Hat, Backtrack), MAC OS X. Out of these, people associated with computers prefer Linux distributions because of their reliability and robust-ness and their cheap cost. Most Linux distributions are free and come without any restrictions which lead to popularity of the Linux platform, while the other two are pretty expensive.
Now, we come to the question, What exactly is an Operating System?
Simply put, an Operating System is just another piece of software. But this is the main piece of software. It lies above the hardware and makes(or at-least tries to make) full use of the abilities of the microprocessor. It makes using a computer, easy for the end user. Any other software or application which you create has to request the Operating System for resources or memory. So it is safe to say that the Operating System is the master software. But, in a way, it is a different type of master. This is so because, to let a process execute, it has to give the process control over the microprocessor for some time and then takes control back from the process.
You may be wondering, How big is the Operating System?
The Operating Systems of today are pretty big. Well, they have to be, if they want to make full use of today’s microprocessors. Although giving the exact amount of memory which todays Operating Systems consume, may be hard, a rough estimate can be got as to how big they are from the number of lines thy contain. Windows contain 50 million lines of code while Linux Distribution have got anywhere between 20-30 million lines of code.
How do you load the Operating System?
Well, loading the Operating System is pretty simple, just use a bootloader. The most popular one is GRUB. Your memory is partitioned into sectors which are 512 bytes long. A bootloader, such as GRUB, checks for a boot sector and then loads that sector into memory and executes the instructions contained in it. Most probably however, the sector points to another place in memory where the code of the Operating System is stored. Now, you may be wondering how the bootloader comes to know, which sector is the boot sector. The boot sector has a signature which identifies it as a boot sector. The last two bytes in the sector have the following hex numbers written to it: 55AA.
Now, What happens when you switch on your computer?
Here is what happens:
- The BIOS(This is the program which comes with the motherboard and is placed on microprocessor itself) executes a POST-Power On Self Test, to make sure all the components are working.
- If all the components are working, then it checks various components to see if any have a boot sector. The order in which it checks for boot sectors, can be changed by changing the BIOS settings.
- When it finds the boot sector and it has a valid boot signature, then the BIOS loads that program into memory and the program starts getting executed.
- Thus the Operating System starts up and begins executing other processes.
This is all for now, in later posts, I will describe Operating Systems in more detail.