Showing posts with label operating systems. Show all posts
Showing posts with label operating systems. Show all posts

Sunday, September 11, 2011

Booting

Today let's discuss about booting and what actually happens when a system boots.

During the early days of computers, the boot program is made read only and is put in hardware chips. This boot program is called a bootstrap in computer terminology. The bootstrap initiates all the CPU registers, device controllers and finally loads the operating system into memory. The advantage of this scheme is that, since the bootstrap is read only, no virus can effect it. But the disadvantages outweigh this. First, if we want to add any external hardware,  it's device driver needs to be loaded when the system starts. But, since the bootstrap is read only, we need to change the hardware chips. Also, the operating system must be in a fixed location as specified in the boot strap, if we install the operating system in a different area, then also there is a need to change the chip.


So our computer scientists thought over this and came up with a simple solution. Instead of making ROM's with complete bootstrap program in them, they started making ROM's with tiny bootstrap program's called bootstrap loader. And the main bootstrap program is stored in the disk. Since changing the bootstrap program simply requires a write to the disk, our problem is solved. The bootstrap program on the disk is generally stored in first sector of the hard disk called boot sector.

But... a new problem arrived -- Boot sector virus

Enough of computer terminology, now I will explain in simple terms. BIOS is generally present in non-volatile ROM chips as you know, and this generally initiates the main memory, CPU registers, device controllers and starts the tiny bootstrap loader that is present in it. The BIOS is built at the time of manufacture of a PC and when you start the PC, it is the first software that normally executes, even before the main memory or disk gets initialised. It looks as below


The full bootstrap program as I told earlier, is stored in first sector of harddisk called boot sector. After initialisation of all aspects, the BIOS loads this program to main memory and hands the baton to it for execution. This boot sector in windows computers is called Master Boot Record or simply MBR. MBR contains the full boot code, along with a partition table. This partition table contains the information of partitions along with information whether an Operating system is present in each one or not. If only one OS is present, it is shown or by default it's loaded since there is no need for user to make choice. If more than one OS is present, the user is presented with options to load what ever operating system he wants to be loaded.


Last, about boot sector virus. To prevent boot sector virus, there is an option in BIOS, which makes the bootstrap program on the disk read-only. When ever you think you are not going to install any more OS, check it on and when you want to change your OS, check it off. Happy now...virus problem also solved

Thursday, August 25, 2011

Operating Systems - Device drivers

You install XP or Vista or windows 7 in any computer, the prime thing that is done, immeditely after installing the operating system is installing of device drivers. Ever wondered what exactly are they ?

" A device driver is a piece of software, that acts as a translator "

You may look at some of my previous posts and there I told you, a compiler is a translator. So, a device driver converts one language code to another language code, hence's it's also a typical compiler.


Consider, we insert a pendrive, the first thing that the operating system does is check for the device driver. If it's not present, then the OS installs it, you can see the pop up on the left bottom corner showing "Installing device driver software" and when it's successfully installed " Your pen drive is ready to use" pops. The reason, why the operating system first checks and does this, is because of the fact that device drivers helps it, to talk with the hardware of the device. Consider the computer passes a high level instruction "copy file - mog.avi". Now our intelligent device driver, converts this into a language that the harware controller that interfaces the pendrive with the computer understands and the task gets done.

Before the invention of device drivers, the task that needs to be done, needed to be partitioned and carried onto different hardware, since there is no communication between them. But now, with a translator, the task can be done smoothly.

Almost every piece of hardware, that is connected to the mother board has a device driver software and they get installed as soon as they are connected. And now a days, most of the device drivers, come bundled with operating system. Windows 7 has almost removed the need for all drivers, except the wifi, and one or two others. And Ubuntu from the beginning had no need for them except the wifi and graphics drivers.

Tuesday, August 23, 2011

Operating Systems - 3

In case you missed part-1 and 2, below are the links for them

http://systemspro.blogspot.com/2011/06/operating-systems-win-or-loss-of.html

http://systemspro.blogspot.com/2011/06/operating-systems-2.html

Also, the code for different problems related to operating systems, that you come across in your under graduate studies, is made available in the link below

http://operatingsystemscode.blogspot.com/

