Electronic device, multi-operating system running method, apparatus, and storage medium
By introducing multiple operating modes into the processor, the switching and operation of multiple operating systems can be achieved, solving the problem of electronic devices being incompatible with multiple operating systems and improving the processor's task processing efficiency and security.
Patent Information
- Application Number
- CN202310135653.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-13
- Publication Date
- 2026-12-04
- Estimated Expiration
- 2043-02-13
AI Technical Summary
Existing electronic devices, having only a single processor, cannot effectively support multiple operating systems, thus limiting their ability to handle complex tasks.
By introducing multiple operating modes into the processor, including machine mode, supervisor mode and user mode, the switching and running of multiple operating systems can be realized, and the different permissions of the processor can be used to manage the task processing of different operating systems.
It improves the processor's performance, enabling it to leverage the strengths of multiple operating systems to handle corresponding tasks, thereby enhancing task processing efficiency and security.
Smart Images

Figure CN116028126B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and in particular to an electronic device, a method, apparatus and storage medium for operating multiple operating systems. Background Technology
[0002] Electronic devices with only a single processor typically run only one operating system (OS). For example, Linux or a real-time operating system (RTOS) might run on the processor alone.
[0003] The Linux operating system offers strong compatibility with third-party software and provides various functionalities for electronic devices, but its task processing speed is relatively slow. RTOS, on the other hand, features timely responses but has weaker compatibility with third-party software. Therefore, single-processor-based electronic devices are limited in their ability to handle a variety of complex tasks. Summary of the Invention
[0004] In view of the above problems, this disclosure provides an electronic device, a method, apparatus, medium and program product for operating multiple operating systems.
[0005] According to one aspect of this disclosure, an electronic device is provided, comprising: a memory configured to store a first executable file for a first operating system and a second executable file for a second operating system; and a processor configured to: retrieve the first executable file and the second executable file from the memory; switch the processor's operating mode from regulator mode to machine mode in response to receiving a machine mode interrupt signal in regulator mode, wherein in regulator mode, the processor runs the first operating system based on the first executable file; generate instructions for instructing the switching of the first operating system to the second operating system; and, based on the instructions, switch the operating mode from machine mode to regulator mode, wherein in regulator mode, the processor runs the second operating system based on the second executable file.
[0006] According to an embodiment of the present disclosure, the electronic device further includes: a register configured to generate a machine mode interrupt signal at a preset time; wherein, before running the first operating system, the processor sets the preset time in a machine mode operating mode.
[0007] According to embodiments of this disclosure, the processor is further configured to: when running a first operating system, in response to receiving a request to process a first task, switch the running mode from supervisor mode to user mode, wherein the first task is related to the first operating system; and process the first task.
[0008] According to embodiments of this disclosure, the processor is further configured to: switch the operating mode from user mode to supervisor mode upon determining that the first task processing has been completed; and generate a machine mode interrupt signal.
[0009] According to embodiments of this disclosure, the processor is further configured to: when running a first operating system, generate a machine-mode interrupt signal in response to receiving a request to process a second task, the second task being associated with a second operating system.
[0010] According to embodiments of the present disclosure, the processor is further configured to: when running a first operating system, in response to receiving a first interrupt signal, process the first interrupt signal based on the first operating system, wherein the first interrupt signal is a supervisor mode interrupt signal associated with the first operating system.
[0011] According to embodiments of this disclosure, the processor is further configured to: when running a first operating system, generate a machine-mode interrupt signal in response to receiving a second interrupt signal, wherein the second interrupt signal is a regulator-mode interrupt signal associated with the second operating system.
[0012] In another aspect, this disclosure provides a method for running multiple operating systems, including: retrieving a first runtime file and a second runtime file from memory; switching the processor's operating mode from regulator mode to machine mode in response to receiving a machine mode interrupt signal in regulator mode, wherein in regulator mode, the processor runs a first operating system based on the first runtime file; generating instructions to indicate switching the first operating system to a second operating system; and switching the operating mode from machine mode to regulator mode based on the instructions, wherein in regulator mode, the processor runs a second operating system based on the second runtime file.
[0013] In another aspect, this disclosure provides a multi-operating system running apparatus, comprising: an acquisition module for acquiring a first executable file and a second executable file from memory; a first switching module for switching the processor's running mode from supervisor mode to machine mode in response to receiving a machine mode interrupt signal in supervisor mode, wherein in the supervisor mode running mode, the processor runs a first operating system based on the first executable file; a generation module for generating instructions for instructing the switching of the first operating system to a second operating system; and a second switching module for switching the running mode from machine mode to administrator mode based on the instructions, wherein in the supervisor mode running mode, the processor runs a second operating system based on the second executable file.
[0014] In another aspect of this disclosure, an electronic device is provided, comprising: one or more processors; and a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors perform the methods described above.
[0015] In another aspect, this disclosure provides a computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, cause the processor to perform the methods described above.
[0016] In another aspect, this disclosure provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.
[0017] According to embodiments of this disclosure, multiple operating modes of the processor are utilized to enable the operation of multiple operating systems and the switching between multiple operating systems, thereby enabling the processor to take advantage of the operation of multiple operations to process corresponding tasks and improve the processor's operating performance. Attached Figure Description
[0018] The foregoing contents, as well as other objects, features, and advantages of this disclosure, will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:
[0019] Figure 1 A schematic diagram of the structure of an electronic device according to an embodiment of the present disclosure is shown.
[0020] Figure 2 A schematic diagram illustrating the operation of multiple operating systems according to embodiments of the present disclosure is shown.
[0021] Figure 3 A schematic diagram of the structure of an electronic device according to another embodiment of the present disclosure is shown;
[0022] Figure 4 A schematic diagram illustrating an electronic device running multiple operating systems according to another embodiment of the present disclosure is shown.
[0023] Figure 5 A flowchart illustrating a method for operating multiple operating systems according to an embodiment of the present disclosure is shown schematically.
[0024] Figure 6 A schematic block diagram of a multi-operating system operating device according to embodiments of the present disclosure is shown; and
[0025] Figure 7 A block diagram of an electronic device suitable for implementing a multi-operating system operation method according to an embodiment of the present disclosure is shown schematically. Detailed Implementation
[0026] The embodiments of the present disclosure will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the disclosure. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of the present disclosure for ease of explanation. However, it will be apparent that one or more embodiments may be practiced without these specific details. Furthermore, descriptions of well-known structures and techniques are omitted in the following description to avoid unnecessarily obscuring the concepts of the present disclosure.
[0027] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit this disclosure. The terms “comprising,” “including,” etc., as used herein indicate the presence of features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0028] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.
[0029] Figure 1 A schematic diagram of the structure of an electronic device according to an embodiment of the present disclosure is shown.
[0030] like Figure 1 As shown, the electronic device 100 includes a memory 110 and a processor 120.
[0031] In this embodiment of the disclosure, memory 110 stores a first executable file for a first operating system and a second executable file for a second operating system. For example, the first executable file contains data resources required by processor 120 to run the first operating system, and the second executable file contains data resources required by processor 120 to run the second operating system. For example, the first operating system may be a Linux operating system, and the second operating system may be an RTOS.
[0032] In this embodiment of the present disclosure, processor 120 retrieves a first runtime file and a second runtime file from memory 110, and runs a first operating system based on the first runtime file in a supervisor mode. In response to receiving a machine mode interrupt signal in supervisor mode, processor 120 switches its operating mode from supervisor mode to machine mode. In machine mode, processor 120 generates instructions to switch the first operating system to a second operating system, and based on these instructions, switches its operating mode from machine mode to supervisor mode. In supervisor mode, processor 120 runs the second operating system based on the second runtime file.
[0033] For example, memory 110 can be external memory. Processor 120 can be a central processing unit (CPU) under a fifth-generation Reduced Instruction Set Computer V (RISC-V) architecture. When it is determined that electronic device 100 is in an operating state, such as after electronic device 100 is powered on, processor 120 reads a first running file and a second running file from memory 110 and writes the first running file and the second running file into memory.
[0034] In this embodiment, the processor 120 operates in three modes: Machine Mode, Supervisor Mode, and User Mode. For example, Machine Mode has the highest privileges; in Machine Mode, the processor 120 can access any memory and register of the electronic device 120. Supervisor Mode has privileges second only to Machine Mode; in Machine Mode, the processor 120 can handle interrupts and has memory isolation capabilities. User Mode has the lowest privileges; in Machine Mode, the processor 120 has memory isolation capabilities but cannot handle interrupts.
[0035] For example, processor 120 reads the Linux operating system's runtime file from memory and runs the Linux operating system based on the runtime file in supervisor mode. While running the Linux operating system, processor 120 receives a machine mode interrupt signal, switching its running mode from supervisor mode to machine mode. In machine mode, processor 120 processes the machine mode interrupt signal and generates a switch instruction to instruct switching from the Linux operating system to an RTOS. Based on the switch instruction, processor 120 switches its running mode from machine mode to supervisor mode. In supervisor mode, processor 120 can run the RTOS based on its runtime file, thus achieving the switch from the Linux operating system to an RTOS.
[0036] For example, processor 120 can read the RTOS runtime file from memory and run the RTOS based on the runtime file in supervisor mode. While running the RTOS, processor 120 receives a machine mode interrupt signal, switching its running mode from supervisor mode to machine mode. In machine mode, processor 120 processes the machine mode interrupt signal and generates a switch instruction to switch the RTOS to a Linux operating system. Based on the switch instruction, processor 120 switches its running mode from machine mode to supervisor mode. In supervisor mode, processor 120 can run the Linux operating system based on the Linux runtime file, thus achieving the switch from RTOS to Linux.
[0037] In this embodiment of the disclosure, in machine mode, the processor 120 has the authority to process machine mode interrupt signals. For example, machine mode interrupt signals include machine mode software interrupts, machine mode timer interrupts, and machine mode external interrupts. Machine mode software interrupts include interrupts caused by the operation of software in the operating system. Machine mode timer interrupts include interrupt signals generated when an interrupt counter overflows after counting to a certain value under the oscillation of a crystal oscillator. Machine mode external interrupts include interrupt requests from peripherals of the electronic device 100; for example, if the electronic device 100 is a computer, peripherals may include a keyboard, printer, and mouse.
[0038] For example, upon receiving a machine-mode interrupt signal, processor 120 needs to suspend the currently executing task and process the task indicated by the interrupt signal in machine mode. After processing, processor 120 can return to processing the previously suspended task as needed.
[0039] In this embodiment of the disclosure, since the machine mode has the highest operating authority, the processor 120 can manage the running status of multiple operating systems in the machine mode and realize the switching between multiple operating systems.
[0040] For example, in the supervisor mode, when the processor 120 is running the Linux operating system, upon determining that a task with high real-time requirements has been received, the processor 120 can generate a machine mode interrupt signal and switch the operating mode from supervisor mode to machine mode. In machine mode, the processor 120 processes the machine mode interrupt signal and generates a switch instruction to instruct the processor 120 to switch the Linux operating system to an RTOS. Based on the switch instruction, the processor 120 switches the operating mode from machine mode to supervisor mode. In supervisor mode, the processor 120 can run the RTOS based on its runtime files, enabling rapid processing of the task within the RTOS and ensuring real-time processing results.
[0041] In this embodiment of the disclosure, the processor 120 may also, upon receiving a machine mode exception signal, suspend the currently executing task and process the task indicated by the exception signal in machine mode. After processing, the processor 120 may return to processing the previously suspended task as needed. For example, the exception signal originates from within the processor 120's core. For instance, it may be an exception signal generated due to an instruction error or memory access error.
[0042] In this embodiment of the disclosure, when running the first operating system, in response to receiving a request to process a first task, the processor 120 switches its operating mode from supervisor mode to user mode to process the first task. For example, the first task is related to the first operating system.
[0043] For example, in the supervisor mode of operation, when running the Linux operating system, upon receiving an application's execution instruction, the processor 120 switches the operation mode from supervisor mode to user mode based on the execution instruction. In user mode, the processor 120 runs the application.
[0044] Because user mode has the lowest privileges, running applications in user mode can limit the application's running permissions and prevent operating system security issues caused by applications having excessive running privileges.
[0045] According to embodiments of this disclosure, the processor 120 utilizes multiple operating modes to enable the operation of multiple operating systems and the switching between multiple operating systems, thereby enabling the processor 120 to handle corresponding tasks by leveraging the advantages of each operating system and improving its operating performance.
[0046] Figure 2 A schematic diagram illustrating the operation of multiple operating systems according to embodiments of the present disclosure is shown. (In conjunction with...) Figure 1 and Figure 2 This paper provides an illustrative example of an application scenario where an electronic device runs multiple operating systems.
[0047] like Figure 2 As shown, in machine mode, the processor can deploy a context manager. The context manager implements the context management protocol, saving and restoring various global states. In supervisor mode, the processor runs a Linux operating system or an RTOS. In user mode, the processor runs applications running a Linux operating system or an RTOS.
[0048] For example, when running the Linux operating system in supervisor mode, upon receiving a machine mode interrupt signal, the processor 120 switches its operating mode from supervisor mode to machine mode. In machine mode, the processor 120 saves the execution data of the tasks originally being executed in the Linux operating system using the context manager, processes the machine mode interrupt signal, and generates a switch instruction to switch the Linux operating system to an RTOS. Based on the switch instruction, the processor 120 switches its operating mode from machine mode to supervisor mode and runs the RTOS in supervisor mode. After determining that the tasks in the RTOS have been completed, the processor 120 can restore the original running state of the Linux operating system in supervisor mode based on the execution data of the tasks originally being executed in the Linux operating system saved in the context manager.
[0049] In this embodiment of the disclosure, when running the Linux operating system in supervisor mode, upon determining that an application execution instruction has been received, the processor 120 can switch the execution mode from supervisor mode to user mode based on the execution instruction. For example, in user mode, the processor 120 can run the application by creating threads or tasks. The processor 120 can also allocate corresponding memory access permissions for different threads (thread A, thread B, and thread C) or different tasks (task A, task B, and task C), allowing different threads to run different applications by accessing corresponding resources in memory.
[0050] When an application is running in user mode and an interrupt signal is detected, the processor 120 needs to switch operating modes because it does not have the authority to handle interrupts in user mode. If the interrupt signal belongs to supervisor mode, the processor 120 switches from user mode to supervisor mode and handles the interrupt signal in supervisor mode.
[0051] For example, in a Linux operating system, during the execution of application 1 by creating thread A in user mode, if a supervisor mode interrupt signal is determined to be generated, the processor 120 switches from user mode to supervisor mode and handles the interrupt signal in supervisor mode. For example, if the interrupt signal indicates that application 2 should be executed, the processor 120 switches from supervisor mode to user mode and executes application 2 by creating thread B in user mode.
[0052] For example, in an RTOS, during the process of running application 1 by creating task A in user mode, if a supervisor mode interrupt signal is determined to be generated, the processor 120 switches from user mode to supervisor mode and processes the interrupt signal in supervisor mode. For example, if it is determined that the interrupt signal indicates that application 2 should be run, the processor 120 switches from supervisor mode to user mode and runs application 2 by creating task B in user mode.
[0053] According to embodiments of this disclosure, a context manager in machine mode is used to save and restore runtime data of multiple operating systems, ensuring that data from the original operating system is not lost during operating system switching. Furthermore, by configuring different permissions for threads and tasks running in user mode, the execution permissions of applications are restricted, preventing runtime security issues from occurring in the operating system.
[0054] Figure 3 A schematic diagram of the structure of an electronic device according to another embodiment of the present disclosure is shown.
[0055] like Figure 3 As shown, the electronic device 300 includes a memory 310, a processor 320, and a register 330. In this embodiment, the memory 310 and processor 320 are similar to the memory 110 and processor 120 described in the preceding embodiments, respectively. For the sake of brevity, further details are omitted here.
[0056] In this embodiment, register 330 can be an interrupt counter. Register 330 can generate a machine mode interrupt signal at a preset time. For example, register 330 generates a machine mode interrupt signal at a preset time according to a preset counting period. Before running the first operating system, processor 320 can set the preset time for register 330 in machine mode. For example, after electronic device 300 is powered on, in machine mode, processor 320 initializes register 330 and sets the counting period. For example, the interrupt counter is set to generate a machine mode interrupt signal after counting 1000 times.
[0057] By setting the timing for generating a machine-mode interrupt signal in register 330, the operating system can be switched at specific times, thereby enabling the execution of different tasks within a specific time period. For example, by setting the timing for generating a machine-mode interrupt signal in register 330, electronic device 300 can run a Linux operating system during idle periods and an RTOS during busy periods. This allows electronic device 300 to perform complex tasks using the Linux operating system during idle periods and to quickly execute more tasks using the RTOS during busy periods, thus improving the operating performance of electronic device 300.
[0058] In this embodiment of the disclosure, register 330 may further include a set of control and status registers (CSRs). Electronic device 300 processes interrupt signals through CSRs.
[0059] For example, CSRs include, but are not limited to, the Machine Exception Cause (mcause) register, the Machine Trap Vector Base-Address (mtvec) register, the Machine Exception Program Counter (mepc) register, the Machine Interrupt Enable (mie) register, the Machine Trap Value (mtval) register, and the Machine Status (mstatus) register.
[0060] For example, when processor 320 receives an interrupt signal, if it determines that the current operating mode has been saved to the mstatus register, it should switch the operating mode to machine mode. It saves the code corresponding to the source of the interrupt signal to the mcause register and saves the relevant additional information about the interrupt signal to the mtval register. It saves the PC value of the task being processed before the interrupt signal occurred to the mepc register and sets the PC value to the entry address of the mtvec register. After the task corresponding to the interrupt signal is completed, it restores the mstatus register to its state before the interrupt signal occurred. It retrieves the PC value from the mepc register and returns to the address corresponding to that PC value, thus restoring processor 320 to its operating state before the interrupt occurred.
[0061] Figure 4 A schematic diagram illustrating an electronic device running multiple operating systems according to another embodiment of the present disclosure is shown.
[0062] like Figure 4 As shown, in machine mode, the processor can deploy a context manager. The context manager implements the context management protocol, saving and restoring various global states. In supervisor mode, the processor runs a Linux operating system or an RTOS. In user mode, the processor runs applications running a Linux operating system or an RTOS.
[0063] In this embodiment of the disclosure, when it is determined that the first task in the first operating system has been completed, the processor switches the running mode from user mode to supervisor mode and generates a machine mode interrupt signal.
[0064] For example, when running the Linux operating system in supervisor mode, upon receiving a task to run application 1, the processor switches from supervisor mode to user mode, where application 1 runs using thread A. Upon determining that the task for running application 1 has been completed, the processor can switch the running mode from user mode back to supervisor mode and generate a machine mode interrupt signal. Based on the machine mode interrupt signal, the processor switches the running mode from supervisor mode back to machine mode. In machine mode, the processor processes the machine mode interrupt signal and generates a switch instruction indicating that the Linux operating system should be switched to an RTOS. Based on the switch instruction, the processor switches the running mode from machine mode back to supervisor mode and runs the RTOS in supervisor mode.
[0065] When a task in one operating system is completed, the processor generates an interrupt signal, which can promptly switch to another operating system to handle the tasks running in that operating system, thereby improving the processor's task processing efficiency.
[0066] In this embodiment of the disclosure, when the processor is running the first operating system, it generates a machine mode interrupt signal in response to receiving a request to process a second task, the second task being related to the second operating system.
[0067] For example, when running the Linux operating system in supervisor mode, upon receiving a task to run application 1 in the RTOS, the processor generates a machine mode interrupt signal. Based on the machine mode interrupt signal, the processor switches its operating mode from supervisor mode to machine mode. In machine mode, the processor processes the machine mode interrupt signal and generates a switch instruction to instruct the processor to switch the Linux operating system to the RTOS. Based on the switch instruction, the processor switches its operating mode from machine mode to supervisor mode and runs the RTOS in supervisor mode. The processor then switches from supervisor mode to user mode, where it runs application 1 using task A.
[0068] By utilizing different operating systems to handle specific tasks according to their requirements, the unique characteristics of each operating system can be fully leveraged to optimize task execution. Furthermore, using multiple operating systems to handle different tasks reduces the workload on each system and improves the processor's task processing efficiency.
[0069] In this embodiment of the disclosure, when the processor is running the first operating system, in response to receiving a first interrupt signal, the processor processes the first interrupt signal based on the first operating system. The first interrupt signal is a supervisor mode interrupt signal associated with the first operating system.
[0070] For example, when running a Linux operating system in supervisor mode, if the processor determines that a supervisor mode interrupt signal has been received from the Linux operating system, it can process the supervisor mode interrupt signal using supervisor mode CSRs. Similarly, when running an RTOS operating system in supervisor mode, if the processor determines that a supervisor mode interrupt signal has been received from the RTOS operating system, it can process the supervisor mode interrupt signal using supervisor mode CSRs.
[0071] In Supervisor mode, the processor has interrupt handling privileges. Therefore, when an interrupt signal belonging to the currently running operating system and originating in Supervisor mode is generated during the operation of the operating system, the processor can handle the interrupt signal in Supervisor mode. For example, the processor can delegate the handling of interrupt signals generated in Supervisor mode to Supervisor mode through an exception delegation mechanism.
[0072] In this embodiment of the disclosure, when the first operating system is running, in response to receiving a second interrupt signal, the processor generates a machine mode interrupt signal, wherein the second interrupt signal is a supervisor mode interrupt signal associated with the second operating system.
[0073] For example, when running the Linux operating system in supervisor mode, upon receiving a supervisor mode interrupt signal from the RTOS, the processor generates a machine mode interrupt signal. Based on the machine mode interrupt signal, the processor switches its operating mode from supervisor mode to machine mode. In machine mode, the processor processes the machine mode interrupt signal and generates a switch instruction to instruct the processor to switch the Linux operating system to the RTOS. Based on the switch instruction, the processor switches its operating mode from machine mode to supervisor mode, runs the RTOS in supervisor mode, and processes the supervisor mode interrupt signal.
[0074] In this embodiment of the disclosure, when running the Linux operating system in supervisor mode, if a supervisor mode interrupt signal from the RTOS is received, the processor may temporarily not switch the Linux operating system to the RTOS. For example, if it is determined that the priority of the supervisor mode interrupt signal from the RTOS is lower than that of the current task being processed in the Linux operating system, the current task can continue to be processed in the Linux operating system. After the current task is determined to be completed, the task processing order is determined according to the priority between the next task and the supervisor mode interrupt signal. As another example, if it is determined that the supervisor mode interrupt signal from the RTOS can be processed in the Linux operating system, the supervisor mode interrupt signal can continue to be processed in the Linux operating system.
[0075] According to the embodiments of this disclosure, the corresponding tasks are processed by utilizing the operating characteristics of different operating modes of the processor, giving full play to the task processing capabilities of different operating modes, reducing the number of times the processor switches the operating system during task processing, and improving the task processing efficiency of the processor.
[0076] Figure 5 A flowchart illustrating a method for operating multiple operating systems according to an embodiment of the present disclosure is shown schematically.
[0077] like Figure 5 As shown, the multi-operating system operation method of this embodiment includes operations S510 to S540.
[0078] When operating S510, obtain the first and second executable files.
[0079] When operating S520, in response to receiving a machine mode interrupt signal in supervisor mode, the processor's operating mode is switched from supervisor mode to machine mode, wherein in supervisor mode, the processor runs a first operating system based on a first runtime file.
[0080] During operation of S530, instructions are generated to instruct the switching of the first operating system to the second operating system.
[0081] When operating the S540, the running mode is switched from machine mode to administrator mode based on instructions. In the administrator mode, the processor runs a second operating system based on a second runtime file.
[0082] In this embodiment, operations S510 to S540 are executed by the processor 120 in the previous embodiment, and the operations executed by the processor 120 are corresponding to those executed by the processor 120, which will not be described again here for the sake of simplicity.
[0083] Based on the above-described multi-operating system operation method, this disclosure also provides a multi-operating system operation device. The following will be combined with... Figure 6 The device is described in detail. Figure 6 A schematic block diagram of a device for operating a multi-operating system according to an embodiment of the present disclosure is shown.
[0084] like Figure 6 As shown, the multi-operating system running device 600 of this embodiment includes an acquisition module 610, a first switching module 620, a generation module 630, and a second switching module 640.
[0085] The acquisition module 610 is used to acquire the first running file and the second running file. In one embodiment, the acquisition module 610 can be used to perform the operation S510 described above, which will not be repeated here.
[0086] The first switching module 620 is used to switch the processor's operating mode from regulator mode to machine mode in response to receiving a machine mode interrupt signal in regulator mode. In regulator mode, the processor runs a first operating system based on a first executable file. In one embodiment, the first switching module 620 can be used to execute the operation S520 described above, which will not be repeated here.
[0087] The generation module 630 is used to generate instructions for instructing the switching of the first operating system to the second operating system. In one embodiment, the generation module 630 may be used to perform the operation S530 described above, which will not be repeated here.
[0088] The second switching module 640 is used to switch the operating mode from machine mode to administrator mode based on instructions. In the administrator mode, the processor runs a second operating system based on a second executable file. In one embodiment, the second switching module 640 can be used to execute the operation S540 described above, which will not be repeated here.
[0089] According to embodiments of this disclosure, the acquisition module 610, the first switching module 620, the generation module 630, and the second switching module 640 may be located in, for example, the processor 120 in the embodiments described above. Any plurality of modules among the acquisition module 610, the first switching module 620, the generation module 630, and the second switching module 640 may be implemented in a single module, or any one of these modules may be split into multiple modules. Alternatively, at least some of the functionality of one or more of these modules may be combined with at least some of the functionality of other modules and implemented in a single module. According to embodiments of this disclosure, at least one of the acquisition module 610, the first switching module 620, the generation module 630, and the second switching module 640 may be at least partially implemented as hardware circuitry, such as a field-programmable gate array (FPGA), a programmable logic array (PLA), a system-on-a-chip, a system-on-a-substrate, a system-on-package, an application-specific integrated circuit (ASIC), or implemented in hardware or firmware by any other reasonable means of integrating or packaging circuitry, or implemented in any one of software, hardware, and firmware methods, or in a suitable combination of any of these methods. Alternatively, at least one of the acquisition module 610, the first switching module 620, the generation module 630, and the second switching module 640 can be at least partially implemented as a computer program module, which can perform corresponding functions when the computer program module is run.
[0090] Figure 7 A block diagram schematically illustrates an electronic device suitable for implementing a multi-operating system operation method according to an embodiment of the present disclosure.
[0091] like Figure 7 As shown, an electronic device 700 according to an embodiment of the present disclosure includes a processor 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage portion 708 into a random access memory (RAM) 703. The processor 701 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 701 may also include onboard memory for caching purposes. The processor 701 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.
[0092] RAM 703 stores various programs and data required for the operation of electronic device 700. Processor 701, ROM 702, and RAM 703 are interconnected via bus 704. Processor 701 performs various operations of the method flow according to embodiments of the present disclosure by executing programs in ROM 702 and / or RAM 703. It should be noted that the programs may also be stored in one or more memories other than ROM 702 and RAM 703. Processor 701 may also perform various operations of the method flow according to embodiments of the present disclosure by executing programs stored in said one or more memories.
[0093] According to embodiments of this disclosure, the electronic device 700 may further include an input / output (I / O) interface 705, which is also connected to a bus 704. The electronic device 700 may also include one or more of the following components connected to the I / O interface 705: an input section 706 including a keyboard, mouse, etc.; an output section 707 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 710 as needed so that computer programs read from it can be installed into the storage section 708 as needed.
[0094] This disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs that, when executed, implement the method according to the embodiments of this disclosure.
[0095] According to embodiments of this disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, such as, but not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this disclosure, the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to embodiments of this disclosure, the computer-readable storage medium may include ROM 702 and / or RAM 703 and / or one or more memories other than ROM 702 and RAM 703 described above.
[0096] Embodiments of this disclosure also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. When the computer program product is run on a computer system, the program code enables the computer system to implement the multi-operating system operation method provided in embodiments of this disclosure.
[0097] When the computer program is executed by the processor 701, it performs the functions defined in the system / apparatus of this disclosure embodiments. According to embodiments of this disclosure, the systems, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0098] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and may be downloaded and installed via the communication section 709, and / or installed from a removable medium 711. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.
[0099] In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 709, and / or installed from the removable medium 711. When the computer program is executed by the processor 701, it performs the functions defined in the system of this disclosure embodiment. According to embodiments of this disclosure, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0100] According to embodiments of this disclosure, program code for executing the computer programs provided in embodiments of this disclosure can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, languages such as Java, C++, Python, "C", or similar programming languages. The program code can execute entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0101] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0102] Those skilled in the art will understand that the features described in the various embodiments and / or claims of this disclosure can be combined or combined in various ways, even if such combinations or combinations are not explicitly described in this disclosure. In particular, the features described in the various embodiments and / or claims of this disclosure can be combined or combined in various ways without departing from the spirit and teachings of this disclosure. All such combinations and / or combinations fall within the scope of this disclosure.
[0103] The embodiments of this disclosure have been described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of this disclosure. Although various embodiments have been described above, this does not mean that the measures in the various embodiments cannot be used advantageously in combination. The scope of this disclosure is defined by the appended claims and their equivalents. Various substitutions and modifications can be made by those skilled in the art without departing from the scope of this disclosure, and all such substitutions and modifications should fall within the scope of this disclosure.
Citation Information
Patent Citations
Interrupt isolation method, interrupt controller, system on chip and electronic equipment
CN114741176A
Operating system starting and deploying method and device, equipment, medium and program product
CN115220797A
