CN112052125A - Dump processing method and device for operating system kernel and electronic equipment - Google Patents

Dump processing method and device for operating system kernel and electronic equipment Download PDF

Info

Publication number
CN112052125A
CN112052125A CN202011038557.6A CN202011038557A CN112052125A CN 112052125 A CN112052125 A CN 112052125A CN 202011038557 A CN202011038557 A CN 202011038557A CN 112052125 A CN112052125 A CN 112052125A
Authority
CN
China
Prior art keywords
dump
kernel
nonvolatile
operating system
mode
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
CN202011038557.6A
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.)
Lenovo Beijing Ltd
Original Assignee
Lenovo Beijing 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 Lenovo Beijing Ltd filed Critical Lenovo Beijing Ltd
Priority to CN202011038557.6A priority Critical patent/CN112052125A/en
Publication of CN112052125A publication Critical patent/CN112052125A/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/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process
    • G06F11/1469Backup restoration techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures

Landscapes

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

Abstract

The application discloses a dump processing method and device for an operating system kernel and electronic equipment, wherein the method comprises the following steps: under the condition that the operating system kernel is started, initializing nonvolatile equipment connected with electronic equipment where the operating system kernel is located; acquiring kernel dump data under the condition that the kernel of the operating system is down; and transmitting the kernel dump data to the nonvolatile device so as to store the kernel dump data in the nonvolatile device.

Description

Dump processing method and device for operating system kernel and electronic equipment
Technical Field
The present application relates to the field of operating system technologies, and in particular, to a method and an apparatus for performing dump processing on an operating system kernel, and an electronic device.
Background
Currently, a kernel dump mechanism called kdump exists on the Linux platform. This mechanism addresses the issue of operating system error kernel state instability, achieved by a second kernel called the dump kernel.
Specifically, the dump kernel is loaded to a reserved memory when the operating system is started, and is booted to complete dumping of the kernel when the operating system is down. Because the boot and subsequent dump work of the dump kernel are both carried out in the reserved memory space, the method is not influenced by the unstable state of the original kernel and cannot damage the operation site of the original kernel.
In the above dumping scheme, a dumping kernel needs to be booted, and the boot process of the dumping kernel is the same as that of the original kernel, and various hardware needs to be detected and initialized, but the original kernel may be unstable when the operating system is down, so that the system hardware may not work normally, and then the booting of the dumping kernel may fail, resulting in a situation of dumping failure. Therefore, the reliability of the above dump scheme is low.
Disclosure of Invention
In view of the above, the present application provides a method, an apparatus, and an electronic device for processing dump of an operating system kernel, as follows:
a method of dump processing of an operating system kernel, the method comprising:
under the condition that the operating system kernel is started, initializing nonvolatile equipment connected with electronic equipment where the operating system kernel is located;
acquiring kernel dump data under the condition that the kernel of the operating system is down;
and transmitting the kernel dump data to the nonvolatile device so as to store the kernel dump data in the nonvolatile device.
In the above method, preferably, the nonvolatile device includes at least one storage space, and the storage space is configured in a dump mode, so that the storage space configured in the dump mode can store the kernel dump data.
The above method, preferably, further comprises:
receiving a dump configuration operation aiming at a configuration interface corresponding to the nonvolatile device, wherein the dump configuration operation is used for setting a storage space corresponding to the dump configuration operation in the nonvolatile device to be in the dump mode.
In the above method, preferably, the dump configuration operation includes at least a mode configuration operation and a space configuration operation;
wherein the mode configuration operation is used for setting the storage space in the nonvolatile device to be in the dump mode, and the space configuration operation is used for setting the space size and/or the space address of the storage space in the nonvolatile device to be in the dump mode.
In the above method, preferably, before performing initialization processing on the nonvolatile device connected to the electronic device where the operating system kernel is located, the method further includes:
identifying whether a preset target parameter exists in the kernel of the operating system, wherein the target parameter represents that the electronic equipment uses a nonvolatile device to perform kernel dump;
searching the connected nonvolatile device in the device list of the electronic device, and executing the following steps under the condition that the nonvolatile device is searched: and initializing the nonvolatile equipment connected with the electronic equipment where the operating system kernel is located.
Preferably, the method for initializing a nonvolatile device connected to an electronic device in which the operating system kernel is located includes:
obtaining storage space in the non-volatile device configured in a dump mode;
mapping the memory space configured as dump mode to the space of the operating system kernel to enable the memory space configured as dump mode to store the kernel dump data.
The above method, preferably, obtaining a storage space configured as a dump mode in the nonvolatile device includes:
obtaining at least one divided storage space in the nonvolatile device;
and finding the storage space configured to be in a dump mode in the at least one storage space.
A dump processing apparatus of an operating system kernel, comprising:
the device initialization unit is used for initializing nonvolatile devices connected with the electronic device where the operating system kernel is located under the condition that the operating system kernel is started;
the data acquisition unit is used for acquiring kernel dump data under the condition that the kernel of the operating system is down;
and the data transmission unit is used for transmitting the kernel dump data to the nonvolatile equipment so as to store the kernel dump data in the nonvolatile equipment.
An electronic device to which a nonvolatile device is connected, the electronic device comprising:
a memory for storing an application program and data generated by the application program running;
a processor for executing the application to implement: under the condition that the operating system kernel is started, initializing nonvolatile equipment connected with electronic equipment where the operating system kernel is located; acquiring kernel dump data under the condition that the kernel of the operating system is down; and transmitting the kernel dump data to the nonvolatile device so as to store the kernel dump data in the nonvolatile device.
In the above electronic device, preferably, the nonvolatile device includes at least one storage space, and the storage space is configured in a dump mode, so that the storage space configured in the dump mode can store kernel dump data transmitted by the processor.
According to the above scheme, in the dump processing method and apparatus for the operating system kernel and the electronic device provided by the application, the nonvolatile device connected to the electronic device where the operating system kernel is located is initialized when the operating system kernel is started, and then the kernel dump data can be obtained and transmitted to the nonvolatile device when the operating system kernel is down, so that the kernel dump data is stored in the nonvolatile device. Therefore, the dump process realized by the method is relatively simple, the participation of a dump kernel is not needed, whether the kernel of the operating system is stable or not is not needed to be considered, and even if the system hardware cannot work normally, the kernel dump data can be safely stored in the initialized nonvolatile equipment, so that the dump failure condition is avoided, and the dump reliability is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
FIG. 1 is a flowchart of a method for processing dump of an operating system kernel according to an embodiment of the present disclosure;
FIG. 2 is a diagram illustrating an example of a storage space in an embodiment of the present application;
FIGS. 3-4 are illustrations of embodiments of the present application, respectively;
FIG. 5 is another flow chart of the first embodiment of the present application;
FIG. 6 is a partial flowchart of a method for processing dump of an operating system kernel according to an embodiment of the present application;
FIG. 7 is a schematic structural diagram of a dump processing apparatus for an operating system kernel according to a second embodiment of the present application;
FIG. 8 is a schematic diagram of another structure of a dump processing apparatus for an operating system kernel according to a second embodiment of the present application;
fig. 9 is a schematic structural diagram of an electronic device according to a third embodiment of the present application;
fig. 10 is a flowchart when the embodiment of the present application is applied to a device such as a notebook.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Fig. 1 is a flowchart illustrating an implementation of a dump processing method for an operating system kernel, which is applicable to an electronic device, such as a computer or a server, loaded with an operating system and capable of performing data processing. The technical scheme in the embodiment is mainly used for improving the dump reliability.
Specifically, the method in this embodiment may include the following steps:
step 101: and under the condition that the kernel of the operating system is started, initializing the nonvolatile equipment connected with the electronic equipment where the kernel of the operating system is located.
The starting of the operating system kernel may be understood as that the operating system kernel starts to be started or is in the process of starting after the electronic device is started, at this time, the initialization processing is performed on the nonvolatile device connected to the electronic device where the operating system kernel is located, so that the initialized nonvolatile device can be used as a data storage device to realize a dump function.
Step 102: and monitoring whether the kernel of the operating system is down, and executing the step 103 under the condition that the kernel of the operating system is down.
The downtime of the kernel of the operating system may be the downtime caused by the occurrence of the internal error kemel panic of the kernel of the operating system, or the downtime caused by other conditions, that is, the dump scheme in this embodiment may be applicable to the kernel downtime scenario caused by any condition, so as to implement dump.
Step 103: kernel dump data is obtained.
In this embodiment, kernel dump data that can be used for post analysis can be obtained in the operating system kernel and the hard disk in the electronic device.
Step 104: and transmitting the kernel dump data to the nonvolatile device so as to store the kernel dump data in the nonvolatile device.
That is to say, in this embodiment, the nonvolatile device connected to the electronic device is used as a kernel dump device to store kernel dump data, so as to analyze the downtime event in the following process.
In a specific implementation, the nonvolatile device may be a nonvolatile memory device connected to the electronic device, and thus, data reading and writing of the nonvolatile memory device is the same as that of a memory, and an access process of kernel dump data in the nonvolatile memory device may be implemented as a simple memory copy without depending on any other kernel functions. Therefore, the access conciseness of the nonvolatile memory device in the dump enables the dump to be carried out in the original kernel, namely the kernel of the operating system, without worrying about the influence of the instability of the original kernel, without the participation of an additional dump kernel, and the problem of loading failure of the dump kernel when the crash occurs is also avoided.
According to the above scheme, in the dump processing method for the operating system kernel provided in the embodiment of the present application, the nonvolatile device connected to the electronic device where the operating system kernel is located is initialized when the operating system kernel is started, and then the kernel dump data can be obtained and transmitted to the nonvolatile device when the operating system kernel is down, so that the kernel dump data is stored in the nonvolatile device. Therefore, the dump process realized by the method is relatively simple, the participation of a dump kernel is not needed, whether the kernel of the operating system is stable or not is not needed to be considered, and even if the system hardware cannot work normally, the kernel dump data can be safely stored in the initialized nonvolatile equipment, so that the dump failure condition is avoided, and the dump reliability is improved.
In one implementation, the non-volatile device, which is connected to the electronic device and has undergone the initialization process, includes at least one storage space, and the storage space is configured in a dump mode, so that the storage space configured in the dump mode can store kernel dump data obtained when a kernel of the operating system is down, and thus, the dump is implemented by the storage space configured in the dump mode in the non-volatile device.
It should be noted that the nonvolatile device may further include other storage spaces, which can be used for storing other data. As shown in fig. 2, an address space capable of storing data in a nonvolatile device is divided into a plurality of memory spaces, wherein a memory space a configured in a dump mode is used to implement a dump, i.e., to store kernel dump data, and the other memory space b is used to store other data.
The memory space configured in the nonvolatile device in the dump mode may be a space divided by default in the nonvolatile device, that is, in an initial state, the space in the nonvolatile device that may default a preset address to the memory space in the dump mode, or the memory space configured in the dump mode in the nonvolatile device may also be set according to an operation of a user, and the following is implemented:
in a specific implementation, in this embodiment, a configuration operation is performed on a nonvolatile device serving as a dump device in advance, for example, after the nonvolatile device is connected to an electronic device, a user may perform a dump configuration operation in a configuration interface corresponding to the nonvolatile device, as shown in fig. 3, at least a configuration control capable of configuring a storage space in the nonvolatile device in a dump mode is provided in the configuration interface, based on which, in this embodiment, a dump configuration operation for the configuration interface corresponding to the nonvolatile device may be accepted, so that the storage space in the nonvolatile device corresponding to the dump configuration operation is set to be in the dump mode according to the dump configuration operation. For example, a user operates a configuration control in the configuration interface to set the address space a to be in a dump mode, and at this time, the address space a, i.e., a storage space as a dump mode, can be used for storing kernel dump data.
It should be noted that the above dump configuration operation for the storage space may be performed when the kernel of the operating system is started or after the kernel of the operating system is started, so as to complete setting of the storage space in the dump mode in the nonvolatile device, so that the acquired kernel dump data can be safely and reliably transmitted to the storage space in the dump mode in the nonvolatile device when the kernel of the operating system is down, and dump is implemented.
Further, the above dump configuration operation includes at least a mode configuration operation and a space configuration operation, where the mode configuration operation is used to set the storage space in the nonvolatile device to be in the dump mode, that is, determine to set the address space in the nonvolatile device to be the storage space in the dump mode, and the space configuration operation is used to set the space size and/or the space address of the storage space in the nonvolatile device to be in the dump mode, that is, after determining to set the address space in the nonvolatile device to be the storage space in the dump mode, determine which address spaces are the storage spaces in the dump mode, for example, specify the address space a, that is, the address space including addresses a1 to an, as the storage space in the dump mode, and n is a positive integer greater than or equal to 1.
In a specific implementation, the mode configuration operation performed by the user on the configuration interface in this embodiment may also be used to set the storage space in the nonvolatile device to be in another mode, such as a blcok mode, for example, as shown in fig. 4, the configuration interface includes a plurality of mode configuration controls, each mode configuration control corresponds to a type or a mode of the address space, such as a dump mode or a block mode, and the user may select a corresponding mode configuration control in the configuration interface to set the address space of the nonvolatile device to be in the mode corresponding to the control, for example, in this embodiment, the user may generate a corresponding mode configuration operation by clicking the mode configuration control corresponding to the dump mode in the configuration interface, so as to set the address space in the nonvolatile device to be in the dump mode; and corresponding to the space configuration control under the corresponding mode configuration control, the user may perform configuration operation on the space size of the address space under the corresponding mode or the space address, such as the start address, through the space configuration control, for example, in this embodiment, the user selects "30%" in the space configuration control corresponding to the mode configuration control under the dump mode, and then the space configuration operation may be generated, so as to conveniently set 30% of the address space of the nonvolatile device as the storage space in the dump mode, thereby implementing dump parameter configuration of the nonvolatile device.
In one implementation manner, before performing initialization processing on a nonvolatile device connected to an electronic device where an operating system kernel is located in step 101, the method in this embodiment may further include the following steps, as shown in fig. 5:
step 105: and identifying whether preset target parameters exist in the kernel of the operating system, and if so, executing step 106.
The target parameters characterize that the electronic device uses a nonvolatile device to perform kernel dump. Based on this, if the target parameter exists in the kernel of the operating system, the electronic device determines to use the connected nonvolatile device to perform kernel dump if the kernel of the operating system is down, and if the target parameter does not exist in the operating system, the electronic device does not use the nonvolatile device to perform kernel dump if the kernel of the operating system is down.
Step 106: and searching the connected nonvolatile equipment in an equipment list of the electronic equipment, and if the nonvolatile equipment is searched, executing the step 101 so as to initialize the nonvolatile equipment connected with the electronic equipment where the kernel of the operating system is located, so that the initialized nonvolatile equipment has the function of realizing dump, and further realizing kernel dump when the kernel of the operating system is down.
In this embodiment, it may be found whether a nonvolatile device is connected in a device list formed by identifiers of all devices connected after the electronic device is started, if so, step 101 is executed to initialize the nonvolatile device, and if not, it is indicated that the electronic device is not connected to the nonvolatile device capable of performing kernel dump, at this time, a prompt message may be output on the electronic device or on other devices connected to the electronic device, such as a user mobile phone, to prompt a user that the nonvolatile device capable of performing kernel dump is not found, and the user is prompted to load the nonvolatile device for the electronic device.
Based on the above implementation, in step 101 in this embodiment, when performing initialization processing on a nonvolatile device connected to an electronic device where an operating system kernel is located, the implementation may be specifically implemented in the following manner, as shown in fig. 6:
step 601: a storage space in a non-volatile device configured in a dump mode is obtained.
In this embodiment, the storage space configured as the dump mode is configured on the nonvolatile device in advance, and therefore, the storage space already configured as the dump mode, such as the storage space composed of the addresses a1 to an, may be obtained through the configuration parameters on the nonvolatile device in this embodiment.
Specifically, at step 601, at least one storage space divided into the nonvolatile device, such as the storage space composed of the addresses a1 to an and the storage space composed of the addresses b1 to bn, etc., may be first obtained, and then the storage space configured in the dump mode may be found in the at least one storage space according to the configuration parameters or in other manners.
Step 602: mapping the memory space configured in the dump mode to a space of the kernel of the operating system to enable the memory space configured in the dump mode to store kernel dump data.
Specifically, in this embodiment, the operating system kernel may map the storage space configured in the dump mode to the operating system kernel, and further, in the case that the operating system kernel is down, the operating system kernel does not depend on an additional dump kernel, and even if the operating system kernel is unstable, the kernel dump data may be safely and reliably stored in the storage space configured in the dump mode due to the simplicity of the data access by the nonvolatile device, so as to implement reliable dump.
In one implementation manner, in this embodiment, a driver of a nonvolatile device that is connected to the electronic device and is to be used as a dump device is modified in advance, so that the modified driver can support the nonvolatile device to implement the dump function. Specifically, the memory space configured in the dump mode in the nonvolatile device after the driver is modified can be mapped to the space of the operating system kernel through the driver, so that the memory space configured in the dump mode in the nonvolatile device can store kernel dump data when the operating system kernel is down, and reliable dump is realized.
Referring to fig. 7, a schematic structural diagram of a dump processing apparatus of an operating system kernel according to a second embodiment of the present application is provided, where the dump processing apparatus may be applied to an electronic device, such as a computer or a server, which is loaded with an operating system and capable of performing data processing. The technical scheme in the embodiment is mainly used for improving the dump reliability.
Specifically, the apparatus in this embodiment may include the following units:
an apparatus initialization unit 701, configured to perform initialization processing on a nonvolatile apparatus connected to an electronic apparatus where the operating system kernel is located when the operating system kernel is started;
a data obtaining unit 702, configured to obtain kernel dump data when a kernel of the operating system is down;
a data transmission unit 703, configured to transmit the kernel dump data to the nonvolatile device, so that the kernel dump data is stored in the nonvolatile device.
According to the above scheme, in the dump processing apparatus for an operating system kernel provided in the second embodiment of the present application, the nonvolatile device connected to the electronic device where the operating system kernel is located is initialized when the operating system kernel is started, and then the kernel dump data can be obtained and transmitted to the nonvolatile device when the operating system kernel is down, so that the kernel dump data is stored in the nonvolatile device. Therefore, the dump process realized by the method is relatively simple, the participation of a dump kernel is not needed, whether the kernel of the operating system is stable or not is not needed to be considered, and even if the system hardware cannot work normally, the kernel dump data can be safely stored in the initialized nonvolatile equipment, so that the dump failure condition is avoided, and the dump reliability is improved.
In one implementation, the nonvolatile device includes at least one storage space, and the storage space is configured in a dump mode, so that the storage space configured in the dump mode can store the kernel dump data.
Based on this, the apparatus in the present embodiment may further include the following units, as shown in fig. 8:
an operation receiving unit 704, configured to receive a dump configuration operation for a configuration interface corresponding to the nonvolatile device, where the dump configuration operation is used to set a storage space corresponding to the dump configuration operation in the nonvolatile device to be in the dump mode.
Specifically, the dump configuration operation at least comprises a mode configuration operation and a space configuration operation;
wherein the mode configuration operation is used for setting the storage space in the nonvolatile device to be in the dump mode, and the space configuration operation is used for setting the space size and/or the space address of the storage space in the nonvolatile device to be in the dump mode.
In one implementation, the apparatus in this embodiment may further include the following units, as shown in fig. 8:
a device determining unit 705, configured to identify whether a preset target parameter exists in the operating system kernel before the device initializing unit 701 initializes the nonvolatile device connected to the electronic device where the operating system kernel is located, where the target parameter represents that the electronic device uses the nonvolatile device to perform kernel dump; searching the connected nonvolatile device in the device list of the electronic device, and triggering a device initialization unit 701 to initialize the nonvolatile device connected to the electronic device where the operating system kernel is located, if the nonvolatile device is found.
In an implementation manner, the device initialization unit 701 is specifically configured to: obtaining a storage space configured as a dump mode in the nonvolatile device, for example, first obtaining at least one storage space divided in the nonvolatile device, and then finding the storage space configured as the dump mode in the at least one storage space; then, mapping the memory space configured as the dump mode to the space of the kernel of the operating system so that the memory space configured as the dump mode can store the kernel dump data.
Referring to fig. 9, a schematic structural diagram of an electronic device according to a third embodiment of the present disclosure is provided, where the electronic device may be an electronic device connected with a nonvolatile device, such as an electronic device loaded with an operating system and capable of performing data processing, such as a computer or a server. And the non-volatile device may be a non-volatile memory device or the like. The technical scheme in the embodiment is mainly used for improving the dump reliability.
Specifically, the electronic device in this embodiment may include the following structure:
a memory 901 for storing an application program and data generated by the application program running;
a processor 902 for executing the application to implement: under the condition that the operating system kernel is started, initializing nonvolatile equipment connected with electronic equipment where the operating system kernel is located; acquiring kernel dump data under the condition that the kernel of the operating system is down; and transmitting the kernel dump data to the nonvolatile device so as to store the kernel dump data in the nonvolatile device.
Specifically, the nonvolatile device includes at least one storage space, and the storage space is configured in a dump mode, so that the storage space configured in the dump mode can store kernel dump data transmitted by the processor.
According to the above scheme, in the electronic device provided in the third embodiment of the present application, the nonvolatile device connected to the electronic device where the operating system kernel is located is initialized when the operating system kernel is started, and then the kernel dump data can be obtained and transmitted to the nonvolatile device when the operating system kernel is down, so that the kernel dump data is stored in the nonvolatile device. Therefore, the dump process realized by the method is relatively simple, the participation of a dump kernel is not needed, whether the kernel of the operating system is stable or not is not needed to be considered, and even if the system hardware cannot work normally, the kernel dump data can be safely stored in the initialized nonvolatile equipment, so that the dump failure condition is avoided, and the dump reliability is improved.
Taking a computer as an example, the technical scheme of the application is illustrated as follows:
first, in the present application, a kernel dump is implemented based on a nonvolatile memory, specifically: by utilizing the non-volatility of the nonvolatile memory and the simplicity of the access mode, the nonvolatile memory is used as kernel dump equipment, and dump data are stored when the kernel of the operating system goes down.
Based on the above implementation scheme, the method has the following advantages:
firstly, the reliability is high: in the technical scheme of the application, because the reading and writing of the nonvolatile memory are the same as those of the common memory, the main process of realizing dump can be realized as simple memory copy without depending on any other kernel functions. Due to the simplicity, the dump processing of the nonvolatile memory can be performed in the original kernel without worrying about the influence of the instability of the original kernel. Meanwhile, the problem of loading failure of the down dump kernel is also avoided.
Secondly, the applicable scene is wide: according to the technical scheme, the downtime generated in the kernel starting process can be dumped. The simplicity of the non-volatile memory access enables it to be initialized and operate normally during the early stages of kernel boot.
In addition, no extra memory is occupied: according to the technical scheme, no dump kernel is used, and extra memory is not occupied.
Finally, the configuration is simple: according to the technical scheme, the dump kernel and the related configuration thereof do not need to be generated.
In the specific implementation, in order to facilitate data management, the nonvolatile memory is divided into a plurality of spaces namespaces; and according to different use modes, namespace is correspondingly formatted. Therefore, the dump device realized by the nonvolatile memory corresponds to namespace. In order to support the kernel dumping function, a new mode for the dumping function, namely the dumping mode in the foregoing, is introduced into the nonvolatile memory. Thus, the dump device implemented by the nonvolatile memory is a namespace in dump mode.
The kernel dump function based on the nonvolatile memory mainly comprises four parts:
1. the kernel starts the initialization of the nonvolatile dump device in an early stage;
2. modifying the dump part in the kernel error processing process, thereby increasing the functions of transmitting and storing data to the nonvolatile memory;
3. modifying the drive of the nonvolatile memory device, thereby increasing the initialization and the function of namespace in a dump mode;
4. the modification of the non-volatile memory configuration tool adds the function of creating dump mode namespace in the configuration tool, namely a configuration interface.
As shown in fig. 10, a flowchart of an initialization and dump process of a dump device implemented for a nonvolatile memory, where:
when the kernel of the operating system is started, firstly detecting whether kernel starting parameters, namely target parameters in the previous text, exist to determine whether nonvolatile equipment is used as dump equipment, if so, traversing a device list in the current electronic device to find the nonvolatile equipment used as the dump equipment, and if not, continuing to start the kernel of the operating system;
after traversing a nonvolatile device serving as a dump device, acquiring a storage space "xxx" configured as a dump mode in the nonvolatile device, if the storage space "xxx" configured as the dump mode is found, initializing the storage space and mapping the storage space to an operating system kernel space, and after the operating system kernel is started, if a downtime phenomenon caused by an internal error or the like occurs, storing kernel dump data into the storage space "xxx" to implement dump.
If the electronic device is not connected to the nonvolatile device as the dump device or the nonvolatile device does not have a storage space configured as the dump mode, the kernel boot process of the operating system is continued, and at this time, the dump may be implemented by using the original dump scheme.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A method of dump processing of an operating system kernel, the method comprising:
under the condition that the operating system kernel is started, initializing nonvolatile equipment connected with electronic equipment where the operating system kernel is located;
acquiring kernel dump data under the condition that the kernel of the operating system is down;
and transmitting the kernel dump data to the nonvolatile device so as to store the kernel dump data in the nonvolatile device.
2. The method of claim 1, wherein the non-volatile device comprises at least one memory space configured in a dump mode, such that the memory space configured in the dump mode is capable of storing the kernel dump data.
3. The method of claim 2, further comprising:
receiving a dump configuration operation aiming at a configuration interface corresponding to the nonvolatile device, wherein the dump configuration operation is used for setting a storage space corresponding to the dump configuration operation in the nonvolatile device to be in the dump mode.
4. The method of claim 3, wherein the dump configuration operation includes at least a mode configuration operation and a space configuration operation;
wherein the mode configuration operation is used for setting the storage space in the nonvolatile device to be in the dump mode, and the space configuration operation is used for setting the space size and/or the space address of the storage space in the nonvolatile device to be in the dump mode.
5. The method according to claim 1 or 2, before performing initialization processing on a nonvolatile device to which an electronic device in which the operating system kernel is connected, the method further comprising:
identifying whether a preset target parameter exists in the kernel of the operating system, wherein the target parameter represents that the electronic equipment uses a nonvolatile device to perform kernel dump;
searching the connected nonvolatile device in the device list of the electronic device, and executing the following steps under the condition that the nonvolatile device is searched: and initializing the nonvolatile equipment connected with the electronic equipment where the operating system kernel is located.
6. The method according to claim 5, wherein initializing a nonvolatile device connected to the electronic device in which the operating system kernel is located comprises:
obtaining storage space in the non-volatile device configured in a dump mode;
mapping the memory space configured as dump mode to the space of the operating system kernel to enable the memory space configured as dump mode to store the kernel dump data.
7. The method of claim 6, obtaining storage space in the non-volatile device configured in a dump mode, comprising:
obtaining at least one divided storage space in the nonvolatile device;
and finding the storage space configured to be in a dump mode in the at least one storage space.
8. A dump processing apparatus of an operating system kernel, comprising:
the device initialization unit is used for initializing nonvolatile devices connected with the electronic device where the operating system kernel is located under the condition that the operating system kernel is started;
the data acquisition unit is used for acquiring kernel dump data under the condition that the kernel of the operating system is down;
and the data transmission unit is used for transmitting the kernel dump data to the nonvolatile equipment so as to store the kernel dump data in the nonvolatile equipment.
9. An electronic device to which a nonvolatile device is connected, the electronic device comprising:
a memory for storing an application program and data generated by the application program running;
a processor for executing the application to implement: under the condition that the operating system kernel is started, initializing nonvolatile equipment connected with electronic equipment where the operating system kernel is located; acquiring kernel dump data under the condition that the kernel of the operating system is down; and transmitting the kernel dump data to the nonvolatile device so as to store the kernel dump data in the nonvolatile device.
10. The electronic device of claim 9, wherein the non-volatile device includes at least one memory space, and the memory space is configured in a dump mode, so that the memory space configured in the dump mode can store kernel dump data transferred by the processor.
CN202011038557.6A 2020-09-28 2020-09-28 Dump processing method and device for operating system kernel and electronic equipment Pending CN112052125A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011038557.6A CN112052125A (en) 2020-09-28 2020-09-28 Dump processing method and device for operating system kernel and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011038557.6A CN112052125A (en) 2020-09-28 2020-09-28 Dump processing method and device for operating system kernel and electronic equipment

