[go: up one dir, main page]

CN111176875B - BIOS time reset recovery method - Google Patents

BIOS time reset recovery method Download PDF

Info

Publication number
CN111176875B
CN111176875B CN201911339908.4A CN201911339908A CN111176875B CN 111176875 B CN111176875 B CN 111176875B CN 201911339908 A CN201911339908 A CN 201911339908A CN 111176875 B CN111176875 B CN 111176875B
Authority
CN
China
Prior art keywords
time
current time
bios
correct
current
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
CN201911339908.4A
Other languages
Chinese (zh)
Other versions
CN111176875A (en
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.)
Beijing Aerospace Era Laser Navigation Technology Co ltd
Original Assignee
Beijing Aerospace Era Laser Navigation Technology Co 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 Beijing Aerospace Era Laser Navigation Technology Co ltd filed Critical Beijing Aerospace Era Laser Navigation Technology Co ltd
Priority to CN201911339908.4A priority Critical patent/CN111176875B/en
Publication of CN111176875A publication Critical patent/CN111176875A/en
Application granted granted Critical
Publication of CN111176875B publication Critical patent/CN111176875B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0751Error or fault detection not based on redundancy
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0793Remedial or corrective actions
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a recovery method for BIOS time reset, which comprises the following steps: judging whether the current time of the system is correct or not; if the current time of the system is incorrect, receiving the current time input from the outside; judging whether the current time input from the outside is correct or not; if the current time of the external input is correct, setting the current time of the external input as BIOS clock time; reading BIOS clock time, and converting the read BIOS clock time into modified current system time; judging whether the current time of the modified system is correct or not; if the current time of the modified system is correct, entering a system flow. The system time interface is designed and modified at the application layer of the vxworks system, after the vxworks system is started, whether the current time is correct or not is firstly obtained and judged, and the system time is recovered to the correct current time by calling the system time interface under the condition of error, so that the operation flow is simple and the maintenance is simple.

Description

