WO2015090195A1 - 操作***实例创建方法及装置 - Google Patents

操作***实例创建方法及装置 Download PDF

Info

Publication number
WO2015090195A1
WO2015090195A1 PCT/CN2014/094039 CN2014094039W WO2015090195A1 WO 2015090195 A1 WO2015090195 A1 WO 2015090195A1 CN 2014094039 W CN2014094039 W CN 2014094039W WO 2015090195 A1 WO2015090195 A1 WO 2015090195A1
Authority
WO
WIPO (PCT)
Prior art keywords
resource
operating system
description information
system instance
instance
Prior art date
Application number
PCT/CN2014/094039
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 华为技术有限公司
Publication of WO2015090195A1 publication Critical patent/WO2015090195A1/zh

Links

Images

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/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4406Loading of operating system
    • G06F9/441Multiboot arrangements, i.e. selecting an operating system to be loaded
    • 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/50Allocation of resources, e.g. of the central processing unit [CPU]

Definitions

  • the embodiments of the present invention relate to the field of computers, and in particular, to a method and an apparatus for creating an operating system instance.
  • Multiprocessor system a plurality of physical cores (Cores) are deployed on a central processing unit (CPU) to form a multi-core processor with powerful processing capability, and a computer system including at least one multi-core processor is called Multiprocessor system.
  • CPU central processing unit
  • a kernel is deployed on one or more physical cores, called a multi-core operating system.
  • a multi-core operating system In a multi-core operating system, a custom independently compiled system image is deployed on the core, thereby Form a complete operating system.
  • a plurality of operating system instances coexist on a multi-core operating system, wherein an operating system instance that is first started is a primary operating system instance, and one or more operating system instances that are subsequently started are called secondary operations.
  • the user can create and manage the Secondary operating system instance via the Primary operating system instance.
  • An embodiment of the present invention provides a method and an apparatus for creating an operating system instance, which dynamically creates an operating system instance with an exclusive resource according to resource requirements provided by the user, thereby improving system expansion performance and meeting user requirements.
  • an embodiment of the present invention provides a method for creating an operating system instance, including:
  • the primary operating system instance receives a creation request indicating the creation of an instance from the operating system, the creation request And requesting to carry resource requirement information of the slave operating system instance;
  • the main operating system instance allocates an exclusive system resource to the slave operating system instance according to the resource requirement information, where the system resource includes at least: a processor resource and a physical memory partition resource;
  • the primary operating system instance initializes the system resources to obtain initial system resources
  • the primary operating system instance launches the secondary operating system instance on the initializing system resource.
  • the primary operating system instance receives the creation request from the operating system instance, and allocates the exclusive operation to the slave operating system instance according to the resource requirement information.
  • system resources including:
  • the primary operating system instance determines, according to the resource requirement information, whether the system resource that meets the resource requirement information exists in the resource pool.
  • the resource description information includes:
  • the compatible resource description information is resource description information that does not meet the boot process standard multiboot;
  • Standard resource description information is resource description information conforming to the boot process standard multiboot.
  • the primary operating system instance is configured according to the resource requirement information Generating resource description information of the slave operating system, including:
  • the primary operating system instance generates first resource description information describing the quantity information of the system resource at the user layer according to the resource requirement information, and generates the slave operating system instance according to the quantity information in a kernel space. Complete resource description information, so that the slave operating system instance loads the resource description information into a physical memory partition resource in the system resource; or
  • the primary operating system instance generates resource description information of the slave operating system instance, and loads the physical memory partition in the system resource allocated for the slave operating system instance.
  • the primary operating system instance generates the initialization resource of the operating system instance according to the resource requirement information, initializes the system resource, and obtains an initialization system. Before the resource, including:
  • the Primary operating system instance performs virtual address remapping on the physical memory partition resource.
  • an operating system instance creation apparatus including:
  • a receiving module configured to receive a creation request indicating that a slave operating system instance is created, where the creation request carries resource requirement information of the slave operating system
  • An allocating module configured to allocate an exclusive system resource to the operating system instance according to the resource requirement information, where the system resource includes at least: a processor resource and a physical memory partition resource;
  • a generating module configured to generate resource description information of the slave operating system instance according to the resource requirement information
  • An initialization module configured to initialize the system resource, and obtain an initialization system resource
  • a startup module configured to start the slave operating system instance on the initialization system resource.
  • the apparatus further includes:
  • the determining module is configured to determine, according to the resource requirement information, whether the system resource that meets the resource requirement information exists in the resource pool.
  • the resource description information includes:
  • the compatible resource description information is resource description information that does not meet the boot process standard multiboot;
  • Standard resource description information is resource description information conforming to the boot process standard multiboot.
  • the generating module is configured to perform according to the resource requirement And generating, in the user layer, first resource description information describing the quantity information of the system resource, and generating, in the kernel space, the resource description information of the slave operating system instance according to the quantity information, so that the slave An operating system instance loads the resource description information with the system resource In the physical memory partition resource; or,
  • the device further includes:
  • a remapping module configured to perform virtual address remapping on the physical memory partition resource.
  • the Primary operating system allocates exclusive system resources for the instance of the secondary operating system according to the resource requirement information, and generates the resource description information of the instance of the secondary operating system instance, and then initializes and starts the secondary operating system.
  • the example is to dynamically create an operating system instance with exclusive resources according to the resource requirements provided by the user, so as to improve the system expansion performance and meet the needs of the user.
  • Embodiment 1 is a flowchart of Embodiment 1 of a method for creating an operating system instance according to the present invention
  • FIG. 2 is a schematic structural diagram of a startup parameter data structure applicable to an operating system instance creation method according to the present invention
  • Embodiment 1 of an operating system instance creation apparatus according to the present invention
  • Embodiment 4 is a schematic structural diagram of Embodiment 2 of an operating system instance creation apparatus according to the present invention.
  • FIG. 5 is a schematic structural diagram of Embodiment 3 of an operating system instance creation apparatus according to the present invention.
  • FIG. 1 is a flowchart of Embodiment 1 of a method for creating an operating system instance according to the present invention.
  • This embodiment is applicable to a multi-core operating system having a primary operating system instance and at least one secondary operating system instance, and is applied to a scenario in which a secondary operating system instance having independent system resources needs to be dynamically created. Specifically, the embodiment includes the following steps:
  • the main operating system instance receives the creation request indicating that the slave operating system instance is created, and the creation request carries the resource requirement information of the slave operating system.
  • the Primary operating system instance can also be called Heavy OS (Heavy OS). It is a general-purpose operating system with functions such as resource allocation, recycling, virtualization, and coordination. It is also the first boot on the hardware.
  • An operating system instance responsible for managing system resources, for example, controlling resources such as CPU resources, physical memory partition resources, physical devices, or virtual devices in a multiprocessor operating system.
  • the secondary operating system instance can also be called a lightweight operating system (Light OS). It is based on the resources managed by Heavy OS to create a customized operating system. It can only manage its own resources, apply for resources from Heavy OS, or put resources. Released and returned to Heavy OS.
  • the user proposes to create a creation request for starting the Secondary operating system instance in the environment or interface of the Primary operating system instance, and provides resource requirement information required for the application service, for example, the requirement.
  • resource requirement information required for the application service, for example, the requirement.
  • the main operating system instance allocates exclusive system resources from the operating system instance according to the resource requirement information, and the system resources include at least: a processor resource and a physical memory partition resource.
  • the Primary operating system After receiving the resource requirement information generated by the Secondary operating system instance, the Primary operating system allocates exclusive system resources from the resource pool to the Secondary operating system instance, for example, an exclusive CPU, an exclusive physical memory partition, and an exclusive virtual device. Or device resources such as physical devices.
  • the main operating system instance generates resource description information of the operating system according to the resource requirement information.
  • the primary operating system generates resource description information of a specific data structure from the operating system instance according to the resource requirement information in the received secondary operating system instance creation request. For example, for the Huawei-funded multi-core operating system developed by the Chinese Academy of Sciences: Rainforest For the operating system, resource description information of the startup parameter data structure Kernbootparams is generated.
  • the Primary operating system can be implemented in the following manner for the Secondary operating system.
  • Example to generate resource description information Example to generate resource description information:
  • the first operating system instance generates a first resource description information describing the quantity information of the system resource at the user layer according to the resource requirement information, and generates a complete resource description information from the operating system according to the quantity information in the kernel space, so that The resource description information is loaded from the operating system instance with the physical memory partition in the system resource.
  • the primary operating system may first construct, according to the resource requirement information, a first resource description information describing the quantity information of the system resource at the user layer, and information about the required system resources, such as the number of CPUs and the number of cores.
  • the number, the size of the physical memory partition, the information of the system image file corresponding to the application service, and the like are filled in the resource description information to form the first resource description information describing the quantity information.
  • the first resource description information generated by the user layer is transmitted to the kernel space through a function call or the like, and the first resource description information is continuously filled in the kernel space, for example, the specific CPU information corresponding to the required number of CPUs,
  • the information of the specific physical memory partition corresponding to the size of the required physical memory partition is added to the first resource description information, thereby generating the final complete resource description information, and then loading the resource description information from the operating system instance and the system resources.
  • the physical memory partition In the physical memory partition.
  • Manner 2 The main operating system instance is in the kernel space, and generates resource description information from the operating system instance, so that the resource description information is loaded from the operating system instance and the physical memory partition in the system resource. Specifically, the Primary operating system generates a complete resource description information of the Secondary operating system instance directly in the kernel space according to the resource requirement information.
  • Manner 3 The resource description information of the operating system instance is directly loaded on the physical memory partition allocated from the operating system instance, and is read from the memory space by the operating system.
  • the main operating system instance initializes system resources, and obtains initial system resources.
  • the Primary operating system instance initializes system resources and prepares related resources started by the Secondary operating system instance, such as the X86 architecture CPU to switch from real mode to protected mode (Trampoline) code.
  • the Secondary operating system instance such as the X86 architecture CPU to switch from real mode to protected mode (Trampoline) code.
  • the resource description information may be used to initialize the system resources; or the system resources may be initialized first, and the resource description information may be generated.
  • the main operating system instance starts the slave operating system instance on the initial system resource.
  • the Primary operating system instance runs on the initial system resources. Secondary operating system kernel code, etc., to create an instance of the secondary operating system.
  • the operating system instance creation method provided by the embodiment of the present invention, the primary operating system allocates exclusive system resources for the secondary operating system instance according to the resource requirement information, generates the resource description information of the secondary operating system instance, and then initializes and starts the secondary operating system instance. Therefore, the operating system instance with exclusive resources is dynamically created according to the resource requirements provided by the user, so as to improve the system expansion performance and meet the needs of the user.
  • the primary operating system instance after the primary operating system instance receives the creation request from the operating system instance, and allocates the exclusive system resource according to the resource requirement information, it may determine whether the resource pool exists in the resource pool according to the resource requirement information. System resources for resource demand information.
  • the instance of the Primary operating system may determine, according to the resource requirement information, whether there is a resource that satisfies the resource requirement information in the idle resource in the resource pool. For example, according to the CPU allocation status bitmap (MP Table), the currently available CPU or Core, or, by other means, such as hot plug (Hotplug) release the CPU in the other Secondary operating system instance, the recycled CPU is assigned to the secondary operating system instance to be created.
  • MP Table CPU allocation status bitmap
  • Hotplug hot plug
  • the resource description information of the operating system instance includes compatible resource description information and standard resource description information, and is consistent with the resource description information of the multiboot.
  • the resource description information is standard; otherwise, the resource description information that does not conform to multiboot is referred to as compatible resource description information.
  • multi-core operating systems can have many forms of expression.
  • the Rainforest operating system developed by the Chinese Academy of Sciences, the open source virtual machine monitor (XEN) maintained by the University of Cambridge, and the XEN, are in XEN.
  • the virtual machine has access to the opinion resource and can manage the operating system (Demain0) of other word operating systems.
  • the present invention will be described in detail by taking the Rainforest operating system as an example.
  • the Rainforest system is a system consisting of one (or more) Primary operation instance and multiple Secondary operating system instances.
  • the Primary operating system instance is responsible for system resource integration, configuration, and the life cycle of the Secondary operating system instance. Management, etc.
  • the Secondary operating system instance runs on an isolated physical memory partition.
  • partitioning system resources First, they are physically separated (PCI-E, internal bus), and secondly, when the system resources cannot meet the requirements, they can be independent functional units of physical devices. Dividing, finally, will consider virtualizing a single physical device, moving up the physical device through time multiplexing Create multiple virtual devices.
  • Examples of the Primary operating system of the Rainforest system include: operating system user layer loading function (Osloader) module, CPU control (CPU Controller) module, and springboard (Trampoline) module.
  • the Primary operating system instance uses the Osloader function module to respond to the user's secondary operating system instance. Create a request, create a Secondary operating system instance via the CPU Controller module driver, and complete the mode conversion through the Trampoline module, which generally includes the following steps:
  • the S1, Primary operating system instance receives a creation request to create an instance of the secondary operating system.
  • the Osloader module in the S2 Primary operating system instance responds to the creation request, constructs the first resource description information at the user layer, and invokes the CPU Controller module of the kernel space.
  • the first resource description information constructed at the user layer starts a partial startup parameter of the Secondary operating system instance.
  • the Osloader module completes the following substeps:
  • the resource requirement information is, for example, the number of CPU/core, the size of the physical memory partition, and the system image file required to start the Secondary operating system to be created.
  • the Osloader module verifies whether there are six idle CPUs in the system resource pool, or whether it can hotplug other secondary systems. 6 CPUs of the operating system instance to be assigned to the Secondary system instance to be created. Taking the system image file as an example, the Osloader module verifies the legality of the system image file.
  • the first resource description information is generated at the user layer, and the first resource description information is used to describe the quantity information of the system resource, for example, a startup parameter data structure (kernboootparams). ), including the number of CPU / Core, physical memory partition resource size, system image file related information.
  • a startup parameter data structure Kernboootparams.
  • FIG. 2 is a schematic structural diagram of a startup parameter data structure applicable to an operating system instance creation method according to the present invention.
  • the S24 and Osloader modules call the CPU Controller module to allocate related resources, and then prepare to construct complete resource description information in the kernel space.
  • the Osloader module calls the CPU Controller module, and transfers the constructed first resource description information to the kernel space by calling the function (ioctl), and monitors the parameter in the parameter.
  • a member variable ret indicating whether the instance of the Secondary operating system is successfully created to determine the success or failure of the creation of the Secondary operating system instance.
  • the CPU Controller module allocates related system resources according to the first resource description information generated at the user layer, and constructs complete resource description information of the Secondary operating system instance in the kernel space, where the process includes specific CPU/core allocation and physical memory partitioning.
  • a series of Secondary operating system instances such as allocation, page table mapping, CPU allocation status bitmap (MP Table), start the required resource preparation, and finally send the Inter-Processor Interrupt Controller (IPI). Start the instance of the Secondary operating system.
  • the CPU Controller module completes the following substeps:
  • the CPU Controller module receives the first resource description information generated by the Osloader module and generated by the user layer.
  • the CPU Controller module releases from the currently idle CPU/core or by other means according to the CPU allocation status bitmap (MP Table, CPU_Possible, CPU_online_map) (such as CPU_hotplug).
  • the CPU/core resource indicated by the first resource description information is allocated to the Secondary operating system instance, and the continuous physical memory partition indicated by the first resource description information is allocated to the Secondary operating system instance by the alloc_pages() function.
  • the CPU Controller module generates resource description information of the Secondary operating system instance.
  • the CPU Controller module allocates the required resources in the S31, and constructs the MP_Table and ACPI_Table description information conforming to the PC standard on the physical memory partition allocated by the Secondary operating system instance, and describes the specific information about the CPU/core allocated by the Secondary operating system instance and The system's Global Descriptor Table (GDT), Interrupt Descriptor Table (IDT) and other information, while constructing the E820map data structure, in the secondary operating system instance startup process, through the detect_memory_e820 () to obtain the memory layout Fill the boot_params.e820map to establish the management framework of the physical operating system partition of the Secondary operating system instance.
  • the ACPI_Table can be used to describe the information of the exclusive device resource in the system resource allocated to the instance of the operating system.
  • the exclusive device resource information can be selected after the available information parameters are selected from the device information of the instance of the Primary operating system. In the ACPI_Table.
  • the Primary operating system instance performs virtual address remapping on the memory partition resources.
  • the CPU Controller module of the Primary operating system instance obtains the start (memstart) information for the physical memory partition allocated in step S31, and performs remapping of the virtual address page_to_phys() so that the Secondary operating system instance has an independent address space.
  • the CPU Controller module passes the system image file to the physical memory partition of the Secondary operating system instance.
  • the CPU Controller module copies the incoming system image file to the specified physical memory space, and fills in the Kernbootparams data structure of the startup parameter.
  • step S33 the start (memstart) information, the system image file, etc. are obtained, and the resource description information construction work is completed. After all the necessary resources are prepared, the Secondary operating system instance waits for the IPI signal.
  • the CPU Controller module sends the resource description information to the Trampoline module.
  • the CPU Controller module sets the mode conversion function code (trampoline_data_multi-kernel) to the specified position, and passes the entire startup parameter Kernbootparams data structure to Trampoline. Module.
  • the CPU Controller module sends an IPI interrupt signal to the Secondary operating system instance.
  • apicid Advanced Configuration and Power Interface
  • the S4 and Trampoline modules initialize the system resources allocated by the Secondary operating system instance and start the Secondary operating system instance.
  • the Trampoline module initializes system resources such as processor resources and memory partition resources, such as initializing the CPU to wait for the IPI signal, adjusting the value of the page table area in the trampoline, Re-mapping of virtual addresses, etc.
  • system resources such as processor resources and memory partition resources, such as initializing the CPU to wait for the IPI signal, adjusting the value of the page table area in the trampoline, Re-mapping of virtual addresses, etc.
  • the CPU/core of the instance of the Secondary operating system is initialized by the Trampoline module, waits for the IPI signal, and after receiving the IPI interrupt signal, executes the corresponding processing program, and then jumps through the trampoline to make the CPU of the Secondary operating system instance.
  • /core completes the conversion of real mode to protected mode.
  • the Trampoline module copies the construction parameters of the trampoline function code via head.S Go to the kernel space of the Secondary operating system, start the required parameters as the instance of the Secondary operating system, and then jump to the system image file loading location of the Secondary operating system instance. After loading the system image file, transfer the execution rights to the Secondary operating system instance.
  • the kernel completes a series of initialization tasks, builds the entire system to run the kernel environment, from start_kernel to CPU_idle.
  • the Secondary operating system starts and initializes the device by reading device resource information from a low address space, such as a BIOS memory area, during startup. For devices that are not directly accessed, the instance of the Primary operating system and the instance of the Secondary operating system negotiate to complete the construction of the "virtual device".
  • the Primary operating system instance sets the member variable ret for monitoring in the osloader to 1 to identify that the Secondary operating system instance is successfully created.
  • FIG. 3 is a schematic structural diagram of Embodiment 1 of an operating system instance creation apparatus according to the present invention.
  • the operating system instance creation device provided in this embodiment may be configured on the instance of the primary operating system of the multi-processor operating system, or may be the instance of the primary operating system itself, and is an apparatus embodiment corresponding to the embodiment of FIG. 1 of the present invention. The process will not be described here.
  • the operating system instance creation apparatus 100 provided in this embodiment specifically includes:
  • the receiving module 11 is configured to receive a creation request indicating that a slave operating system instance is created, and the creation request carries resource requirement information from the operating system;
  • the allocating module 12 is configured to allocate an exclusive system resource from the operating system instance according to the resource requirement information, where the system resource includes at least: a processor resource and a physical memory partition resource;
  • the generating module 13 is configured to generate resource description information of the slave operating system instance according to the resource requirement information;
  • the initialization module 14 is configured to initialize system resources and obtain initial system resources.
  • the startup module 15 is configured to start the slave operating system instance on the initialization system resource.
  • the operating system instance creation device provided by the embodiment of the present invention allocates an exclusive system resource to the secondary operating system instance according to the resource requirement information, generates a resource description information of the secondary operating system instance, and then initializes and starts the secondary operating system instance, thereby implementing the basis.
  • User-provided resource requirements dynamically create operating system instances with exclusive resources to improve system scalability and meet user needs.
  • FIG. 4 is a schematic structural diagram of Embodiment 2 of an operating system instance creation apparatus according to the present invention. As shown in Figure 4 The operating system instance creation device 200 provided in this embodiment further includes, on the basis of FIG. 3,
  • the determining module 16 is configured to determine, according to the resource requirement information, whether the system resource that meets the resource requirement information exists in the resource pool.
  • resource description information includes:
  • Compatible resource description information is resource description information that does not meet the boot process standard multiboot.
  • Standard resource description information is resource description information that conforms to the boot process standard multiboot.
  • the generating module 13 is configured to generate first resource description information describing the quantity information of the system resource at the user layer according to the resource requirement information, and generate complete resource description information from the operating system instance according to the quantity information in the kernel space. So that the resource description information is loaded from the operating system instance with the physical memory partition resource in the system resource; or,
  • the operating system instance creation device includes:
  • the remapping module 17 is configured to perform virtual address remapping on the physical memory partition resource.
  • FIG. 5 is a schematic structural diagram of Embodiment 3 of an operating system instance creation apparatus according to the present invention.
  • the operating system instance creation apparatus 300 provided in this embodiment includes a processor 31 and a memory 32.
  • the operating system instance creation device 300 may further include a transmitter 33 and a receiver 34. Transmitter 33 and receiver 34 can be coupled to processor 31.
  • the transmitter 33 is configured to transmit data or information
  • the receiver 34 is configured to receive data or information
  • the memory 32 stores execution instructions.
  • the processor 31 communicates with the memory 32, and the processor 31 calls the execution instruction in the memory 32 for performing the following operations:
  • the creation request carrying resource requirement information from the operating system
  • an exclusive system resource is allocated from an operating system instance, and the system resource includes at least: a processor resource and a physical memory partition resource;
  • the method includes:
  • the resource requirement information it is determined whether there is a system resource in the resource pool that satisfies the resource requirement information.
  • resource description information includes:
  • Compatible resource description information is resource description information that does not meet the boot process standard multiboot.
  • Standard resource description information is resource description information that conforms to the boot process standard multiboot.
  • the resource description information of the operating system is generated according to the resource requirement information, including:
  • the system resource is initialized according to the resource requirement information, and before the system resource is initialized, the method includes:

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

