Kernel upgrade method, device, medium, chip and electronic device
By transferring the kernel to be upgraded to the off-chip file system and using bootloader to index the file system, the kernel upgrade problem of the microkernel operating system is solved, the system upgradeability function and maintainability are realized, and flexible upgrade methods and fast Responsiveness.
Patent Information
- Application Number
- CN202410072507.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-18
- Publication Date
- 2025-01-17
- Estimated Expiration
- 2044-01-18
AI Technical Summary
The existing technology lacks a kernel upgrade solution based on microkernel operating systems, resulting in system upgradeability and maintainability limitations.
By transferring the kernel to be upgraded to the off-chip file system for saving, and using the bootloader index file system to perform kernel upgrades, a kernel upgrade based on the microkernel operating system is realized.
It has achieved a comprehensive and complete upgrade of the microkernel operating system, ensured the upgradeable functions and maintainability of the system, and provided flexible upgrade methods and rapid response capabilities.
Smart Images

Figure CN117591163B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of chip technology, and in particular to a kernel upgrade method, device, medium, chip and electronic device. Background Art
[0002] At present, the main control chips involved in many systems (such as power systems) use microkernel embedded operating systems (hereinafter referred to as microkernel operating systems). In order to ensure the upgradeability and maintainability of the system, it is necessary to implement the upgrade function of the microkernel operating system. However, the existing technologies are all based on the upgrade solutions of the Linux operating system, and there is no proprietary upgrade solution based on the microkernel operating system. Summary of the invention
[0003] The purpose of the embodiments of the present invention is to provide a kernel upgrade method, device, medium, chip and electronic device, which are used to at least partially solve the above technical problems.
[0004] In order to achieve the above-mentioned purpose, an embodiment of the present invention provides a kernel upgrade method, which is applied to a microkernel operating system having a kernel to be upgraded and a boot loader, and the kernel upgrade method includes: transferring the kernel to be upgraded to an off-chip file system for storage, wherein an upgrade information file and an upgrade confirmation file about the kernel to be upgraded are formed in the file system; and in response to an upgrade trigger, running the bootloader to index the file system to perform a kernel upgrade.
[0005] Optionally, transferring the kernel to be upgraded to an off-chip file system for storage includes: transferring the kernel to be upgraded to any location of the file system for storage via a debugging serial port supporting shell commands or via an application program (APP).
[0006] Optionally, the upgrade information file is used to indicate the storage location, execution start address and file name of the kernel to be upgraded, and the upgrade confirmation file is used to indicate that the kernel to be upgraded is confirmed to be upgraded.
[0007] Optionally, the upgrade is triggered by calling an upgrade application programming interface (API) through an APP, or by executing a shell command.
[0008] Optionally, in response to an upgrade trigger, running the bootloader to index the file system to perform a kernel upgrade includes: in response to an upgrade trigger, running the bootloader to directly index the upgrade information file and the upgrade confirmation file from the file system to perform a kernel upgrade.
[0009] Optionally, in response to an upgrade trigger, running the bootloader to index the file system to perform a kernel upgrade includes: in response to the upgrade trigger, forming an on-chip upgrade flag, the flag being used to indicate whether to upgrade the kernel to be upgraded; and running the bootloader to detect the flag, and determining based on the flag whether to upgrade the kernel to be upgraded, and if so, causing the bootloader to index the upgrade information file from the file system to perform the kernel upgrade.
[0010] Optionally, the executing kernel upgrade includes: the bootloader copies the kernel to be upgraded in the file system to an on-chip execution area to perform kernel update.
[0011] On the other hand, an embodiment of the present invention also provides a kernel upgrade device, which is applied to a microkernel operating system having a kernel to be upgraded and a bootloader, and the kernel upgrade device includes: a transmission module, which is used to transmit the kernel to be upgraded to an off-chip file system for storage, wherein an upgrade information file and an upgrade confirmation file about the kernel to be upgraded are formed in the file system; and an upgrade module, which is used to run the bootloader to index the file system to perform a kernel upgrade in response to an upgrade trigger.
[0012] Optionally, the transmission module transfers the kernel to be upgraded to any location in the file system for storage through a debugging serial port that supports shell commands or through an APP; and / or the upgrade module triggers the upgrade by calling an API through an APP, or triggers the upgrade by executing a shell command.
[0013] Optionally, the upgrade module responds to an upgrade trigger and runs the bootloader to index the file system to perform a kernel upgrade, including: responding to an upgrade trigger, running the bootloader to directly index the upgrade information file and the confirmation upgrade file from the file system to perform a kernel upgrade; or responding to an upgrade trigger, forming an on-chip upgrade flag (flag) for indicating whether to upgrade the kernel to be upgraded, running the bootloader to detect the flag, and determining whether to upgrade the kernel to be upgraded based on the flag, and if so, enabling the bootloader to index the upgrade information file from the file system to perform a kernel upgrade.
[0014] On the other hand, an embodiment of the present invention further provides a machine-readable storage medium, on which instructions are stored, and the instructions are used to enable a machine to execute any of the above-mentioned kernel upgrade methods.
[0015] On the other hand, an embodiment of the present invention also provides a chip, comprising: a microkernel operating system having a kernel and a bootloader to be upgraded; and any of the above-mentioned kernel upgrade devices or the above-mentioned machine-readable storage medium, wherein the chip executes instructions stored in the machine-readable storage medium to implement any of the above-mentioned kernel upgrade methods.
[0016] On the other hand, an embodiment of the present invention further provides an electronic device, comprising the above-mentioned chip.
[0017] Through the above technical scheme, the embodiment of the present invention utilizes the on-chip bootloader to index the off-chip file system, which is equivalent to the bootloader integrating its own file system, so that the kernel to be upgraded and related upgrade files stored in the file system can be comprehensively and completely analyzed, thereby realizing kernel upgrade based on the microkernel operating system.
[0018] Other features and advantages of the embodiments of the present invention will be described in detail in the subsequent detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The accompanying drawings are used to provide a further understanding of the embodiments of the present invention and constitute a part of the specification. Together with the following specific embodiments, they are used to explain the embodiments of the present invention, but do not constitute a limitation on the embodiments of the present invention. In the accompanying drawings:
[0020] Figure 1 is a flowchart of a kernel upgrade method according to an embodiment of the present invention;
[0021] Figure 2 It is a schematic diagram of the structure of a microkernel operating system according to an embodiment of the present invention;
[0022] Figure 3 is a schematic diagram of a process of performing a kernel or APP upgrade on a microkernel operating system in an example of an embodiment of the present invention; and
[0023] Figure 4 It is a schematic diagram of the structure of a kernel upgrade device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0024] The specific implementation of the embodiment of the present invention is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described here is only used to illustrate and explain the embodiment of the present invention, and is not used to limit the embodiment of the present invention.
[0025] To facilitate understanding, some descriptions of concepts related to the embodiments of the present invention are exemplarily provided for reference.
[0026] 1) Microkernel: It is a lightweight design. Compared with the single kernel structure such as Linux, the microkernel only contains the most basic operating system services, such as memory management, process management, thread management and inter-process communication. In addition, due to the lightweight characteristics of the microkernel, its microkernel operating system is generally used in resource-constrained chips (such as processors), so the program code of the bootloader, kernel, etc. is stored in the on-chip flash, and the code can be executed directly on the flash, while the Linux operating system needs to load the bootloader, kernel and file system from the off-chip storage medium to run in the RAM space. The embodiment of the present invention uses this difference between the microkernel operating system and the Linux operating system to implement a solution for directly running the bootloader on the chip to perform kernel upgrades.
[0027] 2) Kernel: The kernel is the most basic part of the operating system, responsible for managing the system's processes, memory, device drivers, file systems, and network systems, and determines the system's performance and stability. In the embodiment of the present invention, the bootloader is used to upgrade the kernel in the operating system.
[0028] 3) Bootloader: The boot loader is the first code executed by the embedded system after power-on. In this program, you can jump to different Flash addresses through conditional judgment. In the existing upgrade scheme based on the Linux operating system, after loading the bootloader, kernel and file system from the off-chip storage medium, it usually runs the kernel first, then mounts the file system, and the file system is parsed by the kernel instead of the bootloader; and the bootloader cannot directly index the file system. The files in the file system must first be converted and saved in a certain format to the specified location of the off-chip flash, and the bootloader then reads from the specified location (external file address). The embodiment of the present invention can solve this problem by utilizing the characteristic that the microkernel operating system can execute the bootloader directly on the flash.
[0029] 4) File system: A method and data structure for organizing and managing files in an operating system. Each readable block device corresponding to the operating system can have a file system, so that the block device can be mounted to a directory of the system and then the files therein can be accessed. In the embodiment of the present invention, the file system is mainly used to mount the upgrade file.
[0030] 5) Off-chip: In the embodiments of the present invention, "chip" refers to the processor where the bootloader and other programs are located. Taking MCU (Microcontroller Unit) as an example, the flash area of the MCU is used to store execution code, and off-chip refers to a storage device outside the MCU, which is used as a medium for the file system to store files.
[0031] Figure 1 FIG. 1 is a flow chart of a kernel upgrade method according to an embodiment of the present invention, wherein the kernel upgrade method is used for a microkernel operating system having a kernel and a bootloader to be upgraded. Figure 1 As shown, the kernel upgrade method may include the following steps S100 and S200:
[0032] Step S100: The kernel to be upgraded is transferred to an off-chip file system for storage, wherein an upgrade information file and an upgrade confirmation file about the kernel to be upgraded are formed in the file system.
[0033] Step S200, in response to an upgrade trigger, running the bootloader to index the file system to perform a kernel upgrade.
[0034] For the above steps S100 and S200, Figure 2 As shown, the embodiment of the present invention provides the cooperation of three parts to realize the kernel upgrade function:
[0035] The first is the bootloader part: in a microkernel operating system, the bootloader can directly index the file system by introducing file system codes such as littefs. Therefore, the embodiment of the present invention enables the bootloader in the microkernel operating system to directly index the file system, without having to load the bootloader from an off-chip storage medium as Linux does. Accordingly, it is equivalent to including the same file system as the kernel in the bootloader in the microkernel operating system of the embodiment of the present invention, and then the bootloader can directly obtain the kernel to be upgraded and the supporting upgrade information files and confirmation files from the file system. For example, in an MCU based on a microkernel operating system, through the embodiment of the present invention, the MCU stores all execution codes in the flash and executes the codes directly on the flash, which is equivalent to integrating the file system code in its bootloader.
[0036] The upgrade information file is written to indicate the storage location, execution start address and file name of the kernel to be upgraded, and the upgrade confirmation file is used to indicate that the kernel to be upgraded is confirmed to be upgraded. It should be noted that the bootloader further has the function of copying the kernel to be upgraded to perform the upgrade, which will be described in conjunction with examples below and will not be repeated here.
[0037] The second is the kernel part: in the example, the kernel supports triggering the upgrade process through shell commands, or supports the upgrade API (application programming interface) for APP to call, and the upgrade process can also be triggered by APP.
[0038] The third is the file system part: the embodiment of the present invention can store the relevant upgrade files to any location of the file system, and the above upgrade file information includes its saved file, so that the bootloader can parse the upgrade file information to index the kernel to be upgraded from the file system.
[0039] For step S100, in a preferred embodiment, in addition to the application (APP), the kernel to be upgraded can also be transferred to any location of the file system for storage through a debugging serial port that supports shell commands. And more preferably, the triggering of the upgrade process can also be achieved through APP or shell commands. That is, for step S200, the upgrade can be triggered by calling the upgrade API through APP, or by executing a shell command. Therefore, the upgrade can be fully utilized to trigger the APP, but when the APP is not running, the upgrade can also be triggered by shell commands, providing more flexibility in triggering the upgrade.
[0040] With respect to the above step S200, in a first preferred embodiment, in response to an upgrade trigger, running the bootloader to index the file system to perform a kernel upgrade may include: in response to an upgrade trigger, running the bootloader to directly index the upgrade information file and the confirmation upgrade file from the file system to perform a kernel upgrade.
[0041] However, reference Figure 2If the bootloader directly indexes the upgrade information file and the upgrade confirmation file in the file system, there may be a problem of a large index amount, which in turn affects the boot time of the relevant chip restart after the kernel upgrade. In this regard, in the second preferred embodiment, for step S200, in response to the upgrade trigger, running the bootloader to index the file system to perform the kernel upgrade includes: in response to the upgrade trigger, forming an on-chip upgrade flag (recorded as flag), the flag is used to indicate whether to upgrade the kernel to be upgraded; and running the bootloader to detect the flag, and judging whether to upgrade the kernel to be upgraded according to the flag, and if so, making the bootloader index the upgrade information file from the file system to perform the kernel upgrade.
[0042] For example, flag defines a four-byte code to the on-chip flash to indicate to the bootloader whether an upgrade is required. Those skilled in the art will know that retrieving the address of the flag in the on-chip flash is faster than retrieving the off-chip file system, so the purpose of the flag is to allow the bootloader to quickly know whether to upgrade. If the upgrade is not required, the indexing of the file system can be skipped, thereby increasing the boot speed in the skip scenario. If an upgrade is required, the indexing of the confirmation upgrade file that is similar to the flag function can be skipped.
[0043] Thus, in the example where the kernel to be upgraded, the upgrade information file, and the confirmed upgrade file are bin files, inf files, and req files, respectively, a flag file is further included, and the flag is the data at the specified address of the on-chip flash, and the bootloader can monitor the specified address to determine whether to upgrade the kernel. In the example, when the upgrade process is triggered, it is determined whether there is a req file in the kernel. If there is, the kernel automatically sets the flag, and the bootloader can determine whether to continue the upgrade by retrieving the flag instead of the req file, which improves the judgment speed. However, it can be understood that the flag is intended to achieve a quick response to the upgrade, and the bootloader still needs to retrieve the inf information to determine the storage location of the bin file of the kernel to be upgraded, the execution start address, and the file name, etc., but it does not need to retrieve the req file, which improves the retrieval speed.
[0044] Returning to step S200, in the example, executing the kernel upgrade includes: copying the kernel to be upgraded in the file system to the on-chip execution area to perform kernel update.
[0045] Combine the following Figure 3The specific process of implementing a kernel upgrade method of an embodiment of the present invention to adapt a microkernel operating system to a system restart and perform a kernel upgrade is introduced by way of example. Figure 3 FIG. 1 is a flowchart of kernel operation for a microkernel operating system in an example of an embodiment of the present invention. Figure 3 As shown, the following steps may be included:
[0046] Step S1, transferring the kernel to be upgraded to any location in the file system through the debugging serial port or through the APP.
[0047] The kernel to be upgraded is a bin file, and the debugging serial port supports shell transmission commands.
[0048] Step S2, writing the upgrade file information of the kernel file to be upgraded into the file system and saving it.
[0049] That is, the upgrade information file is used to indicate the storage location, execution start address, file name, etc. of the kernel to be upgraded, and it is an inf file generated by encoding.
[0050] Step S3, saving the confirmed upgrade file to the file system.
[0051] The upgrade confirmation file is a req file generated by encoding, which corresponds to the upgrade information file in the previous step. If the upgrade confirmation file exists, it indicates that the upgrade needs to be performed, otherwise the upgrade does not need to be performed.
[0052] Step S4, the APP calls the upgrade API or executes a shell command to trigger the upgrade process.
[0053] That is, two optional upgrade triggering modes are given, providing flexibility of upgrade triggering.
[0054] Step S5, in response to the upgrade trigger, the system will automatically restart and start running from the bootloader, and generate an upgrade flag.
[0055] For example, the microkernel operating system obtains the upgrade command based on the API or shell command, automatically restarts the system, runs the bootloader, and generates an upgrade flag in the kernel's on-chip flash. The function of this flag is similar to the req file above, but it is the data at the specified address of the on-chip flash, and the bootloader retrieves the on-chip data much faster than retrieving the off-chip req file.
[0056] Step S6, the bootloader first indexes the flag and makes a judgment.
[0057] For example, as described above, if the flag indicates that an upgrade is required, then continue to step S7, otherwise skip the kernel upgrade during the current operating system restart, thereby improving the current boot speed.
[0058] Step S7, obtaining the upgrade information file from the specified location of the file system.
[0059] It should be noted that the index flag in step S6 is mainly intended to improve the boot speed in scenarios where no upgrade is required. In addition, for scenarios where upgrade is required, the upgrade confirmation file (req) can still be obtained to further determine whether to upgrade, but in some examples, the upgrade confirmation file may no longer be indexed.
[0060] Step S8, obtaining the name and specific location of the kernel to be upgraded from the upgrade information file, reading the kernel to be upgraded and copying it to the kernel execution area.
[0061] That is, the bootloader parses the upgrade information file (inf file) to obtain the bin file of the kernel to be upgraded, and puts the bin file into the kernel execution area to perform the upgrade action. In addition, when the bootloader copies the kernel to be upgraded from the file system, if there is a power outage, the copy process will continue to be re-executed after powering on again until the update is completed.
[0062] Step S9, after completing the upgrade action, delete the upgrade confirmation file and the upgrade information file, and load and execute the kernel code.
[0063] For example, the on-chip flash is divided into a kernel execution area. After the upgrade action is completed in the area, the upgrade confirmation file and the upgrade information file are deleted to ensure the storage space of the kernel execution area, and the kernel code (such as the startup code) is further loaded and executed to complete the operating system restart process.
[0064] In addition, in addition to implementing kernel upgrades, the embodiments of the present invention can also implement APPs for microkernel operating systems, for example, for the above steps S1-S9, the kernel to be upgraded is replaced with the APP to be upgraded to perform APP upgrades. Therefore, the embodiments of the present invention can upgrade the kernel and also upgrade the APP using a similar solution.
[0065] In summary, the kernel upgrade for the microkernel operating system has been completed, which has at least the following advantages:
[0066] 1) In the embodiment of the present invention, the on-chip bootloader can index the same file system as the kernel, which is equivalent to the bootloader integrating its own file system, so that the kernel to be upgraded and related upgrade files stored in the file system can be fully and completely analyzed to achieve the upgrade of the microkernel operating system, thereby ensuring the upgradeability and maintainability of the system. In addition, the kernel upgrade method of the embodiment of the present invention is easy to implement, and only needs to send the kernel to be upgraded to any custom location under any folder or subfolder to achieve the bootloader indexing of the kernel to be upgraded.
[0067] 2) In the embodiment of the present invention, the kernel to be upgraded can be stored in any partition of the file system, so there is no need to re-partition the kernel to be upgraded for upgrading.
[0068] 3) In the embodiment of the present invention, the upgrade process can be triggered by APP, giving APP more freedom to play. In addition, the upgrade process can also be triggered based on shell commands, making the upgrade more flexible.
[0069] 4) In the embodiment of the present invention, the information on whether an upgrade is required (flag and confirmation upgrade req) and the upgrade information (upgrade inf) are saved in the file system in the form of files, so that the bootloader can obtain all the information required for the upgrade through the file index.
[0070] 5) In the embodiment of the present invention, the upgrade information file saves basic information such as the storage address of the kernel, but can also save some additional burning data to meet the customized requirements of the upgrade.
[0071] 6) The embodiment of the present invention realizes the kernel upgrade based on the microkernel operating system, filling the gap of the current lack of a proprietary kernel upgrade solution based on the microkernel operating system.
[0072] Figure 4 It is a structural diagram of a kernel upgrade device of another embodiment of the present invention, which is based on the same inventive idea as the above-mentioned kernel upgrade method. The kernel upgrade device is applied to a microkernel operating system having a kernel to be upgraded and a bootloader, and includes: a transmission module, which is used to transmit the kernel to be upgraded to an off-chip file system for storage, wherein an upgrade information file and a confirmation upgrade file about the kernel to be upgraded are formed in the file system; and an upgrade module, which is used to respond to an upgrade trigger and run the bootloader to index the file system to perform a kernel upgrade.
[0073] In a preferred embodiment, the transmission module transmits the kernel to be upgraded to any location of the file system for storage through a debugging serial port supporting shell commands or through an APP.
[0074] In a preferred embodiment, the upgrade module triggers the upgrade by calling an upgrade application programming interface API through an APP, or triggers the upgrade by executing a shell command.
[0075] In a preferred embodiment, the upgrade module responds to an upgrade trigger and runs the bootloader to index the file system to perform a kernel upgrade, including: responding to an upgrade trigger, running the bootloader to directly index the upgrade information file and the confirmation upgrade file from the file system to perform a kernel upgrade; or responding to an upgrade trigger, forming an on-chip upgrade flag for indicating whether to upgrade the kernel to be upgraded, running the bootloader to detect the flag, and determining whether to upgrade the kernel to be upgraded based on the flag, and if so, causing the bootloader to index the upgrade information file from the file system to perform a kernel upgrade.
[0076] For more implementation details and effects of the kernel upgrade device, reference may be made to the above-mentioned kernel upgrade method, which will not be described in detail here.
[0077] The embodiment of the present invention further provides a machine-readable storage medium, on which instructions are stored, and the instructions are used to enable a machine to execute the kernel upgrade method described in the above embodiment. The machine is, for example, a processor or a computer.
[0078] An embodiment of the present invention also provides a chip, comprising: a microkernel operating system having a kernel and a bootloader to be upgraded; and the kernel upgrade device or machine-readable storage medium described in the above embodiment, wherein the chip executes instructions stored in the machine-readable storage medium to implement the kernel upgrade method described in the above embodiment.
[0079] The electronic device of the embodiment of the present invention may be a communication device or a power device, wherein the communication device may include, for example, a mobile phone, a foldable electronic device, a tablet computer, a personal computer (PC), a laptop computer, a handheld computer, a notebook computer, an ultramobile personal computer (UMPC), a netbook, a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) device, a virtual reality (VR) device, an artificial intelligence (AI) device, a wearable device, a vehicle-mounted device, a smart home device, a smart city device, or at least one of a server. The power device is, for example, a large number of automated instruments involved in the power collection system. The embodiment of the present invention does not impose any special restrictions on the specific type of the electronic device.
[0080] An embodiment of the present invention further provides a computer program product, which, when executed on a data processing device, is suitable for executing a program that initializes the steps of the kernel upgrade method of the above embodiment as follows.
[0081] Among them, the electronic device, machine storage medium, computer program product or chip provided by the embodiments of the present invention are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above and will not be repeated here.
[0082] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0083] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, 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, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0084] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0085] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0086] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0087] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0088] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0089] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0090] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A kernel upgrade method, characterized in that: The invention is applied to a microkernel operating system having a kernel to be upgraded and a boot loader stored in an on-chip flash, and the kernel upgrade method comprises: The kernel to be upgraded is transferred to an off-chip file system for storage, wherein an upgrade information file and an upgrade confirmation file about the kernel to be upgraded are formed in the file system; and In response to the upgrade trigger, determining whether the kernel to be upgraded has a corresponding confirmed upgrade file, and if so, automatically generating an on-chip upgrade flag located in an on-chip flash, the on-chip upgrade flag being used to indicate whether to upgrade the kernel to be upgraded; and Running the boot loader to detect the on-chip upgrade flag, and judging whether to upgrade the kernel to be upgraded according to the on-chip upgrade flag, and if so, making the boot loader index only the upgrade information file from the file system to perform the kernel upgrade, otherwise skipping the kernel upgrade; The transferring of the kernel to be upgraded to an off-chip file system for storage includes: transferring the kernel to be upgraded to any location of the file system for storage through a debugging serial port supporting shell commands or through an application program APP; and The upgrade is triggered by calling an upgrade application programming interface API through an application APP, or by executing a shell command.
2. The kernel upgrade method according to claim 1, characterized in that: The upgrade information file is used to indicate the storage location, execution start address and file name of the kernel to be upgraded, and the confirmed upgrade file is used to indicate that the kernel to be upgraded is confirmed to be upgraded.
3. The kernel upgrade method according to claim 1 or 2, characterized in that: Performing a kernel upgrade involves: The boot loader copies the kernel to be upgraded in the file system to the on-chip execution area to perform kernel update.
4. A kernel upgrade device, characterized in that: The invention is applied to a microkernel operating system having a kernel to be upgraded and a boot loader stored in an on-chip flash, and the kernel upgrade device comprises: a transmission module, used for transmitting the kernel to be upgraded to an off-chip file system for storage, wherein an upgrade information file and an upgrade confirmation file about the kernel to be upgraded are formed in the file system; and An upgrade module, configured to judge whether the kernel to be upgraded has a corresponding confirmed upgrade file in response to an upgrade trigger, and if so, automatically form an on-chip upgrade flag located in an on-chip flash, the on-chip upgrade flag being used to indicate whether to upgrade the kernel to be upgraded, run the boot loader to detect the on-chip upgrade flag, and judge whether to upgrade the kernel to be upgraded according to the on-chip upgrade flag, and if so, enable the boot loader to only index the upgrade information file from the file system to perform the kernel upgrade, otherwise skip the kernel upgrade; The transmission module transmits the kernel to be upgraded to any location of the file system for storage through a debugging serial port supporting shell commands or through an application program APP; and The upgrade module triggers the upgrade by calling an upgrade application programming interface API through an APP, or triggers the upgrade by executing a shell command.
5. A machine-readable storage medium having instructions stored thereon, the instructions being used to enable a machine to execute the kernel upgrade method described in any one of claims 1 to 3.
6. A chip, characterized in that: The chip includes: a microkernel operating system having a kernel to be upgraded and a boot loader; and the kernel upgrade device described in claim 4 or the machine-readable storage medium described in claim 5, and the chip executes instructions stored in the machine-readable storage medium to implement the kernel upgrade method described in any one of claims 1 to 3.
7. An electronic device, characterized in that: Comprising the chip as claimed in claim 6.
Citation Information
Patent Citations
Processing system and method for embedded device root file system
CN102043652A