Publications (1)

Publication Number Publication Date
CN112052125A true CN112052125A (en) 2020-12-08

Family

ID=73605266

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011038557.6A Pending CN112052125A (en) 2020-09-28 2020-09-28 Dump processing method and device for operating system kernel and electronic equipment

Country Status (1)

Country Link
CN (1) CN112052125A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023274166A1 (en) * 2021-06-30 2023-01-05 华为云计算技术有限公司 Kernel upgrade method and apparatus

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102063344A (en) * 2009-11-18 2011-05-18 中兴通讯股份有限公司 Method and system for system fault information dump
CN102662785A (en) * 2012-04-12 2012-09-12 青岛海信移动通信技术股份有限公司 Method and device for acquiring kernel error messages of Android system
CN109426606A (en) * 2017-08-23 2019-03-05 东软集团股份有限公司 Kernel failure diagnosis information processing method, device, storage medium and electronic equipment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102063344A (en) * 2009-11-18 2011-05-18 中兴通讯股份有限公司 Method and system for system fault information dump
CN102662785A (en) * 2012-04-12 2012-09-12 青岛海信移动通信技术股份有限公司 Method and device for acquiring kernel error messages of Android system
CN109426606A (en) * 2017-08-23 2019-03-05 东软集团股份有限公司 Kernel failure diagnosis information processing method, device, storage medium and electronic equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023274166A1 (en) * 2021-06-30 2023-01-05 华为云计算技术有限公司 Kernel upgrade method and apparatus

