Kernel switching method and electronic device
By acquiring memory space layout information and loading a second kernel, the problem of time-consuming and laborious kernel switching is solved, achieving fast kernel switching and efficient memory management.
Patent Information
- Application Number
- CN201810003838.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2018-01-02
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2038-10-03
AI Technical Summary
In existing technologies, kernel switching requires redeploying the physical operating system, which is time-consuming and labor-intensive, resulting in low switching efficiency.
By obtaining the memory space layout information, the second kernel is loaded into the first memory space, and the memory space is initialized based on the layout information, giving the second kernel management privileges and enabling kernel switching.
Kernel switching can be completed without redeploying the physical operating system, improving switching speed and memory utilization.
Smart Images

Figure CN108228260B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to a kernel switching method and an electronic device. BACKGROUND
[0002] Container technology is a technology of packing related program codes, function libraries and environment configuration files required by an application program to establish a sandbox execution environment. The technology creates a virtual execution environment in a core system layer of an operating system and shares a host operating system (Host OS). A container can be enabled in tens of seconds or even seconds, which is much faster than a traditional virtual machine that needs to be started for several minutes or even tens of minutes. Therefore, the Container technology is widely used.
[0003] However, when the kernel required by the container needs to be changed, the kernel needs to be switched, for example, when the role of the container host is changed by the container scheduling system due to business requirements, at this time, the OS kernel version needs to be switched, and then the physical operating system needs to be redeployed, for example, from kernel 2.6.32 to kernel 3.10. The time for deploying and starting the operating system is considerable, which is estimated to take 30-60 minutes.
[0004] In summary, kernel switching needs to redeploy the physical operating system, which is time-consuming and laborious. SUMMARY
[0005] One aspect of the present disclosure provides a method for switching a kernel, comprising: obtaining layout information of a memory space, loading information of a second kernel to the first memory space, and running the second kernel; and based on the layout information, initializing the memory space, and enabling the second kernel to have management authority of the memory space.
[0006] Optionally, the obtaining the layout information of the memory space comprises calling a BIOS interface to obtain the layout information of the memory space, or reading the layout information of the memory space.
[0007] Optionally, the obtaining the layout information of the memory space comprises obtaining the layout information of the memory space in at least one of the following cases: when the first kernel has an exception, when the first kernel cannot meet the requirements of an application program, and based on a user operation.
[0008] Optionally, the loading the information of the second kernel to the first memory space and running the second kernel comprises loading the second kernel to the first memory space by Kexec and running the second kernel.
[0009] Optionally, the method further comprises reserving a first memory space in the memory space under the management of the second kernel.
[0010] Another aspect of the present disclosure provides an electronic device comprising a processor, and a memory having stored thereon computer readable instructions that, when executed by the processor, cause the processor to acquire layout information of the memory space, load information of the second kernel to the first memory space, and run the second kernel, and initialize the memory space based on the layout information, so that the second kernel has the management authority of the memory space.
[0011] Optionally, the processor acquiring the layout information of the memory space comprises invoking a BIOS interface to acquire the layout information of the memory space.
[0012] Optionally, the processor acquiring the layout information of the memory space comprises reading the layout information of the memory space.
[0013] Optionally, the processor loading the information of the second kernel to the first memory space and running the second kernel comprises loading the second kernel to the first memory space by Kexec and running the second kernel.
[0014] Optionally, the processor further executes reserving a first memory space in the memory space under the management of the second kernel.
[0015] Another aspect of the present disclosure provides a non-transitory storage medium storing computer executable instructions that, when executed, perform the method as described above.
[0016] Another aspect of the present disclosure provides a computer program comprising computer executable instructions that, when executed, perform the method as described above. BRIEF DESCRIPTION OF DRAWINGS
[0017] For a more complete understanding of the present disclosure and its advantages, reference is now made to the following description taken in conjunction with the accompanying drawings in which:
[0018] Figure 1A An application scenario of the method for switching kernels according to an embodiment of the present disclosure is schematically shown;
[0019] Figure 1A A schematic diagram of the method for switching kernels according to an embodiment of the present disclosure is schematically shown;
[0020] Figure 2 A flowchart of the method for switching kernels according to an embodiment of the present disclosure is schematically shown;
[0021] Figure 3 A flowchart of a method of switching a kernel according to another embodiment of the disclosure is schematically shown;
[0022] Figure 4 A flowchart of a method of switching a kernel according to another embodiment of the disclosure is schematically shown;
[0023] Figure 5 A flowchart of a method of switching a kernel according to another embodiment of the disclosure is schematically shown;
[0024] Figure 6 A flowchart of a method of switching a kernel according to another embodiment of the disclosure is schematically shown;
[0025] Figure 7 A block diagram of a system of switching a kernel according to an embodiment of the disclosure is schematically shown;
[0026] Figure 8A A block diagram of an acquisition module according to an embodiment of the disclosure is schematically shown;
[0027] Figure 8B A block diagram of an acquisition module according to another embodiment of the disclosure is schematically shown;
[0028] Figure 9 A block diagram of a system of switching a kernel according to another embodiment of the disclosure is schematically shown; and
[0029] Figure 10 A block diagram of an electronic device according to an embodiment of the disclosure is schematically shown. DETAILED DESCRIPTION
[0030] Hereinafter, embodiments of the disclosure will be described with reference to the accompanying drawings. It should be understood, however, that the description which follows is merely illustrative and is not intended to limit the scope of the disclosure. In addition, in the following description, descriptions of well-known structures and techniques are omitted to avoid unnecessarily obscuring the concept of the disclosure.
[0031] The terms used herein are merely used to describe specific embodiments and are not intended to limit the disclosure. The terms "include", "comprise", and the like used herein indicate the presence of the described features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0032] All terms used herein (including technical and scientific terms) have meanings that are commonly understood by one of ordinary skill in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having meanings that are consistent with the context of the specification, and should not be interpreted in an idealized or overly formal manner.
[0033] In the event that a usage similar to "at least one of A, B, and C, etc." is used in the description, claims, or accompanying scheme or block diagram, it will be understood that this is merely intended to illustrate the products whose possibilities are to include one of A, one of B, one of C, to include both of A and B, to include both of A and C, to include both of B and C, and to include all of A, B, and C, as well as their possible combinations. In the event that a usage similar to "at least one of A, B, or C, etc." is used in the description, claims, or accompanying scheme or block diagram, it will be understood that this is merely intended to illustrate the products whose possibilities are to include one of A, one of B, or one of C, to include both of A and B, to include both of A and C, to include both of B and C, and to include all of A, B, and C, as well as their possible combinations. It will be further understood that substantially any disjunctive word or phrase presenting two or more alternative items, regardless of how it is worded, should be understood to encompass the possibilities of including one of the items, the other of the items, or both of the items. For example, the phrase "A or B" should be understood to include the possibilities of "A" or "B" or "A and B."
[0034] Some of the diagrams and / or flowcharts are illustrated in the accompanying drawings. It should be understood that some of the blocks in the diagrams and / or flowcharts, or combinations thereof, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus, so that the instructions executed by the processor can create means for implementing the functions / operations illustrated in the diagrams and / or flowcharts.
[0035] Accordingly, the technology of the present disclosure can be embodied in the form of hardware and / or software (including firmware, microcode, etc.). Also, the technology of the present disclosure can take the form of a computer program product on a computer-readable medium having instructions stored thereon. In the context of the present disclosure, a computer-readable medium can be any medium that can contain, store, communicate, propagate, or transport instructions. For example, the computer-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, device, or propagation medium. Specific examples of the computer-readable medium include magnetic storage devices such as hard disks or hard disk drives (HDDs), optical storage devices such as compact discs (CD-ROMs), memories such as random access memories (RAMs) or flash memories, and / or wired / wireless communication links.
[0036] Embodiments of the present disclosure provide a method for switching kernels and an electronic device. The method comprises obtaining layout information of a memory space under management of a first kernel, loading information of a second kernel to the first memory space, which is reserved in the memory space under management of the first kernel, running the second kernel, and initializing the memory space based on the layout information, so that the second kernel has management authority of the memory space. The method can switch the operating system kernel without redeploying the physical operating system, improves the speed of kernel switching, and the method initializes the memory space so that the second kernel can manage the memory, thereby improving the utilization rate of the memory.
[0037] Figure 1A An application scenario of the method for switching kernels according to embodiments of the present disclosure is schematically shown. It should be noted that, Figure 1A The shown is only an example of a scenario to which embodiments of the present disclosure can be applied, to help those skilled in the art understand the technical content of the present disclosure, but does not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments or scenarios.
[0038] As Figure 1A The application scenario shown includes an electronic device 100, which includes a hardware part and a software part, wherein the software part at least includes an operating system (OS) and a sandbox execution environment established based on container technology, which is referred to as a container hereinafter, and the container includes relevant program codes, function libraries, environment configuration files and the like required by an application program. Figure 1A The container can run an application program 1 and an application program 2 under the operating system of the embodiment shown.
[0039] The electronic device 100 can be any possible electronic device, such as a computer, a server, a cloud platform, etc.
[0040] The container can execute an application program without installing an operating system, and the container technology is not to establish a virtual environment outside the operating system, but to create a virtual execution environment in the core system layer within the OS, and to replace the guest operating system in a virtual machine by sharing the host operating system. The container requires all applications to share one kernel, and only applications compatible with the host operating system can run. For example, in FIG. 1, the application program 1 and the application program 2 are compatible with the operating system, and therefore the application program 1 and the application program 2 in the container can run on the operating system.
[0041] When it is necessary to change the application program running on the electronic device 100, for example, when the business volume greatly increases, the application program 1 and the application program 2 running normally cannot meet the demand, and it is necessary to run the application program 3 on the electronic device 100. The application program 3 is incompatible with the operating system, and it is necessary to change the version of the operating system kernel. In the prior art, changing the version of the operating system kernel requires redeployment of the physical operating system, and the time for deploying the entire operating system and starting is considerable, which is estimated to be 30-60 minutes, resulting in low work efficiency of the kernel switching.
[0042] To this end, embodiments of the present disclosure provide a method that can solve the above problems.
[0043] Figure 1B A schematic diagram of a method for switching a kernel according to an embodiment of the present disclosure is shown schematically.
[0044] As shown in Figure 1B , the memory space layout information of a first kernel, for example, linux 2.6.32, is obtained. The memory space layout under the management of the first kernel includes a reserved first memory space. Under the management of the first kernel, the information of a second kernel, for example, linux 3.10, is loaded into the first memory space, and the second kernel is run in the first memory space. Based on the space layout information, the memory space is initialized, and the second kernel is given the management authority of the memory space, and the operation of switching the first kernel to the second kernel is completed. Similarly, the operation of switching the second kernel to the third kernel, …, the N-1 kernel to the N kernel can be completed.
[0045] The method for switching a kernel according to an exemplary embodiment of the present disclosure will be described below in conjunction with Figures 2-6
[0046] Figure 2 A flowchart of a method for switching a kernel according to an embodiment of the present disclosure is shown schematically.
[0047] As shown in Figure 2 , the method includes operations S210-S230.
[0048] In operation S210, the layout information of the memory space is obtained.
[0049] In operation S220, the information of the second kernel is loaded into the first memory space, and the second kernel is run.
[0050] In operation S230, based on the layout information, the memory space is initialized, and the second kernel is given the management authority of the memory space.
[0051] This method allows switching the operating system kernel without redeploying the physical operating system, improving the speed of kernel switching. Furthermore, by initializing the memory space, the second kernel can manage memory, thus improving memory utilization.
[0052] According to embodiments of this disclosure, obtaining the layout information of the memory space includes obtaining the layout information of the memory space when the first kernel cannot meet the needs of the application. For example, the operating system attempts to read or write invalid or disallowed memory addresses, resulting in a kernel error.
[0053] According to embodiments of this disclosure, obtaining the layout information of the memory space includes obtaining the layout information of the memory space when the first kernel cannot meet the needs of the application. For example, due to business requirements, it is necessary to change the running application 1 to running application 2, but application 2 is incompatible with the current kernel, so the first kernel needs to be switched to a kernel compatible with application 2.
[0054] According to embodiments of this disclosure, obtaining the layout information of the memory space includes obtaining the layout information of the memory space based on user operations.
[0055] According to embodiments of this disclosure, in operation S210, the memory space layout information includes physical memory information, such as the total number of available physical addresses and the data stored at a certain physical address. Obtaining the memory space layout information can be done by calling an interface, or it can be obtained from a disk or a specific address in memory. For example, under the management of the first kernel, the current memory space layout information is written to the disk; when switching kernels, it can be directly obtained from the disk.
[0056] Figure 3 A flowchart illustrating a method for switching kernels according to another embodiment of this disclosure is shown schematically.
[0057] like Figure 3 As shown, the method includes operations S310, S220 and S230.
[0058] During operation S310, the BIOS interface is invoked to obtain the layout information of the memory space; or the layout information of the memory space is read.
[0059] According to an embodiment of this disclosure, during operation S310, the BIOS interface is called, for example, requesting BIOS interrupt number 15H and setting operation code AX = e820, or the layout information of the memory space is read. This memory layout information can be written to other locations besides reserved memory that can store information under the management of the first kernel, such as a certain address in the disk or memory.
[0060] Referring back to Figure 2 , according to an embodiment of the present disclosure, in operation S220, information of the second kernel is loaded into the first memory space, which is a first memory space reserved in the memory space under the management of the first kernel, for example, the memory space is 4G, and the reserved first memory space is 128M, and the 128M space does not store data nor run programs. The loading includes, for example, loading the second kernel information from the disk into the first memory space, at this time, the first memory space stores the information of the second kernel, and the second kernel runs in the 128M space.
[0061] According to an embodiment of the present disclosure, the loading of the information of the second kernel into the first memory space and the running of the second kernel include loading the second kernel into the first memory space by Kexec and running the second kernel.
[0062] Figure 4 A flowchart of a method for switching kernels according to another embodiment of the present disclosure is schematically shown.
[0063] As Figure 4 shown, the method includes operations S210, S410 and S230.
[0064] In operation S410, the second kernel is loaded into the first memory space by Kexec and the second kernel is run.
[0065] Kexec can directly boot from the currently running kernel to a new kernel, without the need for hardware reboot, without the need for firmware operation, without involving the boot loader, making the kernel switching more simple.
[0066] According to an embodiment of the present disclosure, the loading of the second kernel into the first memory space by Kexec can be loading the second kernel into the first memory space by Kexec-l syntax. The running of the second kernel can be running the second kernel by Kexec-e syntax.
[0067] Referring back to Figure 2 , according to an embodiment of the present disclosure, in operation S230, based on the layout information, the memory space is initialized, and the second kernel is given the management authority of the memory space. The initialization of the memory space includes layout of the memory space according to the layout information, for example, allocation of address storage information.
[0068] Figure 5 A flowchart of a method for switching kernels according to another embodiment of the present disclosure is schematically shown.
[0069] As Figure 5As shown, the method further includes operation S510 in addition to the aforementioned embodiments.
[0070] During operation of S510, under the management of the second kernel, a first memory space is reserved in the memory space.
[0071] This method enables continuous kernel switching, making kernel switching more convenient.
[0072] According to an embodiment of this disclosure, in operation S510, the reserved first memory space includes a first memory space that does not store data or support program execution.
[0073] According to embodiments of this disclosure, the switched second kernel can have the same memory layout as the first kernel, and the physical address of the reserved first memory space can be the same to facilitate the switching of the next kernel. Of course, under the management of the second kernel, the physical address of the reserved first memory space can also be changed, and it can be different from the physical address of the reserved address of the previous kernel.
[0074] Figure 6 A flowchart illustrating a method for switching kernels according to another embodiment of this disclosure is shown schematically.
[0075] like Figure 6 As shown, in this embodiment, the application in the container runs on the host's operating system. Under the management of the first kernel of the operating system, a new kernel memory space is reserved, which is the first memory space, and the Kexec function is enabled. Under the management of the first kernel, the container runs. When it is necessary to switch the host kernel, the memory layout information at this time can be obtained by calling the BIOS interface, and the obtained memory layout information is saved to the disk or memory at the location reserved for the new kernel space. Obtaining the memory layout information at this time, for example, requests BIOS interrupt number 15H and sets the opcode AX = e820 to obtain the memory layout information at this time. The new host kernel is loaded into the reserved memory space, i.e., the first memory space, using Kexec-l. The new host kernel is the second kernel described in the above embodiment. The new kernel is run using Kexec-e. The new kernel runs only in the reserved memory space. At this time, the first kernel has stopped working. The second kernel obtains the memory layout information, for example, from the previously saved location, or by calling the BIOS interface to obtain the memory layout information. The second kernel reinitializes all memory according to the obtained memory layout information and takes over the memory.
[0076] The second kernel takes full control of memory. At this point, container applications adapted to the second kernel are compatible with the host operating system, thus enabling the loading of the third, fourth... Nth kernel.
[0077] Figure 7Fig. 7 schematically illustrates a block diagram of a system 700 for switching a kernel according to an embodiment of the present disclosure.
[0078] As shown in Fig. 7, the system 700 for switching a kernel comprises an obtaining module 710, a loading and running module 720, and an initializing module 730. Figure 7
[0079] The obtaining module 710, for example, performs operation S210 described above with reference to Fig. 2, is configured to obtain layout information of the memory space. Figure 2
[0080] The loading and running module 720, for example, performs operation S220 described above with reference to Fig. 2, is configured to load the second kernel into the first memory space and run the second kernel. Figure 2
[0081] The initializing module 730, for example, performs operation S230 described above with reference to Fig. 2, is configured to initialize the memory space based on the layout information, and make the second kernel have a management right of the memory space. Figure 2
[0082] Figure 8A Fig. 8 schematically illustrates a block diagram of the obtaining module 710 according to an embodiment of the present disclosure. Figure 8B As shown in Fig. 8, the obtaining module 710 comprises an obtaining subunit 711 or a reading subunit 712.
[0083] Figure 8A Figure 8B The obtaining subunit 711, for example, performs operation S310 described above with reference to Fig. 3, is configured to call a BIOS interface to obtain the layout information of the memory space.
[0084] The reading subunit 712, for example, performs operation S310 described above with reference to Fig. 3, is configured to read the layout information of the memory space. Figure 3
[0085] Fig. 9 schematically illustrates a block diagram of a system 900 for switching a kernel according to another embodiment of the present disclosure. Figure 3 As shown in Fig. 9, the system 900 for switching a kernel further comprises a reserving module 910 on the basis of the foregoing embodiment.
[0086] Figure 9 The reserving module 910, for example, performs operation S510 described above with reference to Fig. 5, is configured to reserve a first memory space in the memory space under management of the second kernel.
[0087] Figure 9
[0088] Figure 5
[0089] It can be understood that the above modules can be combined to be implemented in one module, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of the modules can be combined with at least part of the functions of other modules, and implemented in one module. According to an embodiment of the present application, at least one of the above modules can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on chip, a system on board, a system on package, an application specific integrated circuit (ASIC), or any other reasonable manner of integrating or packaging a circuit, etc. hardware or firmware, or a suitable combination of software, hardware and firmware. Alternatively, at least one of the above modules can be at least partially implemented as a computer program module which can perform the functions of the corresponding module when the program is run by a computer.
[0090] Figure 10 A block diagram of an electronic device according to an embodiment of the disclosure is schematically shown.
[0091] As Figure 10 shown, the electronic device 1000 includes a processor 1010 and a computer readable storage medium 1020. The robot 500 can perform the method described above with reference to Figures 2-6 to implement the switching of the kernel.
[0092] In particular, the processor 1010 can include, for example, a general purpose microprocessor, an instruction set processor, and / or related chip set, and / or a special purpose microprocessor (e.g., an application specific integrated circuit (ASIC)), etc. The processor 1010 can also include on-board memory for cache purposes. The processor 510 can be a single processing unit or a plurality of processing units for executing the different actions of the method flow according to embodiments of the disclosure described with reference to Figures 2-6
[0093] The computer readable storage medium 1020 may, for example, be any medium capable of containing, storing, communicating, propagating or transporting instructions. For example, the readable storage medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared or semiconductor system, device, apparatus or propagation medium. Specific examples of readable storage media include magnetic storage devices such as magnetic tape or hard disk (HDD); optical storage devices such as compact disc (CD-ROM); memory such as random access memory (RAM) or flash memory; and / or wired / wireless communication links.
[0094] The computer readable storage medium 1020 can include a computer program 1021, which can include code / computer executable instructions that, when executed by the processor 1010, cause the processor 1010 to perform, for example, the above described with reference toFigures 2-6 The method flow described and any variations thereof.
[0095] The computer program 1021 can be configured to have computer program code, for example, comprising computer program modules. For example, in an example embodiment, the code in the computer program 1021 can include one or more program modules, for example, including 1021A, module 1021B, …. It should be noted that the division and number of modules are not fixed, and a person skilled in the art can use appropriate program modules or combinations of program modules according to actual conditions, when these program modules or combinations of program modules are executed by the processor 1010, so that the processor 1010 can perform, for example, the above-described operations in combination with the above-described modules. Figures 2-6 The method flow described and any variations thereof.
[0096] According to an embodiment of the present application, at least one of the above-described modules can be implemented as a reference to a computer program code stored in a memory 1011 and executed by the processor 1010. Figure 10 The computer program modules described, when executed by the processor 1010, can implement the corresponding operations described above.
[0097] Those skilled in the art can understand that the features recited in various embodiments and / or claims of the present disclosure can be combined or / and combined, even if such combinations or combinations are not explicitly recited in the present disclosure. In particular, the features recited in various embodiments and / or claims of the present disclosure can be combined and / or combined in various combinations without departing from the spirit and teachings of the present disclosure. All such combinations and / or combinations fall within the scope of the present disclosure.
[0098] Although the present disclosure has been shown and described with reference to certain exemplary embodiments thereof, it should be understood by those skilled in the art that various changes in form and detail can be made therein without departing from the spirit and scope of the disclosure as defined by the appended claims and their equivalents. Therefore, the scope of the present disclosure should not be limited to the above-described embodiments, but should be determined only by the appended claims, and should be defined by the equivalents of the appended claims.
Claims
1. A method for switching kernels, used to switch a first kernel to a second kernel when the operating system kernel required by a container needs to be changed, wherein, Under the management of the first kernel, a first memory space is reserved in the memory space, the method including: Obtain the layout information of the memory space; Load the second kernel into the first memory space and run the second kernel; and The second kernel lays out the memory space according to the layout information, so as to reinitialize the memory using the layout information and take full control of the memory. The layout information includes physical memory information managed by the first kernel. The method further includes: running an application compatible with the operating system in the container; and when the first kernel is incompatible with the application in the container, switching the first kernel to the second kernel to run the application in the container through the second kernel. The first kernel and the second kernel are operating system kernels.
2. The method according to claim 1, wherein obtaining the layout information of the memory space includes: Call the BIOS interface to obtain the layout information of the memory space; or Read the layout information of the memory space.
3. The method according to claim 1, wherein obtaining the layout information of the memory space includes at least one of the following: In the event of an anomaly in the first kernel, obtain the layout information of the memory space; If the first kernel cannot meet the application's requirements, obtain the layout information of the memory space; as well as Based on user actions, obtain the layout information of the memory space.
4. The method according to claim 1, wherein, Loading the second kernel into the first memory space and running the second kernel includes: The second kernel is loaded into the first memory space using Kexec, and then the second kernel is run.
5. The method according to claim 1, further comprising: Under the management of the second kernel, a first memory space is reserved in the memory space.
6. An electronic device, comprising: processor; as well as A memory storing computer-readable instructions, which, when executed by a processor, cause the processor to switch from a first kernel to a second kernel when the operating system kernel required by the container needs to be changed, wherein, under the management of the first kernel, a first memory space is reserved in the memory space, and the processor is used to: Obtain the layout information of the memory space; Load the second kernel into the first memory space and run the second kernel; and The second kernel lays out the memory space according to the layout information, so as to reinitialize the memory using the layout information and take full control of the memory. The layout information includes physical memory information managed by the first kernel. The processor is further configured to: run applications compatible with the operating system within a container; and, when the first kernel is incompatible with the application in the container, switch the first kernel to the second kernel to run the application in the container through the second kernel. The first kernel and the second kernel are operating system kernels.
7. The electronic device according to claim 6, wherein the processor obtains the layout information of the memory space by: Call the BIOS interface to obtain the layout information of the memory space.
8. The electronic device according to claim 6, wherein the processor obtains the layout information of the memory space by: Read the layout information of the memory space.
9. The electronic device according to claim 6, wherein the processor loads the second kernel into the first memory space and runs the second kernel, comprising: The second kernel is loaded into the first memory space using Kexec, and then the second kernel is run.
10. The electronic device of claim 6, wherein the processor further performs: Under the management of the second kernel, a first memory space is reserved in the memory space.
Citation Information
Patent Citations
Fault information record method and fault management system used for access controller
CN102722916A
LINUX inner core dynamic loading method
CN101324850A
Method for treating crash dump of Linux operation system based on loongson server
CN102929747A
Method for Information exchange between plurality of operating systems of electronic device
CN103197964A
Application migration with dynamic operating system containers
CN103620552A