MICROPROCESSOR BOOT CODE:SINGLE-PROCESSOR BOOT SEQUENCES

SINGLE-PROCESSOR BOOT SEQUENCES

The following are the main steps in a typical boot sequence (or boot process). Of course, this will vary with hardware components, BIOS, and so on and especially with what peripherals are in the computer or controller system.

(1) Power on

The internal power supply for this microprocessor unit or CPU chipset turns on and initializes. There is some delay until it can generate reliable power for the rest of the computer, and having it turn on prematurely could potentially lead to damage. Therefore, the unit or chipset will generate a reset signal to the microprocessor until it receives the “power good” signal from the power supply.

(2) Load BIOS, MBR and boot program

When the microprocessor receives the reset signal, it will be ready to start executing an instruction, but there will be nothing at all in the memory to execute at first. Of course, the microprocessor makers know this will happen, so they preprogram the microprocessor to always look at the same place in the system BIOS in a specific ROM location for the start of the BIOS boot program. This is normally right at the end of the system memory, so that the size of the ROM can be changed without creating compatibility problems. Since, in most cases, there are only 16 bytes left from there to the end of conventional memory, this location just contains a jump instruction telling the microprocessor where to go to find the real BIOS start-up program.

(3) Initiate hardware components

The first thing that the BIOS does when it boots the system is to perform what is called the power-on self-test, or POST for short. The POST is a built-in diagnostic program that checks all hardware components in the system to ensure that everything is present and functioning properly, before the BIOS begins the actual boot. It later continues with additional tests (such as the memory test) as the boot process is proceeding.

The POST starts with an internal check of the CPU and of the boot code by comparing code at various locations against a fixed template. Then, the POST checks the bus, ports, system clock, display adapter memory, RAM, DMA, keyboard, floppy drives, hard drives, and so forth. The CPU sends signals over the system bus to make sure that these devices are functioning properly. In addition to the POST, the BIOS initialization routines initialize memory refresh, and load BIOS routines to memory. These routines will add to the system BIOS routines with routines and data from other BIOS chips on installed microcontrollers (note this is the microcontroller rather than an industrial controller). The routine then compares the information it has gathered with the information stored in the setup program. If there are any discrepancies, it halts the boot process and informs the operator. If everything is satisfactory, this will usually be displayed to the operator on screen.

The POST runs very quickly, and the user will normally not even notice that it is happening. If any errors are detected, the system may deliver an error code. Error codes, both visual and audible, differ from manufacturer to manufacturer. To interpret them, the operator will need a table of these codes from the manufacturer of the system’s motherboard. If any problems are encountered during the POST routine, then the operator knows that it is hardware-related. In some cases, the operator can find and repair problems by searching for poor connections, damaged cables, seized fans, and power problems; or the operator may need to check that adapter cards and RAM are installed properly in their respective slots. In extreme cases, the operator may have to strip the system down to its motherboard, RAM, video card, power supply, and CPU. By adding the rest of the devices individually and restarting after each one, the operator can sometimes discover the cause of the problem.

The BIOS often does more tests on the system, including the memory count-up test. It will generally display a text error message on the screen if it encounters an error at this point; these error messages and their explanations can be found in this part of the BIOS Troubleshooting Expert.

It also performs a system inventory of sorts, doing more tests to determine what sort of hardware is in the system, displaying a summary screen about the system’s configuration. Checking this page of data in the screen can be helpful in diagnosing setup problems.

(4) Initiate interrupt vectors

The initialization of the system during POST creates interrupt vectors to the proper interrupt handling routines and sets up registers with parameters. In Figure 15.2, the interrupt vector table is included in the boot sector program, thus initializing the interrupt vectors to set up pointers (or registers) in memory to access those interrupt handling routines. In addition to the POST, interrupt vectors are reinitialized and system timers are reinitialized. In other words, the BIOS code initializes the computer or controller system to such a state that it is ready to load the operating system. Issuing an interrupt performs the loading of the operating system.

(5) Transfer to operating system

Whenever a computer or an industrial controller is turned on, BIOS takes control and performs a lot of operations. It checks the hardware, ports, and so on and finally it loads the MBR program into memory (RAM). At this point the MBR takes control of the booting process. When only one operating system is installed in the system, the functions of the MBR are as follows:

(a) the boot process starts by executing MBR code in the first sector of the hard disk;

(b) the MBR looks over the partition table to find the active partition;

(c) control is passed to that partition’s boot record to continue booting;

(d) the partition’s boot record locates the system-specific boot files;

(e) these boot files then continue the process of loading and initializing the rest of the operating system.

Leave a comment

Your email address will not be published. Required fields are marked *