WO2011076089A1 - 在嵌入式系统中操作系统的管理方法及装置 - Google Patents

在嵌入式系统中操作系统的管理方法及装置 Download PDF

Info

Publication number
WO2011076089A1
WO2011076089A1 PCT/CN2010/079971 CN2010079971W WO2011076089A1 WO 2011076089 A1 WO2011076089 A1 WO 2011076089A1 CN 2010079971 W CN2010079971 W CN 2010079971W WO 2011076089 A1 WO2011076089 A1 WO 2011076089A1
Authority
WO
WIPO (PCT)
Prior art keywords
operating system
instruction
currently running
switching
interrupt
Prior art date
Application number
PCT/CN2010/079971
Other languages
English (en)
French (fr)
Inventor
张建春
Original Assignee
华为终端有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为终端有限公司 filed Critical 华为终端有限公司
Priority to EP10838652A priority Critical patent/EP2492810A4/en
Priority to JP2012543460A priority patent/JP2013515293A/ja
Publication of WO2011076089A1 publication Critical patent/WO2011076089A1/zh
Priority to US13/493,296 priority patent/US20120246370A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4812Task transfer initiation or dispatching by interrupt, e.g. masked
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors

Definitions

  • the present invention relates to the field of mobile communications, and in particular, to a management method and apparatus for an operating system in an embedded system.
  • BACKGROUND In an embedded system, it is usually required to run multiple operating systems by using multiple CPUs (Central Processing Units). For example, most smartphone platforms use a dual CPU solution to run dual operating systems. One of the CPUs runs the smartphone operating system for interaction with the user; the other CPU runs the MODEM (MOdulator/DEModulator) operating system, which is used to provide users with MODEM features, such as wireless. Protocol stack function.
  • CPUs Central Processing Units
  • MODEM MODEM/DEModulator
  • the cost of the embedded system is generally higher.
  • the cost and complexity of the system are reduced by running a dual operating system on a single CPU, such as reducing a set of CPU, FLASH, and SDRAM; reducing the complexity of the dual-core bus interface; and reducing software complexity.
  • Virtualization technology is achieved by implementing multiple virtual machines on a single CPU, and the operating system runs on the virtual machine.
  • each virtual machine is a logical CPU that can run multiple systems on a single CPU.
  • Embodiments of the present invention provide a management method and apparatus for an operating system in an embedded system, which implements running multiple operating systems on a single CPU with less performance loss and lower product complexity.
  • the embodiment of the present invention adopts the following technical solutions:
  • a system switching device includes:
  • a receiving unit configured to receive an interrupt instruction
  • a switching unit configured to switch the currently running operating system to a target operating system corresponding to the interrupt instruction.
  • the system switching device when multiple operating systems are run on a single CPU, the system switching device uniformly receives an interrupt instruction, and needs to perform an operating system switch according to different interrupt instructions.
  • the system switching device saves the currently running operating system state and then switches to the target operating system corresponding to the interrupt instruction.
  • the switched target operating system runs directly on the real physical CPU, which not only realizes switching between multiple operating systems on a single CPU, but also avoids implementing the virtual machine by using a virtual machine to simulate the CPU in the prior art. CPU performance loss when running multiple operating systems on the CPU.
  • FIG. 1 is a flowchart of a management method of an operating system in an embedded system in Embodiment 1;
  • Embodiment 2 is a structural block diagram of a system switching device in Embodiment 1;
  • Embodiment 3 is a flow chart of a management method of an operating system in an embedded system in Embodiment 2;
  • Fig. 4 is a block diagram showing the structure of a system switching device in the second embodiment.
  • the technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. example. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
  • An embodiment of the present invention provides a management method of an operating system in an embedded system, where the embedded system includes at least two operating systems, and the at least two operating systems are run on a single CPU, as shown in FIG. , the method includes the following steps:
  • the system switching device receives an interrupt instruction. Since the at least two operating systems are run on a single CPU, the system switching device calls the interrupt processing program of the operating system to process the interrupt instruction by uniformly accepting all or part of the interrupt processing program of the operating system. Instead of the interrupt handler being called directly by the operating system. When an interrupt instruction arrives, the interrupt instruction is uniformly received by the system switching device instead of being received by the currently running operating system, thereby avoiding that the received interrupt instruction cannot be executed under the currently running operating system. Dealing with the problem.
  • the system switching device After receiving the interrupt instruction, the system switching device saves the currently running operating system state when it is determined that the operating system is required to be switched according to the interrupt instruction. Since the interrupt instruction includes a corresponding target operating system identifier, different interrupt instructions are processed corresponding to different operating systems, and the identifier may be determined by determining It is determined by which operating system the interrupt instruction is executed. Then save the currently running operating system state, and it is convenient and quick to restore to the operating system before the switching when it is necessary to restore the currently running operating system.
  • the system switching device switches the currently running operating system to a target operating system corresponding to the interrupt instruction. Different interrupt instructions are processed corresponding to different operating systems. When the received interrupt instruction is not corresponding to the currently running operating system, the system switching device can conveniently switch to the target operating system corresponding to the received interrupt instruction. , ensuring that the received interrupt instruction is processed by the correct operating system. After the switching of the system switching device, the operating system before the switching is saved, temporarily suspended, and the target operating system after the switching is directly run on a single CPU, which solves the CPU performance loss caused by the virtual machine simulation. . In addition, since the above method has small modifications to the plurality of operating systems, the workload for maintaining the plurality of operating systems is greatly reduced, and the complexity of the post-maintenance work of the embedded system is reduced.
  • an embodiment of the present invention further provides a system switching apparatus.
  • the apparatus includes: a receiving unit 21, a saving unit 22, and a switching unit 23.
  • the receiving unit 21 is configured to receive an interrupt instruction. Different interrupt instructions correspond to different operating systems.
  • the saving unit 22 is configured to save the currently running operating system state.
  • the saving unit 22 saves the currently running operating system state, and can conveniently and quickly restore to the operating system before the switching when it is necessary to restore the currently running operating system.
  • the switching unit 23 is configured to switch the currently running operating system to the target operating system corresponding to the interrupt instruction.
  • the target operating system switched by the switching unit 23 will run directly on a single CPU. This enables multiple operating systems to run on a single CPU with less performance loss and lower product complexity.
  • the embedded system includes at least two operating systems.
  • This embodiment assumes that the application scenario is that a single CPU runs dual operating systems on the smart phone platform, one of which is an application operating system running the application, and the other is another A MODEM operating system that provides wireless protocol stack functionality.
  • the interrupt instruction may be a first instruction sent by the operating system or a second instruction sent by the operating system.
  • the interrupt instruction when the interrupt instruction is the first instruction sent by the operating system externally,
  • the example details the management method of the operating system in the embedded system. As shown in FIG. 3, the method includes the following steps:
  • the system switching device when an operation command comes, the system switching device uniformly receives the operation instruction, and determines the operation Whether the instruction is an interrupt instruction. Receiving the operation instruction uniformly by the system switching device can avoid the problem that the processing operation cannot be processed when the received operation instruction cannot be executed under the currently running operating system.
  • the operation instruction when it is determined that the operation instruction is not an interrupt instruction, it indicates that the currently running operating system directly executes the operation instruction. For example, when the operation instruction is assumed to be a user's key instruction, after the currently running application operating system receives the user's key instruction, since the user key instruction is executed by the application operating system, there is no need to switch the operating system at this time.
  • the user button instruction may be directly executed by the currently running application operating system.
  • the operation instruction is an interrupt instruction
  • the first instruction may be a user key instruction executed under an application operating system or a download instruction, a call connection request instruction, or the like executed under the MODEM operating system.
  • the interrupt instruction is from a first instruction external to the currently running operating system
  • the received first instruction is an instruction to perform a download task
  • the operating system is assumed to be
  • the operating system since the received first instruction is an instruction to execute a download task, the first instruction needs to be executed under the MODEM operating system, and then the operating system needs to be switched.
  • the system switching device saves the currently running operating system state before performing the switching of the operating system.
  • the system switching device switches the currently running application operating system to a MODEM operating system that executes the first instruction.
  • the system switching apparatus instructs the switched MODEM operating system to execute the first instruction.
  • the MODEM operating system executes the downloaded instruction by calling an interrupt handler.
  • the operation instruction is an interrupt instruction
  • determine that the interrupt instruction is not from the first instruction external to the currently running operating system
  • the second instruction of the operating system for switching the operating system. Since the interrupt instruction can also be sent to the operating system
  • the second instruction such as: when the currently running operating system wants to give up the control of the CPU, the active switching between the operating systems is implemented through a switching interface.
  • the second instruction implements a function of switching to a target operating system corresponding to the second instruction. If the currently running application operating system wants to switch directly to the MODEM operating system.
  • the currently running operating system state is saved.
  • the system switching device switches the currently running operating system to a target operating system corresponding to the interrupt instruction.
  • the operating system before the switching is saved and temporarily suspended, and the target operating system after switching is directly run on a single CPU, which solves the CPU performance loss caused by virtual machine simulation.
  • the modification of the multiple operating systems is small, the workload of maintaining the multiple operating systems is greatly reduced, and the complexity of the post-maintenance work of the embedded system is reduced, and the implementation is realized. Run multiple operating systems on a single CPU with less performance loss and lower product complexity.
  • the embodiment of the present invention further provides a system switching apparatus.
  • the apparatus includes: a receiving unit 41, a determining unit 42, a saving unit 43, a switching unit 44, a first indicating unit 45, and a second indicating unit 46.
  • the receiving unit 41 is configured to uniformly receive the operation instruction when an operation instruction comes.
  • the system switching device uniformly receives the operation instruction instead of receiving it through the currently running operating system, thereby avoiding the problem that the received operation instruction cannot be processed when it cannot be executed under the currently running operating system.
  • the determining unit 42 is used to determine whether the operation instruction received by the receiving unit 41 is an interrupt instruction.
  • the second indication unit 46 is configured to instruct the currently operating operating system to directly execute the operation instruction.
  • the determining unit 42 determines that the operation instruction is an interrupt instruction
  • the determining unit 42 is further configured to determine whether the interrupt instruction is a first instruction from outside the currently running operating system.
  • the saving unit 43 is configured to save the currently running operating system state. In order to facilitate the quick recovery to the operating system before the switching when it is necessary to restore the currently running operating system.
  • the switching unit 44 is configured to switch the currently running operating system to a target operating system that executes the first instruction.
  • the first indication unit 45 is configured to instruct the target operating system after the switching to execute the first instruction.
  • the receiving unit 41 is further configured to receive a third instruction, where the third instruction is used to switch back from the target operating system to the currently running operation, when the target operating system after the switching is executed. system.
  • the switching unit 44 is further configured to switch the target operating system back to the currently running operating system according to the third instruction and the saved current running operating system state. Not only can the current operating system be switched to the target operating system, but also the operating system running above is quickly switched when the operating system before the switching needs to be restored.
  • the operation instruction may also be a second instruction sent by the current operating system, for example, when the currently running operating system wants to voluntarily give up the control of the CPU, the active switching between the operating systems is implemented through a switching interface, then the judgment is performed.
  • the unit 42 determines that the operation instruction is an interrupt instruction
  • the determining unit 42 is further configured to determine whether the interrupt instruction is a second instruction for switching the operating system sent by the currently running operating system.
  • the saving unit 43 is further configured to save the currently running operating system state when the interrupt instruction is a second instruction sent by the currently operating operating system for switching the operating system.
  • the switching unit 44 is further configured to switch the currently running operating system to a target operating system indicated by the second instruction. This achieves the goal of running multiple operating systems on a single CPU.
  • the system switching apparatus may be used for a mobile terminal that includes an operating system in an embedded system, and at least two operating systems in the mobile terminal are configured to perform switching on a single CPU, where the mobile terminal may It is a smart mobile phone, personal digital assistant PDA, etc.
  • the embodiments of the present invention are mainly applied to the field of mobile communications, and realize a single CPU running multiple operating systems in an embedded system with less performance loss and lower product complexity.
  • the present invention can be implemented by means of software plus necessary general hardware, and of course, by hardware, but in many cases, the former is a better implementation. .
  • the technical solution of the present invention which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a readable storage medium, such as a floppy disk of a computer.
  • a hard disk or optical disk or the like includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform the methods described in various embodiments of the present invention.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Hardware Redundancy (AREA)

