CN100504779C - 一种加速bios运行的方法 - Google Patents

一种加速bios运行的方法 Download PDF

Info

Publication number
CN100504779C
CN100504779C CNB2006100907940A CN200610090794A CN100504779C CN 100504779 C CN100504779 C CN 100504779C CN B2006100907940 A CNB2006100907940 A CN B2006100907940A CN 200610090794 A CN200610090794 A CN 200610090794A CN 100504779 C CN100504779 C CN 100504779C
Authority
CN
China
Prior art keywords
bios
cpu
car
flash rom
bios program
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CNB2006100907940A
Other languages
English (en)
Other versions
CN101097522A (zh
Inventor
柯海滨
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Lenovo Beijing Ltd
Original Assignee
Lenovo Beijing Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Lenovo Beijing Ltd filed Critical Lenovo Beijing Ltd
Priority to CNB2006100907940A priority Critical patent/CN100504779C/zh
Priority to JP2007159869A priority patent/JP2008016020A/ja
Priority to US11/769,174 priority patent/US8037292B2/en
Publication of CN101097522A publication Critical patent/CN101097522A/zh
Application granted granted Critical
Publication of CN100504779C publication Critical patent/CN100504779C/zh
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/25Using a specific main memory architecture
    • G06F2212/251Local memory within processor subsystem
    • G06F2212/2515Local memory within processor subsystem being configurable for different purposes, e.g. as cache or non-cache memory

Abstract

本发明提出了一种利用作为RAM的高速缓存加速BIOS运行的方法,包括:在计算机上电后,CPU从BIOS Flash ROM中读取第一条指令,开始运行BIOS程序;CPU打开高速缓存的非逐出模式NEM,初始化作为RAM的高速缓存CAR;CPU将BIOS程序从BIOS Flash ROM中复制到CAR空间中,完全在CAR空间中运行BIOS程序,在CAR空间BIOS程序运行的最后,CPU初始化系统内存;系统内存初始化完成后,CPU重新从Flash ROM中读取BIOS程序,把尚未运行的BIOS程序模块从BIOS Flash ROM中复制到系统内存中,从系统内存中运行BIOS程序,完成计算机平台的初始化。

Description

一种加速BIOS运行的方法
技术领域
本发明涉及计算机领域,更具体地,涉及一种利用作为RAM的高速缓存(Cache as RAM,缩写为“CAR”)加速BIOS运行的方法。
背景技术
现有的计算机系统在上电后,CPU通过低速总线(如ISA、LPC、FWH等)从BIOS Flash ROM中读取第一条指令,并开始运行BIOS;BIOS对CPU、芯片组和外围设备进行一些简单的上电初始化后,开始初始化内存;等到内存初始化完毕后,CPU才把BIOS主程序从Flash ROM复制到系统内存中,然后从内存中读取指令,从而提高BIOS的运行速度。
中国专利申请CN03156907.2、中国专利CN1641580等通过以CPU高速缓存映射BIOS程序运行所使用的内存区域,提高访问内存的速度,从而加速BIOS程序的运行。
中国专利申请CN03156907.2和中国专利CN1641580公开了一种加速运行BIOS的方法,该方法利用CPU高速缓存映射BIOS程序所使用的内存区域,CPU在运行BIOS程序时,如果“读命中”(Cache Hit)时,则直接从高速缓存中读取BIOS指令,而不需要从系统内存中读取,因而可以加速BIOS程序的运行。
美国专利申请US2003/023812公开了一种加速运行外插卡选项ROM的方法,该方法中BIOS要运行某个外插卡的选项ROM时,把该选项ROM复制到系统内存中,然后用CPU高速缓存映射该内存区域,从而加快了选项ROM的运行。
上述方法存在以下两个缺点:
(一)只有系统内存可用后,才可以应用上述方案。但在BIOS运行初期,系统内存是不可用的,因此上述方案无法应用。
(二)即使应用了上述方案,CPU在读取BIOS程序时,也无法保证完全的“Cache Hit”,此时CPU仍然需要从系统内存中读取BIOS程序。
为了解决上述问题,加速BIOS运行,本发明提出了一种方法:把CPU的高速缓存设置成RAM(随机存取存储器)使用,这样在系统内存不可用时,也可以在这段RAM空间中运行BIOS,从而大大加快了BIOS的运行。
发明内容
新型的CPU(如Intel的Prescott、Nocona等)增加了一个新的高速缓存属性NEM(No-Eviction Mode,非逐出模式),该属性允许程序把CPU的高速缓存设置成一段RAM空间使用,即所谓的CAR(Cache—as-RAM,作为RAM的高速缓存)。利用NEM属性,计算机在上电后,BIOS通过初始化CPU的相关寄存器,打开高速缓存的CAR功能;然后把BIOS程序从Flash ROM复制到CPU高速缓存中,并直接从高速缓存中读取BIOS指令;直到大部分BIOS程序运行完毕后,再初始化系统内存;系统内存初始化完毕后,通过设置CPU的相关寄存器,关闭CAR功能,CPU从系统内存读取BIOS指令,完成全部的BIOS程序。
因此,根据本发明,提出了一种利用作为RAM的高速缓存加速BIOS运行的方法,包括以下步骤:CPU从BIOS Flash ROM中读取第一条指令,开始运行BIOS程序;CPU打开高速缓存的非逐出模式NEM,初始化作为RAM的高速缓存CAR;CPU将BIOS程序从BIOS Flash ROM中复制到CAR空间中,完全在CAR空间中运行BIOS程序,在CAR空间BIOS程序运行的最后,CPU初始化系统内存;系统内存初始化完成后,CPU重新从Flash ROM中读取BIOS程序;在使用系统内存之前,BIOS关闭高速缓存的NEM模式,关闭CAR功能,并把高速缓存恢复到缺省状态;CPU把尚未运行的BIOS程序模块从BIOS Flash ROM中复制到系统内存中;以及CPU从系统内存中运行BIOS程序,完成计算机平台的初始化。
相对于现有的技术本发明具有以下优势:
(一)本发明在BIOS运行初期就把CPU高速缓存设置成RAM使用,然后把BIOS程序复制到这段RAM空间中,因此即使在系统内存不可用时,CPU也不必通过低速总线逐个获得BIOS指令。
(二)本发明把BIOS程序复制到高速缓存后,CPU完全从高速缓存中运行BIOS程序,因为不存在“读命中”失败的问题,因此与通过高速缓存映射系统内存的方法相比,速度得到了较大的提高。
附图说明
下面将参照附图,对本发明的优选实施例进行详细的描述,其中:
图1是本发明利用NEM加速BIOS运行的方法的流程图。
具体实施方式
下面结合附图说明本发明的具体实施方式。应该指出,所描述的实施例仅是为了说明的目的,而不是对本发明范围的限制。所描述的各种数值并非用于限定本发明,这些数值可以根据本领域普通技术人员的需要进行任何适当的修改。
图1是本发明利用NEM加速BIOS运行的方法的流程图。
当计算机上电时,CPU处于实模式状态,缺省的CS(代码段寄存器):IP(指令指针)指向了BIOS Flash ROM。也就是说,系统上电后CPU从BIOS Flash ROM中读取第一条指令,开始运行BIOS程序(S10)。
CPU初始化16位Big-Real模式(即16位代码/32位地址模式),此时DS(数据段寄存器)、ES(附加段寄存器)、FS(标志段寄存器)、GS(全局段寄存器)、SS(堆栈段寄存器)段寄存器值为0,CPU有能力寻址0~4GB大小的内存空间;但CPU的取指仍然是16位的CS:IP模式(S11)。
CPU打开高速缓存的NEM(No-Eviction Mode,非逐出模式)模式,初始化Cache-As-RAM(作为RAM的高速缓存,CAR),并为CAR空间指定一个基地址。此后对CAR空间的操作都基于该基地址(S12)。
CPU将BIOS程序从BIOS Flash ROM中复制到CAR空间中,并且设置BIOS程序从Flash ROM跳转进入CAR的入口点(Entry)和BIOS程序从CAR返回Flash ROM的返回入口点(Return Entry)(S13)。
CPU切换到32位的保护模式,此时CPU无论是取指还是寻址都完全处于32位的模式(即所谓的USE32模式),以便CPU可以从CAR空间运行BIOS程序(S14)。
CPU通过运行一个“Far Jump”指令,从Flash ROM跳转到CAR空间中的程序入口点(Entry),此后CPU完全在CAR空间中运行BIOS程序(S15)。
CPU运行在32位的保护模式下,从CAR空间读取并运行BIOS程序,同时保存程序运行的中间结果(S16)。
在CAR空间BIOS程序运行的最后,CPU初始化系统内存(S17)。
系统内存初始化完成后,CPU切换回16位的Big-Real模式(USE16代码/USE32数据),以便退出CAR空间(S18)。
CPU再次通过“Far Jump”指令,从CAR空间跳转到Flash ROM中的返回入口点(Return Entry),CPU又重新从Flash ROM中读取BIOS程序(S19)。
在使用系统内存之前,BIOS关闭高速缓存的NEM模式,关闭Cache-As-RAM功能,并把高速缓存恢复到缺省状态(S20)。
CPU把尚未运行的BIOS模块从BIOS Flash ROM中复制到系统内存中(S21)。
再次通过跳转指令,使CPU从系统内存中运行BIOS程序,而不再从BIOS Flash ROM中读取BIOS指令。CPU从系统内存运行所有的BIOS程序,完成计算机平台的初始化,并最终进入OS或进入Shell环境(S22)。
最后所应说明的是:以上实施例仅仅用以说明而非限制本发明的技术方案,尽管参照上述实施例对本发明进行了详细说明,本领域的普通技术人员应当理解:依然可以对本发明进行修改或者等同替换,而不脱离本发明的精神和范围的任何修改或局部替换,其均应涵盖在本发明的权利要求范围当中。

Claims (7)

1.一种加速BIOS运行的方法,包括以下步骤:
1)CPU从BIOS Flash ROM中读取第一条指令,开始运行BIOS程序;
2)CPU打开高速缓存的非逐出模式NEM,初始化作为RAM的高速缓存CAR;
3)CPU将BIOS程序从BIOS Flash ROM中复制到CAR空间中,完全在CAR空间中运行BIOS程序;
4)在CAR空间BIOS程序运行的最后,CPU初始化系统内存;
5)系统内存初始化完成后,CPU重新从BIOS Flash ROM中读取BIOS程序;
6)CPU把尚未运行的BIOS程序模块从BIOS Flash ROM中复制到系统内存中;以及
7)CPU从系统内存中运行BIOS程序,完成计算机的初始化。
2.根据权利要求1所述的方法,其特征在于初始化CAR的步骤包括:为CAR空间指定一个基地址,并且此后对CAR空间的操作都基于所述基地址。
3.根据权利要求1所述的方法,其特征在于将BIOS程序复制到CAR空间中的步骤包括:设置BIOS程序从BIOS Flash ROM跳转进入CAR的入口点和BIOS程序从CAR返回BIOS Flash ROM的返回入口点。
4.根据权利要求3所述的方法,其特征在于CPU完全在CAR空间中运行BIOS程序的步骤包括:通过运行“Far Jump”指令,从BIOS FlashROM跳转到CAR空间中的入口点。
5.根据权利要求3所述的方法,其特征在于CPU重新从Flash ROM中读取BIOS程序的步骤包括:通过“Far Jump”指令,从CAR空间跳转到BIOS Flash ROM中的返回入口点。
6.根据权利要求1所述的方法,其特征在于CPU在16位的Big-Real模式下,从BIOS Flash ROM中读取BIOS程序;以及CPU在32位的保护模式下,从CAR空间中读取和运行BIOS程序。
7.根据权利要求1所述的方法,其特征在于,在步骤6)之前,BIOS关闭高速缓存的NEM模式,关闭CAR功能,并把高速缓存恢复到缺省状态。
CNB2006100907940A 2006-06-30 2006-06-30 一种加速bios运行的方法 Active CN100504779C (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
CNB2006100907940A CN100504779C (zh) 2006-06-30 2006-06-30 一种加速bios运行的方法
JP2007159869A JP2008016020A (ja) 2006-06-30 2007-06-18 Biosの実行を加速化する方法
US11/769,174 US8037292B2 (en) 2006-06-30 2007-06-27 Method for accelerating BIOS running

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2006100907940A CN100504779C (zh) 2006-06-30 2006-06-30 一种加速bios运行的方法

Publications (2)

Publication Number Publication Date
CN101097522A CN101097522A (zh) 2008-01-02
CN100504779C true CN100504779C (zh) 2009-06-24

Family

ID=38878276

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2006100907940A Active CN100504779C (zh) 2006-06-30 2006-06-30 一种加速bios运行的方法

Country Status (3)

Country Link
US (1) US8037292B2 (zh)
JP (1) JP2008016020A (zh)
CN (1) CN100504779C (zh)

Families Citing this family (28)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080103179A1 (en) 2006-10-27 2008-05-01 Tam Peter Y Combination Therapy
US8145893B2 (en) * 2007-10-26 2012-03-27 Intel Corporation Hot-plugging a memory device
DE102008011925B4 (de) * 2008-02-29 2018-03-15 Globalfoundries Inc. Sicheres Initialisieren von Computersystemen
US8103862B2 (en) * 2008-06-25 2012-01-24 Dell Products L.P. Self test initialization
US8296555B2 (en) 2008-09-18 2012-10-23 Marvell World Trade Ltd. Preloader
KR101543581B1 (ko) * 2009-02-25 2015-08-11 삼성전자주식회사 시스템 온 칩 및 이를 포함하는 전자 시스템
TWI464681B (zh) * 2010-08-17 2014-12-11 Wistron Corp 加速開機方法及系統
US8847967B2 (en) * 2010-11-08 2014-09-30 Dell Products, Lp System and method for providing instant video in an information handling system
US8990548B2 (en) * 2011-04-11 2015-03-24 Intel Corporation Apparatuses for configuring programmable logic devices from BIOS PROM
US9141394B2 (en) * 2011-07-29 2015-09-22 Marvell World Trade Ltd. Switching between processor cache and random-access memory
US9436629B2 (en) 2011-11-15 2016-09-06 Marvell World Trade Ltd. Dynamic boot image streaming
CN103677867A (zh) * 2012-09-05 2014-03-26 珠海扬智电子科技有限公司 快速恢复开机状态的电子装置、控制单元及其控制方法
TWI497302B (zh) * 2012-11-28 2015-08-21 Via Tech Inc 電腦裝置及其操作方法
US9575768B1 (en) 2013-01-08 2017-02-21 Marvell International Ltd. Loading boot code from multiple memories
US9736801B1 (en) 2013-05-20 2017-08-15 Marvell International Ltd. Methods and apparatus for synchronizing devices in a wireless data communication system
US9521635B1 (en) 2013-05-21 2016-12-13 Marvell International Ltd. Methods and apparatus for selecting a device to perform shared functionality in a deterministic and fair manner in a wireless data communication system
US9836306B2 (en) 2013-07-31 2017-12-05 Marvell World Trade Ltd. Parallelizing boot operations
JP2015191606A (ja) 2014-03-28 2015-11-02 富士通株式会社 情報処理装置、情報処理装置の制御方法及び情報処理装置の制御プログラム
CN104021086B (zh) * 2014-05-26 2016-12-07 西安交通大学 一种8位单片机读写16位存储单元ram的实现方法
JP6455353B2 (ja) 2015-07-23 2019-01-23 富士通株式会社 並列計算機、並列計算機の初期化方法および起動プログラム
CN105511631B (zh) * 2016-01-19 2018-08-07 北京小米移动软件有限公司 手势识别方法及装置
EP3427435A1 (en) 2016-03-08 2019-01-16 Marvell World Trade Ltd. Methods and apparatus for secure device authentication
CN111133414A (zh) * 2017-12-25 2020-05-08 英特尔公司 存储器初始化前多线程并行计算平台
US11360783B2 (en) * 2019-12-27 2022-06-14 Quanta Computer Inc. Method and system for booting from a split BIOS image
US20230176735A1 (en) * 2020-05-22 2023-06-08 Intel Corporation Accelerating system boot times via host-managed device memory
CN113064646A (zh) * 2021-03-24 2021-07-02 山东英信计算机技术有限公司 一种bios启动方法、系统及相关装置
CN113448639B (zh) * 2021-08-27 2022-02-18 阿里云计算有限公司 用户配置变量区的访问方法、装置、设备和存储介质
US11635968B2 (en) * 2021-09-15 2023-04-25 International Business Machines Corporation Using idle caches as a backing store for boot code

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6298443A (ja) * 1985-10-25 1987-05-07 Hitachi Ltd デ−タ処理装置
US5410711A (en) * 1991-02-14 1995-04-25 Dell Usa, L.P. Portable computer with BIOS-independent power management
US6167532A (en) * 1998-02-05 2000-12-26 Compaq Computer Corporation Automatic system recovery
JP2003248580A (ja) * 2002-02-22 2003-09-05 Seiko Epson Corp プログラムおよび情報処理装置
US7127579B2 (en) * 2002-03-26 2006-10-24 Intel Corporation Hardened extended firmware interface framework
US7254676B2 (en) * 2002-11-15 2007-08-07 Intel Corporation Processor cache memory as RAM for execution of boot code
US20040103272A1 (en) * 2002-11-27 2004-05-27 Zimmer Vincent J. Using a processor cache as RAM during platform initialization
JP2004295397A (ja) * 2003-03-26 2004-10-21 Seiko Epson Corp コンピュータシステム、コンピュータシステムの起動方法及びそのプログラム
JP2004348677A (ja) * 2003-05-26 2004-12-09 Sony Corp プログラムおよび情報処理方法
US7493460B2 (en) * 2005-09-07 2009-02-17 Intel Corporation Preboot memory of a computer system

Also Published As

Publication number Publication date
US8037292B2 (en) 2011-10-11
JP2008016020A (ja) 2008-01-24
CN101097522A (zh) 2008-01-02
US20080005549A1 (en) 2008-01-03

Similar Documents

Publication Publication Date Title
CN100504779C (zh) 一种加速bios运行的方法
US7516453B1 (en) Binary translator with precise exception synchronization mechanism
US9189248B2 (en) Specialized boot path for speeding up resume from sleep state
JP5837126B2 (ja) 現在実行している命令セット以外の命令セットから命令をプリロードするシステム、方法およびソフトウェア
US20060271760A1 (en) Translation look-aside buffer
CN101013351A (zh) 硬盘驱动器高速缓存存储器及重放装置
MX2008013345A (es) Memoria asociada de instrucciones etiquetada virtualmente con un comportamiento etiquetado fisicamente.
CN109426619A (zh) 访问快闪存储器模块的方法及相关闪存控制器与电子装置
CN101246389A (zh) 提供从休眠状态瞬时接通恢复的计算系统节电方法和装置
CN102792285A (zh) 层级转换表控制
CN1200341C (zh) 嵌入式系统中固件程序在线升级的实现方法
KR20060061832A (ko) 메모리를 소거하는 메모리 제어기를 포함하는 신뢰성있는실행 환경을 이용한 컴퓨터 시스템
GB2514107A (en) Page table data management
US7398383B2 (en) Method and system for using internal FIFO RAM to improve system boot times
US20080162611A1 (en) Methods and apparatus for marking objects for garbage collection in an object-based memory system
US20140173203A1 (en) Block Memory Engine
JP2002236589A (ja) コンピュータシステムのbiosデータ格納装置及びその駆動方法
US8473722B2 (en) Processor architecture for exact pointer identification
US9507709B2 (en) Hibernation based on page source
US20040243767A1 (en) Method and apparatus for prefetching based upon type identifier tags
JPH11265286A (ja) レガシ指令のエミュレ―ション装置及び方法
WO2006120408A2 (en) Memory caching in data processing
KR20010014096A (ko) 개선된 마이크로프로세서를 위한 변환된 메모리 보호 장치
US20050005071A1 (en) Method for synchronizing a cache memory with a main memory
TWI416324B (zh) 用於嵌入式控制器裝置之結構化虛擬暫存器

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant