Pages

Friday, December 26, 2008

Booting

The booting procedure is described below.

We all know booting is the process of loading of programs from the secondary storage devices like hard disks to the primary memory RAM. This does not occur in one step. It occurs through a series of steps. They are listed below:

1. The first step in the process of booting is Power On Self Test (POST). During this stage the programs stored in the ROM of the computer checks whether the other programs were in the right order.
2. The next stage is to set up the Interrupt Vector Table (IVT). This table contains interrupt number and the address of the corresponding interrupt service routine. When an interrupt is occurred the processor looks in to the IVT and gets the location of the interrupt service routine and executes the task specified by that interrupt service routine.
3. In the third stage the system performs the RAM test. During RAM test the system calculates the maximum size of the RAM and stores it in the location 0x413 and 0x414. Thus we will get the maximum size of the RAM from the location 0x413 and 0x414.
4. The next step is to initialize the standard equipments like keyboard, disc drives etc. The list of these equipments are stored in the memory location 0x410
5. The next step is to initialize the non-standard equipments like hard disk drive. The computer checks for the non-standard equipments connected to the computer. If they were found they momentarily transfer control to ROM extension routines. After initializing the non-standard equipments the computer transforms the control back to the ROM startup routines.
6. The system contains the RAM startup routine. The RAM startup routine reads the boot sequence from CMOS RAM. This is applicable only for the processors AT and above. For XT processors the boot sequence will always starts from A drive. This cannot be changed. But in the case of AT processors the boot sequence can be changed according to the need of the user.
7. The system contains Bootstrap Loader whose purpose is to load the content of the side 0, track 0 and sector 1.

From here we have to deal with two cases regarding the type of the processor.
In the case of the XT processors booting starts loading the programs from the floppy drive then t the hard disk (from A drive then to C drive ). But in the case of the AT processor the boot sequence can be changed. Let us first look in to the case of the XT processor:


BOOTING FROM FLOPPY DISK

(i) The Bootstrap Loader is a short and primitive program, smart enough to move the head of the disk drive to track 0, and read the contents of the first physical sector of the disk into memory, at a predetermined location and pass control to it.

The side 0, track 0, sector 1 of floppy disk contains Boot Parameters and Disk Bootstrap Program. Hence the Bootstrap Loader loads into memory and hands over the control to them.

The first three bytes of the boot parameters contains the jump instruction. This instructions cause the control to jump to the Disk Bootstrap Program, bypassing the Boot Parameters which are placed after the jump instruction.

The important job of the Disk Bootstrap Program is to load the file IO.SYS into the memory. But there is a problem in doing this. The Disk Bootstrap Program does not know the exact location of the file IO.SYS on the disk which depends upon the number of copies of the FAT on the disk, number of sectors occupied by each copy of FAT and a number of sectors occupied by the directory.
These parameters vary from disk to disk.This is where the Boot Parameters come into rescue of Disk Bootstrap Program. Using the data in the Boot Parameters it calculates the exact location of the file IO.SYS. Once this location has been found out, the actual loading of Operating System into memory starts.

(2) The Disk Bootstrap Program first checks for the existance of the file IO.SYS. If the file is present the file is loaded into memory and passes control to it. If the fle is abscent then the familiar message is displayed:

Non system disk. Insrt system disk and press any key.

On inserting a disk containing the file and the pressing a key, it loads the IO.SYS from the disk. As soon as IO.SYS is loaded, the Disk Bootstrap Program is removed from the memory.

(3) IO.SYS consists of two modules: - Disk BIOS and SYSINIT. Let us discard the case of Disk BIOS for the time being. Lets go with SYSINIT. SYSINIT module loads the file MSDOS.SYS from disk into memory and passes control to it.

(4) MSDOS.SYS builds some internal data structures and work ares and then returns the control to SYSINIT.
SYSINIT loads a file CONFIG.SYS file from the root directory of the floppy. The optional file can contain a variety of commands that enables the user to customize the working environment. For example, the user may specify the nmber of disk buffers, the maximum number of files that can be opened, etc. If it is found, the entire CONFIG.SYS file is loaded into memory and each command in it is executed one line at a time.

(5) SYSINIT then loads the Resident portion of the file COMMAND.COM into memory. Once the Resident portion is loaded, the SYSINIT module is discarded from the memory and the control is handed over to the Resdent portion.

(6) The Resident Portion of COMMAND.COM loads the Trancient Portion of COMMAND.COM into high end of memory. Here high end means the top of base memory. This high end may vary from computer to computer since different computers have different base memory sizes. The resident portion finds out the high end from the base memory size stored at locations 0x413 - 0x414 during the RAM test. The Transcient Portion of the COMMAND.COM executes the file AUTOEXEC.BAT, if it is present in the root directory.

(7) The Transcient Portion of COMMAND.COM finally displays the DOS prompt.


BOOTING FROM HARD DISK

In the case of Booting from hard disk also the steps from 1 - 7 remains the same. Continuing steps are given below:
(1) Since the capacity of the hard disk is huge we can use different Operating Systems. For this purpose we divide the whole portion into different logical partitions and install one or more Operating Systems in each partition. The information about where each partition begins and ends, the size of each partition, etc are stored in a partition table in side 0, track 0, sector 1. This sector also contains a Master Boot Program. The partition table is 64 bytes long. The partition table also indicates which is the bootable partition. The ROM Bootstrap Loading Program loads the partition table and the Master Boot program into memory and passes control to it.

(2) The Master boot program finds out which is the bootable partition, loads the boot sector (containing Boot Parameters and Disk Bootstrap Program) from the bootable partition and passes control to it.

(3) Once the Disk Bootstrap Program receives the control the rest of the booting procedure is same as in the case of booting from a floppy disk.

Thursday, December 18, 2008

Introduction

You may have computers. While working with computers you may note several bad things happening in your computer. You may found that your .exe files are losing, word document is displaying unnecessary messages, your internet bandwidth becoming narrower, alert symbol in the system tray etc. When you ask your colleagues about this problem they have only one answer-“VIRUS”.

Now let us browse in to the world of virus…….

What is a virus?

A virus is an executable file that is capable of replicating (copying itself). The viruses are programmed for destructive purposes like deleting files and data, reducing the bandwidth of the network medium etc. The size of most of the virus is in KB. This shows that the most of the virus were made by the brilliant programmers. Viruses are of different types and forms. They can latch to other files like .exe, .com etc. They have the capability to spread through the removable media like floppy disk, CDs, flash drives etc. Some have the capability to spread through the network. Most of the viruses are programmed in assembly language that results in its reduced size.