Description

在嵌入式系统中操作系统的管理方法及装置 本申请要求于 2009年 12月 24日提交中国专利局、 申请号为 200910261692. 4、 发明 名称为 "在嵌入式系统中操作系统的管理方法及装置" 的中国专利申请的优先权, 其全部 内容通过引用结合在本申请中。 技术领域 本发明涉及移动通信领域, 尤其涉及一种在嵌入式系统中操作系统的管理方法及装 置。
背景技术 在嵌入式系统中通常需要借助多个 CPU ( Central Processing Unit, 中央处理器) 来实现运行多个操作系统。如:大部分智能手机平台采用双 CPU的方案来运行双操作系统。 其中一个 CPU运行智能手机操作系统, 用于实现与用户之间的交互; 另外一个 CPU运行 MODEM (MOdulator/DEModulator, 调制器 /解调器) 操作系统, 用于给用户提供 MODEM特 性功能, 如无线协议栈功能。
在嵌入式系统中采用双 CPU运行双操作系统时, 该嵌入式系统的成本一般较高。 现 有技术中通过采用在单 CPU 上运行双操作系统来降低系统的成本和复杂度, 如减少一套 CPU, FLASH, SDRAM; 降低双核总线接口复杂度; 降低软件复杂度。
现有技术通常采用以下方案在嵌入式系统中实现单 CPU运行多操作系统:
一、 采用虚拟 CPU技术。 虚拟化技术是通过在单 CPU上实现多个虚拟机, 操作系统 运行在虚拟机上。对于操作系统而言, 每个虚拟机就是一个逻辑的 CPU, 从而可以在单 CPU 上运行多系统。
然而, 采用虚拟化技术需要在物理 CPU上增加一层虚拟机并对其进行解析, 因此会 造成比较大的 CPU性能损失。
二、 通过将操作系统移植到同一个微内核上, 可以实现在单 CPU上运行多操作系统, 移植后的操作系统提供和原操作系统相同的接口功能。
采用该方案, 需要将操作系统在新的微内核上重新移植一遍, 通常工作量是比较巨 大的, 而且由于第三方发布操作系统的升级版本时, 都只能提供在原操作系统上的版本, 因此每次移植后的操作系统需要升级时都要通过将升级版本的操作系统重新进行一遍移 植, 导致该嵌入式系统的后期维护工作的复杂度较高, 移植工作需要持续进行, 工作量的 花费不能控制。 发明内容 本发明的实施例提供一种在嵌入式系统中操作系统的管理方法及装置, 以较少的性能 损失和较低的产品复杂度在单 CPU上实现了运行多操作系统。 为达到上述目的, 本发明的实施例采用如下技术方案:
一种在嵌入式系统中操作系统的管理方法, 该嵌入式系统中包括至少两个操作系统, 所述方法包括:
接收中断指令;
保存当前运行的操作系统状态;
将所述当前运行的操作系统切换到所述中断指令对应的目标操作系统。
一种系统切换装置, 包括:
接收单元, 用于接收中断指令;
保存单元, 用于保存当前运行的操作系统状态;
切换单元, 用于将所述当前运行的操作系统切换到所述中断指令对应的目标操作系 统。
由上述技术方案所描述的本发明实施例, 在所述嵌入式系统中, 当在单 CPU上运行多 操作系统时, 系统切换装置统一接收中断指令, 根据中断指令的不同在需要进行操作系统 切换时, 所述系统切换装置将当前运行的操作系统状态进行保存, 然后切换到所述中断指 令对应的目标操作系统。 所述切换后的目标操作系统直接运行在真正的物理 CPU上, 不仅 实现了在单 CPU上多个操作系统之间的切换,也避免了现有技术中通过采用虚拟机模拟 CPU 来实现在单 CPU上运行多操作系统时带来的 CPU性能损失。 同时由于上述技术方案中对所 述多个操作系统的修改很小, 使得维护所述多个操作系统的工作量大为减少, 从而也解决 了现有技术中采用将操作系统移植到同一个微内核上而导致的所述嵌入式系统的后期维 护工作的复杂度较高的问题, 实现了以较少的性能损失和较低的产品复杂度在单 CPU上运 行多操作系统。 附图说明 图 1为实施例 1中在嵌入式系统中操作系统的管理方法流程图;
图 2为实施例 1中系统切换装置的结构框图;
图 3为实施例 2中在嵌入式系统中操作系统的管理方法流程图;
图 4为实施例 2中系统切换装置的结构框图。 具体实施方式 下面将结合本发明实施例中的附图, 对本发明实施例中的技术方案进行清楚、 完整地 描述, 显然, 所描述的实施例仅仅是本发明一部分实施例, 而不是全部的实施例。 基于本 发明中的实施例, 本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实 施例, 都属于本发明保护的范围。
实施例 1 :
本发明的实施例提供一种在嵌入式系统中操作系统的管理方法, 所述嵌入式系统中包 括至少两个操作系统, 在单 CPU上运行所述至少两个操作系统, 如图 1所示, 该方法包括 如下步骤:
101、 系统切换装置接收中断指令。 由于在单 CPU上运行所述至少两个操作系统, 所 述系统切换装置通过统一接管上述操作系统的全部或部分中断处理程序, 由系统切换装置 调用操作系统的中断处理程序来处理所述中断指令, 而不是由操作系统来直接调用中断处 理程序。 当有中断指令来到时, 通过系统切换装置统一接收中断指令, 而不是通过当前运 行的操作系统来接收, 避免了当所述接收到的中断指令不能在当前运行的操作系统下执行 时而无法进行处理的问题。
102、 所述系统切换装置在接收到所述中断指令之后, 根据所述中断指令判断到需要 进行操作系统切换时, 保存当前运行的操作系统状态。 由于所述中断指令中包含对应的目 标操作系统标识, 不同的中断指令对应不同的操作系统来处理, 通过判断该标识可以是确 定所述中断指令是由哪个操作系统来具体执行。 然后将当前运行的操作系统状态保存起 来,可以在需要恢复当前运行的操作系统时,方便快速地恢复到所述切换之前的操作系统。
103、 所述系统切换装置将所述当前运行的操作系统切换到所述中断指令对应的目标 操作系统。 不同的中断指令对应不同的操作系统来处理, 当所述接收到的中断指令不是对 应当前运行的操作系统时, 通过系统切换装置可以方便的切换到所述接收到的中断指令对 应的目标操作系统, 保证所述接收到的中断指令由正确的操作系统来处理。 经过系统切换 装置的切换, 所述切换前的操作系统被保存起来, 暂时处于挂起状态, 而切换后的目标操 作系统将直接运行在单 CPU上, 解决了通过虚拟机模拟造成的 CPU性能损失。 此外, 由于 上述方法对所述多个操作系统的修改很小, 从而使得维护所述多个操作系统的工作量大为 减少, 降低了所述嵌入式系统的后期维护工作的复杂度。
为了实现上述方法, 本发明实施例还提供一种系统切换装置, 如图 2所示, 该装置包 括: 接收单元 21、 保存单元 22和切换单元 23。
其中, 所述接收单元 21 用于接收中断指令。 不同的中断指令对应不同的操作系统, 当所述接收单元 21接收到的中断指令不是对应于当前运行的操作系统时, 保存单元 22用 于保存当前运行的操作系统状态。 所述保存单元 22将当前运行的操作系统状态保存起来, 可以在需要恢复当前运行的操作系统时, 方便快速地恢复到所述切换之前的操作系统。 然 后, 切换单元 23 用于将所述当前运行的操作系统切换到所述中断指令对应的目标操作系 统。 通过所述切换单元 23切换后的目标操作系统将直接运行在单 CPU上。 从而实现了以 较少的性能损失和较低的产品复杂度在单 CPU上运行多操作系统。
实施例 2:
由实施例 1可知, 所述嵌入式系统中包括至少两个操作系统, 本实施例假设应用场景 为智能手机平台上单 CPU运行双操作系统, 其中一个为运行应用程序的应用操作系统, 另 一个为提供无线协议栈功能的 MODEM操作系统。 根据中断指令的来源不同, 所述中断指令 可以为操作系统外部发送的第一指令或者为操作系统发送的第二指令, 本实施例以所述中 断指令为操作系统外部发送的第一指令时为例详细介绍在嵌入式系统中操作系统的管理 方法, 如图 3所示, 该方法包括如下步骤:
301、 当有操作指令来到时, 由系统切换装置统一接收所述操作指令, 并判断所述操 作指令是否为中断指令。 由系统切换装置统一接收所述操作指令可以避免当所述接收到的 操作指令不能在当前运行的操作系统下执行时而无法进行处理的问题。
然后在判断到所述操作指令不是中断指令时, 指示当前运行的操作系统直接执行所述 操作指令。 如: 所述操作指令假设为用户的按键指令时, 当前正在运行的应用操作系统接 收到用户的按键指令后, 由于所述用户按键指令是由应用操作系统执行的, 此时不需要切 换操作系统, 直接由所述当前运行的应用操作系统执行所述用户按键指令即可。
302、 当判断到所述操作指令为中断指令时, 进一步判断所述中断指令是否为来自当 前运行的操作系统外部的第一指令。 所述第一指令可以为在应用操作系统下执行的用户按 键指令或者在 MODEM操作系统下执行的下载指令、 呼叫连接请求指令等。
303、 当判断到所述中断指令来自所述当前运行的操作系统外部的第一指令时, 如, 所述接收到的第一指令为执行下载任务的指令, 假设所述当前运行的操作系统为应用操作 系统时, 由于所述接收到的第一指令为执行下载任务的指令, 该第一指令需要在 MODEM操 作系统下执行, 此时就需要进行操作系统的切换。 在执行切换操作系统之前, 所述系统切 换装置保存所述当前运行的操作系统状态。
将当前运行的操作系统状态保存起来, 可以在需要恢复当前运行的操作系统时, 方便 快速地恢复到所述切换之前的操作系统。
304、 所述系统切换装置将所述当前运行的应用操作系统切换到执行所述第一指令的 MODEM操作系统。
305、 切换到 MODEM操作系统之后, 所述系统切换装置指示所述切换后的 MODEM操作 系统执行所述第一指令。 所述 MODEM操作系统通过调用中断处理程序执行下载的指令。
306、 当上述切换后的 MODEM操作系统执行完所述第一指令之后, 接收第三指令, 所 述第三指令用于从所述目标操作系统切换回所述当前运行的操作系统, 此时系统切换装置 会根据所述第三指令及所述保存的当前运行操作系统状态, 将所述目标操作系统切换回所 述当前运行的操作系统。
307、 当判断到所述操作指令为中断指令时, 但是判断到所述所述中断指令不是来自 所述当前运行的操作系统外部的第一指令时, 进一步判断所述中断指令是否为来自当前运 行的操作系统的用于切换操作系统的第二指令。 由于所述中断指令也可以为操作系统发送 的第二指令, 如: 当前运行的操作系统想主动放弃 CPU的控制权时, 通过一个切换接口实 现操作系统之间的主动切换,
所述第二指令实现切换为第二指令对应的目标操作系统的功能。 如当前运行的应用操 作系统想直接切换到 MODEM操作系统。
当判断到所述中断指令为来自当前运行的操作系统的用于切换操作系统的第二指令, 保存当前运行的操作系统状态。
308、 将所述当前运行的操作系统切换到第二指令指示的目标操作系统。
所述系统切换装置将所述当前运行的操作系统切换到所述中断指令对应的目标操作 系统。 所述切换前的操作系统被保存起来, 暂时处于挂起状态, 而切换后的目标操作系统 将直接运行在单 CPU上, 解决了通过虚拟机模拟造成的 CPU性能损失。 此外, 由于上述方 法对所述多个操作系统的修改很小, 从而使得维护所述多个操作系统的工作量大为减少, 降低了所述嵌入式系统的后期维护工作的复杂度, 实现了以较少的性能损失和较低的产品 复杂度在单 CPU上运行多操作系统。
本发明实施例还提供一种系统切换装置, 如图 4所示, 该装置包括: 接收单元 41、 判 断单元 42、 保存单元 43、 切换单元 44、 第一指示单元 45和第二指示单元 46。
其中所述接收单元 41 用于在有操作指令来到时, 统一接收所述操作指令。 由系统切 换装置统一接收所述操作指令, 而不是通过当前运行的操作系统来接收, 避免了当所述接 收到的操作指令不能在当前运行的操作系统下执行时而无法进行处理的问题。 然后所述判 断单元 42用于所述接收单元 41接收到的操作指令是否为中断指令。 在所述判断单元 42 判断到所述操作指令不是中断指令时, 所述第二指示单元 46 用于指示当前运行的操作系 统直接执行所述操作指令。
在所述判断单元 42判断到所述操作指令是中断指令时, 所述判断单元 42还用于判断 所述中断指令是否为来自当前运行的操作系统外部的第一指令。 当所述中断指令为当前运 行的操作系统外部发送的第一指令时, 保存单元 43 用于保存所述当前运行的操作系统状 态。 以便于在在需要恢复当前运行的操作系统时, 方便快速地恢复到所述切换之前的操作 系统。 然后, 切换单元 44用于将所述当前运行的操作系统切换到执行所述第一指令的目 标操作系统。 第一指示单元 45用于指示所述切换后的目标操作系统执行所述第一指令。 当切换后的目标操作系统执行完所述第一指令时, 所述接收单元 41 还用于接收第三 指令, 所述第三指令用于从所述目标操作系统切换回所述当前运行的操作系统。 然后所述 切换单元 44还用于根据所述第三指令及所述保存的当前运行操作系统状态, 将所述目标 操作系统切换回所述当前运行的操作系统。 不仅实现了可当前操作系统切换为目标操作系 统, 也实现了在需要回复切换前的操作系统时, 快速地切换回上述当前运行的操作系统。
由于所述操作指令也可以为当前操作系统发送的第二指令, 如: 当前运行的操作系统 想主动放弃 CPU的控制权时, 通过一个切换接口实现操作系统之间的主动切换, 那么在所 述判断单元 42判断到所述操作指令是中断指令时, 所述判断单元 42还用于判断所述中断 指令是否为当前运行的操作系统发送的用于切换操作系统的第二指令。 当所述中断指令为 当前运行的操作系统发送的用于切换操作系统的第二指令时, 所述保存单元 43 还用于保 存当前运行的操作系统状态。 然后, 所述切换单元 44还用于将所述当前运行的操作系统 切换到第二指令指示的目标操作系统。 从而实现了在单 CPU上运行多操作系统的目的。
在本发明的实施例中, 所述系统切换装置可以用于包含嵌入式系统中操作系统的移动 终端, 实现所述移动终端中至少两个操作系统在单 CPU上运行切换, 所述移动终端可以是 智能移动电话、 个人数字助理 PDA等。
本发明的实施例主要应用于移动通信领域, 以较少的性能损失和较低的产品复杂度在 嵌入式系统中实现了单 CPU运行多操作系统。
通过以上的实施方式的描述, 所属领域的技术人员可以清楚地了解到本发明可借助软 件加必需的通用硬件的方式来实现, 当然也可以通过硬件, 但很多情况下前者是更佳的实 施方式。 基于这样的理解, 本发明的技术方案本质上或者说对现有技术做出贡献的部分可 以以软件产品的形式体现出来, 该计算机软件产品存储在可读取的存储介质中, 如计算机 的软盘, 硬盘或光盘等, 包括若干指令用以使得一台计算机设备 (可以是个人计算机, 服 务器, 或者网络设备等) 执行本发明各个实施例所述的方法。
以上所述仅为本发明的较佳实施例, 并不用以限制本发明, 凡在本发明的精神和原则 之内, 所作的任何修改、 等同替换、 改进等, 均应包含在本发明的保护范围之内。