BIOS time reset recovery method
Technical Field
The invention belongs to the technical field of BIOS time reset, and particularly relates to a recovery method of BIOS time reset.
Background
The vxworks system is widely applied to the fields of communication, military, aerospace, ships, aviation and the like as an embedded real-time operation system. The vxworks system runs on the industrial computer main board, and the user designs an application program to realize the functions of controlling, testing and the like of industrial products. After the industrial computer equipment is stopped, the industrial computer equipment is powered off and stored in a warehouse, when the electric quantity of a main board battery is insufficient, the BIOS time is reset to the factory time, and the vxworks system time is wrong.
BIOS time reset generally needs to take out the main board of industrial computer equipment, replace the main board battery, enter the BIOS interface to reset the system time to the current time after restarting and powering on, and has the advantages of complex operation flow, long maintenance period and great difficulty.
Disclosure of Invention
The technical solution of the invention is as follows: the method for restoring BIOS time reset is characterized in that a system time interface is modified through design of an application layer of a vxworks system, whether the current time is correct or not is firstly obtained and judged after the vxworks system is started, the modified system time interface is called under the condition of error, the system time is restored to the correct current time, the operation flow is simple, and the maintenance is simple.
In order to solve the technical problems, the invention discloses a recovery method for BIOS time reset, which comprises the following steps:
judging whether the current time of the system is correct or not;
if the current time of the system is incorrect, receiving the current time input from the outside;
judging whether the current time input from the outside is correct or not;
if the current time of the external input is correct, setting the current time of the external input as BIOS clock time;
reading BIOS clock time, and converting the read BIOS clock time into modified current system time;
judging whether the current time of the modified system is correct or not;
if the current time of the modified system is correct, entering a system flow.
The recovery method for resetting BIOS time further comprises: if the current time of the system is correct, entering the system flow.
The recovery method for resetting BIOS time further comprises: if the current time of the external input is incorrect, returning to receive the external input of the next round again.
The recovery method for resetting BIOS time further comprises: if the current time of the modified system is incorrect, prompting that the time setting is failed, and performing manual investigation.
The recovery method for resetting BIOS time further comprises: starting the vxworks system, calling a function in time.h, and extracting the current time of the system from the function in time.h.
In the recovery method of BIOS time reset, the function in time.h is the date and time header file in C/C++, which supports vxworks, linux, windows operating system.
In the recovery method of BIOS time reset, the current time of external input includes: year, month, day, hour, minute, second.
In the recovery method of BIOS time reset, a function in time.h is called, and the read BIOS clock time is converted into the modified current system time.
The invention has the following advantages:
the invention discloses a recovery method for BIOS time reset, which comprises the steps of firstly acquiring and judging whether the current time is correct after the vxworks system is started by designing and modifying a system time interface at an application layer of the vxworks system, calling and modifying the system time interface under the condition of error, recovering the system time to the correct current time, and the recovery method is simple and convenient to operate, can be directly used at the system application layer, and reduces maintenance period and cost.
Drawings
FIG. 1 is a flowchart illustrating a method for recovering BIOS time reset according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present invention more apparent, the embodiments of the present invention disclosed herein will be described in further detail with reference to the accompanying drawings.
As shown in fig. 1, in this embodiment, the recovery method for the BIOS time reset includes:
and step 101, starting the vxworks system, calling a function in the time.h, and extracting the current time of the system from the function in the time.h.
In this embodiment, the function in time.h is the date and time header file in C/C++, supporting the vxworks, linux, windows operating system.
Step 102, judging whether the current time of the system is correct.
In this embodiment, the manner of determining whether the current time of the system is correct is as follows:
a) Generally, if the year information in the factory time of the BIOS is 1900, if the year information in the current time of the system obtained in step 101 is 1900, it may be determined that the current time of the system is incorrect.
b) And comparing the year information in the current time of the system obtained in the step 101 with the software development year, and if the year information in the current time of the system obtained in the step 101 is smaller than the software development year, determining that the current time of the system is incorrect. For example, if a software development year is 2019, if the year information in the current time of the system acquired in step 101 is less than 2019, it may be determined that the current time of the system is incorrect.
Preferably, if the current time of the system is incorrect, step 103 is executed; if the current time of the system is correct, step 108 is executed to enter the system flow.
Step 103, receiving the current time of the external input.
In this embodiment, the current time of the external input includes: year, month, day, hour, minute, second. Preferably, the QDateEdit year, month and day control and the QTimeEdit time-division and second control can be used for realizing the external input of the current time, and the rationality of month and day corresponding to the automatic detection can be realized.
Step 104, judging whether the current time input from the outside is correct.
In this embodiment, if the current time of the external input is correct, step 105 is executed; if the current time of the external input is incorrect, the process returns to step 103, and the external input of the next round is received again.
Step 105, setting the current time of the external input as the BIOS clock time.
In this embodiment, a function in time.h may be called, and the current time of the external input is set as the BIOS clock time: under the X86 architecture, the sysOutByte () function is used to write the acquired time-saving address at port 0X70 (0 xbfd00070 under the MIPS architecture), and then the time value to be set is written from port 0X71 (0 xbfd00071 under the MIPS architecture), address 0X00 corresponds to seconds, address 0X02 corresponds to minutes, address 0X04 corresponds to days, address 0X07 corresponds to months, and address 0X09 corresponds to years.
Step 106, the BIOS clock time is read, and the read BIOS clock time is converted into the modified current system time.
In this embodiment, a function in time.h may be called to convert the read BIOS clock time into a modified current system time: under the X86 architecture, BIOS clock time is read under the vxworks system, a time deposit address to be acquired is written from the port 0X70 (0 xbfd00070 under the MIPS architecture) by using a sysOutByte () function, and the time deposit address is fetched from the port 0X71 (0 xbfd00071 under the MIPS architecture) by using a sysInByte () function.
Step 107, it is determined whether the current time of the modified system is correct.
In this embodiment, if the modified current time of the system is correct, step 108 is executed, and the system flow is entered; if the current time of the modified system is incorrect, prompting that the time setting is failed, and performing manual investigation.
Step 108, entering the system flow.
Although the present invention has been described in terms of the preferred embodiments, it is not intended to be limited to the embodiments, and any person skilled in the art can make any possible variations and modifications to the technical solution of the present invention by using the methods and technical matters disclosed above without departing from the spirit and scope of the present invention, so any simple modifications, equivalent variations and modifications to the embodiments described above according to the technical matters of the present invention are within the scope of the technical matters of the present invention.
What is not described in detail in the present specification belongs to the known technology of those skilled in the art.