本发明实施例提供一种操作***实例创建方法及装置,该方法中,Primary操作***根据资源需求信息,为Secondary操作***实例分配独占的***资源,生成Secondary操作***实例的资源描述信息后,初始化并启动Secondary操作***实例,从而实现根据用户提供的资源需求,动态的创建具有独占资源的操作***实例,达到提高***扩展性能,并满足用户的需求的目的。

Description

操作***实例创建方法及装置 技术领域
本发明实施例涉及计算机领域,尤其涉及一种操作***实例创建方法及装置。
背景技术
随着计算机技术的不断发展,在一个中央处理器(Central Processing Unit,CPU)上部署多个物理核(Core)形成具有强大处理能力的多核处理器,包括至少一个多核处理器的计算机***称为多处理器***。
在多处理器***中,一个或多个物理核(core)上部署一个内核(kernel),称为多内核操作***,在多内核操作***中,core上部署定制的独立编译的***映像,从而形成一个完整的操作***。一般来说,多内核操作***上共存多个操作***实例,其中,首先启动的操作***实例为主(Primary)操作***实例,后续启动的一个或多个操作***实例称为从(Secondary)操作***实例,用户可经由Primary操作***实例创建并管理Secondary操作***实例。为满足用户需求,需要根据用户提供的资源需求,创建与资源需求相符的操作***实例。然而,现有技术中并没有具体的根据用户提供的资源需求,动态的创建具有独占资源的操作***实例的方法。
因此,如何提出一种根据用户提供的资源需求,动态的创建具有独占资源的操作***实例的方法,实为业界亟待解决的问题。
发明内容
本发明实施例提供一种操作***实例创建方法及装置,实现根据用户提供的资源需求,动态的创建具有独占资源的操作***实例,从而提高***扩展性能,并满足用户的需求。
第一个方面,本发明实施例提供一种操作***实例创建方法,包括:
主操作***实例接收指示创建从操作***实例的创建请求,所述创建请 求携带所述从操作***实例的资源需求信息;
所述主操作***实例根据所述资源需求信息,为所述从操作***实例分配独占的***资源,所述***资源至少包括:处理器资源、物理内存分区资源;
所述主操作***实例根据所述资源需求信息,生成所述从操作***实例的资源描述信息;
所述主操作***实例初始化所述***资源,得到初始化***资源;
所述主操作***实例在所述初始化***资源上启动所述从操作***实例。
在第一个方面的第一种可能的实现方式中,所述主操作***实例接收指示创建从操作***实例的创建请求之后,根据所述资源需求信息,为所述从操作***实例分配独占的***资源之前,包括:
所述主操作***实例根据所述资源需求信息,判断资源池中是否存在满足所述资源需求信息的所述***资源。
结合第一个方面或第一个方面的第一种可能的实现方式,在第一个方面的第二种可能的实现方式中,所述资源描述信息,包括:
兼容的资源描述信息,所述兼容的资源描述信息为不符合引导过程标准multiboot的资源描述信息;或者,
标准的资源描述信息,所述标准的资源描述信息为符合引导过程标准multiboot的资源描述信息。
结合第一个方面、第一个方面的第一种或第二种可能的实现方式,在第一个方面的第三种可能的实现方式中,所述主操作***实例根据所述资源需求信息,生成所述从操作***的资源描述信息,包括:
所述主操作***实例根据所述资源需求信息,在用户层生成描述所述***资源的数量信息的第一资源描述信息,并在内核空间,根据所述数量信息,生成所述从操作***实例完整的资源描述信息,以使所述从操作***实例将所述资源描述信息加载与所述***资源中的物理内存分区资源中;或者,
所述主操作***实例在内核空间,生成所述从操作***实例的资源描述信息,以使所述从操作***实例将所述资源描述信息加载与所述***资源中的物理内存分区资源中;或者,
所述主操作***实例,生成所述从操作***实例的资源描述信息,加载于为所述从操作***实例分配的所述***资源中的物理内存分区中。
在第一个方面的第四种可能的实现方式中,所述主操作***实例根据所述资源需求信息,生成所述从操作***实例的资源描述信息之后,初始化所述***资源,得到初始化***资源之前,包括:
所述Primary操作***实例对所述物理内存分区资源进行虚拟地址重映射。
第二个方面,本发明实施例提供一种操作***实例创建装置,包括:
接收模块,用于接收指示创建从操作***实例的创建请求,所述创建请求携带所述从操作***的资源需求信息;
分配模块,用于根据所述资源需求信息,为所述从操作***实例分配独占的***资源,所述***资源至少包括:处理器资源、物理内存分区资源;
生成模块,用于根据所述资源需求信息,生成所述从操作***实例的资源描述信息;
初始化模块,用于初始化所述***资源,得到初始化***资源;
启动模块,用于在所述初始化***资源上启动所述从操作***实例。
在第二个方面的第一种可能的实现方式中,所述装置还包括:
判断模块,用于根据所述资源需求信息,判断资源池中是否存在满足所述资源需求信息的所述***资源。
结合第二个方面或第二个方面的第一种可能的实现方式,在第二个方面的第二种可能的实现方式中,所述资源描述信息,包括:
兼容的资源描述信息,所述兼容的资源描述信息为不符合引导过程标准multiboot的资源描述信息;或者,
标准的资源描述信息,所述标准的资源描述信息为符合引导过程标准multiboot的资源描述信息。
结合第二个方面、第二个方面的第一种或第二种可能的实现方式,在第二个方面的第三种可能的实现方式中,所述生成模块,用于根据所述资源需求信息,在用户层生成描述所述***资源的数量信息的第一资源描述信息,并在内核空间,根据所述数量信息,生成所述从操作***实例完整的资源描述信息,以使所述从操作***实例将所述资源描述信息加载与所述***资源 中的物理内存分区资源中;或者,
在内核空间,生成所述从操作***实例的资源描述信息,以使所述从操作***实例将所述资源描述信息加载与所述***资源中的物理内存分区资源中;或者,
生成所述从操作***实例的资源描述信息,加载于为所述从操作***实例分配的所述***资源中的物理内存分区中。
在第二个方面的第四种可能的实现方式中,所述装置还包括:
重映射模块,用于对所述物理内存分区资源进行虚拟地址重映射。
本发明实施例提供的操作***实例创建方法及装置,Primary操作***根据资源需求信息,为Secondary操作***实例分配独占的***资源,生成Secondary操作***实例的资源描述信息后,初始化并启动Secondary操作***实例,从而实现根据用户提供的资源需求,动态的创建具有独占资源的操作***实例,达到提高***扩展性能,并满足用户的需求的目的。
附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1为本发明操作***实例创建方法实施例一的流程图;
图2为本发明操作***实例创建方法所适用的启动参数数据结构示意图;
图3为本发明操作***实例创建装置实施例一的结构示意图;
图4为本发明操作***实例创建装置实施例二的结构示意图;
图5为本发明操作***实例创建装置实施例三的结构示意图。
具体实施方式
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于 本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
图1为本发明操作***实例创建方法实施例一的流程图。本实施例适用于具有主(Primary)操作***实例与至少一个从(Secondary)操作***实例的多内核操作***,应用于需要动态创建具有独立***资源的Secondary操作***实例的场景。具体的,本实施例包括如下步骤:
101、主操作***实例接收指示创建从操作***实例的创建请求,创建请求携带从操作***的资源需求信息。
多内核操作***中,Primary操作***实例也可称之为重量级操作***(Heavy OS),是具有资源分配、回收、虚拟化及协调等功能的通用操作***,也是在硬件上第一个启动的操作***实例,负责***资源的管理,例如,控制多处理器操作***中的CPU资源、物理内存分区资源、物理设备或虚拟设备等资源。Secondary操作***实例也可称之为轻量级操作***(Light OS),是基于Heavy OS所管理的资源而创建定制的操作***,只能管理自身的资源,从Heavy OS申请资源,或将资源释放后返还给Heavy OS。本步骤中,当需要发起某种应用服务时,用户在Primary操作***实例的环境或接口中提出创建启动Secondary操作***实例的创建请求,同时提供该应用服务所需的资源需求信息,例如,需求的CPU的个数、物理内存分区的大小等。
102、主操作***实例根据资源需求信息,为从操作***实例分配独占的***资源,***资源至少包括:处理器资源、物理内存分区资源。
在接收到Secondary操作***实例生成所需的资源需求信息后,Primary操作***从资源池中为Secondary操作***实例分配独占的***资源,例如,独占的CPU,独占的物理内存分区、独占的虚拟设备或物理设备等设备资源。
103、主操作***实例根据资源需求信息,生成从操作***的资源描述信息。
Primary操作***根据接收到的Secondary操作***实例创建请求中的资源需求信息,为从操作***实例生成特定数据结构的资源描述信息,例如,对于华为资助下,中科院开发出的多内核操作***:Rainforest操作***而言,生成启动参数数据结构Kernbootparams的资源描述信息。
可选的,Primary操作***可采用如下几种方式为Secondary操作***实 例生成资源描述信息:
方式一、主操作***实例根据资源需求信息,在用户层生成描述***资源的数量信息的第一资源描述信息,并在内核空间,根据数量信息,生成从操作***完整的资源描述信息,以使从操作***实例将资源描述信息加载与***资源中的物理内存分区中。
具体的,主操作***可先根据资源需求信息,在用户层构造出描述***资源的数量信息的第一资源描述信息,将所需的***资源的相关信息,如CPU的个数、Core的个数、物理内存分区的大小、与应用服务对应的***映像文件的信息等填充在资源描述信息中形成描述数量信息的第一资源描述信息。然后,通过函数调用等将用户层生成的第一资源描述信息传输至内核空间,在内核空间继续对第一资源描述信息进行填充,例如,与所需的CPU个数对应的具体CPU的信息、与所需的物理内存分区的大小对应的具体的物理内存分区的信息补充到第一资源描述信息中,从而生成最终完整的资源描述信息,然后使从操作***实例将资源描述信息加载与***资源中的物理内存分区中。
方式二、主操作***实例在内核空间,生成从操作***实例的资源描述信息,以使从操作***实例将资源描述信息加载与***资源中的物理内存分区中。具体的,Primary操作***在内核空间,直接根据资源需求信息,生成Secondary操作***实例完整的资源描述信息。
方式三、构建从操作***实例的资源描述信息,直接加载于为从操作***实例分配的物理内存分区上,由从操作***从内存空间读取。
104、主操作***实例初始化***资源,得到初始化***资源;
本步骤中,Primary操作***实例初始化***资源,并准备Secondary操作***实例启动的相关资源,如x86架构CPU从实模式转换到保护模式的跳板(Trampoline)代码等。
需要说明的是,上述103与104没有严格的先后顺序,即实际的实施过程中,可先生成资源描述信息,再初始化***资源;或者,也可以先初始化***资源,再生成资源描述信息。
105、主操作***实例在初始化***资源上启动从操作***实例。
对***资源初始化后,Primary操作***实例在初始化***资源上运行 Secondary操作***内核代码等,从而创建启动Secondary操作***实例。
本发明实施例提供的操作***实例创建方法,Primary操作***根据资源需求信息,为Secondary操作***实例分配独占的***资源,生成Secondary操作***实例的资源描述信息后,初始化并启动Secondary操作***实例,从而实现根据用户提供的资源需求,动态的创建具有独占资源的操作***实例,达到提高***扩展性能,并满足用户的需求的目的。
进一步的,上述实施例一中,主操作***实例接收指示创建从操作***实例的创建请求之后,根据资源需求信息,分配独占的***资源之前,可根据资源需求信息,判断资源池中是否存在满足资源需求信息的***资源。
具体的,Primary操作***实例可根据资源需求信息,判断资源池中空闲的资源是否存在满足资源需求信息的资源,例如,可以根据CPU分配状态位图(MP Table),判断当前空闲可用的CPU或Core,或者,通过其他方式释放,如热插拔(Hotplug)方式释放其他Secondary操作***实例中的CPU,将回收的CPU分配给当前待创建的Secondary操作***实例。
进一步的,上述实施例一中,从引导过程标准(multiboot)的角度来讲,从操作***实例的资源描述信息包括兼容的资源描述信息与标准的资源描述信息,符合multiboot的资源描述信息称之为标准的资源描述信息;反之,不符合multiboot的资源描述信息称之为兼容的资源描述信息。
一般来说,多内核操作***可以有多种表现形式,例如,华为资助下,中科院开发出的Rainforest操作***、剑桥大学维护的开源虚拟技术的开放源代码虚拟机监视器(XEN)、在XEN虚拟机上具有访问意见资源权限,并且可以管理其他字操作***的操作***(Demain0)。下面,以Rainforest操作***为例,对本发明进行详细阐述。
具体的,在Rainforest***是一个由一个(亦可以为多个)Primary操作实例和多个Secondary操作***实例构成的***,Primary操作***实例负责***资源的整合、配置、Secondary操作***实例的生命周期的管理等,Secondary操作***实例在隔离的物理内存分区上运行。其中,在对***资源进行分区时有以下指导原则:首先,以物理上(PCI-E、内部总线)相互隔离的设备划分,其次,在***资源无法满足需求时可以以物理设备的独立功能单元划分,最后,才会考虑对单一物理设备进行虚拟化,通过时间复用物理设备向上构 造多个虚拟设备。Rainforest***的Primary操作***实例包括:操作***用户层加载功能(Osloader)模块、CPU控制(CPU Controller)模块以及跳板(Trampoline)模块,Primary操作***实例用Osloader功能模块响应用户发送的Secondary操作***实例创建请求,经由CPU Controller模块驱动创建Secondary操作***实例,并通过Trampoline模块完成模式转换,大致包括如下步骤:
S1、Primary操作***实例接收创建启动Secondary操作***实例的创建请求。
S2、Primary操作***实例中的Osloader模块响应创建请求,在用户层构造第一资源描述信息,并调用内核空间的CPU Controller模块。
本步骤中,在用户层构造的第一资源描述信息例如启动Secondary操作***实例的部分启动参数。具体的,Osloader模块完成如下子步骤:
S21、根据应用服务的特性的资源需求信息,准备在用户层构造第一资源描述信息。
具体的,资源需求信息例如为CPU/core的个数、物理内存分区的大小以及启动待创建的Secondary操作***所需的***映像文件等。
S22、验证资源需求信息中对应资源的合法性,并进行一系列的初始化。
例如,以CPU为例,若S21中资源描述信息指示的CPU个数为6个,则Osloader模块验证***资源池中是否存在6个空闲的CPU,或者,是否可以热插拔(hotplug)其他Secondary操作***实例的6个CPU,以分配给该待创建的Secondary***实例。以***映像文件为例,Osloader模块验证***映像文件的合法性。
S23、若合法,则根据资源需求信息在用户层生成第一资源描述信息。
若步骤S22验证出资源需求信息中对应资源的均合法,则在用户层生成第一资源描述信息,该第一资源描述信息用于描述***资源的数量信息等,例如为启动参数数据结构(kernboootparams),其中包括CPU/Core的个数、物理内存分区资源大小、***映像文件的相关信息等。具体的,图2为本发明操作***实例创建方法所适用的启动参数数据结构示意图。
S24、Osloader模块调用CPU Controller模块,分配相关资源,之后准备在内核空间构建完整资源描述信息。
在对第一资源描述信息,即启动参数部分数据结构填充完毕后,Osloader模块调用CPU Controller模块,通过调用函数(ioctl)将构造的第一资源描述信息传入内核空间,并监控该参数中的指示Secondary操作***实例是否成功创建的成员变量ret,以确定Secondary操作***实例创建的成功与否。
S3、CPU Controller模块根据在用户层生成的第一资源描述信息,分配相关的***资源,在内核空间构建Secondary操作***实例的完整资源描述信息,该过程包括具体CPU/core的分配、物理内存分区的分配、页表映射、CPU分配状态位图(MP Table)等一系列Secondary操作***实例启动所需求的资源准备工作,最后发送高级可编程中断控制器(Inter-Processor Interrupt Controller,IPI),顺序启动Secondary操作***实例。具体的,CPU Controller模块完成如下子步骤:
S31、CPU Controller模块接收Osloader模块发送的在用户层生成的第一资源描述信息。
在接收到Osloader模块传入的第一资源描述信息后,CPU Controller模块根据CPU分配状态位图(MP Table、CPU_Possible、CPU_online_map),从当前空闲的CPU/core中或通过其他方式释放(如CPU_hotplug)的第一资源描述信息指示的CPU/core资源,分配给Secondary操作***实例,同时通过alloc_pages()函数为该Secondary操作***实例分配第一资源描述信息指示的、连续的物理内存分区。
S32、CPU Controller模块生成Secondary操作***实例的资源描述信息。
CPU Controller模块在S31中分配所需资源中,为Secondary操作***实例分配的物理内存分区上构建符合PC标准的MP_Table、ACPI_Table描述信息,描述为Secondary操作***实例分配的CPU/core的具体相关信息以及***的全局描述符表(Global Descriptor Table,GDT)、中断描述符表(Interrupt Descriptor Table,IDT)等信息,同时构建E820map数据结构,在Secondary操作***实例启动过程中,通过detect_memory_e820()获取内存布局,填充boot_params.e820map,从而建立Secondary操作***实例物理内存分区的管理框架基础。其中,ACPI_Table可用于描述为Secondary操作***实例分配的***资源中的独占的设备资源的信息,该独占的设备资源信息可以是从Primary操作***实例的设备信息中选取可用的信息参数后再填充在 ACPI_Table中。
S33、Primary操作***实例对所理内存分区资源进行虚拟地址重映射。
Primary操作***实例的CPU Controller模块为步骤S31中分配的物理内存分区获取起始处(memstart)信息,进行虚拟地址的重映射page_to_phys(),使得Secondary操作***实例具有独立的地址空间。
S34、CPU Controller模块将***映像文件传入Secondary操作***实例的物理内存分区。
CPU Controller模块复制传入的***映像文件到指定的物理内存空间,并填充完善启动参数Kernbootparams数据结构,如步骤S33中获取起始处(memstart)信息、***映像文件等,完成资源描述信息构造工作,准备好所有必须的资源后,Secondary操作***实例等待IPI信号。
S35、CPU Controller模块将资源描述信息传入Trampoline模块。
在构造完资源描述信息,即对整个启动参数Kernbootparams数据结构填充完毕后,CPU Controller模块将模式转换的功能代码(trampoline_data_multi-kernel)设置到指定位置,并将整个启动参数Kernbootparams数据结构传入至Trampoline模块。
S36、CPU Controller模块向Secondary操作***实例发送IPI中断信号。
具体的,CPU Controller模块转换启动参数成员变量bspindex为高级配置与电源管理接口(Advanced Configuration and Power Interface,apicid),即int apicid=apic->CPU_present_toapicid(bp->bspindex),通过apic机制发送IPI中断信号,让Secondary操作***实例执行相应的中断处理程序。
S4、Trampoline模块对Secondary操作***实例分配的***资源进行初始化,并启动Secondary操作***实例。
本步骤中,Trampoline模块在Primary操作***实例为Secondary操作***实例分配好***资源后,初始化处理器资源、内存分区资源等***资源,如初始化CPU等待IPI信号、调整trampoline里页表区域的值、虚拟地址的重映射等。具体的,Secondary操作***实例的CPU/core在Trampoline模块支持下初始化后,等待IPI信号,当接收到IPI中断信号后,执行相应处理程序,然后,通过trampoline跳转、使得Secondary操作***实例的CPU/core完成实模式到保护模式的转换。Trampoline模块通过head.S复制trampoline功能代码的构造参数 到Secondary操作***的内核空间,作为Secondary操作***实例启动所需的参数,然后跳转到Secondary操作***实例的***映像文件加载处,加载***映像文件后,将执行权交给Secondary操作***实例的内核,完成一系列的初始化任务,搭建整个***运行内核环境,从start_kernel到CPU_idle。该启动过程中,对于Linux操作***,Secondary操作***在启动过程中会从低地址空间,如BIOS内存区域读取设备资源的信息,以此来启动和初始化设备。对于非直接访问的设备,有Primary操作***实例和Secondary操作***实例协商完成“虚拟设备”的构建。
最后,当Secondary操作***实例启动成功后,Primary操作***实例将osloader中用于监控的成员变量ret置1,标识该Secondary操作***实例成功创建。
图3为本发明操作***实例创建装置实施例一的结构示意图。本实施例提供的操作***实例创建装置可设置在多处理器操作***的Primary操作***实例上,也可以是Primary操作***实例本身,是与本发明图1实施例对应的装置实施例,具体实现过程在此不再赘述。具体的,本实施例提供的操作***实例创建装置100具体包括:
接收模块11,用于接收指示创建从操作***实例的创建请求,创建请求携带从操作***的资源需求信息;
分配模块12,用于根据资源需求信息,为从操作***实例分配独占的***资源,***资源至少包括:处理器资源、物理内存分区资源;
生成模块13,用于根据资源需求信息,生成从操作***实例的资源描述信息;
初始化模块14,用于初始化***资源,得到初始化***资源;
启动模块15,用于在初始化***资源上启动从操作***实例。
本发明实施例提供的操作***实例创建装置,根据资源需求信息,为Secondary操作***实例分配独占的***资源,生成Secondary操作***实例的资源描述信息后,初始化并启动Secondary操作***实例,从而实现根据用户提供的资源需求,动态的创建具有独占资源的操作***实例,达到提高***扩展性能,并满足用户的需求的目的。
图4为本发明操作***实例创建装置实施例二的结构示意图。如图4所 示,本实施例提供的操作***实例创建装置200,在图3的基础上,还包括:
判断模块16,用于根据资源需求信息,判断资源池中是否存在满足资源需求信息的***资源。
进一步的,资源描述信息,包括:
兼容的资源描述信息,兼容的资源描述信息为不符合引导过程标准multiboot的资源描述信息;或者,
标准的资源描述信息,标准的资源描述信息为符合引导过程标准multiboot的资源描述信息。
进一步的,生成模块13,用于根据资源需求信息,在用户层生成描述***资源的数量信息的第一资源描述信息,并在内核空间,根据数量信息,生成从操作***实例完整的资源描述信息,以使从操作***实例将资源描述信息加载与***资源中的物理内存分区资源中;或者,
在内核空间,生成从操作***实例的资源描述信息,以使从操作***实例将资源描述信息加载与***资源中的物理内存分区资源中;或者,
生成从操作***实例的资源描述信息,加载于为从操作***实例分配的***资源中的物理内存分区中。
再请参照图4,操作***实例创建装置包括:
重映射模块17,用于对物理内存分区资源进行虚拟地址重映射。
图5为本发明操作***实例创建装置实施例三的结构示意图。如图5所示,本实施例提供的操作***实例创建装置300包括处理器31和存储器32。操作***实例创建装置300还可以包括发射器33、接收器34。发射器33和接收器34可以和处理器31相连。其中,发射器33用于发送数据或信息,接收器34用于接收数据或信息,存储器32存储执行指令,当操作***实例创建装置300运行时,处理器31与存储器32之间通信,处理器31调用存储器32中的执行指令,用于执行以下操作:
接收指示创建从操作***实例的创建请求,创建请求携带从操作***的资源需求信息;
根据资源需求信息,为从操作***实例分配独占的***资源,***资源至少包括:处理器资源、物理内存分区资源;
根据资源需求信息,生成从操作***实例的资源描述信息;
初始化***资源,得到初始化***资源;
在初始化***资源上启动从操作***实例。
进一步的,接收指示创建从操作***实例的创建请求之后,根据资源需求信息,为从操作***实例分配独占的***资源之前,包括:
根据资源需求信息,判断资源池中是否存在满足资源需求信息的***资源。
进一步的,资源描述信息,包括:
兼容的资源描述信息,兼容的资源描述信息为不符合引导过程标准multiboot的资源描述信息;或者,
标准的资源描述信息,标准的资源描述信息为符合引导过程标准multiboot的资源描述信息。
进一步的,根据资源需求信息,生成从操作***的资源描述信息,包括:
根据资源需求信息,在用户层生成描述***资源的数量信息的第一资源描述信息,并在内核空间,根据数量信息,生成从操作***实例完整的资源描述信息,以使从操作***实例将资源描述信息加载与***资源中的物理内存分区资源中;或者,
在内核空间,生成从操作***实例的资源描述信息,以使从操作***实例将资源描述信息加载与***资源中的物理内存分区资源中;或者,
生成从操作***实例的资源描述信息,加载于为从操作***实例分配的***资源中的物理内存分区中。
进一步的,根据资源需求信息,生成从操作***实例的资源描述信息之后,初始化***资源,得到初始化***资源之前,包括:
对物理内存分区资源进行虚拟地址重映射。
本领域普通技术人员可以理解:实现上述各方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成。前述的程序可以存储于一计算机可读取存储介质中。该程序在执行时,执行包括上述各方法实施例的步骤;而前述的存储介质包括:ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。
最后应说明的是:以上各实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述各实施例对本发明进行了详细的说明,本领域的普通 技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的范围。