Claims

权利 要 求
1、 一种在嵌入式系统中操作系统的管理方法, 其特征在于, 该嵌入式系统中包括至 少两个操作系统, 在单 CPU上运行所述至少两个操作系统,所述方法包括:
系统切换装置接收中断指令;
如果所述中断指令判断到需要进行操作系统切换, 则保存当前运行的操作系统状态; 所述系统切换装置将所述当前运行的操作系统切换到所述中断指令对应的目标操作 系统。
2、 根据权利要求 1 所述的在嵌入式系统中操作系统的管理方法, 其特征在于, 该方 法还包括:
判断所述中断指令是否为来自当前运行的操作系统外部的第一指令。
3、 根据权利要求 2 所述的在嵌入式系统中操作系统的管理方法, 其特征在于, 该方 法还包括:
指示所述切换后的目标操作系统执行所述第一指令。
4、 根据权利要求 1 所述的在嵌入式系统中操作系统的管理方法, 其特征在于, 该方 法还包括:
判断所述中断指令是否为来自当前运行的操作系统的用于切换操作系统的第二指令。
5、 根据权利要求 1 所述的在嵌入式系统中操作系统的管理方法, 其特征在于, 该方 法还包括:
接收操作指令;
判断所述操作指令是否为中断指令;
当所述操作指令不是中断指令时, 指示当前运行的操作系统直接执行所述操作指令。
6、 根据权利要求 1-4任一项权利要求所述的在嵌入式系统中操作系统的管理方法, 其特征在于, 该方法还包括:
接收第三指令, 所述第三指令用于从所述目标操作系统切换回所述当前运行的操作系 统;
根据所述第三指令及所述保存的当前运行操作系统状态, 将所述目标操作系统切换回 所述当前运行的操作系统。
7、 一种系统切换装置, 其特征在于, 包括:
接收单元, 用于接收中断指令;
保存单元, 用于保存当前运行的操作系统状态;
切换单元, 用于将所述当前运行的操作系统切换到所述中断指令对应的目标操作系 统。
8、 根据权利要求 7所述的系统切换装置, 其特征在于, 还包括:
判断单元, 用于判断所述中断指令是否为来自当前运行的操作系统外部的第一指令。
9、 根据权利要求 8所述的系统切换装置, 其特征在于, 还包括:
第一指示单元, 用于指示所述切换后的目标操作系统执行所述第一指令。
10、 根据权利要求 7所述的系统切换装置, 其特征在于,
所述判断单元还用于判断所述中断指令是否为来自当前运行的操作系统的用于切换 操作系统的第二指令。
11、 根据权利要求 7所述的系统切换装置, 其特征在于, 所述接收单元还用于接收操 作指令, 所述判断单元还用于判断所述操作指令是否为中断指令;
该装置还包括: 第二指示单元, 用于当所述操作指令不是中断指令时, 指示当前运行 的操作系统直接执行所述操作指令。
12、 根据权利要求 7-10 所述的系统切换装置, 其特征在于, 所述接收单元还用于接 收第三指令, 所述第三指令用于从所述目标操作系统切换回所述当前运行的操作系统; 所述切换单元还用于根据所述第三指令及所述保存的当前运行操作系统状态, 将所述 目标操作系统切换回所述当前运行的操作系统。
13、 一种包含嵌入式系统中操作系统的移动终端, 所述嵌入式系统中包括至少两个操 作系统, 在单 CPU上运行所述至少两个操作系统,其特征在于, 如权利要求 7-12中任一项 权利要求所述的系统切换装置, 所述系统切换装置用于对所述至少两个操作系统进行切 换。
PCT/CN2010/079971 2009-12-24 2010-12-18 在嵌入式系统中操作系统的管理方法及装置 WO2011076089A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
EP10838652A EP2492810A4 (en) 2009-12-24 2010-12-18 METHOD AND DEVICE FOR MANAGING OPERATING SYSTEMS IN AN EMBEDDED SYSTEM
JP2012543460A JP2013515293A (ja) 2009-12-24 2010-12-18 組み込みシステムにおけるオペレーティングシステムを管理するための方法と装置
US13/493,296 US20120246370A1 (en) 2009-12-24 2012-06-11 Method and apparatus for managing operating systems in embedded system

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN200910261692.4 2009-12-24
CN200910261692A CN101782861A (zh) 2009-12-24 2009-12-24 在嵌入式系统中操作系统的管理方法及装置

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US13/493,296 Continuation US20120246370A1 (en) 2009-12-24 2012-06-11 Method and apparatus for managing operating systems in embedded system

Publications (1)

Publication Number Publication Date
WO2011076089A1 true WO2011076089A1 (zh) 2011-06-30

Family

ID=42522872

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2010/079971 WO2011076089A1 (zh) 2009-12-24 2010-12-18 在嵌入式系统中操作系统的管理方法及装置

Country Status (6)

Country Link
US (1) US20120246370A1 (zh)
EP (1) EP2492810A4 (zh)
JP (1) JP2013515293A (zh)
KR (1) KR20120076381A (zh)
CN (1) CN101782861A (zh)
WO (1) WO2011076089A1 (zh)

Families Citing this family (27)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101782861A (zh) * 2009-12-24 2010-07-21 华为终端有限公司 在嵌入式系统中操作系统的管理方法及装置
CN102479100B (zh) * 2010-11-26 2015-08-26 中国科学院软件研究所 一种普适计算环境虚拟机平台及其创建方法
US9010641B2 (en) * 2010-12-07 2015-04-21 Hand Held Products, Inc. Multiple platform support system and method
CN103294545B (zh) * 2012-02-23 2017-07-04 纬创资通股份有限公司 切换双操作系统的方法以及电子装置
CN103309737A (zh) * 2012-03-07 2013-09-18 联想(北京)有限公司 一种切换操作系统的方法及设备
CN103870298B (zh) * 2012-12-17 2017-08-29 联想(北京)有限公司 切换方法和电子设备
US9310926B2 (en) * 2013-01-08 2016-04-12 Samsung Electronics Co., Ltd. Touch event processing methods and apparatus for portable device with multiple operating systems
US9880888B2 (en) * 2013-06-07 2018-01-30 Mitsubishi Electric Corporation Executing an operating system in a multiprocessor computer system
WO2015014013A1 (zh) * 2013-07-30 2015-02-05 宇龙计算机通信科技(深圳)有限公司 终端、用户界面的显示控制方法和显示控制系统
CN104516747A (zh) * 2013-09-27 2015-04-15 联想(北京)有限公司 一种系统切换方法及电子设备
US9270659B2 (en) 2013-11-12 2016-02-23 At&T Intellectual Property I, L.P. Open connection manager virtualization at system-on-chip
US9456071B2 (en) 2013-11-12 2016-09-27 At&T Intellectual Property I, L.P. Extensible kernel for adaptive application enhancement
US9645864B2 (en) 2014-02-06 2017-05-09 Intel Corporation Technologies for operating system transitions in multiple-operating-system environments
US9934047B2 (en) * 2014-03-20 2018-04-03 Intel Corporation Techniques for switching between operating systems
US20160055031A1 (en) * 2014-11-13 2016-02-25 Mediatek Inc. Dual-System Architecture With Fast Recover And Switching Of Operating System
CN104462905B (zh) * 2014-12-18 2018-12-25 宇龙计算机通信科技(深圳)有限公司 操作系统的数据处理方法、数据处理装置和终端
WO2016172830A1 (zh) * 2015-04-27 2016-11-03 宇龙计算机通信科技(深圳)有限公司 应用程序的运行方法、应用程序的运行装置和终端
CN105117272B (zh) * 2015-08-21 2018-05-01 浪潮集团有限公司 一种操作系统管理器、虚拟机和操作系统间切换方法
US10146940B2 (en) 2016-01-13 2018-12-04 Gbs Laboratories, Llc Multiple hardware-separated computer operating systems within a single processor computer system to prevent cross-contamination between systems
JP6615726B2 (ja) 2016-09-16 2019-12-04 株式会社東芝 情報処理装置、情報処理方法及びプログラム
US10467211B2 (en) * 2017-11-15 2019-11-05 International Business Machines Corporation Representing and analyzing cloud computing data as pseudo systems
CN109101283A (zh) * 2018-07-17 2018-12-28 北京元心科技有限公司 Gpu设备的控制方法、装置及电子设备
US10778709B2 (en) 2018-10-31 2020-09-15 International Business Machines Corporation Cloud-native extensibility provided to security analytics
CN109542829B (zh) * 2018-11-29 2023-04-25 北京元心科技有限公司 多系统中gpu设备的控制方法、装置及电子设备
CN113094101A (zh) * 2019-12-19 2021-07-09 成都鼎桥通信技术有限公司 双域系统的控制方法、装置、电子设备和存储介质
GB201919236D0 (en) * 2019-12-23 2020-02-05 Toothbrush Club Ltd A method for recycling consumable items
FR3107975B1 (fr) 2020-03-05 2022-12-02 Idemia France Procédé mis en œuvre dans un module à circuit intégré, module à circuit intégré correspondant, système comportant un tel module et programme d’ordinateur associé

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1797351A (zh) * 2004-12-24 2006-07-05 联想(北京)有限公司 一种计算机多操作系统的切换方法
CN101051282A (zh) * 2007-05-09 2007-10-10 浙江大学 多操作系统协同工作实现方法
CN101349976A (zh) * 2003-04-09 2009-01-21 扎鲁纳股份有限公司 操作系统
CN101782861A (zh) * 2009-12-24 2010-07-21 华为终端有限公司 在嵌入式系统中操作系统的管理方法及装置

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3546678B2 (ja) * 1997-09-12 2004-07-28 株式会社日立製作所 マルチos構成方法
US6996828B1 (en) * 1997-09-12 2006-02-07 Hitachi, Ltd. Multi-OS configuration method
JP3659062B2 (ja) * 1999-05-21 2005-06-15 株式会社日立製作所 計算機システム
US6715016B1 (en) * 2000-06-01 2004-03-30 Hitachi, Ltd. Multiple operating system control method
JP2003036174A (ja) * 2001-07-25 2003-02-07 Hitachi Ltd 車載端末装置
US7503049B2 (en) * 2003-05-29 2009-03-10 Panasonic Corporation Information processing apparatus operable to switch operating systems
KR100673681B1 (ko) * 2004-03-25 2007-01-24 엘지전자 주식회사 개인용 컴퓨터에서의 인스턴트 온 기능 실행방법
US7930443B1 (en) * 2005-10-26 2011-04-19 Juniper Networks, Inc. Router having routing engine software instance and interface controller software instance on a single processor
US8996864B2 (en) * 2006-12-22 2015-03-31 Virtuallogix Sa System for enabling multiple execution environments to share a device
JP5167844B2 (ja) * 2008-02-05 2013-03-21 日本電気株式会社 プロセッサ、電子機器、割込み制御方法及び割込み制御プログラム
JP2010066931A (ja) * 2008-09-09 2010-03-25 Fujitsu Ltd 負荷分散機能を有した情報処理装置
US8239667B2 (en) * 2008-11-13 2012-08-07 Intel Corporation Switching between multiple operating systems (OSes) using sleep state management and sequestered re-baseable memory

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101349976A (zh) * 2003-04-09 2009-01-21 扎鲁纳股份有限公司 操作系统
CN1797351A (zh) * 2004-12-24 2006-07-05 联想(北京)有限公司 一种计算机多操作系统的切换方法
CN101051282A (zh) * 2007-05-09 2007-10-10 浙江大学 多操作系统协同工作实现方法
CN101782861A (zh) * 2009-12-24 2010-07-21 华为终端有限公司 在嵌入式系统中操作系统的管理方法及装置

Also Published As

Publication number Publication date
EP2492810A1 (en) 2012-08-29
CN101782861A (zh) 2010-07-21
EP2492810A4 (en) 2013-01-02
JP2013515293A (ja) 2013-05-02
US20120246370A1 (en) 2012-09-27
KR20120076381A (ko) 2012-07-09

Similar Documents

Publication Publication Date Title
WO2011076089A1 (zh) 在嵌入式系统中操作系统的管理方法及装置
US10628273B2 (en) Node system, server apparatus, scaling control method, and program
US10768960B2 (en) Method for affinity binding of interrupt of virtual network interface card, and computer device
US9397954B2 (en) System and method for supporting live migration of virtual machines in an infiniband network
KR20180112825A (ko) Mec 애플리케이션의 재배치를 제어하기 위한 방법 및 서버
CN104598294B (zh) 用于移动设备的高效安全的虚拟化方法及其设备
US9697029B2 (en) Guest idle based VM request completion processing
JP2015514270A (ja) インフィニバンドネットワークにおけるバーチャルマシーンのライブマイグレーションをサポートするためのシステムおよび方法
KR20060051932A (ko) 소프트웨어를 실행 동안 업데이트하는 시스템, 방법 및컴퓨터-판독가능 매체
US20240086228A1 (en) Resource Configuration Method and Apparatus, Electronic Device, and Computer-Readable Storage Medium
WO2020114292A1 (zh) 一种虚拟交换机切换方法、装置、宿主机及存储介质
CN114003334A (zh) 虚拟机热迁移网络中断的优化方法、装置、设备、存储介质和系统
CN103593227A (zh) 在客户端运行桌面虚拟系统的方法及客户端
CN104991811A (zh) 隔离系统切换时进程运行状态的调整方法以及智能终端
KR20130051820A (ko) 모바일 환경에서의 소프트웨어 마이그레이션 장치 및 방법
CN109960579B (zh) 一种调整业务容器的方法及装置
US10503487B2 (en) System and method for deploying and controlling mobile operating system on a platform
CN104375854A (zh) 一种应用更新下载方法及用户终端
US8453149B2 (en) Efficient multi-core processing of events
TWI668634B (zh) 基於軟體容器提供雲端服務之系統及方法
JP5102528B2 (ja) 情報処理装置及び制御方法
CN103678163A (zh) 数据流的切换方法、装置及系统
WO2021057649A1 (zh) 定时器处理方法、装置、电子设备及计算机存储介质
CN115878136A (zh) 一种基于裸金属服务器的部署方法、装置及系统
CN112395079B (zh) 异构众核架构下的运算核作业迁移方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 10838652

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 4350/CHENP/2012

Country of ref document: IN

WWE Wipo information: entry into national phase

Ref document number: 2010838652

Country of ref document: EP

ENP Entry into the national phase

Ref document number: 20127013875

Country of ref document: KR

Kind code of ref document: A

WWE Wipo information: entry into national phase

Ref document number: 2012543460

Country of ref document: JP

NENP Non-entry into the national phase

Ref country code: DE