Error » Hardware Error!! » Hardware tutorials » What is the BIOS and how does it work

Hardware tutorials All Knowledge Info and links to posted here

Post New Thread Reply
  What is the BIOS and how does it work
LinkBack Thread Tools Display Modes
Old 08-Sep-2006, 02:51 PM   #1 (permalink)
Administrator
 
Anilrgowda's Avatar

Posts: 18,715
Join Date: Jan 2006
Rep Power: 10 Anilrgowda is on a distinguished road

IM:
Default What is the BIOS and how does it work

Introduction

Inside every PC out there is BIOS, which stands for Basic Input Output System. In a nutshell, BIOS is software that interacts between a computers hardware and the operating system and software applications. There are several types of BIOS's, ranging from the motherboard ROM BIOS to adapter BIOS's such as video BIOS, drive controller BIOS, network adapter BIOS, SCSI adapter BIOS, etc... These BIOS's are the lowest level of software in a computer providing a set of small programs or software routines that allow the hardware of a computer to interact with the operating system by a set of standard calls.

I hope to provide a through understanding of how the BIOS works and leave you with a better understanding of it's interworkings. At the same time, I hope to show how complex a BIOS is in relation to it's relationship with the operating system and the software applications you use everyday. Enjoy.

The Boot Process

To get to the operating system, a computer must first boot from the BIOS. The BIOS performs a number of tasks when a computer is started. From initializing the microprocessor to initializing and testing hardware to starting the operating system. Starting a computer is not a simple task. It's a methodical process that is performed every time power is applied to computer. Here is a detailed description of the boot process. This process will vary with different computers and different BIOS', but the overall goal is the same. When you first turn on a computer the very first operation performed by the CPU is to read the address space at FFFF:0000h. This address space it reads from is only 16 bytes, which is not nearly enough space to house the BIOS found on a motherboard. Instead, this location contains a special instruction called a jump command (JMP) that tells the processor where to go to find and read the actual BIOS into memory. The process of the processor reading the jump instruction and redirection to the actual BIOS is called the bootstrap or boot. So, when you apply power, it's not the operating system that's working. It's the BIOS.

First, I want to get something straight. The CMOS and the BIOS are two different things. The BIOS refers to the firmware instructions that are located on the BIOS ROM. CMOS refers to the low-power RAM that holds the system's setup parameters. The BIOS reads the CMOS RAM into memory at boot up and provides the setup routine that allows you to change the contents of CMOS, but the CMOS RAM/RTC device is a totally different IC. The CMOS holds the information provided by the BIOS. This is why you "lose" the settings of a system when the battery dies or you clear the CMOS through a jumper on the motherboard.