Claims (5)

1. A method for recovering a BIOS time reset, comprising:
the method comprises the steps of designing and modifying a system time interface at an application layer of a vxworks system, starting the vxworks system, calling a function in time.h, and extracting the current time of the system from the function in time.h;
judging whether the current time of the system is correct or not;
if the current time of the system is incorrect, receiving the current time input from the outside;
judging whether the current time input from the outside is correct or not;
if the current time of the external input is correct, setting the current time of the external input as BIOS clock time;
reading BIOS clock time, and converting the read BIOS clock time into modified current system time;
judging whether the current time of the modified system is correct or not;
if the current time of the modified system is correct, entering a system flow;
wherein:
there are two ways to determine whether the current time of the system is correct:
a) If the year information in the current time of the system is 1900, determining that the current time of the system is incorrect;
b) Comparing the year information in the current time of the system with the software development year, and if the year information in the current time of the system is smaller than the software development year, determining that the current time of the system is incorrect;
the present time of the external input is set as BIOS clock time by:
calling a function in time.h, and setting the current time of external input as BIOS clock time: under the X86 architecture, the sysOutByte () function is used for writing the acquired time storage address at the port 0X70, then writing the time value to be set from the port 0X71, the address 0X00 corresponds to seconds, the address 0X02 corresponds to minutes, the address 0X04 corresponds to days, the address 0X07 corresponds to months, and the address 0X09 corresponds to years; the function in time.h is a date and time header file in C/C++, which supports vxworks, linux, windows operating system;
the read BIOS clock time is converted into the modified system current time by the following method:
calling a function in time.h, and converting the read BIOS clock time into the modified current system time: under the X86 architecture, BIOS clock time is read under the vxworks system, a time deposit address to be acquired is written from the port 0X70 by using a sysOutByte () function, and the time deposit address is fetched from the port 0X71 by using a sysInByte () function.
2. The method for recovering a BIOS time reset according to claim 1, further comprising: if the current time of the system is correct, entering the system flow.
3. The method for recovering a BIOS time reset according to claim 1, further comprising: if the current time of the external input is incorrect, returning to receive the external input of the next round again.
4. The method for recovering a BIOS time reset according to claim 1, further comprising: if the current time of the modified system is incorrect, prompting that the time setting is failed, and performing manual investigation.
5. The method for recovering a BIOS time reset according to claim 1, wherein the current time of the external input comprises: year, month, day, hour, minute, second.
CN201911339908.4A 2019-12-23 2019-12-23 BIOS time reset recovery method Active CN111176875B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911339908.4A CN111176875B (en) 2019-12-23 2019-12-23 BIOS time reset recovery method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911339908.4A CN111176875B (en) 2019-12-23 2019-12-23 BIOS time reset recovery method

Publications (2)

Publication Number Publication Date
CN111176875A CN111176875A (en) 2020-05-19
CN111176875B true CN111176875B (en) 2023-08-29

Family

ID=70652126

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911339908.4A Active CN111176875B (en) 2019-12-23 2019-12-23 BIOS time reset recovery method

Country Status (1)

