CN112395166A - Method for reading system log, UEFI and computer - Google Patents

Method for reading system log, UEFI and computer Download PDF

Info

Publication number
CN112395166A
CN112395166A CN202011364739.2A CN202011364739A CN112395166A CN 112395166 A CN112395166 A CN 112395166A CN 202011364739 A CN202011364739 A CN 202011364739A CN 112395166 A CN112395166 A CN 112395166A
Authority
CN
China
Prior art keywords
system log
reading
log
hard disk
display
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.)
Pending
Application number
CN202011364739.2A
Other languages
Chinese (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.)
Cetc Beijing Co ltd
CETC Beijing Co
Original Assignee
Cetc Beijing 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 Cetc Beijing Co ltd filed Critical Cetc Beijing Co ltd
Priority to CN202011364739.2A priority Critical patent/CN112395166A/en
Publication of CN112395166A publication Critical patent/CN112395166A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3055Monitoring arrangements for monitoring the status of the computing system or of the computing system component, e.g. monitoring if the computing system is on, off, available, not available
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/32Monitoring with visual or acoustical indication of the functioning of the machine
    • G06F11/324Display of status information
    • G06F11/328Computer systems status display
    • 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
    • G06F9/4411Configuring for operating with peripheral devices; Loading of device drivers

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Computing Systems (AREA)
  • Quality & Reliability (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention relates to the field of computers, and provides a method for reading system logs, which is applied to UEFI and comprises the following steps: the method comprises the following steps that firstly, a hard disk drive, a video card drive and a file system drive are loaded; secondly, identifying a hard disk partition corresponding to the system log through the hard disk drive; thirdly, identifying a file system in the hard disk partition through the file system driver; fourthly, positioning the system log from the file system through a file system function and the characteristic information of the system log; and fifthly, loading the system log into a cache and displaying the system log through a display. The UEFI method provided by the invention can read the system log, so that a user can more flexibly acquire the system log under the condition that the user cannot enter the operating system.

Description

Method for reading system log, UEFI and computer
Technical Field
The present disclosure relates to the field of computers, and in particular, to a method for reading a system log, UEFI, and a computer.
Background
In daily use, the computer sometimes has an unexpected condition that the computer cannot normally enter an operating system. Once this occurs, the user typically is very cumbersome to handle. Therefore, there is a need for a method that can conveniently access the system log file when the computer fails to enter the system, and further analyze and diagnose the computer fault. The system log is used for recording information of hardware, software and system problems in the system and monitoring events occurring in the system. Through which the user can check the cause of the error or look for traces left by the attacker when under attack. Therefore, the problem is quickly located or narrowed down by looking at the log, which is helpful for the user to find out and solve the reason of the system abnormality.
The mainstream way to read the system log is to read the system log in the operating system. The Windows operating system and the X86 platform which are mainly used have strong stability after a lot of tests, and users can enter the operating system only by restarting or reinstalling the computer after an accident that the operating system cannot be normally entered occurs, and the situation that the operating system cannot be entered hardly occurs. Thus, there is no need to devise ways to not read the system log within the operating system.
The domestic platform may have various conditions due to short development time, so that the domestic platform cannot enter the operating system, the problem of the domestic platform may be solved by restarting, and the domestic platform is not suitable for reinstalling the system (the operating system used by the domestic platform is usually based on Linux, the Linux does not partition the hard disk, and if the system is reinstalled, all data can be covered). In addition, for some sensitive devices, corresponding encryption and binding operations are often performed, and if a fault occurs, a maintenance worker often does not have a related authority to enter an operating system, and cannot acquire a system log in a mode of entering the operating system. How to read the system log under the condition that the domestic platform can not enter the operating system becomes a subject in the field.
Disclosure of Invention
The invention provides a method for reading a system log so as to obtain the system log through UEFI, and the defects of the prior art are overcome.
The invention provides a method for reading a system log, which is applied to UEFI and comprises the following steps:
the method comprises the following steps that firstly, a hard disk drive, a video card drive and a file system drive are loaded;
secondly, identifying a hard disk partition corresponding to the system log through the hard disk drive;
thirdly, identifying a file system in the hard disk partition through the file system driver;
fourthly, positioning the system log from the file system through a file system function and the characteristic information of the system log;
and fifthly, loading the system log into a cache and displaying the system log through a display.
Aiming at the method, the system log is loaded into a cache and displayed through a display, and the method comprises the following steps:
reading a starting record of the last starting from the system log;
and reading the starting record into the cache, and displaying the starting record through the display.
For the above method, reading the last start record from the system log, including:
reading data from an address M-K to an address M;
and M is an address corresponding to the end of the system log, and K is a preset length of one-time starting record.
The invention provides UEFI for reading a system log, which comprises the following modules:
the drive module is used for loading a hard disk drive, a display card drive and a file system drive;
the first identification module is used for identifying a hard disk partition corresponding to the system log through the hard disk drive;
the second identification module is used for identifying the file system in the hard disk partition through the file system driver;
the positioning module is used for positioning the system log from the file system through a file system function and the characteristic information of the system log;
and the display module is used for loading the system log into a cache and displaying the system log through a display.
For the UEFI, the display module includes:
the first reading submodule is used for reading the starting record of the last starting from the system log;
and the display submodule is used for reading the starting record into the cache and displaying the starting record through the display.
For the UEFI, the first reading sub-module includes:
the second reading submodule is used for reading data of the address M-K-M;
and M is an address corresponding to the end of the system log, and K is a preset length of one-time starting record.
The invention provides a computer for reading system logs, which comprises any UEFI.
The UEFI method provided by the invention can read the system log, so that a user can more flexibly acquire the system log under the condition that the user cannot enter the operating system.
Drawings
FIG. 1 is a flow chart of a method for reading system logs according to the present invention;
fig. 2 is an overall framework diagram of UEFI for reading system logs according to the present invention.
Detailed Description
The present invention is not limited by the following examples, and specific embodiments may be determined according to the technical solutions and practical situations of the present invention.
The invention is further described with reference to the following examples and figures:
example 1: fig. 1 is a flowchart of a method for reading a system log, which is applied to UEFI, and includes the following steps:
s1, loading a hard disk drive, a video card drive and a file system drive;
s2, identifying the hard disk partition corresponding to the system log through the hard disk drive;
s3, identifying the file system in the hard disk partition through the file system driver;
s4, locating the system log from the file system through the file system function and the characteristic information of the system log;
and S5, loading the system log into a cache and displaying the system log through a display.
The invention is suitable for domestic platforms. The operating system used by the domestic platform may be Linux.
In practical application, the system log is automatically generated by the operating system in the process of starting the operating system. When the operating system cannot be loaded, the user typically reboots the computer. After the system log is restarted, after the logo of the UEFI appears, a user can trigger the process of reading the system log through pressing a key.
In step S1, the order of loading the hard disk drive, the graphics card drive, and the file drive may be arbitrary. Generally, UEFI automatically loads drivers of all devices after startup, and S2 may be executed after the drivers of all devices are loaded, or may be executed immediately after the drivers of all devices in S1 are preferentially loaded.
Specifically, in step S3, the FILE SYSTEM in the partition may be identified by a FILE SYSTEM function (EFI _ SIMPLE _ FILE _ SYSTEM _ PROTOCOL) in the FILE SYSTEM driver, and a root directory handle (EFI _ FILE _ PROTOCOL) of the FILE SYSTEM may be obtained by OpenVolume in the FILE SYSTEM function, where the directory handle includes an operation interface for operating the directory FILE. After getting the pointer of the root directory EFI _ FILE _ progress instance on the partition FILE system, the FILE on the partition can be operated on, such as for reading a FILE or directory.
In step S4, the characteristic information of the system log may be a name of the system log or/and a name of a directory of files where the system log is located. The system log may be located under a root directory of the file system or under other directories. UEFI can locate system log files by automatically traversing the file system through a function, for example, a name syslog of a system log is preset in UEFI, and the file is searched in a root-removing directory; or the system log can be manually selected in the operation interface according to the file name. If operated manually, the driver of the input device, such as a keyboard or a mouse, needs to be loaded in S1.
The UEFI method provided by the invention can read the system log, so that a user can more flexibly acquire the system log under the condition that the user cannot enter the operating system.
Example 2: the method, step S5, includes:
s51, reading the starting record of the last start from the system log;
and S52, reading the start record into the cache, and displaying the start record through the display.
The system logs are generated when the system is started every time, the service time of the computer is long, and the system logs are very long and inconvenient to check. And when the operating system loads a fault, only the last started record is meaningful for repair, so that the embodiment only displays the last started record, and the displayed information is more convenient for a user to find the fault.
Specifically, the start-up record is stored in the buffer, and all the contents in the buffer can be displayed through the print function.
Example 3: the method, step S51, includes:
s511, reading data of the address M-K-M;
and M is an address corresponding to the end of the system log, and K is a preset length of one-time starting record.
Specifically, the computer is started once, and the corresponding section of the system log (i.e. the start record) of the start is generated at the tail of the whole system log. In order to obtain the start record of the last start, all data from the length of the start record of the last start back from the tail of the system file to the tail of the system file are read and displayed on a display. Because the lengths of the start records corresponding to each start are different, multiple detections can be performed, and the length of a start record with a longer length is detected as the preset length of the start record, for example, the memory size occupied by 100 pages of content.
The embodiment provides a method for displaying the section of the system log corresponding to the last startup on the screen, so that the user can more easily find the fault occurring in the last startup process of the operating system in the displayed content.
Based on the same inventive concept, the embodiment of the invention also provides the UEFI and the computer for reading the system log, and as the UEFI and the computer solve the problem in a similar manner to the method, the implementation of the UEFI and the computer can refer to the implementation of the method, and repeated parts are not described again.
Example 4: FIG. 2 is an overall frame diagram of UEFI for reading system logs, which includes the following modules:
the drive module is used for loading a hard disk drive, a display card drive and a file system drive;
the first identification module is used for identifying a hard disk partition corresponding to the system log through the hard disk drive;
the second identification module is used for identifying the file system in the hard disk partition through the file system driver;
the positioning module is used for positioning the system log from the file system through a file system function and the characteristic information of the system log;
and the display module is used for loading the system log into a cache and displaying the system log through a display.
Example 5: the UEFI, the display module, comprises:
the first reading submodule is used for reading the starting record of the last starting from the system log;
and the display submodule is used for reading the starting record into the cache and displaying the starting record through the display.
Example 6: the UEFI, the first reading sub-module, includes:
the second reading submodule is used for reading data of the address M-K-M;
and M is an address corresponding to the end of the system log, and K is a preset length of one-time starting record.
Example 7: the invention provides a computer for reading system logs, which comprises any UEFI.

Claims (7)

1. A method for reading a system log is applied to UEFI, and is characterized by comprising the following steps:
the method comprises the following steps that firstly, a hard disk drive, a video card drive and a file system drive are loaded;
secondly, identifying a hard disk partition corresponding to the system log through the hard disk drive;
thirdly, identifying a file system in the hard disk partition through the file system driver;
fourthly, positioning the system log from the file system through a file system function and the characteristic information of the system log;
and fifthly, loading the system log into a cache and displaying the system log through a display.
2. The method of claim 1, wherein loading the system log into a cache for display via a display comprises:
reading a starting record of the last starting from the system log;
and reading the starting record into the cache, and displaying the starting record through the display.
3. The method of claim 2, wherein reading a boot record of a last boot from the system log comprises:
reading data from an address M-K to an address M;
and M is an address corresponding to the end of the system log, and K is a preset length of one-time starting record.
4. UEFI for reading a system log, comprising the following modules:
the drive module is used for loading a hard disk drive, a display card drive and a file system drive;
the first identification module is used for identifying a hard disk partition corresponding to the system log through the hard disk drive;
the second identification module is used for identifying the file system in the hard disk partition through the file system driver;
the positioning module is used for positioning the system log from the file system through a file system function and the characteristic information of the system log;
and the display module is used for loading the system log into a cache and displaying the system log through a display.
5. The UEFI of claim 4, wherein the display module comprises:
the first reading submodule is used for reading the starting record of the last starting from the system log;
and the display submodule is used for reading the starting record into the cache and displaying the starting record through the display.
6. The UEFI of claim 5, wherein the first read sub-module comprises:
the second reading submodule is used for reading data of the address M-K-M;
and M is an address corresponding to the end of the system log, and K is a preset length of one-time starting record.
7. A computer that reads system logs, comprising the UEFI of any of claims 4-6.
CN202011364739.2A 2020-11-27 2020-11-27 Method for reading system log, UEFI and computer Pending CN112395166A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011364739.2A CN112395166A (en) 2020-11-27 2020-11-27 Method for reading system log, UEFI and computer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011364739.2A CN112395166A (en) 2020-11-27 2020-11-27 Method for reading system log, UEFI and computer

Publications (1)

Publication Number Publication Date
CN112395166A true CN112395166A (en) 2021-02-23

Family

ID=74605492

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011364739.2A Pending CN112395166A (en) 2020-11-27 2020-11-27 Method for reading system log, UEFI and computer

Country Status (1)

Country Link
CN (1) CN112395166A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070299631A1 (en) * 2006-06-27 2007-12-27 Microsoft Corporation Logging user actions within activity context
CN106909468A (en) * 2015-12-22 2017-06-30 中电科技(北京)有限公司 A kind of computer fault diagnosis method based on UEFI firmwares
CN106909351A (en) * 2015-12-22 2017-06-30 中电科技(北京)有限公司 A kind of implementation method of the EXT file system based on UEFI firmwares
CN108182138A (en) * 2018-01-24 2018-06-19 郑州云海信息技术有限公司 Acquisition methods, system, device and the storage medium of BMC SEL daily records
CN108351923A (en) * 2016-01-28 2018-07-31 惠普发展公司,有限责任合伙企业 Threshold value related with the script that unified Extensible Firmware Interface system is executable

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070299631A1 (en) * 2006-06-27 2007-12-27 Microsoft Corporation Logging user actions within activity context
CN106909468A (en) * 2015-12-22 2017-06-30 中电科技(北京)有限公司 A kind of computer fault diagnosis method based on UEFI firmwares
CN106909351A (en) * 2015-12-22 2017-06-30 中电科技(北京)有限公司 A kind of implementation method of the EXT file system based on UEFI firmwares
CN108351923A (en) * 2016-01-28 2018-07-31 惠普发展公司,有限责任合伙企业 Threshold value related with the script that unified Extensible Firmware Interface system is executable
CN108182138A (en) * 2018-01-24 2018-06-19 郑州云海信息技术有限公司 Acquisition methods, system, device and the storage medium of BMC SEL daily records

Similar Documents

Publication Publication Date Title
US9262283B2 (en) Method for reading kernel log upon kernel panic in operating system
JP5483116B2 (en) Maintenance system, maintenance method, and maintenance program
US8768896B2 (en) Setting information database management
US20100241815A1 (en) Hybrid Storage Device
CN105468482B (en) Hard disk position identification and fault diagnosis method and server equipment thereof
US20060106896A1 (en) System and method for creating list of backup files based upon program properties
JP5376258B2 (en) Maintenance system, maintenance method, and maintenance program
US7308547B2 (en) Apparatus and method for control of write filter
CN112650658A (en) Application program exception recording and reproduction method, device and storage medium
US8327324B1 (en) Message logging system
CN111274130A (en) Automatic testing method, device, equipment and storage medium
US5819024A (en) Fault analysis system
US20070294332A1 (en) Processing device for end customer operation
US7548979B2 (en) Method, system, and computer-readable medium for managing a host session on a remote computer
CN103064767B (en) Drive backup, the method recovered and device
CN108197041B (en) Method, device and storage medium for determining parent process of child process
CN112395166A (en) Method for reading system log, UEFI and computer
CN110851332B (en) Log file processing method, device, equipment and medium
CN111488230A (en) Method and device for modifying log output level, electronic equipment and storage medium
CN113722170B (en) PFR function test method, device, equipment and readable storage medium
CN113986517B (en) API call log acquisition method and device, electronic equipment and storage medium
CN113010107B (en) Data storage management method, device, computer equipment and storage medium
EP4307134A1 (en) Platform detection algorithm for forensic images
CN111682991B (en) Bus error message processing method and device
JP7103804B2 (en) User interface control device, user interface control method, and user interface control program

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
CB02 Change of applicant information

Address after: 100083 north side, 13th floor, Taiji building, No.6 working area (South), wohuqiao, Haidian District, Beijing

Applicant after: CLP Technology (Beijing) Co.,Ltd.

Address before: 100083 north side, 13th floor, Taiji building, No.6 working area (South), wohuqiao, Haidian District, Beijing

Applicant before: CETC (BEIJING) Co.,Ltd.

CB02 Change of applicant information
CB02 Change of applicant information

Address after: 100083 north side, 13th floor, Taiji building, No.6 working area (South), wohuqiao, Haidian District, Beijing

Applicant after: Kunlun Taike (Beijing) Technology Co.,Ltd.

Address before: 100083 north side, 13th floor, Taiji building, No.6 working area (South), wohuqiao, Haidian District, Beijing

Applicant before: CLP Technology (Beijing) Co.,Ltd.

CB02 Change of applicant information