An operating system upgrade method, a computing device, and a storage medium
By configuring the slave kernel to poll the master kernel in the computing device, a new kernel can be loaded without restarting the computing device, solving the problem that operating system upgrades in the prior art require a restart, and realizing fast and uninterrupted operating system upgrades.
Patent Information
- Application Number
- CN202210322197.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-29
- Publication Date
- 2025-12-12
- Estimated Expiration
- 2042-03-29
AI Technical Summary
In existing technologies, operating system upgrades require computer restarts, resulting in long business interruptions and being user-unfriendly.
By configuring the processor's slave core in the computing device to poll whether the master core should restart, and loading the second core into the kernel storage area of the internal memory without restarting the computing device, the operating system can be upgraded.
Without restarting the computing device, kernel loading time was shortened, interruption time during the upgrade process was reduced, and user experience was improved.
Smart Images

Figure CN114741106B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of operating systems, and in particular to an operating system upgrading method, a computing device and a storage medium. BACKGROUND
[0002] With the development of computer technology, people usually complete a variety of tasks according to an operating system when using a computer, so the operating system in the computer is particularly important. In order to make the operating system safer and more efficient to provide services for users, it is often necessary to repair vulnerabilities in the operating system or add new functions, such as kernel vulnerability repair and bug repair.
[0003] In the prior art, when upgrading and repairing components such as the kernel of the operating system, it is usually necessary to restart the computer and load a new kernel. This upgrading method is very time-consuming, has a long interruption time for business, and is not user-friendly.
[0004] Therefore, a new operating system upgrading method is needed. SUMMARY
[0005] Therefore, the present application provides an operating system upgrading method to try to solve or at least alleviate the above problems.
[0006] According to one aspect of the present application, an operating system upgrading method is provided, which is suitable for being executed in a computing device, the computing device comprising a processor and an internal memory, and running an operating system, the operating system comprising a first kernel, the method comprising the steps of: loading a second kernel into a kernel storage area of the internal memory when receiving an upgrading request of upgrading the first kernel to the second kernel; setting a slave core of the processor to poll whether the master core is restarted, and closing the master core of the processor; restarting the master core of the processor, and loading the second kernel into the kernel storage area according to the master core; and setting the slave core to stop polling the master core according to the polling request of the master core.
[0007] Optionally, in the method according to the present application, loading the second kernel into the kernel storage area of the internal memory comprises the steps of: allocating a kernel storage area in the internal memory, the kernel storage area being a continuous memory area in the internal memory; and loading the second kernel into the kernel storage area.
[0008] Optionally, in the method according to the present application, setting the slave core of the processor to poll whether the master core is started comprises the steps of: sending a message of closing the master core to the slave core by the master core; and starting to poll whether the master core is started when the slave core receives the message of closing the master core.
[0009] Optionally, in the method according to the present invention, setting the slave core to stop polling the master core according to the polling request of the slave core to the master core includes the steps of: when the master core receives the polling request of the slave core to the master core after restarting, sending a master core restart message to the slave core; when the slave core receives the master core restart message, stopping polling the master core.
[0010] Optionally, in the method according to the present invention, the computing device is communicatively connected to the server, and the generation of an upgrade request to upgrade the first kernel to the second kernel includes the steps of: obtaining the kernel version of the stored kernel from the server; determining whether the kernel version of the kernel stored on the server is higher than the kernel version of the first kernel; if it is higher than the kernel version of the first kernel, then using the kernel stored on the server as the second kernel; obtaining the second kernel from the server and generating an upgrade request for the kernel of the operating system.
[0011] Optionally, in the method according to the present invention, the operating system further includes a first system service, and the method further includes the steps of: when receiving an upgrade request for a system service of the operating system, loading a second system service into the system service storage area of the internal memory; setting the slave core of the processor to poll whether the master core should be restarted, and shutting down the master core of the processor; restarting the master core of the processor, and loading the second system service from the system service storage area according to the master core; and setting the slave core to stop polling the master core according to the polling request of the slave core to the master core.
[0012] Optionally, in the method according to the present invention, the operating system further includes a first system application, and the method further includes the steps of: when receiving an upgrade request for the system services of the operating system, loading a second system application into the system application storage area of the internal memory; setting the slave core of the processor to poll whether the master core should be restarted, and shutting down the master core of the processor; restarting the master core of the processor, and loading the second system application from the system application storage area of the master core according to the master core; and setting the slave core to stop polling the master core according to the polling request of the slave core to the master core.
[0013] Optionally, in the method according to the present invention, the computing device further includes a PCI device, and the method further includes the steps of: after shutting down the main core of the processor, setting the PCI device to suspend operation; and when the main core of the processor restarts, setting the PCI device to resume operation.
[0014] According to another aspect of the present invention, a computing device is provided, comprising: one or more processors; a memory; and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include methods for performing an operating system upgrade according to the present invention.
[0015] According to another aspect of the invention, a computer-readable storage medium is provided for storing one or more programs, the one or more programs including instructions that, when executed by a computing device, cause the computing device to perform the operating system upgrade method according to the invention.
[0016] This invention discloses an operating system upgrade method suitable for execution in a computing device. The computing device includes a processor and internal memory, and runs an operating system, which includes a first kernel. The method includes the steps of: when receiving an upgrade request for the operating system kernel, loading a second kernel into the kernel storage area of the internal memory; setting the processor's slave cores to poll whether the master core should restart, and shutting down the processor's master core; restarting the processor's master core, and loading the second kernel from the kernel storage area according to the master core; and setting the slave cores to stop polling the master core according to the polling of the master core. This invention upgrades the operating system by reloading the processor's master core and loading the new kernel without restarting the computing device; it keeps the slave cores enabled while upgrading the kernel, avoiding restarting the slave cores and extending the update time; and it further reduces the kernel loading time by pre-storing the kernel in the kernel storage area. Attached Figure Description
[0017] To achieve the foregoing and related objectives, certain illustrative aspects are described herein in conjunction with the following description and accompanying drawings. These aspects indicate various ways in which the principles disclosed herein may be practiced, and all aspects and their equivalents are intended to fall within the scope of the claimed subject matter. The foregoing and other objectives, features, and advantages of the present invention will become more apparent from the following detailed description taken in conjunction with the accompanying drawings. Throughout this disclosure, the same reference numerals generally refer to the same parts or elements.
[0018] Figure 1 A schematic diagram of an operating system running in a computing device according to an exemplary embodiment of the present invention is shown;
[0019] Figure 2 A structural block diagram of a computing device 200 according to an exemplary embodiment of the present invention is shown;
[0020] Figure 3 A flowchart illustrating an operating system upgrade method 300 according to an exemplary embodiment of the present invention is shown;
[0021] Figure 4 A schematic diagram illustrating the loading of a new kernel in the prior art is shown;
[0022] Figure 5 A schematic diagram illustrating the loading of a second kernel according to an exemplary embodiment of the present invention is shown;
[0023] Figure 6This diagram illustrates the boot process when the kernel is rebooted in the prior art.
[0024] Figure 7 This diagram illustrates the boot process when the kernel is rebooted in the prior art.
[0025] Figure 8 A schematic diagram illustrating a shutdown process during a main core reboot according to an exemplary embodiment of the present invention is shown;
[0026] Figure 9 A schematic diagram illustrating the boot process during a main core reboot according to an exemplary embodiment of the present invention is shown; and
[0027] Figure 10 A schematic diagram of an upgraded kernel according to an exemplary embodiment of the present invention is shown. Detailed Implementation
[0028] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art. The same reference numerals generally refer to the same parts or elements.
[0029] Figure 1 A schematic diagram of an operating system running in a computing device according to an exemplary embodiment of the present invention is shown. Figure 1 As shown, the computing device 200 includes a hardware layer 130, a system layer, and an application layer 110.
[0030] Hardware layer 130 provides a hardware runtime environment for the operating system and applications in the computing device. Hardware layer 130 includes a processor 131, internal memory 132, external memory 133, and PCI devices 134. The processor may include a master core and one or more slave cores. Figure 1 As shown, processor 131 includes a master core 1311, a slave core 1312, and a slave core 1313. This invention does not limit the architecture type of the master and slave cores included in the processor, nor the number of slave cores. Figure 1 The number of slave cores shown is merely exemplary. In a processor, the master core is the managing core, and the managed cores are slave cores.
[0031] PCI device 134 includes devices connected via the PCI bus, including sound cards, network cards, and other devices.
[0032] The computing device 200 runs an operating system 120, which serves as the system layer of the computing device 200 and provides a software runtime environment for applications running on the computing device. The operating system 120 includes a first kernel 121, first system services 122, and first system applications 123. The first kernel 121 is responsible for managing the processes, memory, device drivers, files, and network system of the operating system 120; the first system services 122 execute programs, routines, or processes that specify system functions to support other programs, including audio servers and video servers; the first system applications 123 are applications that control and coordinate the computing device and external devices, supporting application software development and operation, including compilers.
[0033] The application layer 110 includes one or more applications running on the hardware layer 130 and the operating system 120: applications 111 to 113. This invention does not limit the number or type of applications in the application layer.
[0034] Figure 2 A structural block diagram of a computing device 200 according to an exemplary embodiment of the present invention is shown. Figure 2 As shown, in basic configuration 202, computing device 200 typically includes system memory 206 and one or more processors 204. Memory bus 208 can be used for communication between processor 204 and system memory 206.
[0035] Depending on the desired configuration, processor 204 can be any type of processor, including but not limited to: microprocessor (μP), microcontroller (μC), digital information processor (DSP), or any combination thereof. Processor 204 may include one or more levels of cache such as L1 cache 210 and L2 cache 212, processor core 214, and registers 216. Example processor core 214 may include an arithmetic logic unit (ALU), floating-point unit (FPU), digital signal processing core (DSP core), or any combination thereof. Example memory controller 218 may be used with processor 204, or in some implementations, memory controller 218 may be an internal part of processor 204.
[0036] Depending on the desired configuration, system memory 206 can be any type of memory, including but not limited to volatile memory (such as RAM), non-volatile memory (such as ROM, flash memory, etc.), or any combination thereof. System memory 206 may include operating system 220, one or more programs 222, and program data 228. In some embodiments, program 222 may be arranged to execute instructions 223 of the method 300 according to the invention on the operating system using program data 228.
[0037] The computing device 200 may also include a storage interface bus 234. The storage interface bus 234 enables communication from storage devices 232 (e.g., removable storage 236 and non-removable storage 238) to the basic configuration 202 via the bus / interface controller 230. At least a portion of the operating system 220, program 222, and data 224 may be stored on the removable storage 236 and / or non-removable storage 238, and loaded into system memory 206 via the storage interface bus 234 when the computing device 200 is powered on or when program 222 is to be executed, and executed by one or more processors 204.
[0038] The computing device 200 may also include an interface bus 240 that facilitates communication from various interface devices (e.g., output devices 242, peripheral interfaces 244, and communication devices 246) to the basic configuration 202 via a bus / interface controller 230. Example output devices 242 include a graphics processing unit 248 and an audio processing unit 250. They may be configured to facilitate communication with various external devices such as displays or speakers via one or more A / V ports 252. Example peripheral interfaces 244 may include a serial interface controller 254 and a parallel interface controller 256, which may be configured to facilitate communication with external devices such as input devices (e.g., keyboards, mice, pens, voice input devices, touch input devices) or other peripherals (e.g., printers, scanners, etc.) via one or more I / O ports 258. Example communication devices 246 may include a network controller 260, which may be arranged to communicate with one or more other computing devices 200 via a network communication link through one or more communication ports 264.
[0039] A network communication link can be an example of a communication medium. A communication medium can typically be embodied in a modulated data signal, such as a carrier wave or other transmission mechanism, and can include any information delivery medium. A “modulated data signal” can be a signal whose data set, or whose modifications, can be encoded with information within the signal. As a non-limiting example, a communication medium can include wired media such as wired networks or leased lines, and various wireless media including sound, radio frequency (RF), microwave, infrared (IR), or other wireless media. The term “computer-readable medium” as used herein can include both storage media and communication media.
[0040] In the device 200 according to the present invention, program 222 includes multiple program instructions of operating system upgrade method 300, which can instruct processor 204 to execute some steps of operating system upgrade method 300 running in computing device 200 of the present invention, so that each part of computing device 200 upgrades the operating system by executing operating system upgrade method 300 of the present invention.
[0041] The computing device 200 can be implemented as a server, such as a file server, database, server, application server, etc. These electronic devices can be such as personal digital assistants (PDAs), wireless network browsing devices, application-specific devices, or hybrid devices that can include any of the above functions. It can be implemented as a personal computer including desktop computers and laptop computers. In some embodiments, the computing device 200 is also configured for operating system upgrade method 300.
[0042] Figure 3 A schematic flowchart of an operating system upgrade method 300 according to an exemplary embodiment of the present invention is shown. Figure 3 As shown, step S310 is executed first. When an upgrade request to upgrade the first kernel to the second kernel is received, the second kernel is loaded into the kernel storage area of the internal memory.
[0043] According to one embodiment of the present invention, an upgrade request for the operating system kernel can be initiated by a user or automatically sent by a computing device, and the present invention does not limit the method of generating the upgrade request. The computing device is communicatively connected to a server, which is a server storing the operating system kernel, including the latest version of the kernel uploaded by developers. After the developers have completed developing the kernel and upgraded or fixed bugs, they upload the new version of the kernel to the server.
[0044] The process of generating an upgrade request to upgrade the first kernel to the second kernel includes the following steps: obtaining the kernel version of the stored kernel from the server, determining whether the kernel version of the kernel stored on the server is higher than the kernel version of the first kernel, and if it is higher than the kernel version of the first kernel, then using the kernel stored on the server as the second kernel, obtaining the second kernel from the server, and generating an upgrade request for the operating system kernel.
[0045] According to one embodiment of the present invention, when a computing device obtains a second kernel, it may also be obtained manually from a server by a user, or imported into the computing device by a user via a removable storage medium; the present invention does not limit the method by which the computing device obtains the second kernel.
[0046] After the computing device obtains the second kernel, it stores the second kernel in external memory 133.
[0047] Figure 4This illustrates a schematic diagram of loading a new kernel in existing technology. (For example...) Figure 4 As shown: When loading the second kernel, it is loaded into non-contiguous physical memory in the kernel-mode vmalloc area. When upgrading the kernel and using the second kernel to boot the operating system, the second kernel also needs to be copied from non-contiguous memory pages to contiguous physical memory; this process is very time-consuming, resulting in a long loading time for the new kernel.
[0048] In this invention, when loading the second kernel into the internal memory, a kernel storage area is first allocated in the internal memory. The kernel storage area is a contiguous memory area in the internal memory. Then, the second kernel is loaded into the internal storage area.
[0049] Figure 5 A schematic diagram illustrating the loading of a second kernel according to an exemplary embodiment of the present invention is shown. Figure 5 As shown, a storage area is now allocated in internal memory for storing the second kernel, known as the kernel storage area (reserved memory for the second kernel). The kernel storage area is a contiguous block of memory within internal memory. This area stores the ELF core headers, the initrd (initialization memory disk), the setupcode, and the second kernel. When booting using the second kernel, the system starts loading from the initial location of the second kernel stored in internal memory.
[0050] Subsequently, step S320 is executed, setting the processor's slave cores to poll whether the master core should restart, and then shutting down the processor's master core. Since the master core manages the slave cores in the processor, when setting the slave cores to poll the master core, the master core sends a master core shutdown message to the slave core. When the slave core receives the master core shutdown message, it begins to poll whether the master core should start and sends a polling request to the master core.
[0051] Figure 6 This diagram illustrates a shutdown process during kernel reboot, as described in existing technologies. Figure 6 As shown, during shutdown, the master core sends a message to the slave core, informing it that shutdown is in progress. Upon receiving the message from the master core, the slave core also stops running. The shutdown operation causes both the master and slave cores of the processor to cease operation. Figure 7 This diagram illustrates the boot process when the kernel is rebooted in the prior art. (For example...) Figure 7As shown, during power-on, the main core starts first, then sends a message to the slave cores informing them that the main core has started. Upon receiving this message, the slave core is awakened and starts. The main core waits for the slave cores to run to complete the power-on process. In existing technologies, the slave cores stop and start following the main core, resulting in long power-on and power-off times, and the entire main core restart process takes a considerable amount of time.
[0052] Figure 8 A schematic diagram illustrating a shutdown process during a main core reboot according to an exemplary embodiment of the present invention is shown. Figure 8 As shown, when the master core shuts down, it informs the slave cores that the master core is shutting down. After receiving the message from the master core, the master core sets the slave cores to start polling whether the master core is running, instead of shutting down the slave cores. The slave cores do not stop running, but instead poll whether the master core has started, saving the time for the slave cores to shut down and shortening the shutdown time.
[0053] Subsequently, step S330 is executed to restart the processor's main core and load the second core from the kernel storage area based on the main core's configuration. Restarting the processor's main core allows it to retrieve and load the second core from its storage location in the kernel storage area, thus upgrading the kernel. Since the storage location of the second core differs from that of the first core, the location pointed to by the boot kernel pointer needs to be modified to the starting address of the second core's storage area.
[0054] Finally, step S340 is executed, which sets the slave core to stop polling the master core according to the polling request from the slave core to the master core. Specifically: when the master core restarts and receives the polling request from the slave core to the master core, it sends a master core restart message to the slave core. When the slave core receives the master core restart message, it stops polling the master core.
[0055] Figure 9 A schematic diagram illustrating the boot process when restarting the main core according to an exemplary embodiment of the present invention is shown. Figure 9 As shown, after the master core starts up, it sends a kernel restart message to the slave core. Since the slave core has not stopped running, it is only necessary to let the slave core exit the polling state and start running normally. This saves the slave core startup time, shortens the boot time, and thus reduces the time for kernel upgrades.
[0056] Figure 10 A schematic diagram of an upgraded kernel according to an exemplary embodiment of the present invention is shown. (As follows) Figure 10 As shown: After a computing device powers on, it runs the operating system with the first kernel. When a request to upgrade the operating system kernel is received, a kernel storage area is first allocated in the internal memory. The kernel storage area is a contiguous memory region in the internal memory.
[0057] Subsequently, if the kernel version of the kernel stored on the server is higher than the kernel version of the first kernel, the kernel stored on the server is used as the second kernel, the second kernel is obtained, and the second kernel is loaded into the kernel storage area of the internal memory.
[0058] Next, the kernel update begins, the primary core is shut down, and the slave cores are informed that the primary core is shut down. After receiving the message from the primary core, the primary core configures the slave cores to start polling whether the primary core is running, without shutting down the slave cores. The slave cores do not stop running, but instead poll whether the primary core has started.
[0059] Then the processor's main core is restarted, and a second core is loaded from the kernel storage area based on the main core.
[0060] Then the main core starts and sends a kernel restart message to the slave core. Since the slave core has not stopped running, it is only necessary to let the slave core exit the polling state and start running normally.
[0061] According to one embodiment of the present invention, the operating system further includes a first system service, and the method of the present invention further includes the step of: when an upgrade request for a system service of the operating system is received, loading a second system service into the system service storage area of the internal memory. The system service storage area is a pre-defined contiguous storage area in the internal memory.
[0062] Next, the processor's slave cores are configured to poll whether the master core should restart, and the processor's master core is then shut down. The processor's master core is then restarted, and the second system service is loaded from the system service storage area according to the master core's configuration.
[0063] Finally, based on the polling requests from the slave core to the master core, the slave core is set to stop polling the master core, thereby enabling rapid updates of system services.
[0064] According to one embodiment of the present invention, the operating system further includes a first system application, and the method of the present invention further includes the step of: when receiving an upgrade request for the system services of the operating system, loading a second system application into the system application storage area of the internal memory; the system application storage area is a pre-defined contiguous storage area in the internal memory.
[0065] Next, configure the processor's slave cores to poll whether the master core should restart, and then shut down the processor's master core.
[0066] The processor's main core is then restarted, and a second system application is loaded from the system application storage area based on the main core.
[0067] Finally, based on the polling requests from the slave core to the master core, the slave core is set to stop polling the master core, thereby enabling rapid updates of system applications.
[0068] According to one embodiment of the present invention, when the operating system is a Linux system, the initramfs storage area can also be set up using the method of the present invention to update the initramfs module of the Linux system.
[0069] According to an embodiment of the present invention, the computing device further includes: a PCI device, a USB device, and an I2C device. The method of the present invention further includes the steps of: after shutting down the main core of the processor, setting the PCI device to pause operation without stopping operation, keeping the PCI device powered on, and then setting the PCI device to resume operation when the main core of the processor restarts; avoiding the extension of update time caused by restarting the PCI device when updating the operating system.
[0070] Correspondingly, after shutting down the processor's main core, the USB devices and / or I2C devices are set to pause operation without stopping operation. Subsequently, when the processor's main core restarts, the USB devices and / or I2C devices are set to resume operation, avoiding the extended update time caused by restarting the USB devices and / or I2C devices during operating system updates.
[0071] This invention discloses an operating system upgrade method suitable for execution in a computing device. The computing device includes a processor and internal memory, and runs an operating system, which includes a first kernel. The method includes the steps of: when receiving an upgrade request for the operating system kernel, loading a second kernel into the kernel storage area of the internal memory; setting the processor's slave cores to poll whether the master core should restart, and shutting down the processor's master core; restarting the processor's master core, and loading the second kernel from the kernel storage area according to the master core; and setting the slave cores to stop polling the master core according to the polling of the master core. This invention upgrades the operating system by reloading the processor's master core and loading the new kernel without restarting the computing device; it keeps the slave cores enabled while upgrading the kernel, avoiding restarting the slave cores and extending the update time; and it further reduces the kernel loading time by pre-storing the kernel in the kernel storage area.
[0072] This invention discloses an operating system upgrade method suitable for execution in a computing device. The computing device runs a first operating system. The method includes the following steps: upon receiving an operating system switch request to switch to a second operating system, modifying the kernel load address to the second storage address of the second kernel of the second operating system in internal memory; loading the second kernel of the second operating system according to the kernel load address; obtaining a second system snapshot of the second operating system from external memory; and running the second operating system based on the second kernel and the second system snapshot. This invention achieves operating system switching by modifying the kernel load address and obtaining a system snapshot from external memory so that when the kernel is loaded, the operating system can be restored to its last paused or terminated state. To achieve rapid switching between running operating systems, it eliminates the need to build a virtual machine to install another operating system, thus improving the efficiency of operating system switching and the running efficiency of each operating system.
[0073] Numerous specific details are set forth in the specification provided herein. However, it will be understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures, and techniques have not been shown in detail so as not to obscure the understanding of this specification.
[0074] Similarly, it should be understood that, in order to streamline this disclosure and aid in understanding one or more of the various aspects of the invention, in the above description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof.
[0075] Those skilled in the art will understand that the modules, units, or groups of devices in the examples disclosed herein can be arranged in the device as described in this embodiment, or alternatively, can be located in one or more devices different from the device in this example. The modules in the foregoing examples can be combined into a single module or, in addition, can be divided into multiple sub-modules.
[0076] Those skilled in the art will understand that modules in the apparatus of the embodiments can be adaptively changed and placed in one or more devices different from that embodiment. Modules, units, or groups in the embodiments can be combined into a single module, unit, or group, and further, they can be divided into multiple sub-modules, sub-units, or sub-groups. Except where at least some of such features and / or processes or units are mutually exclusive, any combination can be used to combine all features disclosed herein and all processes or units of any method or apparatus so disclosed. Unless expressly stated otherwise, each feature disclosed herein may be replaced by an alternative feature that serves the same, equivalent, or similar purpose.
[0077] Furthermore, those skilled in the art will understand that although some embodiments described herein include certain features included in other embodiments but not others, combinations of features from different embodiments are meant to be within the scope of the invention and form different embodiments.
[0078] Furthermore, some of the embodiments described herein are methods or combinations of method elements that can be implemented by a processor of a computer system or by other means of performing the functions. Therefore, a processor having the necessary instructions for implementing the methods or method elements forms means for implementing the methods or method elements. Furthermore, the elements described herein in the apparatus embodiments are examples of means for implementing the functions performed by elements for the purposes of carrying out the invention.
[0079] The various techniques described herein can be implemented in combination with hardware or software, or a combination thereof. Thus, the methods and apparatus of the present invention, or certain aspects or portions thereof, can take the form of program code (i.e., instructions) embedded in a tangible medium, such as a floppy disk, CD-ROM, hard disk, or any other machine-readable storage medium, wherein when the program is loaded into and executed by a machine such as a computer, the machine becomes an apparatus for practicing the present invention.
[0080] When the program code is executed on a programmable computer, the computing device generally includes a processor, a processor-readable storage medium (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device. The memory is configured to store program code; the processor is configured to execute the operating system upgrade method of the present invention according to instructions in the program code stored in the memory.
[0081] By way of example, and not limitation, computer-readable media include computer storage media and communication media. Computer storage media stores information such as computer-readable instructions, data structures, program modules, or other data. Communication media generally embodies computer-readable instructions, data structures, program modules, or other data in the form of modulated data signals such as carrier waves or other transmission mechanisms, and includes any information delivery medium. Any combination of the above is also included within the scope of computer-readable media.
[0082] As used herein, unless otherwise specified, the use of ordinal numbers such as “first,” “second,” “third,” etc., to describe ordinary objects merely indicates different instances of similar objects and is not intended to imply that the objects being described must have a given order in time, space, ordering, or any other manner.
[0083] Although the invention has been described with reference to a limited number of embodiments, those skilled in the art will understand from the foregoing description that other embodiments are conceivable within the scope of the invention described herein. Furthermore, it should be noted that the language used in this specification has been chosen primarily for readability and edibility purposes, and not for the purpose of explaining or limiting the subject matter of the invention. Therefore, many modifications and variations will be apparent to those skilled in the art. The disclosure of the invention regarding its scope is illustrative and not restrictive.
Claims
1. An operating system upgrade method, suitable for execution in a computing device, said computing device including a processor and internal memory, and running an operating system, said operating system including a first kernel, said method comprising the steps of: When an upgrade request to upgrade the first kernel to the second kernel is received, the second kernel is loaded into the kernel storage area of the internal memory; The processor is configured to have its slave cores poll whether the master core should restart and to shut down the master core. The step of setting the processor's slave cores to poll whether the master core should start includes sending a master core shutdown message to the slave core through the master core. When the slave core receives the master core shutdown message, it starts polling whether the master core should start. Reboot the processor's main core and load the second kernel from the kernel storage area according to the main core; Based on the polling request from the slave core to the master core, the slave core is set to stop polling the master core, including sending a master core restart message to the slave core when the master core receives the polling request from the slave core after restarting, and stopping polling the master core when the slave core receives the master core restart message.
2. The method as described in claim 1, wherein, Loading the second kernel into the kernel storage region of the internal memory includes the following steps: A kernel storage region is allocated within the internal storage, and the kernel storage region is a contiguous memory region within the internal storage. The second kernel is loaded into the internal storage area.
3. The method as described in claim 1, wherein, The computing device is communicatively connected to the server, and the generation of the upgrade request to upgrade the first kernel to the second kernel includes the following steps: Retrieve the kernel version of the stored kernel from the server; Determine whether the kernel version of the kernel stored on the server is higher than the kernel version of the first kernel; If the kernel version is higher than that of the first kernel, then the kernel stored on the server will be used as the second kernel. Obtain a second kernel from the server and generate an upgrade request for the kernel of the operating system.
4. The method of claim 1, wherein, The operating system also includes a first system service, and the method further includes the following steps: When an upgrade request for the system services of the operating system is received, the second system service is loaded into the system service storage area of the internal memory; Configure the processor's slave cores to poll whether the master core should restart, and then shut down the processor's master core; Restart the processor's main core and load the second system service from the system service storage area according to the main core; Based on the polling request from the slave core to the master core, the slave core is set to stop polling the master core.
5. The method of claim 1, wherein, The operating system also includes a first system application, and the method further includes the following steps: When an upgrade request for the system services of the operating system is received, the second system application is loaded into the system application storage area of the internal memory; Configure the processor's slave cores to poll whether the master core should restart, and then shut down the processor's master core; Reboot the processor's main core and load the second system application from the system application storage area according to the main core; Based on the polling request from the slave core to the master core, the slave core is set to stop polling the master core.
6. The method according to any one of claims 1-5, wherein, The computing device further includes a PCI device, and the method further includes the following steps: After shutting down the processor's main core, the PCI device is set to pause operation; When the processor's main core restarts, the PCI device is set to resume operation.
7. A computing device, comprising: One or more processors; Memory; as well as One or more means, the one or more means comprising instructions for performing the method according to any one of claims 1-6.
8. A computer-readable storage medium storing one or more programs, said one or more programs including instructions that, when executed by a computing device, cause the computing device to perform the method according to any one of claims 1-6.
Citation Information
Patent Citations
Operating system decoupled heterogeneous computing
CN103597449A
Kernel restarting method
CN114064128A