Claims (10)

  1. 一种操作***实例创建方法,其特征在于,包括:
    主操作***实例接收指示创建从操作***实例的创建请求,所述创建请求携带所述从操作***实例的资源需求信息;
    所述主操作***实例根据所述资源需求信息,为所述从操作***实例分配独占的***资源,所述***资源至少包括:处理器资源、物理内存分区资源;
    所述主操作***实例根据所述资源需求信息,生成所述从操作***实例的资源描述信息;
    所述主操作***实例初始化所述***资源,得到初始化***资源;
    所述主操作***实例在所述初始化***资源上启动所述从操作***实例。
  2. 根据权利要求1所述的方法,其特征在于,所述主操作***实例接收指示创建从操作***实例的创建请求之后,根据所述资源需求信息,为所述从操作***实例分配独占的***资源之前,包括:
    所述主操作***实例根据所述资源需求信息,判断资源池中是否存在满足所述资源需求信息的所述***资源。
  3. 根据权利要求1或2所述的方法,其特征在于,所述资源描述信息,包括:
    兼容的资源描述信息,所述兼容的资源描述信息为不符合引导过程标准multiboot的资源描述信息;或者,
    标准的资源描述信息,所述标准的资源描述信息为符合引导过程标准multiboot的资源描述信息。
  4. 根据权利要求1~3任一项所述的方法,其特征在于,所述主操作***实例根据所述资源需求信息,生成所述从操作***实例的资源描述信息,包括:
    所述主操作***实例根据所述资源需求信息,在用户层生成描述所述***资源的数量信息的第一资源描述信息,并在内核空间,根据所述数量信息,生成所述从操作***实例完整的资源描述信息,以使所述从操作***实例将 所述资源描述信息加载与所述***资源中的物理内存分区资源中;或者,
    所述主操作***实例在内核空间,生成所述从操作***实例的资源描述信息,以使所述从操作***实例将所述资源描述信息加载与所述***资源中的物理内存分区资源中;或者,
    所述主操作***实例,生成所述从操作***实例的资源描述信息,加载于为所述从操作***实例分配的所述***资源中的物理内存分区中。
  5. 根据权利要求1所述的方法,其特征在于,所述主操作***实例根据所述资源需求信息,生成所述从操作***实例的资源描述信息之后,初始化所述***资源,得到初始化***资源之前,包括:
    所述主操作***实例对所述物理内存分区资源进行虚拟地址重映射。
  6. 一种操作***实例创建装置,其特征在于,包括:
    接收模块,用于接收指示创建从操作***实例的创建请求,所述创建请求携带所述从操作***的资源需求信息;
    分配模块,用于根据所述资源需求信息,为所述从操作***实例分配独占的***资源,所述***资源至少包括:处理器资源、物理内存分区资源;
    生成模块,用于根据所述资源需求信息,生成所述从操作***实例的资源描述信息;
    初始化模块,用于初始化所述***资源,得到初始化***资源;
    启动模块,用于在所述初始化***资源上启动所述从操作***实例。
  7. 根据权利要求6所述的装置,其特征在于,所述装置还包括:
    判断模块,用于根据所述资源需求信息,判断资源池中是否存在满足所述资源需求信息的所述***资源。
  8. 根据权利要求6或7所述的装置,其特征在于,所述资源描述信息,包括:
    兼容的资源描述信息,所述兼容的资源描述信息为不符合引导过程标准multiboot的资源描述信息;或者,
    标准的资源描述信息,所述标准的资源描述信息为符合引导过程标准multiboot的资源描述信息。
  9. 根据权利要求6~8任一项所述的装置,其特征在于,所述生成模块,用于根据所述资源需求信息,在用户层生成描述所述***资源的数量信息的 第一资源描述信息,并在内核空间,根据所述数量信息,生成所述从操作***实例完整的资源描述信息,以使所述从操作***实例将所述资源描述信息加载与所述***资源中的物理内存分区资源中;或者,
    在内核空间,生成所述从操作***实例的资源描述信息,以使所述从操作***实例将所述资源描述信息加载与所述***资源中的物理内存分区资源中;或者,
    生成所述从操作***实例的资源描述信息,加载于为所述从操作***实例分配的所述***资源中的物理内存分区中。
  10. 根据权利要求6所述的装置,其特征在于,所述装置还包括:
    重映射模块,用于对所述物理内存分区资源进行虚拟地址重映射。