Today, let's discuss about Kernel

Kernel is a piece of software, that generally comes bundled with operating system and is more closer to the hardware. It provides an abstract layer for the user programs to interact with the hardware and allocate apropos resources to them. In short, it is the heart of any operating system.

Windows operating systems use Windows NT Kernel which was developed and released along with NT based OS in the year 1993, that made windows, a more generic player in the operating systems field. It's success was so huge, that Microsoft never dared to remove "NT" from it's OS names. But in 2000, with the release of Windows 2000, it dropped NT, but gave it a tagline "Built on NT technology". With XP, it dropped that tag also. Presently windows operating systems like Windows 7 and Windows Vista use a hybrid version of the same kernel.

Linux distributions like Ubuntu, Red hat use Linux Kernel, that was first developed by Linus Torvalds in 1991. No one thought that a college kid could invent it. Even the professor who taught him, damned it. And the remaining story, need not be told..

Another Linux kernel called "Hurd" was in the development stages, before 1991, but it  never reached it's completion due to the invention of Linux

Friday, June 17, 2011

Operating systems - 2

Well, first of all, let me announce you, the availability of free code for the assignments you find in the standard Galvin book in the link below


Incase, if you are having the Operating systems course to study, these are the likely code snippets you will be given home work for.

Today, let's discuss some more things about operating systems.This is the def of operating system

"Operating system is a software, that makes the hardware do useful things"

There are many more definitions of it, but let's stick to this.One more thing most computer science students or IT students including me, when we join college is to fascinate of building an operating system entirely from scratch, knowing each and every detail.

If you try to do the above said thing, you will either become a mad person or get addicted to some other things in life.What I want you to learn is that, building every thing from scratch is not needed today :)

For example, let me give you the example of Linus Torvalds.He did not entirely build the Linux as people think.He used internet to connect with people and gather useful piece of code he needed, and using some of the code, that is already generated, he prepared Linux. I am not telling you to copy the code, but to steal it.In a sense, that you make it more beautiful.In the words of Picasso


"Good artists copy, great artists steal"

Learn to reuse the code and build something on top of it, which makes the software more usable or will be better than that software.And this is what, you cannot do with proprietary software.I recommend you to switch to one of open Source OS and start altering their code or the software you install in them.You willl really gain a lot of insight and knowledge into it.

Tuesday, June 14, 2011

Operating Systems - A win or loss of mankind

Operating systems play an important role in our day to day life.Although our primary topic is systems programming, let's discuss the operating systems for every two posts, so that it can be on par with other system softwares.

Let's go back into the history.In 1950's, there were only few computers available and that too for defense or scientific purposes.Many people including big companies, thought that computers were meant for that.But the invent of machines like Altair in the late 1970's revolutionized the computer industry.It showed that a computer can be personal, and could serve the needs of common people.The invent of personal computer and Mac, both in early 1980's completely took the industry by storm and with in five to six years, they have shown a new way for industries.In the olden days, to establish an industry, it would require generations of wealth or should be influential to get bank loans.But, Bill Gates and Steve Jobs have shown."Oh, we don't think so".For the story of Steve Jobs and Bill Gates watch the "Pirates of Silicon valley" movie.Below is the link for it.


And lo, the operating systems were born.And they started growing like anything, giving huge profits to their creators and creating a new kind of jobs called software engineers and finally they became a brand themselves.But it's needless to say, because of these so called WONDERFUL things, many people in colleges started enrolling in computer courses.I am also one of them :)

But you know what, there is also the other side of the coin, not many people mention or dare to talk about.Before computers came, majority of the people used to take sciences, physics, chemistry, mechanics as the preferred courses, and so during the time between 1900 and 1980's a lot of good scientists were born and NASA also got quality people who could send man to moon.Do you know when the last manned mission to moon happen ?

It happened in 1972 (Apollo 17)

Looking at the other side of coin, I always fear what will happen to this world, with the lessening of scientists and the people pursuing research as their goal of life like the kinds of Einstein, Edison, Ford, Wright brothers and lot more.

You may say that many people are taking courses other than software engineering, but my say is that most of them are ending as software engineers.Also I am trying to say, other courses also should be given equal preference