Similar Documents

Publication Publication Date Title
US20040255106A1 (en) Recovery of operating system configuration data by firmware of computer system
US7631173B2 (en) Method and system for performing pre-boot operations from an external memory including memory address and geometry
US20090300415A1 (en) Computer System and Method for Performing Integrity Detection on the Same
CN109189342B (en) Disk mounting method, device, equipment and storage medium
CN106843947B (en) Method and device for processing code defects
CN114417335A (en) Malicious file detection method and device, electronic equipment and storage medium
US9129109B2 (en) Method and apparatus for detecting a malware in files
CN110941516B (en) Operating system restoration method, device, equipment and storage medium
EP2172941A1 (en) Computer apparatus
CN112052125A (en) Dump processing method and device for operating system kernel and electronic equipment
CN109189480B (en) File system starting method and device
CN114333977A (en) Method and device for testing solid state disk, computer storage medium and terminal
US20150089486A1 (en) Method of Firmware Upgrade
CN111858116A (en) Information recording method, device, equipment and readable storage medium
CN111124760A (en) Uboot-based embedded equipment starting method and apparatus
CN110750404A (en) Efi shell-based server starting process testing method
CN106445737A (en) Multi-backup starting method
US7296183B2 (en) Selectable data field consistency checking
CN112579397B (en) Service online self-checking method, device, equipment and storage medium
EP1710697A1 (en) Method and apparatus for executing application in system having NAND flash memory
CN107506271A (en) A kind of method of testing and device
CN108595123B (en) Data storage method and device of mobile terminal
CN113220362A (en) Log record obtaining method and device, computer equipment and storage medium
CN112328423A (en) Processing method, device and storage medium for search service loophole
CN111796837A (en) Hot patch uninstalling method, equipment, storage medium and device of operating system

Legal Events

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