PCT/CN2014/094039 2013-12-17 2014-12-17 操作***实例创建方法及装置 WO2015090195A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201310695516.8A CN104714821B (zh) 2013-12-17 2013-12-17 操作***实例创建方法及装置
CN201310695516.8 2013-12-17

Publications (1)

Publication Number Publication Date
WO2015090195A1 true WO2015090195A1 (zh) 2015-06-25

Family

ID=53402109

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/094039 WO2015090195A1 (zh) 2013-12-17 2014-12-17 操作***实例创建方法及装置

Country Status (2)

Country Link
CN (1) CN104714821B (zh)
WO (1) WO2015090195A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109542610A (zh) * 2018-12-04 2019-03-29 中国航空工业集团公司西安航空计算技术研究所 一种多分区操作***虚中断标准组件实现方法

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10248459B2 (en) * 2016-03-15 2019-04-02 Microsoft Technology Licensing, Llc Operating system support for game mode
JP2020503609A (ja) * 2016-12-27 2020-01-30 深▲せん▼前海達闥雲端智能科技有限公司Cloudminds (Shenzhen) Robotics Systems Co., Ltd. マルチオペレーティングシステム用のメモリアクセス方法、装置及び電子設備

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101211272A (zh) * 2006-12-29 2008-07-02 英特尔公司 动态虚拟机生成
CN103002044A (zh) * 2012-12-18 2013-03-27 武汉大学 一种提高多平台智能终端处理能力的方法

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8776050B2 (en) * 2003-08-20 2014-07-08 Oracle International Corporation Distributed virtual machine monitor for managing multiple virtual resources across multiple physical nodes
KR100746025B1 (ko) * 2006-01-12 2007-08-06 삼성전자주식회사 운영체제 스위칭 장치 및 방법
US8176485B2 (en) * 2006-05-15 2012-05-08 Microsoft Corporation Launching hypervisor under running operating system
CN101419561A (zh) * 2007-10-26 2009-04-29 中兴通讯股份有限公司 一种异构多核体系中的资源管理方法及***
CN100570566C (zh) * 2007-12-13 2009-12-16 中兴通讯股份有限公司 一种异构多核间协调调度的方法及异构多核***
CN101246431B (zh) * 2008-03-10 2010-08-18 中兴通讯股份有限公司 加载多核不同操作***映像的管理方法
KR20090108868A (ko) * 2008-04-14 2009-10-19 삼성전자주식회사 가상 머신 관리 시스템 및 그의 프로세서 자원 관리방법
CN101373441B (zh) * 2008-09-19 2012-04-18 苏州壹世通科技有限公司 一种基于固件的虚拟化平台***
US8533713B2 (en) * 2011-03-29 2013-09-10 Intel Corporation Efficent migration of virtual functions to enable high availability and resource rebalance
CN103257929B (zh) * 2013-04-18 2016-03-16 中国科学院计算技术研究所 一种虚拟机内存映射方法及***

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101211272A (zh) * 2006-12-29 2008-07-02 英特尔公司 动态虚拟机生成
CN103002044A (zh) * 2012-12-18 2013-03-27 武汉大学 一种提高多平台智能终端处理能力的方法

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109542610A (zh) * 2018-12-04 2019-03-29 中国航空工业集团公司西安航空计算技术研究所 一种多分区操作***虚中断标准组件实现方法
CN109542610B (zh) * 2018-12-04 2023-06-30 中国航空工业集团公司西安航空计算技术研究所 一种多分区操作***虚中断标准组件实现方法

Also Published As

Publication number Publication date
CN104714821B (zh) 2018-07-31
CN104714821A (zh) 2015-06-17

Similar Documents

Publication Publication Date Title
RU2639693C1 (ru) Способ обработки ресурса, операционная система и устройство
US11429442B2 (en) Parallel and distributed computing using multiple virtual machines
US8381002B2 (en) Transparently increasing power savings in a power management environment
US10191759B2 (en) Apparatus and method for scheduling graphics processing unit workloads from virtual machines
US10656961B2 (en) Method and apparatus for operating a plurality of operating systems in an industry internet operating system
JP5893029B2 (ja) クラウド・コンピューティング環境においてハイパーバイザの制御を可能にする方法
US20170322824A1 (en) Cloning Computing Device Containers
JP2016541072A5 (zh)
JP2011100431A (ja) 仮想マシン制御装置及び仮想マシン制御方法
CN113778612A (zh) 基于微内核机制的嵌入式虚拟化***实现方法
WO2021018267A1 (zh) 虚拟机热迁移方法和通信设备
JP2008186175A (ja) オペレーティングシステムの起動制御方法及び情報処理装置
WO2019028682A1 (zh) 一种多***共享内存的管理方法及装置
WO2015090195A1 (zh) 操作***实例创建方法及装置
CN104714843B (zh) 多内核操作***实例支持多处理器的方法及装置
US20150186180A1 (en) Systems and methods for affinity dispatching based on network input/output requests
CN113568734A (zh) 基于多核处理器的虚拟化方法、***、多核处理器和电子设备
JP2011221634A (ja) 計算機システム、論理区画管理方法及び論理分割処理プログラム
CN114461290A (zh) 数据处理的方法、实例以及***
KR101334842B1 (ko) 가상화 지원 단말 플랫폼을 위한 가상머신 관리장치 및 방법
CN117331704B (zh) 图形处理器gpu调度方法、装置和存储介质
KR102214231B1 (ko) 오프로딩을 수행하기 위한 모바일 장치 및 그 동작 방법
CN114816648A (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: 14871533

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 14871533

Country of ref document: EP

Kind code of ref document: A1