Method for Accelerating BIOS Running

Information

  • Patent Application
  • 20080005549
  • Publication Number
    20080005549
  • Date Filed
    June 27, 2007
    17 years ago
  • Date Published
    January 03, 2008
    16 years ago
Abstract
The present invention provides a method for accelerating the BIOS running by means of Cache-As-RAM, comprising steps of: a CPU reading a first instruction from a BIOS Flash ROM and beginning to run BIOS programs after a computer is powered on; the CPU turning on a No-Eviction Mode (NEM) of a cache and initializing a Cache-As-RAM (CAR); the CPU copying the BIOS programs to the CAR space from the BIOS Flash ROM and running the BIOS programs completely in the CAR space; at the end of running the BIOS programs in the CAR space, the CPU initializing a system memory; after the system memory is initialized, the CPU again reading the BIOS programs from the Flash ROM; the CPU copying the BIOS program modules that have not been run yet to the system memory from the BIOS Flash ROM; and the CPU running the BIOS programs from the system memory, so as to finish the initialization of the computer platform.
Description

BRIEF DESCRIPTION OF THE DRAWINGS

Hereinafter, the preferred embodiments of the present invention will be described with reference to the drawings, in which,



FIG. 1 is a flowchart of a method for accelerating the BIOS running by means of NEM according to the present invention.





DETAILED DESCRIPTION OF PREFERRED EMBODIMENTS

The specific embodiments of the present invention are described hereinafter with reference to the drawings. It is to be noted that the embodiments are described only for illustrative purpose rather than limiting the scope of the present invention. The various numbers described here are not intended to limit the present invention, and appropriate amendments to these numbers can be made by those skilled in the art as desired.



FIG. 1 is a flowchart of a method for accelerating the BIOS running by means of NEM according to the present invention.


When a computer is powered on, a CPU is in a real mode state, and a default CS (code segment register):IP (instruction pointer) points to a BIOS Flash ROM. That is, after the system is powered on, the CPU reads a first instruction from the BIOS Flash ROM, and begins to run BIOS programs (S10).


The CPU initializes a 16-bit Big-Real mode (which is a 16-bit code/32-bit address mode), where register values of a DS (data segment register), an ES (extra segment register), a FS (flag segment register), a GS (global segment register) and a SS (stack segment register) are 0. The CPU is capable of addressing a memory space of 0-4 GB. However, fetch of the CPU is still in the 16-bit CS:IP mode (S11).


The CPU turns on an NEM (No-Eviction Mode) mode of a cache, initializes a Cache-As-RAM (CAR), and designates a base address for the CAR space. Thereafter, the operations on the CAR space are based on the base address (S12).


The CPU copies the BIOS programs from the BIOS Flash ROM to the CAR space, and sets an Entry through which the BIOS programs jump to the CAR from the Flash ROM and a Return Entry through which the BIOS programs return to the Flash ROM from the CAR (S13).


The CPU switches to a 32-bit protect mode, where the CPU is completely in the 32-bit mode regardless of fetching or addressing, which is so called USE32 mode, so that the CPU may run the BIOS programs from the CAR space (S14).


The CPU jumps to the program Entry to the CAR space from the Flash ROM by an instruction of “Far Jump”. Thereafter, the CPU runs the BIOS programs completely in the CAR space (S15).


Running in the 32-bit protect mode, the CPU reads and runs the BIOS programs from the CAR space, and at the same time stores intermediate results of the running programs (S16).


At the end of running the BIOS programs in the CAR space, the CPU initializes a system memory (S17).


After the system memory is initialized, the CPU switches back to the 16-bit Big-Real mode (USE16 code/USE32 data), so as to escape from the CAR space (S18).


The CPU jumps to the Return Entry to the Flash ROM from the CAR again by the instruction of “Far Jump”, so the CPU again reads the BIOS programs from the Flash Rom (S19).


Before using the system memory, the BIOS turns off the NEM mode of the cache, turns off the Cache-As-RAM function, and restores the cache to the default state (S20).


The CPU copies the BIOS modules that have not been run yet to the system memory from the BIOS Flash ROM (S21).


The CPU runs the BIOS programs from the system memory, instead of reading the BIOS instructions from the BIOS Flash ROM, again by means of the jump instruction. The CPU runs all of the BIOS programs from the system memory so as to finish the initialization of the computer platform and finally enter an OS or Shell environment (S22).


The embodiments described above are intended to illustrate while not limit the technical solution of the present invention. Although the present invention is described referring to the above embodiments, it is to be understood by those skilled in the art that modifications and equivalent replacements to the present invention are possible, and those modifications and partial replacements without departing from the spirit and scope of the present invention all fall into the scope of the appended claims.

Claims
  • 1. A method for accelerating BIOS running, comprising steps of: 1) reading a first instruction from a BIOS Flash ROM and beginning to run BIOS programs, by a CPU;2) turning on a No-Eviction Mode (NEM) of a cache and initializing a Cache-As-RAM (CAR), by the CPU;3) copying the BIOS programs to a CAR space from the BIOS Flash ROM and running the BIOS programs completely in the CAR space, by the CPU;4) at the end of running the BIOS programs in the CAR space, initializing a system memory by the CPU;5) after the system memory is initialized, again reading the BIOS programs from the Flash ROM by the CPU;6) copying the BIOS program modules that have not been run yet to the system memory from the BIOS Flash ROM by the CPU; and7) running the BIOS programs from the system memory by the CPU, so as to finish the initialization of the computer.
  • 2. The method according to claim 1, wherein the step of initializing the CAR comprises: designating a base address for the CAR space, thereafter operations on the CAR space are based on the base address.
  • 3. The method according to claim 1, wherein the step of copying the BIOS programs to the CAR space comprises: setting an entry through which the BIOS programs jump to the CAR from the Flash ROM and a return entry through which the BIOS programs return to the Flash ROM from the CAR.
  • 4. The method according to claim 3, wherein the step of running the BIOS programs completely in the CAR space by the CPU comprises: jumping to the entry to the CAR space from the Flash ROM by running an instruction of “Far Jump”.
  • 5. The method according to claim 3, wherein the step of again reading the BIOS programs from the Flash ROM by the CPU comprises: jumping to the return entry to the Flash ROM from the CAR space by the instruction of “Far Jump”.
  • 6. The method according to claim 1, wherein the CPU reads the BIOS programs from the BIOS Flash ROM in a 16-bit Big-Real mode, and the CPU reads and runs the BIOS programs from the CAR space in a 32-bit protect mode.
  • 7. The method according to claim 1, wherein before the step 6), BIOS turns off the NEM mode of the cache, turns off the CAR function, and restores the cache to the default state.
Priority Claims (1)
Number Date Country Kind
200610090794.0 Jun 2006 CN national