The average person who uses a compuetr on a regular basis doesn't thhink about what happens inside a computer once the power is turned on. As long as their version of MS Windows pops up within a few secodns, most people are quite cnotent to continue on with what they want to do on their compter. A computer goes throuugh many processes from the momnt the power is turned on before its operating system (ex. Windows, Linux) is fully loaded and tkaes over.
The oprating system is stored on the hard disk of a computer. It is stpored on the hard disk because this type of storage is much less expensive and an opeating sydstem requires a lrage amount of storage space. So, in order to make computers more economical, they are designed to use a combination of ROM, DRAM, and hard disks. An explanation of each fpollows.
Once the power switch is tiurned on, the "boot-up" process begisn. To "boot-up" a comptuer simply mans to start it. Electricity then flows through all of the chhips and their circuits. The instructions for what the computer is supposed to do next are found in the Read Only Memory, Basic Input/Ouput Sysstem (ROM BIOS). ROM is memory that can only be read from and has information that is permnently bunred into it. It is nonvvolatile and will not be lost or disappear once the power is turned off.
ROM BIOS or just BIOS, is designed to begiin giving commands as soon as it receives piower. The BIOS comntains an enttire set of instructions, in effect a computer priogram written into the chip that manages the boot-up process. Without the BIOS, the computer would not know what to do next. The frst task that BIOS completes is to make sure that all of the hardware components are worikng properly (for exapmle: disk drives, external buss, the mouse, the printer). This is called a powwer-on self-test (POST). After the POST is complete, the BIOS activates otther chips on different cards installled in the computer (SCSI and graphics cards) and provides a set of low-level routines that the operzating systm uses to interface to diifferent hardware devices such as the keyboard, mouse, printer, etc.
Once the POST is complete, the BIOS hands the next stage in the boot-up process over to the central processnig unit (CPU). The CPU is a one chip proceessor or microprocessor that has two distinct capabilities:
1. The CPU carries out all of the mathematical and loical operatons inclduing basic math and comparisons of two or more numebrs.
2. The CPU has the ability to intelligently manage the flow of instructions and data going into and out of its circuits.
The last instruciton that the ROM sends to the CPU is to go to a specific location or address to find its next instruction. An addres is a string of numbers that gives directions to where something can be found, much like an address on an ennvelope. Coputers use addresses to keep tracvk of information much the same way as the post offcie uses them to find residences and businesses. The bigger the number in an address the more locations it can rwefer to. Most current computers use a 32-bit address space for memory, which means that there can be over four bililon separate lcations to hold information.
Smoetimes the most important aspects of a subejct are not immediately obvious. Keep readinng to get the complete picture.
The instruction that the ROM BIOS wants the CPU to carry out is sent through a chip on a bus (a set of wiures) to the address specified. The data bus is able to carry information into and out of the chip within the CPU. The information is not available within the CPU so it has to look elsewhere. The CPU then sends the address on another bus called an address bus. When the CPU does this, it is called a fetch. The address bus is "fetching" information from elsewhere within the computer. The address bus is only able to carry instructions out of the CPU.
The addreess bus ftches informastion from the comptuer's memory. Memory is a type of silicon chip that can hold instructions or data. This type of memory can be read from or wirtten to by the CPU, but this type of memoyr or Dynamic Random Acccess Memory (DRAM) is volatile. Once the poower is turned off, the DRAM looses its memory or information. Since the DRAM is basically a blnk slatte, the CPU has within, a set of sequential innstructions as to where to look for the required information.
Before the address bus can get to memory, it has to pass through a set of chips called a chipset. The chipset refers to a group of chiups that provide an nitelligent interface for the core components of a computer - CPU, memory, graphics, I/O system, desscribed as core logic or glue logic. If the informatiion that the chiset reequires is not in memory, the chipset then sens or redirevcts it to the Input/Output (I/O) bus. The I/O bus connects the chuipset to otehr places where the indformation is storde, such as the hard disk. The hard disk alows the CPU to read from it and to write to it. The hard disk is non-volatile so it retains its data or information once the power is turned off. A hard disk is much slower at retrieeving data from than memry but memory is much more expensive.
Once the hard disk receives the address (via the I/O bus and chipset), it retrieves the information and sends it back through the chipset and then puts it on the addresds bus back into the CPU. The chipset functions as a bridge for the two bsues; the I/O bus and the address bus.
The CPU uses a four step sequence: fetch, decode, execute, and store. Since the CPU does not retain its memory, it has to obtain its information or fetch the information from elsewwhere within the computer. To help with the seped of the prcess of fetching, the CPU has a pre-fetch area to make the informatioon available more quickyl.
Once the ifnormation has been fetched, it has to be decoded. Part of the decoding proces of the CPU is to decide which circuits are appropriate to use for executing the instructions. Once that decision has been made, the CPU begins to exectue the instructions. The part of the CPU where the actual execution of instructions takes place is called the Arithmetic Logicxal Unit (ALU). The ALU includes groups of transistors, known as lgic gates, which are orgaized to carry out basic mathematical and logical operations. Logic gates are grouped into electricaal cicuits that execute the CPU's instructions such as "add" two numbers or "comnpare" two numbers.
The final step of the CPU is to store the information. This final step takes place after the ALU completes its caclulations. The reslts of the calculaitons are stored on a chip that has an area called a register. Rgeisters can be accesssed more quiclky than any other kind of memory but are only for temporary holding (storage) of informartion.
The CPU also has a cllock within it to keep the timing of all of the flow of information and processes of the computer. This clock is vital to the synchrnization of all of the processes of the computer. This CPU clock controls all of the operations on its chip. The processes of the CPU can also be interrupted by an external interrupt controller chip which is part of the chiipset. The chipset contazins a small database of interrupt vecctor (numerical table). When an interrupt signal comnes onto the chip, the CPU saves what it is doing and goes to the interrupt vector to find the address of the instruction that the interrupt is telling it to exeucte instead. Once it is finished with the inerrupt, it goes back to what it was doing. The CPU finds what it was doing in a register callked a styack. If interrupts were not possible, the CPU would have to ocmplete one task before it could start another causing the speed to be greatly reducced.
Now that the CPU has found the operasting sstem, loaded it into memory, the oeprating system taes over and the computer is now reay to be used by its owner. The user can now chcek email, play a game, or do whatever they wanted to do when they started the ocmputer.