CN1658161A - System with primary application and spare program and starting method - Google Patents
System with primary application and spare program and starting method Download PDFInfo
- Publication number
- CN1658161A CN1658161A CN 200410005650 CN200410005650A CN1658161A CN 1658161 A CN1658161 A CN 1658161A CN 200410005650 CN200410005650 CN 200410005650 CN 200410005650 A CN200410005650 A CN 200410005650A CN 1658161 A CN1658161 A CN 1658161A
- Authority
- CN
- China
- Prior art keywords
- boot
- main
- logic controller
- processor
- storer
- 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.)
- Granted
Links
Landscapes
- Stored Programmes (AREA)
Abstract
本发明公开了一种具有主用和备用引导程序的系统及启动方法,其中系统包括处理器,存储主用引导程序的主用存储器和存储备用引导程序的备用存储器,与处理器、主用存储器和备用存储器连接的逻辑控制器;系统启动时,该逻辑控制器选择从主用存储器或备用存储器执行引导程序。
The invention discloses a system with main and standby boot programs and a starting method, wherein the system includes a processor, a main storage for storing the main boot program, and a backup storage for storing the backup boot program, and the processor and the main storage A logic controller connected to the backup memory; when the system starts, the logic controller selects to execute the boot program from the main memory or the backup memory.
Description
技术领域technical field
本发明涉及电子和通信技术,尤其涉及具有主用和备用引导程序的系统及启动方法。The invention relates to electronics and communication technology, in particular to a system with main and standby boot programs and a starting method.
背景技术Background technique
随着通信技术的飞速发展,新的通讯协议和新的硬件接口不断的被开发出来,从而导致对设备制造商已经发售给用户的软件系统进行升级。应用软件的在线升级已经比较普及,为了提高产品的可维护性,用于引导系统启动的只读存储器(以下称BOOTROM)中的引导程序的在线升级已经被提上日程。With the rapid development of communication technology, new communication protocols and new hardware interfaces are constantly being developed, which leads to the upgrading of software systems that equipment manufacturers have sold to users. The online upgrade of application software has been relatively popular. In order to improve the maintainability of the product, the online upgrade of the boot program in the read-only memory (hereinafter referred to as BOOTROM) for booting the system has been put on the agenda.
现有能提供在线升级能力单板的BOOTROM都只是使用一片,启动和升级都是使用的这个BOOTROM,通过在该芯片上引入写信号,使其具备在线升级的能力。The BOOTROM of the existing single board that can provide online upgrade capability only uses one piece, and this BOOTROM is used for both startup and upgrade. By introducing a write signal on the chip, it has the ability of online upgrade.
由于在线升级的时候设备的工作状态是各种各样的,如果升级到一半的时候突然系统断电或是重启,将会导致升级失败,由于只有一片BOOTROM,升级失败后单板将无法再次启动,因此不能再次升级,只能返修,这样单板的维护成本会非常的高,而且还需要承担在返修过程中客户无法使用的其他责任。Due to the various working states of the device during the online upgrade, if the system is suddenly powered off or restarted halfway through the upgrade, the upgrade will fail. Since there is only one BOOTROM, the board will not be able to start again after the upgrade fails. , so it cannot be upgraded again, but can only be repaired, so the maintenance cost of the single board will be very high, and it is necessary to bear other responsibilities that the customer cannot use during the repair process.
另外,由于有写信号引入唯一的BOOTROM中,软件可能会有误操作而错误的改写了BOOTROM中的内容,造成下一次启动失败,也无法升级,导致单板的返修。In addition, because the write signal is introduced into the only BOOTROM, the software may misoperate and rewrite the contents of the BOOTROM by mistake, causing the next startup to fail, and it cannot be upgraded, resulting in the repair of the single board.
发明内容Contents of the invention
本发明的目的在于提供一种具有主用和备用引导程序的系统及启动方法,以解决现有技术中系统的唯一的引导程序在升级失败或错误改写后存在无法启动系统的问题。The purpose of the present invention is to provide a system and start-up method with main and backup boot programs, so as to solve the problem that the only boot program of the system in the prior art cannot start the system after the upgrade fails or is wrongly rewritten.
为解决上述问题,本发明提供以下技术方案:In order to solve the above problems, the present invention provides the following technical solutions:
一种具有主用和备用引导程序的系统启动方法,该方法为:A method of system booting with active and alternate bootloaders, the method being:
选择主用引导程序引导系统启动,并开始计时;Select the main bootloader to boot the system and start timing;
在计时到达系统能够完成正常启动的预定时间时,判断特定寄存器是否被设置为预定值;When the timing reaches the scheduled time for the system to complete normal startup, determine whether a specific register is set to a predetermined value;
如果是,则系统运行其他程序,否则,复位系统并选择备用引导程序引导系统启动。If yes, the system runs other programs, otherwise, resets the system and selects an alternate boot program to boot the system.
其中:in:
在所述主用引导程序和备用引导程序中仅有主用引导程序可进行在线升级。对主用引导程序进行在线升级时,首先检查使能开关是否打开,如果是则允许升级,否则不允许升级。Among the active boot program and the standby boot program, only the active boot program can be upgraded online. When performing an online upgrade of the main bootloader, first check whether the enable switch is turned on, if yes, the upgrade is allowed, otherwise the upgrade is not allowed.
在执行引导程序前将所述特定寄存器设置成与预定值不同的初始值。The specific register is set to an initial value different from a predetermined value before executing the boot program.
一种具有主用和备用引导程序的系统,包括处理器,与处理器连接并用于存储引导程序的存储器;其中,该系统还包括与处理器和存储器连接的逻辑控制器;所述存储器包括存储主用引导程序的主用存储器和存储备用引导程序的备用存储器;所述系统启动时,该逻辑控制器选择从主用存储器或备用存储器执行引导程序。A system with main and standby boot programs, including a processor, a memory connected to the processor and used to store the boot program; wherein, the system also includes a logic controller connected to the processor and the memory; the memory includes storage The main storage for the active boot program and the backup storage for storing the backup boot program; when the system is started, the logic controller selects to execute the boot program from the main storage or the backup storage.
所述逻辑控制器通过地址总线、数据总线和控制线与处理器连接;所述主用存储器和备用存储器通过地址总线、数据总线与处理器连接,通过控制线与逻辑控制器连接。The logic controller is connected to the processor through an address bus, a data bus and a control line; the main memory and the backup memory are connected to the processor through an address bus and a data bus, and connected to the logic controller through a control line.
逻辑控制器与处理器连接的控制线包括数据写信号线、选择引导程序的片选信号线和该逻辑控制器的片选信号线。The control lines connected between the logic controller and the processor include a data write signal line, a chip selection signal line for selecting a boot program, and a chip selection signal line of the logic controller.
主用存储器与逻辑控制器连接的控制线包括片选信号线和数据写信号线;备用存储器与逻辑控制器连接的控制线为片选信号线。The control line connecting the main memory to the logic controller includes a chip selection signal line and a data write signal line; the control line connecting the backup memory to the logic controller is a chip selection signal line.
本发明具有主用和备用引导程序,在执行主用引导程序失败时自动选择备用引导程序来引导系统,能够确保系统启动的可靠性;而且在主用引导程序升级失败的情况下照样能使系统启动,进行下一次升级,因而具有可维护性好和维护成本低的特点。The present invention has main and standby boot programs, and automatically selects the standby boot program to guide the system when the main boot program fails to execute, which can ensure the reliability of system startup; It can be started for the next upgrade, so it has the characteristics of good maintainability and low maintenance cost.
附图说明Description of drawings
图1为本发明的系统中控制主用和备用存储器的原理图。Fig. 1 is a schematic diagram of controlling primary and secondary storage in the system of the present invention.
具体实施方式Detailed ways
参阅图1所示的系统,包括处理器、逻辑控制器、主用存储器(以下称主用BOOTROM)和备用存储器(以下称备用BOOTROM)。主用BOOTROM和备用BOOTROM中分别存储有引导系统启动的引导程序,主用逻辑控制器采用可擦除的可编程逻辑器件(以下称EPLD)。Referring to the system shown in FIG. 1 , it includes a processor, a logic controller, a main memory (hereinafter referred to as the main BOOTROM) and a backup memory (hereinafter referred to as the standby BOOTROM). The main BOOTROM and the standby BOOTROM respectively store a boot program for booting the system, and the main logic controller adopts an erasable programmable logic device (hereinafter referred to as EPLD).
EPLD、主用BOOTROM和备用BOOTROM通过数据线和地址线与处理器连接。EPLD接收处理器输出的片选择信号EPLD_CS、选择启动BOOTROM的片选信号BOOT_CS和数据线写信号DATA_WR。片选信号BOOT_CS经EPLD控制以后分成控制主用BOOTROM的片选信号MAIN_CS和控制备用BOOTROM的片选信号BACK_CS。EPLD只送出一路写信号MAINBOOT_WR到主用BOOTROM,备用BOOTROM没有写信号。EPLD, main BOOTROM and standby BOOTROM are connected with the processor through data lines and address lines. The EPLD receives the chip selection signal EPLD_CS output by the processor, the chip selection signal BOOT_CS for selecting and starting the BOOTROM, and the data line write signal DATA_WR. After being controlled by EPLD, the chip select signal BOOT_CS is divided into the chip select signal MAIN_CS controlling the main BOOTROM and the chip select signal BACK_CS controlling the standby BOOTROM. EPLD only sends one write signal MAINBOOT_WR to the main BOOTROM, and the backup BOOTROM has no write signal.
在系统上电复位时,处理器会发出BOOT_CS信号来选择BOOTROM芯片启动,该信号传送到EPLD,同时产生片选信号EPLD_CS使EPLD处于工作状态。EPLD根据片选信号BOOT_CS产生片选信号MAIN_CS并送给主用BOOTROM,通过片选信号MAIN_CS选中主用BOOTROM,代码开始从主用BOOTROM执行,同时EPLD中的计时器开始计时。主用BOOTROM正常启动以后,会向EPLD的指定寄存器中写入一个预定值,用来指示现在是从主用BOOTROM启动的;该指定寄存器在执行主用BOOTROM中的引导程序前设置为与预定值不同的初始值。如果EPLD在系统应该能正常启动的时间内收到了该值则系统正常启动,开始运行其他程序,如果EPLD在计时到系统应该能正常启动的时间时还没有收到主用BOOTROM写过来的值,即指定寄存器中的值不是预定值,则认为主用BOOTROM出现了问题,复位处理器,准备从备用BOOTROM引导启动。这次在处理器发送了BOOTROM片选信号后,EPLD输出片选信号BACK_CS送给备用BOOTROM,系统开始从备用BOOTROM引导。由于备用BOOTROM没有写信号,所以内容不会被改写,也不会出现无法引导系统启动的情况。When the system is powered on and reset, the processor will send a BOOT_CS signal to select the BOOTROM chip to start, and the signal will be sent to the EPLD, and at the same time, the chip select signal EPLD_CS will be generated to make the EPLD work. EPLD generates the chip selection signal MAIN_CS according to the chip selection signal BOOT_CS and sends it to the main BOOTROM. The main BOOTROM is selected through the chip selection signal MAIN_CS, and the code starts to be executed from the main BOOTROM, and the timer in the EPLD starts timing. After the main BOOTROM starts normally, it will write a predetermined value into the designated register of EPLD to indicate that it is now started from the main BOOTROM; the designated register is set to the predetermined value before executing the boot program in the main BOOTROM. different initial values. If EPLD receives this value within the time that the system should be able to start normally, the system will start normally and start running other programs. That is, if the value in the specified register is not the predetermined value, it is considered that there is a problem with the main BOOTROM, and the processor is reset to prepare to boot from the standby BOOTROM. This time, after the processor sends the BOOTROM chip selection signal, the EPLD outputs the chip selection signal BACK_CS to the backup BOOTROM, and the system starts to boot from the backup BOOTROM. Since the backup BOOTROM has no write signal, the content will not be rewritten, and the system will not be unable to boot.
为了减小主用BOOTROM被软件任意改写的几率,在EPLD中设置一个使能开关,在进行在线升级前先检查该开关是否打开,只有在该使能开关打开的情况下EPLD才能输出写信号MAINBOOT_WR给主用BOOTROM,因此,在升级前先将该使能开关打开,升级主用BOOTROM完成以后关闭该使能开关。使能开关可以通过在一个寄存器中设置特定值来实现。当然也可以是在EPLD外通过常用的硬件方式实现,由EPLD判断该硬件开关是否打开。In order to reduce the probability of the main BOOTROM being arbitrarily rewritten by software, set an enabling switch in the EPLD, and check whether the switch is turned on before performing an online upgrade. Only when the enabling switch is turned on, the EPLD can output the write signal MAINBOOT_WR For the main BOOTROM, therefore, turn on the enable switch before the upgrade, and turn off the enable switch after the upgrade of the main BOOTROM is completed. Enabling the switch can be done by setting a specific value in a register. Of course, it can also be implemented outside the EPLD through common hardware, and the EPLD judges whether the hardware switch is turned on.
主用引导程序和备用引导程序其中之一也可和主机代码一起放在大容量的FLASH中,但还是通过逻辑控制器来控制选择从主用引导程序还是从备用引导程序引导系统,其核心就是通过逻辑芯片来控制处理器发出的BOOTROM的片选信号来控制系统的启动。One of the main boot program and the backup boot program can also be placed in a large-capacity FLASH together with the host code, but it is still controlled by a logic controller to choose whether to boot the system from the main boot program or the backup boot program. The core is The chip selection signal of BOOTROM sent by the processor is controlled by the logic chip to control the startup of the system.
本发明在主用引导程序无法引导系统启动的情况下能够自动地从备用引导程序执行,可确保系统能正常启动,尤其适用于要求在线升级的系统。The present invention can automatically execute from the standby boot program when the main boot program cannot boot the system, can ensure the normal boot of the system, and is especially suitable for systems requiring online upgrades.
Claims (8)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CNB2004100056501A CN100353321C (en) | 2004-02-21 | 2004-02-21 | System with primary application and spare program and starting method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CNB2004100056501A CN100353321C (en) | 2004-02-21 | 2004-02-21 | System with primary application and spare program and starting method |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN1658161A true CN1658161A (en) | 2005-08-24 |
| CN100353321C CN100353321C (en) | 2007-12-05 |
Family
ID=35007666
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CNB2004100056501A Expired - Fee Related CN100353321C (en) | 2004-02-21 | 2004-02-21 | System with primary application and spare program and starting method |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN100353321C (en) |
Cited By (11)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN100373337C (en) * | 2006-01-20 | 2008-03-05 | 北京朗通环球科技有限公司 | Guide system of embedded system |
| CN101470533B (en) * | 2007-12-26 | 2011-02-16 | 宏正自动科技股份有限公司 | Multi-computer switching system and video switching system |
| CN102236590A (en) * | 2010-04-21 | 2011-11-09 | 研华股份有限公司 | Computer system with system rescue and system rescue method |
| CN101493776B (en) * | 2009-02-18 | 2012-08-22 | 宇龙计算机通信科技(深圳)有限公司 | Mobile terminal and power-on method and system thereof |
| CN102135891B (en) * | 2010-01-21 | 2013-06-26 | 杭州华三通信技术有限公司 | System capable of realizing bootload, bootload control device and method |
| CN104111851A (en) * | 2014-07-18 | 2014-10-22 | 广州市中海达测绘仪器有限公司 | Embedded system switching starter |
| CN105187752A (en) * | 2015-07-31 | 2015-12-23 | 深圳市哈工大交通电子技术有限公司 | High-reliability image processing platform |
| CN105468390A (en) * | 2014-09-05 | 2016-04-06 | 中兴通讯股份有限公司 | BOOT online upgrade apparatus and method |
| CN105653405A (en) * | 2015-12-31 | 2016-06-08 | 北京锐安科技有限公司 | Fault processing method and system of U-boot |
| CN105938445A (en) * | 2015-07-31 | 2016-09-14 | 杭州迪普科技有限公司 | Data backup method and device |
| CN111338771A (en) * | 2020-02-13 | 2020-06-26 | 深圳震有科技股份有限公司 | Boot program switching processing method and device, computer equipment and medium |
Family Cites Families (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| EP0697791B1 (en) * | 1994-08-05 | 2000-01-26 | Thomson Consumer Electronics, Inc. | Apparatus for determining if the duration of a power failure exceeded predetermined limits |
| CN1197018C (en) * | 2001-03-01 | 2005-04-13 | 中兴通讯股份有限公司 | Device and method for implementing dual system slots |
| CN100388218C (en) * | 2002-06-27 | 2008-05-14 | 中兴通讯股份有限公司 | A method of implementing backup between servers |
-
2004
- 2004-02-21 CN CNB2004100056501A patent/CN100353321C/en not_active Expired - Fee Related
Cited By (16)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN100373337C (en) * | 2006-01-20 | 2008-03-05 | 北京朗通环球科技有限公司 | Guide system of embedded system |
| CN101470533B (en) * | 2007-12-26 | 2011-02-16 | 宏正自动科技股份有限公司 | Multi-computer switching system and video switching system |
| CN101493776B (en) * | 2009-02-18 | 2012-08-22 | 宇龙计算机通信科技(深圳)有限公司 | Mobile terminal and power-on method and system thereof |
| CN102135891B (en) * | 2010-01-21 | 2013-06-26 | 杭州华三通信技术有限公司 | System capable of realizing bootload, bootload control device and method |
| CN102236590A (en) * | 2010-04-21 | 2011-11-09 | 研华股份有限公司 | Computer system with system rescue and system rescue method |
| CN104111851B (en) * | 2014-07-18 | 2017-09-22 | 广州市中海达测绘仪器有限公司 | Embedded system switches starter |
| CN104111851A (en) * | 2014-07-18 | 2014-10-22 | 广州市中海达测绘仪器有限公司 | Embedded system switching starter |
| CN105468390B (en) * | 2014-09-05 | 2020-11-06 | 中兴通讯股份有限公司 | BOOT online upgrading device and method |
| CN105468390A (en) * | 2014-09-05 | 2016-04-06 | 中兴通讯股份有限公司 | BOOT online upgrade apparatus and method |
| CN105938445B (en) * | 2015-07-31 | 2019-09-06 | 杭州迪普科技股份有限公司 | Data back up method and device |
| CN105938445A (en) * | 2015-07-31 | 2016-09-14 | 杭州迪普科技有限公司 | Data backup method and device |
| CN105187752A (en) * | 2015-07-31 | 2015-12-23 | 深圳市哈工大交通电子技术有限公司 | High-reliability image processing platform |
| CN105653405B (en) * | 2015-12-31 | 2018-12-14 | 北京锐安科技有限公司 | A kind of fault handling method and system of Generic Bootstrap |
| CN105653405A (en) * | 2015-12-31 | 2016-06-08 | 北京锐安科技有限公司 | Fault processing method and system of U-boot |
| CN111338771A (en) * | 2020-02-13 | 2020-06-26 | 深圳震有科技股份有限公司 | Boot program switching processing method and device, computer equipment and medium |
| CN111338771B (en) * | 2020-02-13 | 2023-06-30 | 深圳震有科技股份有限公司 | Method and device for processing boot program switching, computer equipment and medium |
Also Published As
| Publication number | Publication date |
|---|---|
| CN100353321C (en) | 2007-12-05 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN101329632B (en) | Method and apparatus for starting CPU by BOOT | |
| CN109358887B (en) | On-line upgrading method, device and system for single chip microcomputer program | |
| JP5575338B2 (en) | Information processing apparatus, information processing method, and computer program | |
| US9110843B2 (en) | Rack and method thereof for simultaneously updating basic input output systems | |
| CN109960523B (en) | Firmware upgrade method and device for an embedded device | |
| CN102141940B (en) | Device, method and system for recovering firmware update | |
| CN101373433A (en) | Method for updating BIOS and computer and system using the method | |
| CN106598654B (en) | Method for updating PowerPC mainboard boot chip on line | |
| TW201345760A (en) | In-vehicle apparatus | |
| CN102945173A (en) | User program on-line upgrading system and method | |
| CN105760191A (en) | Embedded system equipment programming mass production method | |
| CN101634960A (en) | Method for revising BIOS parameter and regenerating checksum | |
| CN100353321C (en) | System with primary application and spare program and starting method | |
| JP2002278783A (en) | System for rewriting firmware | |
| CN105468390A (en) | BOOT online upgrade apparatus and method | |
| CN100362470C (en) | A kind of BIOS online upgrade device and method | |
| CN117806924B (en) | Control method and device of indicating device, server and medium | |
| US20060010282A1 (en) | Method and apparatus to boot a system by monitoring an operating status of a NAND flash memory | |
| CN115113905A (en) | Firmware upgrade method and firmware upgrade device | |
| CN103890713A (en) | Apparatus and method for managing register information in processing system | |
| US20060224874A1 (en) | Method for updating system management basic input output system (SMBIOS) data | |
| JP2008009721A (en) | Evaluation system and evaluation method thereof | |
| CN119473432A (en) | System startup method, device, computer equipment and storage medium | |
| EP2730993B1 (en) | Reset method and network device | |
| CN1323361C (en) | Processor system and method using multi memory of start-up procedure |
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 | ||
| CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20071205 Termination date: 20150221 |
|
| EXPY | Termination of patent right or utility model |