CN114297044A - Method and device for storing BIOS log of electronic device - Google Patents
Method and device for storing BIOS log of electronic device Download PDFInfo
- Publication number
- CN114297044A CN114297044A CN202111614838.6A CN202111614838A CN114297044A CN 114297044 A CN114297044 A CN 114297044A CN 202111614838 A CN202111614838 A CN 202111614838A CN 114297044 A CN114297044 A CN 114297044A
- Authority
- CN
- China
- Prior art keywords
- electronic device
- log
- serial port
- memory
- bios
- 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
Links
Images
Landscapes
- Debugging And Monitoring (AREA)
Abstract
The application discloses a storage method and a storage device of BIOS logs of an electronic device, wherein the storage method comprises the following steps: running the BIOS system; storing a serial port log generated in the running process of a BIOS (basic input output System) system in a memory of the electronic device; and transferring the serial port log stored in the memory to an external memory connected to the electronic device. The invention can improve the efficiency of obtaining the BIOS log and save the cost.
Description
Technical Field
The invention relates to the technical field of computers, in particular to a method and a device for storing BIOS logs of an electronic device.
Background
In the development and manufacturing process of personal computers, it is often necessary to collect BIOS logs when a system fails to analyze a failure problem.
The conventional method for collecting BIOS logs generally comprises the steps of flying out a serial port sending signal test point on a computer mainboard, connecting the test point to a serial port signal-to-USB signal adapter plate, connecting a USB interface of the adapter plate with a working computer through a USB connecting line, and collecting the BIOS logs during the starting process of the computer by using upper computer software on the working computer. The conventional method for collecting the BIOS logs needs to disassemble the computer and fly the computer, so that the steps are complicated, a large amount of time is consumed, a USB adapter plate is needed, and the cost is increased.
Therefore, it is important to design a method and an apparatus for storing BIOS logs of an electronic device that can solve the above problems.
Disclosure of Invention
The application aims to provide a method and a device for storing a BIOS log of an electronic device, which can improve the efficiency of obtaining the BIOS log and save the cost.
In order to achieve the above object, the present application provides a method for storing a BIOS log of an electronic device, including:
running the BIOS system;
storing a serial port log generated in the running process of the BIOS system in a memory of an electronic device;
and transferring the serial port log stored in the memory to an external memory connected to the electronic device.
Optionally, the "storing the serial port log generated in the BIOS system operation process in a memory of the electronic device" includes:
applying a section of memory to the memory as a storage area for storing the serial port log;
recording the address of the storage area;
and storing the serial port log in the storage area according to the address of the storage area.
Optionally, the "storing the serial port log stored in the memory in a peripheral memory connected to the electronic apparatus" includes:
running a preset program to generate a dump command;
and according to the unloading command, unloading the serial port log stored in the memory into an external memory connected to the electronic device.
Optionally, the "transferring the serial port log stored in the memory to a peripheral storage connected to the electronic device according to the transfer command" includes:
acquiring the address of the storage area;
determining the serial port log in the storage area;
and acquiring the serial port log and storing the serial port log in the peripheral memory.
Optionally, the determining the serial port log in the storage area includes:
and determining the serial port log according to the initial storage position and the termination storage position of the serial port log in the storage area.
Optionally, the preset program is stored in the peripheral memory, and the preset program is an EFI application program.
Optionally, the storage method further includes: and when the BIOS system is in a PEI stage, storing the generated serial port log in the established HOB.
And when the BIOS system is in the DXE stage, transferring the serial port log stored in the HOB into the memory.
In order to achieve the above object, the present application further provides a method for storing a BIOS log of an electronic device, including:
the operation module is used for operating the BIOS system;
the storage module is used for storing the serial port log generated in the running process of the BIOS system in the memory of the electronic device;
and the transfer module is used for transferring the serial port log stored in the memory into an external memory connected to the electronic device.
To achieve the above object, the present application also provides an electronic device, including:
a processor;
a memory having stored therein executable instructions of the processor;
wherein the processor is configured to perform the method of storing the electronic device BIOS log as described above via execution of the executable instructions.
To achieve the above object, the present application further provides a computer readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the storage method of the BIOS log of the electronic device as described above.
The present application also provides a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the electronic device reads the computer instruction from the computer readable storage medium, and executes the computer instruction, so that the electronic device executes the storage method of the electronic device BIOS log.
The method runs the BIOS system on the electronic device, stores the serial port log generated in the running process of the BIOS system in the memory of the electronic device, and then transfers the serial port log stored in the memory of the electronic device into the external memory connected to the electronic device. According to the serial log storage method and device, the serial log generated in the running process of the BIOS system is stored in the memory of the electronic device, so that the serial log is transmitted through the serial port in real time when the BIOS runs, and the starting speed of the electronic device is improved. The serial port log output from the serial port is redirected to the memory of the electronic device, and the serial port log stored in the memory of the electronic device is transferred to the peripheral memory connected to the electronic device, so that the process of flying wires from the signal sending test point needing to be dismounted is saved, the cost of the adapter plate is saved, and the efficiency of collecting the BIOS log is improved.
Drawings
Fig. 1 is a flowchart of a method for storing a BIOS log of an electronic device according to an embodiment of the present application.
Fig. 2 is a flowchart of a method for storing a serial port log in a memory of an electronic device according to an embodiment of the present disclosure.
Fig. 3 is a flowchart of a method for transferring a serial port log from an electronic device to a peripheral memory according to an embodiment of the present application.
Fig. 4 is a flowchart of a method for transferring a serial port log to a peripheral memory according to a transfer command in an embodiment of the present application.
Fig. 5 is a code diagram illustrating how HOB is defined and serial port logs are stored in HOB.
FIG. 6 is a code diagram illustrating the application of memory in the DXE phase and the storage of log files in the HOB in memory.
FIG. 7 is a code diagram illustrating redirection of a serial log to memory of an electronic device.
Fig. 8 is a code diagram for compiling a preset program.
FIG. 9 is a block diagram of a storage device for BIOS log of an electronic device according to an embodiment of the present disclosure.
Fig. 10 is a schematic block diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to explain technical contents, achieved objects, and effects of the present application in detail, the following detailed description is given with reference to the embodiments and the accompanying drawings.
The BIOS (Basic Input Output System) is a program that is fixed to a ROM chip on a computer motherboard and stores a program for Basic Input and Output, a power-on self-test program, and a System self-boot program that are the most important of the computer. When the computer is started, the BIOS can perform scanning detection, equipment initialization, resource allocation and adaptation on hardware on the mainboard, and if the system is down or other system faults occur, the BIOS logs can be acquired to analyze the problems so as to determine the reasons of the faults. Therefore, the application discloses a method for storing BIOS logs of an electronic device, so as to improve the efficiency of collecting the BIOS logs.
Specifically, referring to fig. 1, the method includes:
and S1, running the BIOS system.
It is understood that the Debug version BIOS system is used in this embodiment, and the Debug version BIOS system is often used for development and debugging of a system, and may output a serial port log through a serial port in real time during operation. The serial log is mainly generated in a Power On Self Test (POST) process of a BIOS system.
And S2, storing the serial port log generated in the running process of the BIOS system in a memory of the electronic device.
Referring to fig. 2, specifically, step S2 includes:
and S21, applying a section of memory to the memory of the electronic device as a storage area for storing the serial port log.
Specifically, the applied memory is at least larger than the maximum capacity required to be occupied by the serial log, and the memory of the electronic device should be occupied as little as possible. Preferably, a segment of memory requested for may be 8 MB.
S22, recording the address of the storage area.
And S23, storing the serial port log in the storage area according to the address of the storage area.
After the serial log of the BIOS system is generated, the serial log is stored in the storage area according to the address of the storage area, the serial log does not need to be output from the serial port in real time in the starting process of the system, and the starting speed of the system can be improved.
It is understood that the electronic device referred to in this application may be a personal computer, a server, or other electronic terminal with a BIOS system, and is not limited in this application.
And S3, the serial port log stored in the memory is transferred to an external memory connected to the electronic device.
It should be understood that the peripheral storage may be a mobile hard disk, a usb disk, or other devices with a storage function, as long as the peripheral storage can be connected to the electronic apparatus and can store the serial log, and the application is not limited herein.
Specifically, the peripheral memory may be connected to the electronic device through a USB interface, and when the peripheral memory is connected to the electronic device through the USB interface, the USB driver of the electronic device may identify the peripheral memory, so that the electronic device performs data communication with the peripheral memory.
Referring to fig. 3, specifically, step S3 includes:
and S31, running the preset program to generate a dump command.
It is understood that the preset program may be stored in the electronic device, or may be stored in the peripheral memory. When the preset program is stored in the peripheral memory, technicians can modify the preset program in the peripheral memory conveniently, the serial port log can be stored directly according to the path position of the preset program, and if the preset program is stored in the electronic device, the preset program is required to acquire the storage path in the peripheral memory.
Specifically, the serial log may be stored in the same directory as the preset program.
Further, the preset program is an EFI application program that has been compiled, and the EFI application program may be run in a shell environment of the BIOS system, specifically referring to fig. 8, and compiling the code shown in fig. 8 may generate the preset program for collecting and storing the serial log in the electronic device.
Specifically, after the BIOS system is subjected to power-on self-test, the shell environment may be entered, and a preset program located in the peripheral memory may be selected in the shell command window to be executed.
And S32, according to the unloading command, unloading the serial port log stored in the memory to a peripheral memory connected to the electronic device.
Referring to fig. 4, step S32 further includes:
s321, obtaining the address of the storage area.
And S322, determining the serial port log in the storage area.
And S323, acquiring the serial port log and storing the serial port log in an external memory.
Specifically, the serial port log in the storage area is determined by storing the serial port log in the initial storage position and the termination storage position of the storage area, so that the serial port log is accurately acquired. When the serial port log is stored in the storage area, the initial storage position of the serial port log is recorded, and the termination storage position of the serial port log is recorded after the serial port log is stored.
Further, after the serial port log is transferred from the storage area of the electronic device to the peripheral memory, the serial port log in the storage area can be cleared.
It is understood that the BIOS system includes a PEI (Pre-EFI initialization) phase and a DXE (Driver Execution Environment) phase, wherein the PEI phase is mainly used to initialize the memory, and the DXE phase is mainly used to load the Driver.
Referring to fig. 5, when the BIOS system is in the PEI phase, because the system memory is not initialized, the serial port log generated at this phase may be stored in the established hob (handled Of block). Specifically, referring to fig. 5(a), fig. 5(a) is a schematic diagram of codes defining HOB; the HOB is a structure body for transferring information from the PEI phase to the DXE phase, and data collected in the PEI phase needs to be stored in the HOB if the data needs to be transferred to the DXE phase.
Specifically, referring to fig. 5(b), fig. 5(b) is a schematic diagram of codes for storing serial logs in the HOB, where the codes in the diagram replace original serial log printing functions, so that original serial logs output from the serial port can be stored in the HOB.
And when the BIOS system is in the DXE stage, transferring the serial port log stored in the HOB into a memory of the electronic device. Specifically, referring to fig. 6(b), fig. 6(b) is a schematic code diagram illustrating that the serial port log temporarily stored in the HOB is transferred to the memory of the electronic device.
It is understood that the operation of applying for a segment of memory to the memory of the electronic device may be completed in the DXE phase, and specifically refer to fig. 6(a), where fig. 6(a) is a code diagram illustrating the application of a segment of memory to the memory of the electronic device in the DXE phase.
Referring to fig. 7, further, after applying for a section of memory from the memory of the electronic device in the DXE phase, the original serial port printing function may be replaced with the code shown in fig. 7, and the serial port log that should be originally output from the serial port may be stored in the memory of the electronic device.
The method and the device run the BIOS system on the electronic device, store the serial log generated in the running process of the BIOS system in the memory of the electronic device, and then transfer the serial log stored in the memory of the electronic device into the peripheral memory connected to the electronic device. According to the serial log storage method and device, the serial log generated in the running process of the BIOS system is stored in the memory of the electronic device, so that the serial log is transmitted through the serial port in real time when the BIOS runs, and the starting speed of the electronic device is improved. The serial port log output from the serial port is redirected to the memory of the electronic device, and the serial port log stored in the memory of the electronic device is transferred to the peripheral memory connected to the electronic device, so that the process of flying wires from the signal sending test point needing to be dismounted is saved, the cost of the transfer board is saved, and the efficiency of collecting the BIOS log is improved.
Referring to fig. 9, an embodiment of the present application further discloses a storage device for a BIOS log of an electronic device, including:
an operation module 100 for operating the BIOS system;
the storage module 200 is configured to store a serial port log generated in an operating process of the BIOS system in a memory of the electronic device;
the unloading module 300 is configured to unload the serial port log stored in the memory to an external storage connected to the electronic device.
The serial port log output from the serial port is redirected to the memory of the electronic device, and the serial port log stored in the memory of the electronic device is transferred to the peripheral memory connected to the electronic device, so that the process of flying wires from the signal sending test point needing to be dismounted is saved, the cost of the transfer board is saved, and the efficiency of collecting the BIOS log is improved.
Referring to fig. 10, an embodiment of the present application further discloses an electronic device, including:
a processor 40;
a memory 50 having stored therein executable instructions of the processor 40;
wherein the processor 40 is configured to execute the storage method of the electronic device BIOS log as described above via executing the executable instructions.
The embodiment of the application also discloses a computer readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the storage method of the electronic device BIOS log is realized.
The embodiment of the application also discloses a computer program product or a computer program, which comprises computer instructions, and the computer instructions are stored in a computer readable storage medium. The processor of the electronic device reads the computer instructions from the computer-readable storage medium, and executes the computer instructions, so that the electronic device executes the storage method of the electronic device BIOS log as described above.
It should be understood that in the embodiments of the present Application, the Processor may be a Central Processing Unit (CPU), and the Processor may also be other general purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, and the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware associated with computer program instructions, and the programs can be stored in a computer readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
The above disclosure is only a preferred embodiment of the present application and should not be taken as limiting the scope of the present application, so that the claims of the present application are covered by the appended claims.
Claims (10)
1. A method for storing BIOS logs of an electronic device is characterized by comprising the following steps:
running the BIOS system;
storing a serial port log generated in the running process of the BIOS system in a memory of an electronic device;
and transferring the serial port log stored in the memory to an external memory connected to the electronic device.
2. The method for storing the BIOS log of the electronic device according to claim 1, wherein the step of storing the serial port log generated during the operation of the BIOS in the memory of the electronic device comprises:
applying a section of memory to the memory as a storage area for storing the serial port log;
recording the address of the storage area;
and storing the serial port log in the storage area according to the address of the storage area.
3. The method of storing BIOS log of electronic device of claim 2 wherein,
the step of storing the serial port log stored in the memory in a peripheral memory connected to the electronic device includes:
running a preset program to generate a dump command;
and according to the unloading command, unloading the serial port log stored in the memory into an external memory connected to the electronic device.
4. The method of storing BIOS log of electronic device of claim 3 wherein,
the step of "transferring the serial port log stored in the memory to an external memory connected to the electronic device according to the transfer command" includes:
acquiring the address of the storage area;
determining the serial port log in the storage area;
and acquiring the serial port log and storing the serial port log in the peripheral memory.
5. The method of storing BIOS log of an electronic device of claim 4 wherein,
the step of determining the serial port log in the storage area comprises the following steps:
and determining the serial port log according to the initial storage position and the termination storage position of the serial port log in the storage area.
6. The method of storing BIOS log of electronic device of claim 3 wherein,
the preset program is stored in the peripheral memory, and the preset program is an EFI application program.
7. The method of storing a BIOS log for an electronic device of claim 1, further comprising:
and when the BIOS system is in a PEI stage, storing the generated serial port log in the established HOB.
And when the BIOS system is in the DXE stage, transferring the serial port log stored in the HOB into the memory.
8. A storage device for BIOS logs of an electronic device, comprising:
the operation module is used for operating the BIOS system;
the storage module is used for storing the serial port log generated in the running process of the BIOS system in the memory of the electronic device;
and the transfer module is used for transferring the serial port log stored in the memory into an external memory connected to the electronic device.
9. An electronic device, comprising:
a processor;
a memory having stored therein executable instructions of the processor;
wherein the processor is configured to perform the method of storing an electronic device BIOS log of any of claims 1-7 via execution of the executable instructions.
10. A computer-readable storage medium, on which a computer program is stored, the computer program, when being executed by a processor, implementing a method for storing a BIOS log of an electronic device according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111614838.6A CN114297044A (en) | 2021-12-24 | 2021-12-24 | Method and device for storing BIOS log of electronic device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111614838.6A CN114297044A (en) | 2021-12-24 | 2021-12-24 | Method and device for storing BIOS log of electronic device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114297044A true CN114297044A (en) | 2022-04-08 |
Family
ID=80970199
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111614838.6A Pending CN114297044A (en) | 2021-12-24 | 2021-12-24 | Method and device for storing BIOS log of electronic device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114297044A (en) |
-
2021
- 2021-12-24 CN CN202111614838.6A patent/CN114297044A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109062617B (en) | Application method of platform supporting multiple types of equipment and mobile terminal | |
US20030110369A1 (en) | Firmware extensions | |
US10606677B2 (en) | Method of retrieving debugging data in UEFI and computer system thereof | |
CN100444127C (en) | System and method for testing software | |
US20030221035A1 (en) | CPU life-extension apparatus and method | |
CN115935631A (en) | Test system and method for vehicle equipment and storage medium | |
CN116450398A (en) | Exception backtracking method, device, equipment and medium | |
CN114765051A (en) | Memory test method and device, readable storage medium and electronic equipment | |
CN113377586B (en) | Automatic detection method and device for server and storage medium | |
CN114297044A (en) | Method and device for storing BIOS log of electronic device | |
CN116225541B (en) | Method and system for communication between in-band CPU and out-of-band management BMC | |
CN113722715B (en) | Imported file checking method, checking system and computing equipment | |
CN114265786A (en) | Automatic testing method and device, computer equipment and readable storage medium | |
CN114510375A (en) | Flash chip data area dynamic sharing system and method | |
CN111694600A (en) | Mirror image file design, chip operation method, system, device and medium | |
CN111641419B (en) | Version identification method, control method and system of radio frequency power amplifier of terminal | |
CN111176735B (en) | Method for accelerating startup of electrocardiograph | |
CN115145642B (en) | Software starting method and system | |
CN115840682B (en) | Operation and maintenance monitoring method and device for BIOS (basic input output system) level sampling based on SW64 instruction set | |
US12147701B2 (en) | Systems, methods, and devices for accessing a device program on a storage device | |
CN113448644B (en) | Operating system ring3 mode OC hard disk configuration method, device, terminal and storage medium | |
US20230114636A1 (en) | Systems, methods, and devices for accessing a device program on a storage device | |
CN117033247B (en) | Verification method and system for carrying mobile phone and tablet personal computer | |
JP4125054B2 (en) | Log acquisition method | |
CN115951909A (en) | On-line upgrading and solidifying method for dynamically loading application software in chip |
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 |