CN117555757A - Method and system for automatically recording system log information by notebook computer - Google Patents
Method and system for automatically recording system log information by notebook computer Download PDFInfo
- Publication number
- CN117555757A CN117555757A CN202311547179.8A CN202311547179A CN117555757A CN 117555757 A CN117555757 A CN 117555757A CN 202311547179 A CN202311547179 A CN 202311547179A CN 117555757 A CN117555757 A CN 117555757A
- Authority
- CN
- China
- Prior art keywords
- firmware
- log
- log information
- memory
- storage
- 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
- 238000000034 method Methods 0.000 title claims abstract description 30
- 230000007774 longterm Effects 0.000 claims abstract description 24
- 238000012546 transfer Methods 0.000 claims abstract description 13
- 230000006870 function Effects 0.000 claims description 44
- 230000003287 optical effect Effects 0.000 claims description 3
- 238000004883 computer application Methods 0.000 abstract description 2
- 238000013461 design Methods 0.000 description 12
- 230000008569 process Effects 0.000 description 4
- 230000002159 abnormal effect Effects 0.000 description 3
- 238000011161 development Methods 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 2
- 230000008859 change Effects 0.000 description 2
- 238000010276 construction Methods 0.000 description 2
- 238000003672 processing method Methods 0.000 description 2
- 238000011160 research Methods 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 125000004122 cyclic group Chemical group 0.000 description 1
- 238000012217 deletion Methods 0.000 description 1
- 230000037430 deletion Effects 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 239000003999 initiator Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 230000002085 persistent effect Effects 0.000 description 1
- 238000010926 purge Methods 0.000 description 1
- 238000012827 research and development Methods 0.000 description 1
- 238000012163 sequencing technique Methods 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3065—Monitoring arrangements determined by the means or processing involved in reporting the monitored data
- G06F11/3072—Monitoring arrangements determined by the means or processing involved in reporting the monitored data where the reporting involves data filtering, e.g. pattern matching, time or event triggered, adaptive or policy-based reporting
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3003—Monitoring arrangements specially adapted to the computing system or computing system component being monitored
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3003—Monitoring arrangements specially adapted to the computing system or computing system component being monitored
- G06F11/3024—Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a central processing unit [CPU]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3003—Monitoring arrangements specially adapted to the computing system or computing system component being monitored
- G06F11/3041—Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is an input/output interface
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3065—Monitoring arrangements determined by the means or processing involved in reporting the monitored data
- G06F11/3086—Monitoring arrangements determined by the means or processing involved in reporting the monitored data where the reporting involves the use of self describing data formats, i.e. metadata, markup languages, human readable formats
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Quality & Reliability (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computing Systems (AREA)
- Mathematical Physics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Library & Information Science (AREA)
- Debugging And Monitoring (AREA)
Abstract
The invention provides a method and a system for automatically recording system log information by a notebook computer, and belongs to the technical field of computer application. The method comprises the following steps: short-term log storage: the EC firmware receives the log of the CPU system through a serial port receiving end connected with a serial port transmitting end of the CPU and stores the log in a memory chip of the EC firmware; a long-term diary storage step: the BIOS firmware sends a command to the EC firmware, reads the log information in the memory chip through the EC firmware, adds a time stamp, and then transfers the log information to a memory medium on the notebook computer; a storage space releasing step: and the EC firmware clears the read log information in the memory chip, releases the memory space and stores the log information in the system. The invention also provides a system for realizing the method for automatically recording the system log information by the notebook computer. According to the invention, the log information of the CPU can be recorded in real time without adding a complex and additional debugging jig.
Description
Technical Field
The invention relates to the technical field of computer application, in particular to a method and a system for automatically recording system log information by a notebook computer.
Background
In conventional notebook computer designs, the debugging means in the development stage is usually to check the serial log output of the CPU. From the stage of starting the notebook computer, the BIOS firmware sends debugging information to the CPU serial port until the system is entered, and the system also sends corresponding initialization and working state information to the CPU serial port. In short, the working state of the current notebook computer can be checked by checking the log information of the CPU.
The serial port information of the CPU generally needs to be built up into a serial port receiving jig and a serial port receiving computer, and the serial port information of the CPU can be received and recorded through serial port receiving software. The complex receiving mode is not beneficial to the research, development and debugging of the notebook computer, and if each machine needs to record CPU serial port information, the complex receiving mode can be a very troublesome work. If the CPU log information is not recorded, the current state of the notebook computer cannot be analyzed in detail when the notebook computer has an abnormal problem.
Therefore, it is particularly necessary to design a method that is easy to implement and can automatically record system log information.
Disclosure of Invention
In order to solve the problem that the log information recording is very troublesome in the prior art, the invention provides a method for automatically recording the system log information by a notebook computer, and the log information of a CPU can be recorded in real time without adding a complex and additional debugging tool in the research and development and debugging process of the notebook computer.
The invention discloses a method for automatically recording system log information by a notebook computer, which comprises the following steps:
short-term log storage: the EC firmware receives the log of the CPU system through a serial port receiving end connected with a serial port transmitting end of the CPU and stores the log in a memory chip of the EC firmware to form a short-term log storage record;
a long-term diary storage step: the BIOS firmware sends a command to the EC firmware, reads the log information in the memory chip through the EC firmware, adds a time stamp, and then transfers the log information to a storage medium on the notebook computer to form a long-term log storage record;
a storage space releasing step: and the EC firmware clears the read log information in the memory chip, releases the memory space and stores the log information in the system.
Further, the EC firmware is provided with a function switch, a control interface of the function switch is connected with the BIOS firmware, and the function switch is used for controlling whether the EC firmware starts a function of automatically recording system log information.
Further, the short-term log storage step includes the sub-steps of:
a1: powering up EC firmware and initializing operation;
a2: the function switch is turned on, and the EC firmware receives the log of the CPU system in a serial port interrupt mode;
a3: in interrupt service, executing the transfer from the serial port receiving end to the memory buffer memory, and modifying the buffer pointer;
a4: inquiring the memory cache, transferring the memory cache log to the memory chip, and modifying the pointer of the memory chip.
Further, in the long-term diary storing step, when the EC firmware receives the command, the EC firmware performs sub-step B: inquiring a storage chip pointer, then reading a system log in the EC storage chip to a memory in sequence, and informing a BIOS firmware to read; and after the BIOS firmware is read, the EC firmware executes a storage space release step.
Further, the EC firmware performs sub-steps A3, A4 and sub-step B in a polled manner.
Further, the initializing operation includes log function initializing, pointer initializing, buffer initializing, and setting serial port interrupt mode.
Further, in the long-term diary storing step, the BIOS firmware executing method includes the following sub-steps:
c1: in the POST stage, the BIOS firmware creates a log record file in a storage medium, and adds a time stamp on the log record file;
c2: c3, judging whether the log in the EC memory chip is empty, if so, closing the memory medium, continuing the POST stage, and if not, executing the step C3;
and C3: reading short-term log records in a storage chip to a memory cache of BIOS firmware through EC firmware;
and C4: after the reading is finished, an information clearing instruction is sent to inform the EC firmware of clearing the short-term log record after the reading;
c5: and C2, the BIOS firmware transfers the log information in the memory cache to a log record file of the storage medium, and then returns to execute the step C2.
Further, in step C3-C4, before the BIOS firmware reads, a read instruction is sent to the EC firmware, the EC firmware blocks the log information in the memory chip according to the sequence, and reads the log information to the memory block by block for the BIOS firmware to read, after each piece of log information is read by the BIOS firmware, an information clearing instruction is sent to the EC firmware, and the EC firmware clears the memory and the log information stored in the memory chip.
The invention also provides a system for realizing the method for automatically recording the system log information of the notebook computer, which comprises a CPU, EC firmware, BIOS firmware and a storage medium, wherein,
the EC firmware is provided with a storage chip, a serial port receiving end of the EC firmware is connected with a serial port transmitting end of the CPU, the EC firmware receives a log of the CPU system through the serial port and stores the log in the storage chip of the EC firmware to form a short-term log storage record;
the BIOS firmware is connected with the EC firmware through an LPC interface and is used for reading the log information in the memory chip through the EC firmware, adding a time stamp, and then transferring the log information to a storage medium on the notebook computer to form a long-term log storage record.
Further, the storage chip is an SPI FLASH storage chip, and the storage medium is a computer hard disk, a U disk or an optical disk.
Compared with the prior art, the invention has the beneficial effects that: based on an embedded control unit (hereinafter referred to as EC) of the current notebook computer, the invention can skillfully use the EC to record the log of the CPU and transfer the log information to a storage medium of the notebook computer, thereby realizing real-time and rapid recording of the system log information. The invention has the following advantages:
1. because the hardware of the invention is built in the notebook computer, the log recording system is movable and convenient along with the notebook computer.
2. The invention is mainly realized by software and firmware, the change of hardware is very little, the invention can be completed only by designing the hardware, and the invention does not need to additionally build a complex jig and a receiving computer, thereby being convenient to realize and saving the space.
3. The software firmware of the invention always works, so that the work log of the notebook computer can be recorded at any time from starting the function, and the log output state of the notebook computer can be always tracked. When the notebook computer has an abnormal error, the current problem condition can be recorded.
4. By applying the invention, the system log can be recorded in large batches. According to the previous log record state, only the notebook computer with the log record tool can record the log, which makes batch construction difficult.
5. The invention is mainly realized in a software and firmware mode, has the characteristics of upgradeability and capability of increasing functions in design, and has strong compatibility and expansibility.
Drawings
In order to more clearly illustrate the invention or the solutions of the prior art, a brief description will be given below of the drawings used in the description of the embodiments or the prior art, it being obvious that the drawings in the description below are some embodiments of the invention and that other drawings can be obtained from them without inventive effort for a person skilled in the art.
FIG. 1 is a system block diagram of a notebook computer according to the present invention for automatically recording system log information;
FIG. 2 is a flow chart of an EC firmware processing method;
FIG. 3 is a flowchart of a BIOS firmware processing method.
Detailed Description
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs; the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention; the terms "comprising" and "having" and any variations thereof in the description of the invention and the claims and the description of the drawings above are intended to cover a non-exclusive inclusion. The terms first, second and the like in the description and in the claims or in the above-described figures, are used for distinguishing between different objects and not necessarily for describing a sequential or chronological order.
Reference in the specification to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the invention. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of skill in the art will explicitly and implicitly appreciate that the described embodiments of the invention may be combined with other embodiments.
In order to enable those skilled in the art to better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings.
In the design of the existing notebook computer, the invention provides a system capable of automatically recording system log information, and a method for automatically recording the system log information is designed based on the system, so that the trouble that a log recording tool is really needed to be built is reduced, and the log recording and the acquisition are more convenient.
As shown in FIG. 1, the system for automatically recording system log information of the notebook computer comprises a CPU, EC firmware, BIOS firmware and a storage medium connected with the BIOS firmware, wherein the EC firmware is provided with a storage chip, a serial port receiving end of the EC firmware is connected with a serial port transmitting end of the CPU, and the BIOS firmware is arranged in the CPU system and is connected with the EC firmware through an LPC interface.
The memory chip of the invention adopts a serial peripheral interface FLASH memory (SPI FLASH hereinafter), the memory medium can be a computer hard disk, a USB FLASH memory (USB FLASH memory hereinafter) or an optical disk, and the like, and the example takes a hard disk of a notebook as an example for illustration.
The invention discloses a method for automatically recording system log information by a notebook computer, which comprises the following steps:
short-term log storage: the EC firmware receives the log of the CPU system through a serial port and stores the log in a memory chip of the EC firmware to form a short-term log storage record;
a long-term diary storage step: the BIOS firmware sends a command to the EC firmware, reads the log information in the memory chip through the EC firmware, adds a time stamp, and then transfers the log information to a storage medium on the notebook computer to form a long-term log storage record;
a storage space releasing step: and the EC firmware clears the read log information in the memory chip, releases the memory space and stores the log information in the system.
The invention skillfully uses the EC firmware of the notebook to record the log of the CPU system, improves the EC firmware when designing hardware, and connects the TX signal sent by the serial port information of the CPU to the serial port receiving signal RX of the EC. Meanwhile, in the firmware design of the EC, a serial port receiving program is driven to receive serial port information, so that log information can be received.
After receiving the serial port information, the EC needs to buffer the log information. Typical log information varies from a few thousand (hereinafter K) bytes to a few hundred K bytes, and thus a mass storage is required to hold this information. The SPI FLASH of the EC has the maximum capacity of 16M, the actually used code space is only 128K bytes, the rest part can be used for storing serial log information, and the part needs to be used as a cache on the EC firmware for recording and re-reading the log.
However, SPI FLASH of EC firmware can only store short log information due to capacity size. When the information exceeds the capacity of the SPI FLASH, the EC firmware should take the mode of covering the previous record and keep the latest record. If all logs are to be stored for a long time, the log information on the SPI FLASH can be stored in the hard disk only by the firmware of the basic input/output system (hereinafter referred to as BIOS). Based on the above mode, the notebook computer can record the log information of the CPU in real time without adding an additional debugging jig.
The CPU system is the initiator of the system log. As shown in fig. 1, the detailed implementation process of the present invention is:
when the notebook computer is started, the CPU sends the execution log to the serial port of the EC through the serial port by executing the BIOS firmware and the operating system. Thus, the EC firmware may receive all system logs via the serial port. Because the system log is persistent and is quickly sent out, the EC firmware needs to quickly record the received log information into the internal memory cache of the EC chip. At the moment, the task in the memory cache is transferred to the SPI FLASH through the timing polling task. At this point, short-term system logging is complete.
With continuous transmission of the system logs, short-term system logs are more and more, and the system logs need to be transferred and stored at the moment. The BIOS firmware is responsible for converting the corresponding EC short-term log record into a long-term log record. In the POST stage, the BIOS firmware judges whether a long-term log recording function exists by inquiring keywords in the hard disk storage or the U disk storage. When the key exists, the long-term logging function is in an enabled state, and at the same time, the EC firmware is notified through a command, and the short-term system logging function is also in an enabled state. The BIOS firmware reads the short-term log system into the memory cache of the notebook computer through a low-speed serial bus (LPC) interface, and the EC firmware clears the log in the SPI FLASH for later storage. The BIOS then saves the log in the memory cache in the hard disk by adding a time stamp. At this point, the long-term system log record is completed.
The design is mainly completed through EC firmware and BIOS firmware. The design of these two parts is described in detail below.
EC firmware design
EC firmware is the key execution part responsible for short-term logging while also providing raw logging for long-term logging.
As shown in fig. 2, the EC firmware of the present invention is implemented as follows:
a1: powering up EC firmware and initializing operation;
a2: the function switch is turned on, and the EC firmware receives the log of the CPU system in a serial port interrupt mode;
a3: in interrupt service, executing the transfer from the serial port receiving end to the memory buffer memory, and modifying the buffer pointer;
a4: inquiring the memory cache, transferring the memory cache log to the memory chip, and modifying the pointer of the memory chip.
In the long-term diary storing step, when the EC firmware receives a command, the EC firmware performs the substep B: inquiring a storage chip pointer, then reading a system log in the EC storage chip to a memory in sequence, and informing a BIOS firmware to read; and after the BIOS firmware is read, the EC firmware executes a storage space release step.
And the EC firmware executes the substeps A3 and A4 and the substep B in a polling mode, so that the EC firmware information storage and deletion are synchronously carried out, and the real-time recording of the CPU system log information is realized.
In order to save the resources of the EC firmware and the CPU system, the EC firmware of the embodiment is also provided with a function switch, a control interface of the function switch is connected with the BIOS firmware, and the function switch is used for controlling whether the EC firmware starts the function of automatically recording the system log information.
The functional implementation of the EC firmware is described in detail below.
1. Design of log recording function switch
The logging function is a function that requires additional consumption of EC resources and BIOS resources. If logging is not required, it is preferable not to perform the system logging function. The consumed resources include:
SPI FLASH has an erase life of about 10 ten thousand times. Frequent erasure and logging of short-term system logs can lead SPI FLASH to reach service life early.
And b, the EC firmware can greatly consume CPU resources and memory cache resources of the EC by taking the recording function of the log.
When the BIOS firmware executes the log record function, the starting time is increased.
And d, when the BIOS performs a log recording function, the space of the hard disk/U disk is occupied.
Therefore, the logging function requires a switch function to be designed for the EC firmware to determine whether to receive the log and record. The switch decision of the logging function comes from the operation of the BIOS firmware. Before the operation switch of the BIOS firmware is not received, the log recording function is closed by default, so that the waste of EC resources is avoided. The EC firmware provides a corresponding control interface to the BIOS firmware to operate. And the subsequent system log receiving and the system log recording are controlled by the function switch.
2. System log reception
When the system log recording function is opened, the EC needs to receive log information sent by the serial port and record the received serial port information on an EC memory cache. The serial port receives data and needs to set corresponding serial port parameters, wherein the most important is the data baud rate of the serial port. The EC serial port is used as a receiving end, and the data baud rate is required to be set according to the CPU serial port transmitting end. In this example, the baud rate of the serial port transmitting end of the CPU is 115200 bits per second (abbreviated as bps hereinafter). At this maximum data rate, the amount of data per 1 millisecond is approximately:
115200bps/1000 milliseconds=115.2 bits=11.5 bytes
Therefore, if the execution of the data transfer from the memory to the SPI FLASH is executed at one time of 1 millisecond, the size of the memory buffer is a minimum of 12 bytes. In this example, 32 bytes are taken as the EC buffer size.
Because the log file is sent immediately, the EC firmware needs to receive and record serial port information in time and needs to be realized in a serial port receiving interrupt mode to effectively achieve instantaneity. Therefore, after the EC firmware is initialized by power-on, the serial port receiving end is set to be in an interrupt mode, and the transfer from the serial port receiving end to the memory cache is executed in the interrupt service.
The memory is cached, and a corresponding data pointer is needed to indicate where the current data is stored, so as to locate the place where the next data is stored. And meanwhile, the method is also used for judging the length of the data to be recorded when the EC log is recorded.
3. Recording of short-term logs
After the system log is transferred to the memory cache, the memory cache needs to be transferred to a larger SPI FLASH in time. At this time, the log information can be transferred in time only by performing the above operations in an event executed once every 1 millisecond, and meanwhile, the memory cache is emptied, so that the next data is ensured to have enough storage space.
The SPI FLASH is used as a short-term log record space, and needs enough space to store log information quantity of 1 startup and shutdown. In this example, the log size of one startup/shutdown is about 200,000 bytes, and about 200 kilobytes (hereinafter referred to as K bytes). And the EC firmware code originally stored in SPI FLASH is 128K bytes in size. The size of SPI FLASH must be chosen to be greater than 300K bytes. The model selected in this example is GD25Q80, with a capacity of 1024KBytes bytes, which is sufficient for one storage of data.
In the above embodiment, the code of the EC firmware occupies the SPI FLASH with 128K bytes from the memory address 0x0 to 0x1FFFF. The space of the rest memory addresses 0x20000 to 0xFFFFF, the size of which is 896K bytes, can be used as the memory space.
The read-write characteristic of SPI FLASH is that before each writing, the written content needs to be erased. The erasing mode is a block erasing mode, namely, each time of erasing, the erasing mode is a mode of erasing the size of 4K bytes once. The writing mode is to write 256 bytes at a time in a block manner. Because 256 bytes are written once, the writing of SPI FLASH also requires a corresponding SPI buffer.
In the record of the SPI FLASH, it is also necessary to specify the storage address corresponding to the writing. Therefore, this example needs to apply for an additional memory address pointer to save the write memory address of the current SPI FLASH.
4. System log reading and purging
After the short-term logging, the present example EC firmware also provides an interface for long-term logging. And meanwhile, after the corresponding interface is used, the corresponding SPI FLASH space is cleared for subsequent re-storage and use.
The SPI FLASH is read in a block reading mode, and 256 bytes of data are read at one time. Likewise, 256 bytes of space are also required for the memory cache to read this portion of the content for the BIOS firmware.
The same as the writing log, an additional pointer is required to be applied to point to the storage address of the read SPI FLASH as the read storage address of the SPI FLASH.
Since there are a write memory address and a read memory address, the write mode of SPI FLASH is a full use of 0x20000 to 0xFFFFF by using a cyclic write method. The upper SPI FLASH can be comprehensively used in the mode, and frequent erasing and writing of the single block cannot be caused. Meanwhile, the full writing needs to be judged. When the write address reaches the read address, namely the SPI FLASH is full, the corresponding space is released by adopting a mode of stopping writing or erasing the read address space.
After the BIOS firmware reads the corresponding content, the EC firmware also provides an interface for erasing the read log content and releasing SPI FLASH storage space.
BIOS firmware design
As shown in fig. 3, in the present invention, the method for executing BIOS firmware includes the following sub-steps:
c1: in the POST stage, the BIOS firmware creates a log record file in a storage medium, and adds a time stamp on the log record file;
c2: c3, judging whether the log in the EC memory chip is empty, if so, closing the memory medium, continuing the POST stage, and if not, executing the step C3;
and C3: reading short-term log records in a storage chip to a memory cache of BIOS firmware through EC firmware;
and C4: after the reading is finished, an information clearing instruction is sent to inform the EC firmware of clearing the short-term log record after the reading;
c5: and C2, the BIOS firmware transfers the log information in the memory cache to a log record file of the storage medium, and then returns to execute the step C2.
Before operation, the BIOS firmware searches the keyword information on the storage medium to determine whether to open the logging function in the POST stage. After corresponding storage information is searched, short-term log records of the EC firmware are read into a memory, and corresponding information is recorded on a storage medium.
The functional implementation of the BIOS firmware is described in detail below.
1. Long-term log recorded media search and function switch
The BIOS firmware searches the storage medium during the POST phase, this example being present in the hard disk. By searching for keywords on these media information, it is decided whether to turn on the logging function. In this example, it is arranged to find whether a folder "project_log" exists in the storage medium. When the folder is found on one storage medium in all the medium information, the logging function is considered to be opened, and otherwise, the logging function is closed.
When the logging function is opened, the logging function of the EC firmware needs to be opened through the EC firmware interface. At the same time, in the found 'project_log' folder, a corresponding log record text file is created. And adding a time stamp to set when the file name is named, so that the log time is recorded and sequencing is realized.
2. Long-term log read and clear commands
And the BIOS firmware reads short-term log records in the prepared SPI FLASH in the EC firmware through the LPC interface. Since the EC firmware reads 256 bytes of log information at a time, the BIOS firmware also needs to apply a section of memory for the read cache record.
After the BIOS firmware reads 256 bytes of information of the EC firmware, a corresponding command for clearing SPI FLASH information needs to be sent to clear the content of the SPI FLASH so as to make a storage space free for later log records. The BIOS firmware then needs to notify the EC firmware to swap the next 256 byte block of log information for reading.
By the continuous replacement of the reading of the log information, all log information can be read. At this time, it is necessary to determine whether to continue reading the log information by determining whether the log information is empty. When the log is empty, the reading of the log information in the EC firmware is ended.
3. Long-term log recording in hard disk
After all the log information is read, the log information is recorded in the memory cache, and the memory log information needs to be recorded in a storage medium. And opening the file with the time stamp, which is created in the hard disk, recording the memory cache in the file, and finally storing and exiting the file. And at the moment, after the long-term log information is stored, continuing the POST process of the BIOS firmware.
After a plurality of log information records, a plurality of text documents with time stamps should exist in the folder in the corresponding keyword information in the storage medium. Each text document records the log information content from the last time of the log reading of the BIOS firmware to the time of the log reading of the BIOS firmware.
Through the ingenious design, the system log information can be recorded rapidly in the research, development and debugging process of the notebook computer without building a complex external jig. The invention has the following advantages:
1. because the hardware of the invention is built in the notebook computer, the log recording system is movable and convenient along with the notebook computer.
2. The invention is mainly realized by software and firmware, the change of hardware is very little, the invention can be completed only by designing the hardware, and the invention does not need to additionally build a complex jig and a receiving computer, thereby being convenient to realize and saving the space.
3. The software firmware of the invention always works, so that the work log of the notebook computer can be recorded at any time from starting the function, and the log output state of the notebook computer can be always tracked. When the notebook computer has an abnormal error, the current problem condition can be recorded.
4. By applying the invention, the system log can be recorded in large batches. According to the previous log record state, only the notebook computer with the log record tool can record the log, which makes batch construction difficult.
5. The invention is mainly realized in a software and firmware mode, has the characteristics of upgradeability and capability of increasing functions in design, and has strong compatibility and expansibility.
The above embodiments are preferred embodiments of the present invention, and are not intended to limit the scope of the present invention, which includes but is not limited to the embodiments, and equivalent modifications according to the present invention are within the scope of the present invention.
Claims (10)
1. The method for automatically recording the system log information by the notebook computer is characterized by comprising the following steps of:
short-term log storage: the EC firmware receives the log of the CPU system through a serial port receiving end connected with a serial port transmitting end of the CPU and stores the log in a memory chip of the EC firmware to form a short-term log storage record;
a long-term diary storage step: the BIOS firmware sends a command to the EC firmware, reads the log information in the memory chip through the EC firmware, adds a time stamp, and then transfers the log information to a storage medium on the notebook computer to form a long-term log storage record;
a storage space releasing step: and the EC firmware clears the read log information in the memory chip, releases the memory space and stores the log information in the system.
2. The method for automatically recording system log information by using a notebook computer according to claim 1, wherein: the EC firmware is provided with a function switch, a control interface of the function switch is connected with the BIOS firmware, and the function switch is used for controlling whether the EC firmware starts the function of automatically recording system log information.
3. The method for automatically recording system log information by using a notebook computer according to claim 2, wherein: the short-term log storage step includes the sub-steps of:
a1: powering up EC firmware and initializing operation;
a2: the function switch is turned on, and the EC firmware receives the log of the CPU system in a serial port interrupt mode;
a3: in interrupt service, executing the transfer from the serial port receiving end to the memory buffer memory, and modifying the buffer pointer;
a4: inquiring the memory cache, transferring the memory cache log to the memory chip, and modifying the pointer of the memory chip.
4. The method for automatically recording system log information by using a notebook computer according to claim 3, wherein: in the long-term diary storing step, when the EC firmware receives a command, the EC firmware performs the substep B: inquiring a storage chip pointer, then reading a system log in the EC storage chip to a memory in sequence, and informing a BIOS firmware to read;
and after the BIOS firmware is read, the EC firmware executes a storage space release step.
5. The method for automatically recording system log information by using a notebook computer according to claim 4, wherein: the EC firmware performs sub-steps A3, A4 and sub-step B in a polled manner.
6. The method for automatically recording system log information by using a notebook computer according to claim 3, wherein: the initialization operation comprises log function initialization, pointer initialization, cache initialization and serial port interrupt mode setting.
7. The method for automatically recording system log information by using a notebook computer according to claim 1, wherein: in the long-term diary storage step, the BIOS firmware execution method comprises the following sub-steps:
c1: in the POST stage, the BIOS firmware creates a log record file in a storage medium, and adds a time stamp on the log record file;
c2: c3, judging whether the log in the EC memory chip is empty, if so, closing the memory medium, continuing the POST stage, and if not, executing the step C3;
and C3: reading short-term log records in a storage chip to a memory cache of BIOS firmware through EC firmware;
and C4: after the reading is finished, an information clearing instruction is sent to inform the EC firmware of clearing the short-term log record after the reading;
c5: and C2, the BIOS firmware transfers the log information in the memory cache to a log record file of the storage medium, and then returns to execute the step C2.
8. The method for automatically recording system log information by a notebook computer according to claim 7, wherein: in step C3-C4, before the BIOS firmware reads, a read instruction is sent to the EC firmware, the EC firmware blocks the log information in the memory chip according to the sequence, and reads the log information to the memory block by block for the BIOS firmware to read, after each time the BIOS firmware reads a whole piece of log information, an information clearing instruction is sent to the EC firmware, and the EC firmware clears the memory and the log information stored in the memory chip.
9. A system for automatically recording system log information by a notebook computer, for implementing the method for automatically recording system log information by a notebook computer according to any one of claims 1 to 9, characterized in that: including CPU, EC firmware, BIOS firmware, and storage medium, wherein,
the EC firmware is provided with a storage chip, a serial port receiving end of the EC firmware is connected with a serial port transmitting end of the CPU, the EC firmware receives a log of the CPU system through the serial port and stores the log in the storage chip of the EC firmware to form a short-term log storage record;
the BIOS firmware is connected with the EC firmware through an LPC interface and is used for reading the log information in the memory chip through the EC firmware, adding a time stamp, and then transferring the log information to a storage medium on the notebook computer to form a long-term log storage record.
10. The system according to claim 9, wherein: the storage chip is SPI FLASH, and the storage medium is a computer hard disk, a U disk or an optical disk.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311547179.8A CN117555757A (en) | 2023-11-20 | 2023-11-20 | Method and system for automatically recording system log information by notebook computer |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311547179.8A CN117555757A (en) | 2023-11-20 | 2023-11-20 | Method and system for automatically recording system log information by notebook computer |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117555757A true CN117555757A (en) | 2024-02-13 |
Family
ID=89812205
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311547179.8A Pending CN117555757A (en) | 2023-11-20 | 2023-11-20 | Method and system for automatically recording system log information by notebook computer |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117555757A (en) |
-
2023
- 2023-11-20 CN CN202311547179.8A patent/CN117555757A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7318118B2 (en) | System and method for selective write to flash memory in HDD | |
US8291166B2 (en) | Caching performance optimization | |
US10216637B2 (en) | Non-volatile memory cache performance improvement | |
EP2972808B1 (en) | System and method for predicting and improving boot-up sequence | |
US5546585A (en) | Personal computer system with start-up capability from an external mass storage device | |
US20080005462A1 (en) | Method of configuring non-volatile memory for a hybrid disk drive | |
US8661183B2 (en) | Computer system, data storage method, and program for reduction of stored data after hibernation | |
US10877686B2 (en) | Mass storage device with host initiated buffer flushing | |
CN101331463A (en) | Optimizing write and wear performance for a memory | |
EP1345236A1 (en) | A non-volatile memory device | |
KR101538619B1 (en) | Integration of secure data transfer applications for generic io devices | |
US5761519A (en) | Portable computer having a removable medium drive and a resume setting function | |
CN117555757A (en) | Method and system for automatically recording system log information by notebook computer | |
CN116185892B (en) | Flash memory controller and method for accessing flash memory particles | |
KR101691091B1 (en) | Computing system and hibernation method thereof | |
KR19990019377A (en) | Flash memory auxiliary storage device and method | |
CN116578234A (en) | Flash memory access system and method | |
CN109656881B (en) | Method and system for realizing dynamic file management based on FAT16 technology | |
CN113448771A (en) | Memory controller and data processing method | |
CN116185891B (en) | Descriptor management method | |
KR102343599B1 (en) | Memory controller and storage device including the same | |
KR100640612B1 (en) | Main code writing method and apparatus | |
CN117632776A (en) | Processing system and processing method | |
US5625799A (en) | Method and apparatus for determining the logic and functionality of a changeline | |
Conci et al. | Software Management of Flash Memories |
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 |