With today's high performance 32 bit operating systems, the BIOS becomes less used, but it is still there, always interacting with the operating system. Disk access, for example, is done through the operating system with 32-bit routines, whereas the BIOS is using 16-bit routines. Although the BIOS provides VGA support, Windows and other 32-bit operating systems use software device drivers to work with the hardware. Early OS's, like DOS, worked with the BIOS. DOS relied on the BIOS to perform most functions, like displaying characters on the screen or sending output to the printer, reading input from the keyboard and other essential tasks. These drivers, which operate in protected mode(since they aren't written for real mode, they are able to use memory above the 1MB barrier that real mode provides), allow for several enhancements. They can access more memory, can be written in 32-bit code for optimized execution and are not limited to the amount of space available to their code. However, regardless of OS, whether it's Windows 2000, Linux or DOS, the BIOS and the operating system still interact with each other.

Here is a basic rundown of what is happening:
  • Power is applied to the computer.

    When power is applied to the system and all output voltages from the power supply are good, the power supply will generate a power good signal which is received by the motherboard timer. When the timer receives this signal, it stops forcing a reset signal to the CPU and the CPU begins processing instructions.
  • Actual boot

    The very first instruction performed by a CPU is to read the contents of a specific memory address that is preprogrammed into the CPU. In the case of x86 based processors, this address is FFFF:0000h. This is the last 16 bytes of memory at the end of the first megabyte of memory. The code that the processor reads is actually a jump command (JMP) telling the processor where to go in memory to read the BIOS ROM. This process is traditionally referred to as the bootstrap, but now commonly referred to as boot and has been broadened to include the entire initialization process from applying power to the final stages of loading the operating system.
  • POST

    POST stands for Power On Self Test. It's a series of individual functions or routines that perform various initialization and tests of the computers hardware. BIOS starts with a series of tests of the motherboard hardware. The CPU, math coprocessor, timer IC's, DMA controllers, and IRQ controllers. The order in which these tests are performed varies from motherboard to motherboard. Next, the BIOS will look for the presence of video ROM between memory locations C000:000h and C780:000h. If a video BIOS is found, It's contents will be tested with a checksum test. If this test is successful, the BIOS will initialize the video adapter. It will pass controller to the video BIOS, which will in turn initialize itself and then assume controller once it's complete. At this point, you should see things like a manufacturers logo from the video card manufacturer video card description or the video card BIOS information. Next, the BIOS will scan memory from C800:000h to DF800:000h in 2KB increments. It's searching for any other ROM's that might be installed in the computer, such as network adapter cards or SCSI adapter cards. If a adapter ROM is found, it's contents are tested with a checksum test. If the tests pass, the card is initialized. Controller will be passed to each ROM for initialization then the system BIOS will resume controller after each BIOS found is done initializing. If these tests fail, you should see a error message displayed telling you "XXXX ROM Error". The XXXX indicates the segment address where the faulty ROM was detected. Next, BIOS will begin checking memory at 0000:0472h. This address contains a flag which will tell the BIOS if the system is booting from a cold boot or warm boot. A value of 1234h at this address tells the BIOS that the system was started from a warm boot. This signature value appears in Intel little endian format , that is, the least significant byte comes first, they appear in memory as the sequence 3412. In the event of a warm boot, the BIOS will will skip the POST routines remaining. If a cold start is indicated, the remaining POST routines will be run. During the POST test, a single hexadecimal code will be written to port 80h. Some other PC's send these codes to other ports however. Compaq sends them to port 84h, IBM PS/2 model 25 and 30 send them to port 90h, model 20-286 send them to port 190h. Some EISA machines with an Award BIOS send them to port 300h and system with the MCA architecture send them to port 680h. Some early AT&T, Olivetti, NCR and other AT Clones send them to the printer port at 3BC, 278h or 378h. This code will signify what is being tested at any given moment. Typically, when the BIOS fails at some point, this code will tell you what is failing.
  • Looking for the Operating System

    Once POST is complete and no errors found, the BIOS will begin searching for an operating system. Typically, the BIOS will look for a DOS Volume Boot Sector on the floppy drive. If no operating system is found, it will search the next location, the hard drive C. If the floppy drive (A), has a bootable floppy in it, the BIOS will load sector 1, head 0, cylinder 0 from the disk into memory starting at location 0000:7C00h. The first program to load will be IO.SYS, then MSDOS.SYS. If the floppy does not contain a DOS volume boot sector, then BIOS will next search the computers hard drive for a master partition boot sector and load it into memory at 0000:7C00h. There are some occasions in which you will encounter problems with the proper loading of the Volume Boot Sector. Below are some of those:
    A. If the first byte of the Volume Boot Sector is less than 6h, then you will receive a message similar to "Diskette boot record error".
    B. If the IO.SYS or MSDOS.SYS are not the first two files in the Volume Boot Sector, then you will see a message similar to "Non-system disk or disk error".
    C. If the Volume Boot Sector is corrupt or missing, you will get a message similar to "Disk boot failure"
Once the BIOS has searched for a bootable floppy device, it should turn it's attention to the next boot device it's programmed to look for. The next device is typically the hard drive, or C. Like a floppy drive, the BIOS will attempt to load the Volume Boot Sector from sector 1, head 0, cylinder 0 from the Master Boot Sector, or MBS, into memory starting at 0000:7C00h. The BIOS will check the last two bytes of the MBS. They should be 55h and AAh respectively. If they are not, then you will receive an error message similar to "No boot device available" and "System initialization will halt". If they are correct, then the BIOS will continue the loading process. At this point, the BIOS will scan the MBR in search of any extended partitions. If any extended partitions are identified, the original boot sector will search for a boot indicator byte which indicates a active and bootable partition. If it cannot find one, you will receive a message similar to "Invalid partition table".

At this, once a active partition is found, the BIOS will search for a Volume Boot Sector on the bootable partition and load the VBS into memory and test it. If the VBS is not readable or corrupt, you will see a message similar to "Error loading operating system". At the point, the BIOS will read the last two bytes of the VBS. These bytes should be 55h and AAh respectively. If they are not, then you will see a message similar to "Missing operating system" It is at this point that the BIOS will begin loading of the operating system.
Anilrgowda is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Reply With Quote
   


   
Old 27-Sep-2008, 11:03 PM   #2 (permalink)
Fix my Error!
 
danica's Avatar

Posts: 21
Join Date: Sep 2008
Rep Power: 0 danica is on a distinguished road

IM:
Default Re: What is the BIOS and how does it work

BIOS in part refers to the firmware code run by a PC when first powered on, which is a type of boot loader. The primary function of the BIOS is to identify and initialize system component hardware

danica

__________________________

build your own computer seo agency
danica is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Reply With Quote
Old 28-Sep-2008, 09:58 PM   #3 (permalink)
Fix my Error!
 
Poongodi's Avatar

Posts: 5
Join Date: Sep 2008
Rep Power: 0 Poongodi is on a distinguished road

IM:
Default Re: What is the BIOS and how does it work

I have problem always with my system. Sometimes it never gets started up. It just restarts again and again. Please give me a good solution.

_____________________

promotional items Headlights discounted perfume Sexual Predators
Poongodi is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Reply With Quote
Post New Thread Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
SEo work sohel08 Search Engine Optimization 3 10-Oct-2008 10:30 PM
Will PC Anywhere 10.5 work on Vista? Anilrgowda Microsoft windows vista error 1 28-Jul-2007 01:17 AM
DLL in C++ 6.0 does not work well under Vista driverdownloads Microsoft windows vista error 1 19-Mar-2007 11:22 PM
my microphone dont work in soundrecored or msn and it work if i unmute it from the vo Anilrgowda Microsoft Windows xp error 1 08-Mar-2007 10:51 PM
AutoComplete Does Not Work Anilrgowda Internet Explorer Error 0 29-Jan-2007 09:57 AM


All times are GMT -8. The time now is 03:15 PM.

Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0

DMCA Policy

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228