Country Link
CN (1) CN111176875B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH1049246A (en) * 1996-07-31 1998-02-20 Toshiba Corp Computer system and its starting method
WO1998029809A2 (en) * 1996-12-31 1998-07-09 Viasoft, Inc. Method and apparatus for identifying and correcting date errors
KR19990026800A (en) * 1997-09-26 1999-04-15 윤종용 How to Set Initial Value for Operating System Timer
CN101840365A (en) * 2010-04-30 2010-09-22 广州广电运通金融电子股份有限公司 Safe protection method and system for BIOS (Basic Input/Output System)
CN103942069A (en) * 2014-04-01 2014-07-23 西安睿控创合电子科技有限公司 Quick starting optimizing method based on X86 platform Vxworks operation system
CN104573509A (en) * 2013-10-21 2015-04-29 研祥智能科技股份有限公司 System time protection method and system time protection device
CN104991782A (en) * 2015-07-23 2015-10-21 英业达科技有限公司 Method and system for modifying BIOS configuration

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH1049246A (en) * 1996-07-31 1998-02-20 Toshiba Corp Computer system and its starting method
WO1998029809A2 (en) * 1996-12-31 1998-07-09 Viasoft, Inc. Method and apparatus for identifying and correcting date errors
KR19990026800A (en) * 1997-09-26 1999-04-15 윤종용 How to Set Initial Value for Operating System Timer
CN101840365A (en) * 2010-04-30 2010-09-22 广州广电运通金融电子股份有限公司 Safe protection method and system for BIOS (Basic Input/Output System)
CN104573509A (en) * 2013-10-21 2015-04-29 研祥智能科技股份有限公司 System time protection method and system time protection device
CN103942069A (en) * 2014-04-01 2014-07-23 西安睿控创合电子科技有限公司 Quick starting optimizing method based on X86 platform Vxworks operation system
CN104991782A (en) * 2015-07-23 2015-10-21 英业达科技有限公司 Method and system for modifying BIOS configuration

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
陈D ; .VxWorks for x86系统中实时时钟的应用.电子元器件应用.2010,(第03期),66-69. *

Also Published As

Publication number Publication date
CN111176875A (en) 2020-05-19

Similar Documents

Publication Publication Date Title
CN106933580B (en) Embedded software architecture system
US9218333B2 (en) Context sensitive auto-correction
CN107171833B (en) Method for realizing batch upgrading of BMC and BIOS of server through BMC
CN108334614B (en) Data updating method, system and storage medium
CN109669873A (en) User interface automatic test method and device, electronic equipment and storage medium
US20100205422A1 (en) Method for setting basic input/output system
CN212159910U (en) MCU integrated uncapping detection circuit and electric energy meter control chip
CN112181619A (en) Scheduling method, device, equipment and medium for batch service
CN109783149A (en) Power-on control method, device, mobile terminal and storage medium
CN111176875B (en) BIOS time reset recovery method
CN109144216B (en) Method and system for recording first use time of electronic equipment
CN110110306A (en) Method for exhibiting data, device, terminal and computer readable storage medium
CN112035171B (en) Factory setting restoration method and system based on UEFI firmware
CN113806038A (en) Task scheduling method, device, electronic equipment, storage medium and program product
CN112835413B (en) Control method and device of wearable device and electronic device
CN104699607A (en) Automation testing method and system for mobile terminal
US20070185792A1 (en) Method and system for assisting in compiling employee tax deduction
CN105589703A (en) Terminal application control method and terminal
CN111580885A (en) Method and system for quickly integrating hardware based on labview upper computer
CN109189448B (en) 61850 protocol-based method for online upgrading of relay protection device program
US11789746B2 (en) Computing device reboot
CN112433997B (en) Data restoration method and device
CN112083788A (en) Power saving method and device
CN110147379B (en) Information acquisition method and device based on data lock and computer equipment
CN101179434B (en) Automatic time-counting method in network management system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant