CN104714821B - Operation system example creation method and device - Google Patents

Operation system example creation method and device Download PDF

Info

Publication number
CN104714821B
CN104714821B CN201310695516.8A CN201310695516A CN104714821B CN 104714821 B CN104714821 B CN 104714821B CN 201310695516 A CN201310695516 A CN 201310695516A CN 104714821 B CN104714821 B CN 104714821B
Authority
CN
China
Prior art keywords
resource
operating system
description information
system instance
information
Prior art date
Legal status (The legal status 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 status listed.)
Expired - Fee Related
Application number
CN201310695516.8A
Other languages
Chinese (zh)
Other versions
CN104714821A (en
Inventor
高云伟
池志雄
陆钢
丁科
詹剑锋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Institute of Computing Technology of CAS
Original Assignee
Huawei Technologies Co Ltd
Institute of Computing Technology of CAS
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 Huawei Technologies Co Ltd, Institute of Computing Technology of CAS filed Critical Huawei Technologies Co Ltd
Priority to CN201310695516.8A priority Critical patent/CN104714821B/en
Priority to PCT/CN2014/094039 priority patent/WO2015090195A1/en
Publication of CN104714821A publication Critical patent/CN104714821A/en
Application granted granted Critical
Publication of CN104714821B publication Critical patent/CN104714821B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

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/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]

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

A kind of operation system example creation method of offer of the embodiment of the present invention and device, in this method, Primary operating systems are according to resource requirement information, for the exclusive system resource of Secondary operation system examples distribution, after the resource description information for generating Secondary operation system examples, it initializes and starts Secondary operation system examples, to realize the resource requirement provided according to user, it is dynamic to create the operation system example with exclusive resource, reach and improve set expandability energy, and the purpose met the needs of users.

Description

Operating system instance creating method and device
Technical Field
The embodiment of the invention relates to the field of computers, in particular to an operating system instance creating method and device.
Background
With the continuous development of computer technology, 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 computer systems including at least one multi-Core processor are collectively called a multi-processor system.
In a multiprocessor system, a kernel (kernel) is deployed on one or more physical cores (core), called a multi-core operating system, in which a customized independently compiled system image is deployed on the core, thereby forming a complete operating system. Generally, multiple operating system instances coexist on a multi-kernel operating system, wherein the first started operating system instance is a Primary (Primary) operating system instance, one or more subsequently started operating system instances are called Secondary (Secondary) operating system instances, and a user can create and manage the Secondary operating system instances through the Primary operating system instances. In order to meet the user requirements, an operating system instance conforming to the resource requirements needs to be created according to the resource requirements provided by the user. However, there is no specific method in the prior art for dynamically creating an operating system instance with an exclusive resource according to the resource requirement provided by the user.
Therefore, how to provide a method for dynamically creating an operating system instance with exclusive resources according to the resource requirements provided by the user is an urgent problem to be solved in the industry.
Disclosure of Invention
The embodiment of the invention provides an operating system instance creating method and device, which can dynamically create an operating system instance with exclusive resources according to the resource requirements provided by a user, thereby improving the system expansion performance and meeting the requirements of the user.
In a first aspect, an embodiment of the present invention provides an operating system instance creating method, including:
a master operating system example receives a creation request for indicating the creation of a slave operating system example, wherein the creation request carries resource requirement information of the slave operating system example;
the master operating system instance allocates exclusive system resources to the slave operating system instance according to the resource demand information, wherein the system resources at least comprise: processor resources, physical memory partition resources;
the master operating system instance generates resource description information of the slave operating system instance according to the resource demand information;
the main operating system instance initializes the system resources to obtain initialized system resources;
the master operating system instance starts the slave operating system instance on the initialization system resource.
In a first possible implementation manner of the first aspect, after the master operating system instance receives a creation request indicating creation of a slave operating system instance, before allocating an exclusive system resource to the slave operating system instance according to the resource requirement information, the method includes:
and the main operating system example judges whether the system resources meeting the resource demand information exist in a resource pool or not according to the resource demand information.
With reference to the first aspect or the first possible implementation manner of the first aspect, in a second possible implementation manner of the first aspect, the resource description information includes:
compatible resource description information, wherein the compatible resource description information is the resource description information which does not conform to the guide process standard multiboot; or,
and standard resource description information, wherein the standard resource description information is the resource description information conforming to the guide process standard multiboot.
With reference to the first aspect, the first or second possible implementation manner of the first aspect, in a third possible implementation manner of the first aspect, the generating, by the master operating system instance, the resource description information of the slave operating system according to the resource requirement information includes:
the main operating system instance generates first resource description information describing quantity information of the system resources on a user layer according to the resource demand information, and generates complete resource description information of the slave operating system instance in a kernel space according to the quantity information, so that the slave operating system instance loads the resource description information into physical memory partition resources in the system resources; or,
the master operating system instance generates resource description information of the slave operating system instance in a kernel space, so that the slave operating system instance loads the resource description information into a physical memory partition resource in the system resource; or,
and the master operating system instance generates the resource description information of the slave operating system instance and loads the resource description information into the physical memory partition in the system resource allocated to the slave operating system instance.
In a fourth possible implementation manner of the first aspect, after the master operating system instance generates the resource description information of the slave operating system instance according to the resource requirement information, initializing the system resource, and before obtaining the initialized system resource, the method includes:
and the Primary operating system example performs virtual address remapping on the physical memory partition resources.
In a second aspect, an embodiment of the present invention provides an operating system instance creating apparatus, including:
a receiving module, configured to receive a creation request indicating to create a slave operating system instance, where the creation request carries resource requirement information of the slave operating system;
an allocation module, configured to allocate an exclusive system resource to the slave operating system instance according to the resource demand information, where the system resource at least includes: processor resources, physical memory partition resources;
the generating module is used for generating the resource description information of the slave operating system instance according to the resource demand information;
the initialization module is used for initializing the system resources to obtain initialized system resources;
a start module to start the slave operating system instance on the initialization system resource.
In a first possible implementation manner of the second aspect, the apparatus further includes:
and the judging module is used for judging whether the system resources meeting the resource demand information exist in a resource pool or not according to the resource demand information.
With reference to the second aspect or the first possible implementation manner of the second aspect, in a second possible implementation manner of the second aspect, the resource description information includes:
compatible resource description information, wherein the compatible resource description information is the resource description information which does not conform to the guide process standard multiboot; or,
and standard resource description information, wherein the standard resource description information is the resource description information conforming to the guide process standard multiboot.
With reference to the second aspect and the first or second possible implementation manner of the second aspect, in a third possible implementation manner of the second aspect, the generating module is configured to generate, in a kernel space, first resource description information describing quantity information of the system resource on a user layer according to the resource demand information, and generate, according to the quantity information, complete resource description information of the slave operating system instance, so that the slave operating system instance loads the resource description information into a physical memory partition resource in the system resource; or,
in a kernel space, generating resource description information of the slave operating system instance so that the slave operating system instance loads the resource description information into a physical memory partition resource in the system resource; or,
and generating resource description information of the slave operating system instance, and loading the resource description information into the physical memory partition in the system resource allocated to the slave operating system instance.
In a fourth possible implementation manner of the second aspect, the apparatus further includes:
and the remapping module is used for remapping the virtual address of the physical memory partition resource.
According to the method and the device for creating the operating system instance, the Primary operating system allocates exclusive system resources for the Secondary operating system instance according to the resource demand information, initializes and starts the Secondary operating system instance after the resource description information of the Secondary operating system instance is generated, so that the operating system instance with the exclusive resources is dynamically created according to the resource demand provided by the user, the system expansion performance is improved, and the user demand is met.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
FIG. 1 is a flowchart of a first embodiment of a method for creating an instance of an operating system according to the present invention;
FIG. 2 is a diagram illustrating a data structure of a startup parameter applicable to the exemplary creating method of an operating system according to the present invention;
FIG. 3 is a schematic structural diagram of a first embodiment of an operating system instance creating apparatus according to the present invention;
FIG. 4 is a schematic structural diagram of a second embodiment of an operating system instance creating apparatus according to the present invention;
FIG. 5 is a block diagram of a third embodiment of an operating system creation apparatus according to the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
FIG. 1 is a flowchart of a first embodiment of a method for creating an instance of an operating system according to the present invention. The embodiment is suitable for a multi-core operating system with a Primary (Primary) operating system instance and at least one Secondary (Secondary) operating system instance, and is applied to a scene needing to dynamically create the Secondary operating system instance with independent system resources. Specifically, the present embodiment includes the following steps:
101. the master operating system instance receives a creation request indicating the creation of the slave operating system instance, wherein the creation request carries the resource requirement information of the slave operating system.
In the multi-kernel operating system, the Primary operating system instance may also be referred to as a HeavyOS (HeavyOS), which is a general-purpose operating system having functions of resource allocation, recovery, virtualization, coordination, and the like, and is also an operating system instance that is first started on hardware, and is responsible for management of system resources, for example, controlling resources such as CPU resources, physical memory partition resources, physical devices, or virtual devices in the multiprocessor operating system. The Secondary operating system may also be referred to as a lightweight operating system (Light OS), and is a customized operating system created based on resources managed by the Heavy OS, and may only manage its own resources, apply for resources from the Heavy OS, or release resources and return them to the Heavy OS. In this step, when some application service needs to be initiated, a user puts forward a creation request for creating and starting a Secondary operating system instance in an environment or an interface of a Primary operating system instance, and provides resource requirement information required by the application service, such as the number of required CPUs, the size of a physical memory partition, and the like.
102. The master operating system instance allocates exclusive system resources to the slave operating system instance according to the resource demand information, and the system resources at least comprise: processor resources, physical memory partition resources.
After receiving the resource requirement information required by the generation of the Secondary operating system instance, the Primary operating system allocates an exclusive system resource, such as an exclusive CPU, an exclusive physical memory partition, an exclusive virtual device, or a device resource such as a physical device, to the Secondary operating system instance from the resource pool.
103. And the master operating system instance generates the resource description information of the slave operating system according to the resource demand information.
The Primary operating system generates resource description information of a specific data structure for the Secondary operating system instance according to the resource requirement information in the received Secondary operating system instance creation request, for example, for a multi-core operating system developed by Chinese academy under Huawei funding: for the Rainforest operating system, resource description information of a boot parameter data structure Kernbootparams is generated.
Optionally, the Primary operating system may generate the resource description information for the Secondary operating system instance in the following ways:
in the first mode, the main operating system example generates first resource description information for describing quantity information of system resources on a user layer according to the resource demand information, and generates complete resource description information of the slave operating system according to the quantity information in the kernel space, so that the slave operating system example loads the resource description information into a physical memory partition in the system resources.
Specifically, the main operating system may first construct, on the user layer, first resource description information describing quantity information of the system resources according to the resource demand information, and fill relevant information of the required system resources, such as the number of CPUs, the number of cores, the size of the physical memory partition, information of the system image file corresponding to the application service, and the like, in the resource description information to form the first resource description information describing the quantity information. Then, the first resource description information generated by the user layer is transmitted to the kernel space through function call and the like, the first resource description information is continuously filled in the kernel space, for example, information of a specific CPU corresponding to the number of the required CPUs and information of a specific physical memory partition corresponding to the size of the required physical memory partition are supplemented to the first resource description information, so that final complete resource description information is generated, and then the resource description information is loaded into the physical memory partition in the system resource from the operating system instance.
And secondly, the main operating system instance generates the resource description information of the slave operating system instance in the kernel space, so that the slave operating system instance loads the resource description information into the physical memory partition in the system resource. Specifically, the Primary operating system directly generates complete resource description information of the Secondary operating system instance in the kernel space according to the resource demand information.
And thirdly, constructing resource description information of the slave operating system instance, directly loading the resource description information on the physical memory partition allocated for the slave operating system instance, and reading the resource description information from the memory space by the slave operating system.
104. Initializing system resources by a main operating system example to obtain initialized system resources;
in this step, the Primary os instance initializes system resources and prepares related resources for starting the Secondary os instance, such as a jumper (Trampoline) code for converting the x86 architecture CPU from real mode to protected mode.
It should be noted that there is no strict sequence between 103 and 104, that is, in the actual implementation process, the resource description information may be generated first, and then the system resources are initialized; alternatively, the system resources may be initialized first, and then the resource description information may be generated.
105. The master operating system instance starts the slave operating system instance on the initialization system resource.
After system resources are initialized, the Primary operating system instance runs a Secondary operating system kernel code and the like on the initialized system resources, so that the Secondary operating system instance is created and started.
In the method for creating the operating system instance provided by the embodiment of the present invention, the Primary operating system allocates an exclusive system resource to the Secondary operating system instance according to the resource requirement information, and initializes and starts the Secondary operating system instance after generating the resource description information of the Secondary operating system instance, so as to dynamically create the operating system instance with the exclusive resource according to the resource requirement provided by the user, thereby achieving the purposes of improving the system expansion performance and meeting the requirement of the user.
Further, in the first embodiment, after the master operating system instance receives the creation request indicating that the slave operating system instance is created, and before the exclusive system resource is allocated according to the resource demand information, it may be determined whether the system resource meeting the resource demand information exists in the resource pool according to the resource demand information.
Specifically, the Primary operating system instance may determine whether a resource meeting the resource demand information exists in the free resource in the resource pool according to the resource demand information, for example, may determine a currently free available CPU or Core according to a CPU allocation state bitmap (MP Table), or release the resource in other manners, such as releasing CPUs in other Secondary operating system instances in a hot plug (hotspot) manner, and allocate the recovered CPU to the Secondary operating system instance to be created currently.
Further, in the first embodiment, from the perspective of a boot process standard (multiboot), the resource description information of the operating system instance includes compatible resource description information and standard resource description information, and the resource description information conforming to the multiboot is referred to as standard resource description information; otherwise, the resource description information that does not conform to the multiboot is called compatible resource description information.
Generally, a multi-kernel operating system may have various manifestations, such as Rainforest operating system developed by Chinese academy, open source virtual machine monitor (XEN) of open source virtualization technology maintained by Cambridge university, operating system with access to opinion resources on XEN virtual machines (Demain 0) and may manage other word operating systems. The following describes the present invention in detail by taking the Rainforest operating system as an example.
Specifically, in the Rainforest system, the Primary operating system instance is a system composed of one (or multiple) Primary operating system instances and multiple Secondary operating system instances, the Primary operating system instances are responsible for integration and configuration of system resources, management of life cycles of the Secondary operating system instances, and the like, and the Secondary operating system instances run on isolated physical memory partitions. The following guiding principles are adopted when partitioning the system resources: firstly, the devices are divided into physically (PCI-E, internal bus) isolated devices, secondly, the devices can be divided into independent functional units of the physical devices when the system resources cannot meet the requirements, and finally, the virtualization of a single physical device is considered, and a plurality of virtual devices are constructed upwards through time-multiplexing the physical devices. Examples of the Primary operating System of Rainforest include: the method mainly comprises the following steps that an operating system user layer loading function (Osloader) module, a CPU control (CPU Controller) module and a ramp (Tracoline) module are adopted, a Primary operating system instance responds to a Secondary operating system instance creating request sent by a user through the Osloader function module, the CPU Controller module drives and creates a Secondary operating system instance, and mode conversion is completed through the Tracoline module, and the method roughly comprises the following steps:
s1, the Primary operating system instance receives a creation request for creating a startup Secondary operating system instance.
S2, responding to the creation request by the Osloader module in the Primary operating system instance, constructing first resource description information in a user layer, and calling a CPU Controller module of a kernel space.
In this step, the first resource description information constructed in the user layer is, for example, a part of a start parameter for starting a Secondary operating system instance. Specifically, the Osloader module completes the following substeps:
s21, according to the resource demand information of the application service, preparing to construct the first resource description information in the user layer.
Specifically, the resource requirement information includes, for example, the number of CPUs/cores, the size of a physical memory partition, a system image file required for starting a Secondary operating system to be created, and the like.
And S22, verifying the legality of the corresponding resource in the resource demand information, and carrying out a series of initializations.
For example, taking the CPU as an example, if the number of CPUs indicated by the resource description information in S21 is 6, the Osloader module verifies whether there are 6 free CPUs in the system resource pool, or whether 6 CPUs of other Secondary operating system instances can be hot-plugged (hotplug) to allocate to the Secondary system instance to be created. Taking the system image file as an example, the Osloader module verifies the validity of the system image file.
And S23, if the resource requirement information is legal, generating first resource description information in the user layer according to the resource requirement information.
If the step S22 verifies that the corresponding resources in the resource requirement information are all valid, first resource description information is generated in the user layer, where the first resource description information is used to describe quantity information of the system resources, for example, a startup parameter data structure (kernbootparams), which includes the number of CPUs/cores, the size of the physical memory partition resources, and related information of the system image file. Specifically, fig. 2 is a schematic diagram of a data structure of a startup parameter applicable to the method for creating an operating system example of the present invention.
And S24, calling the CPU Controller module by the Osloader module, distributing related resources, and then preparing to construct complete resource description information in the kernel space.
After the first resource description information, namely the data structure of the part of the starting parameter is filled, the Osloader module calls the CPU Controller module, the constructed first resource description information is transmitted into the kernel space by calling a function (ioctl), and a member variable ret which indicates whether the instance of the second operating system is successfully created in the parameter is monitored, so as to determine whether the instance of the second operating system is successfully created or not.
S3, the CPU Controller module allocates related system resources according to the first resource description information generated in the user layer, and constructs complete resource description information of the Secondary operating system instance in the kernel space, the process includes the allocation of specific CPU/core, the allocation of physical memory partition, page Table mapping, CPU allocation state bitmap (MP Table) and other series of resource preparation work required by the starting of the Secondary operating system instance, and finally sends an Inter-Processor Interrupt Controller (IPI) to start the Secondary operating system instance in sequence. Specifically, the CPU Controller module performs the following substeps:
and S31, the CPU Controller module receives the first resource description information generated at the user layer and sent by the Osloader module.
After receiving the first resource description information transmitted by the Osloader module, the CPU Controller module allocates the CPU/core resource indicated by the first resource description information, which is released from the currently idle CPU/core or by other means (e.g., CPU _ host) according to the CPU allocation state bitmap (MP Table, CPU _ grant, CPU _ online _ map), to the Secondary operating system instance, and allocates the continuous physical memory partition indicated by the first resource description information to the Secondary operating system instance through the alloc _ pages () function.
S32, the CPU Controller module generates the resource description information of the Secondary operating system instance.
In the step of allocating the required resources in S31, the CPU Controller module constructs MP _ Table and ACPI _ Table description information meeting the PC standard, and describes information such as specific relevant information of the CPU/core allocated to the Secondary operating system instance and information such as a Global Descriptor Table (GDT) and an Interrupt Descriptor Table (IDT) of the system, and constructs an E820map data structure, and in the process of starting the Secondary operating system instance, obtains a memory layout through detect _ memory _ E820() and fills a boot _ param.e 820map, thereby establishing a management frame basis of the physical memory partition of the Secondary operating system instance. The ACPI _ Table may be used to describe information of an exclusive device resource in the system resources allocated to the Secondary operating system instance, where the exclusive device resource information may be obtained by selecting an available information parameter from the device information of the Primary operating system instance and then refilling the information parameter in the ACPI _ Table.
S33, the Primary operating system example remaps the virtual address of the managed memory partition resource.
The CPU Controller module of the Primary operating system instance obtains start (memstart) information for the physical memory partition allocated in step S31, and remaps page _ to _ phys () of the virtual address, so that the Secondary operating system instance has an independent address space.
And S34, the CPU Controller module transmits the system image file to the physical memory partition of the Secondary operating system instance.
The CPU Controller module copies the system image file that is transferred to the designated physical memory space, and fills the perfect startup parameter Kernbootparams data structure, for example, in step S33, obtains start (memstart) information, the system image file, and the like, completes the resource description information construction work, and after all necessary resources are prepared, the Secondary operating system instance waits for the IPI signal.
S35, the CPU Controller module transmits the resource description information to the Trampoline module.
After the resource description information is constructed, that is, the whole startup parameter Kernbootparams data structure is filled, the CPU Controller module sets the function code of the mode conversion (Trampoline _ data _ multi-kernel) to the specified position, and transmits the whole startup parameter Kernbootparams data structure to the Trampoline module.
S36, the CPU Controller module sends IPI interrupt signal to the Secondary operating system instance.
Specifically, the CPU Controller module converts the start parameter member variable bspindex into an Advanced Configuration and Power management Interface (Advanced Configuration and Power Interface, apic), that is, int apic = apic- > CPU _ present _ toactid (bp- > bspindex), and sends an IPI interrupt signal through the apic mechanism, so that the instance of the Secondary operating system executes a corresponding interrupt handler.
S4, initializing the system resource distributed by the Secondary operating system instance by the Trampoline module, and starting the Secondary operating system instance.
In this step, after the Primary operating system instance allocates system resources to the Secondary operating system instance, the Trampoline module initializes system resources such as processor resources and memory partition resources, for example, initializes a CPU to wait for an IPI signal, adjusts a value of a page table area in Trampoline, remaps a virtual address, and the like. Specifically, after the CPU/core of the Secondary operating system instance is initialized under the support of the Trampoline module, the CPU/core waits for an IPI signal, and executes a corresponding processing program after receiving an IPI interrupt signal, and then, the CPU/core of the Secondary operating system instance completes the conversion from the real mode to the protected mode through Trampoline jump. The Trampoline module copies the construction parameters of the Trampoline function codes to the kernel space of the Secondary operating system through head.S to serve as parameters required by starting the instance of the Secondary operating system, then jumps to the system image file loading position of the instance of the Secondary operating system, and after the system image file is loaded, the execution right is handed to the kernel of the instance of the Secondary operating system to complete a series of initialization tasks, and the whole system running kernel environment is built from start _ kernel to CPU _ idle. In the booting process, for the Linux operating system, the Secondary operating system reads information of device resources from a low address space, such as a BIOS memory area, during the booting process, so as to boot and initialize the device. For the device which is not directly accessed, a Primary operating system instance and a Secondary operating system instance negotiate to complete the construction of a 'virtual device'.
And finally, after the Secondary operating system instance is successfully started, setting a member variable ret for monitoring in the osloader to be 1 by the Primary operating system instance, and identifying that the Secondary operating system instance is successfully created.
FIG. 3 is a diagram illustrating a first exemplary embodiment of an apparatus for creating an operating system according to the present invention. The operating system instance creating apparatus provided in this embodiment may be set on a Primary operating system instance of a multiprocessor operating system, or may be the Primary operating system instance itself, which is an apparatus embodiment corresponding to the embodiment of fig. 1 in the present invention, and a specific implementation process is not described herein again. Specifically, the operating system instance creating device 100 provided in this embodiment specifically includes:
a receiving module 11, configured to receive a creation request indicating to create a slave operating system instance, where the creation request carries resource requirement information of the slave operating system;
an allocating module 12, configured to allocate an exclusive system resource to the slave operating system instance according to the resource demand information, where the system resource at least includes: processor resources, physical memory partition resources;
a generating module 13, configured to generate resource description information of the slave operating system instance according to the resource demand information;
an initialization module 14, configured to initialize a system resource to obtain an initialized system resource;
a start module 15 for starting the slave operating system instance on the initializing system resource.
The operating system instance creating device provided by the embodiment of the invention allocates exclusive system resources to the Secondary operating system instance according to the resource demand information, initializes and starts the Secondary operating system instance after generating the resource description information of the Secondary operating system instance, thereby dynamically creating the operating system instance with the exclusive resources according to the resource demand provided by the user, and achieving the purposes of improving the system expansion performance and meeting the demand of the user.
FIG. 4 is a diagram illustrating a second exemplary embodiment of an operating system creation apparatus according to the present invention. As shown in fig. 4, the operating system instance creating apparatus 200 provided in this embodiment further includes, on the basis of fig. 3:
and the judging module 16 is configured to judge whether a system resource meeting the resource demand information exists in the resource pool according to the resource demand information.
Further, the resource description information includes:
compatible resource description information, wherein the compatible resource description information is the resource description information which does not conform to the guide process standard multiboot; or,
and standard resource description information, wherein the standard resource description information is the resource description information conforming to the guide process standard multiboot.
Further, the generating module 13 is configured to generate, in the kernel space, first resource description information describing quantity information of the system resources according to the resource demand information, and generate complete resource description information of the slave operating system instance according to the quantity information, so that the slave operating system instance loads the resource description information into a physical memory partition resource in the system resources; or,
in the kernel space, generating resource description information of the slave operating system instance so as to load the resource description information into physical memory partition resources in the system resources from the slave operating system instance; or,
and generating resource description information of the slave operating system instance, and loading the resource description information into the physical memory partition in the system resource allocated to the slave operating system instance.
Referring again to fig. 4, the operating system instance creating apparatus includes:
and a remapping module 17, configured to perform virtual address remapping on the physical memory partition resource.
FIG. 5 is a block diagram of a third embodiment of an operating system creation apparatus according to the present invention. As shown in fig. 5, the operating system instance creating apparatus 300 provided by the present embodiment includes a processor 31 and a memory 32. The operating system instance creation apparatus 300 may further include a transmitter 33 and a receiver 34. The transmitter 33 and the receiver 34 may be connected to the processor 31. Wherein the transmitter 33 is used for transmitting data or information, the receiver 34 is used for receiving data or information, the memory 32 stores execution instructions, when the operating system instance creating device 300 runs, the processor 31 communicates with the memory 32, and the processor 31 calls the execution instructions in the memory 32 to perform the following operations:
receiving a creation request for indicating the creation of a slave operating system instance, wherein the creation request carries resource demand information of a slave operating system;
allocating exclusive system resources to the slave operating system instance according to the resource demand information, wherein the system resources at least comprise: processor resources, physical memory partition resources;
generating resource description information of the slave operating system instance according to the resource demand information;
initializing system resources to obtain initialized system resources;
the slave operating system instance is started on the initializing system resource.
Further, after receiving a creation request indicating creation of a slave operating system instance, and before allocating an exclusive system resource to the slave operating system instance according to the resource requirement information, the method includes:
and judging whether system resources meeting the resource demand information exist in the resource pool or not according to the resource demand information.
Further, the resource description information includes:
compatible resource description information, wherein the compatible resource description information is the resource description information which does not conform to the guide process standard multiboot; or,
and standard resource description information, wherein the standard resource description information is the resource description information conforming to the guide process standard multiboot.
Further, according to the resource requirement information, generating resource description information of the slave operating system, including:
according to the resource demand information, first resource description information describing quantity information of the system resources is generated on a user layer, and in the kernel space, complete resource description information of the slave operating system instance is generated according to the quantity information, so that the slave operating system instance loads the resource description information into physical memory partition resources in the system resources; or,
in the kernel space, generating resource description information of the slave operating system instance so as to load the resource description information into physical memory partition resources in the system resources from the slave operating system instance; or,
and generating resource description information of the slave operating system instance, and loading the resource description information into the physical memory partition in the system resource allocated to the slave operating system instance.
Further, initializing the system resource after generating the resource description information of the slave operating system instance according to the resource requirement information, and before obtaining the initialized system resource, the method includes:
and performing virtual address remapping on the physical memory partition resources.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (10)

1. An operating system instance creation method, comprising:
a master operating system example receives a creation request for indicating the creation of a slave operating system example, wherein the creation request carries resource requirement information of the slave operating system example;
the master operating system instance allocates exclusive system resources to the slave operating system instance according to the resource demand information, wherein the system resources at least comprise: processor resources, physical memory partition resources;
the master operating system instance generates resource description information of the slave operating system instance according to the resource demand information;
the main operating system instance initializes the system resources to obtain initialized system resources;
the master operating system instance starting the slave operating system instance on the initialization system resource;
the main operating system generates the resource description information of the slave operating system according to the resource demand information, and the resource description information comprises the following steps:
the main operating system instance generates first resource description information describing quantity information of the system resources on a user layer according to the resource demand information, and generates complete resource description information of the slave operating system instance in a kernel space according to the quantity information, so that the slave operating system instance loads the resource description information into physical memory partition resources in the system resources; or,
the master operating system instance generates resource description information of the slave operating system instance in a kernel space, so that the slave operating system instance loads the resource description information in a physical memory partition resource in the system resource; or,
and the master operating system instance generates the resource description information of the slave operating system instance and loads the resource description information into the physical memory partition in the system resource allocated to the slave operating system instance.
2. The method of claim 1, wherein after the master operating system instance receives a create request indicating creation of a slave operating system instance, and before allocating exclusive system resources for the slave operating system instance according to the resource requirement information, the method comprises:
and the main operating system example judges whether the system resources meeting the resource demand information exist in a resource pool or not according to the resource demand information.
3. The method according to claim 1 or 2, wherein the resource description information comprises:
compatible resource description information, wherein the compatible resource description information is the resource description information which does not conform to the guide process standard multiboot; or,
and standard resource description information, wherein the standard resource description information is the resource description information conforming to the guide process standard multiboot.
4. The method of claim 3, wherein the generating, by the master operating system instance, the resource description information of the slave operating system instance according to the resource requirement information comprises:
the main operating system instance generates first resource description information describing quantity information of the system resources on a user layer according to the resource demand information, and generates complete resource description information of the slave operating system instance in a kernel space according to the quantity information, so that the slave operating system instance loads the resource description information into physical memory partition resources in the system resources; or,
the master operating system instance generates resource description information of the slave operating system instance in a kernel space, so that the slave operating system instance loads the resource description information in a physical memory partition resource in the system resource; or,
and the master operating system instance generates the resource description information of the slave operating system instance and loads the resource description information into the physical memory partition in the system resource allocated to the slave operating system instance.
5. The method of claim 1, wherein initializing the system resources after the primary operating system instance generates the resource description information of the secondary operating system instance according to the resource requirement information, and before obtaining initialized system resources, comprises:
and the main operating system example performs virtual address remapping on the physical memory partition resources.
6. An operating system instance creation apparatus, comprising:
a receiving module, configured to receive a creation request indicating to create a slave operating system instance, where the creation request carries resource requirement information of the slave operating system;
an allocation module, configured to allocate an exclusive system resource to the slave operating system instance according to the resource demand information, where the system resource at least includes: processor resources, physical memory partition resources;
the generating module is used for generating the resource description information of the slave operating system instance according to the resource demand information;
the initialization module is used for initializing the system resources to obtain initialized system resources;
a start module for starting the slave operating system instance on the initialization system resource;
the generating module is configured to generate, in a kernel space, first resource description information describing quantity information of the system resources according to the resource demand information, and generate, according to the quantity information, complete resource description information of the slave operating system instance, so that the slave operating system instance loads the resource description information in a physical memory partition resource in the system resources; or,
in a kernel space, generating resource description information of the slave operating system instance, so that the slave operating system instance loads the resource description information in a physical memory partition resource in the system resource; or,
and generating resource description information of the slave operating system instance, and loading the resource description information into the physical memory partition in the system resource allocated to the slave operating system instance.
7. The apparatus of claim 6, further comprising:
and the judging module is used for judging whether the system resources meeting the resource demand information exist in a resource pool or not according to the resource demand information.
8. The apparatus according to claim 6 or 7, wherein the resource description information comprises:
compatible resource description information, wherein the compatible resource description information is the resource description information which does not conform to the guide process standard multiboot; or,
and standard resource description information, wherein the standard resource description information is the resource description information conforming to the guide process standard multiboot.
9. The apparatus according to claim 8, wherein the generating module is configured to generate, in a kernel space, first resource description information describing quantity information of the system resource on a user layer according to the resource demand information, and generate complete resource description information of the slave operating system instance according to the quantity information, so that the slave operating system instance loads the resource description information in a physical memory partition resource in the system resource; or,
in a kernel space, generating resource description information of the slave operating system instance, so that the slave operating system instance loads the resource description information in a physical memory partition resource in the system resource; or,
and generating resource description information of the slave operating system instance, and loading the resource description information into the physical memory partition in the system resource allocated to the slave operating system instance.
10. The apparatus of claim 6, further comprising:
and the remapping module is used for remapping the virtual address of the physical memory partition resource.
CN201310695516.8A 2013-12-17 2013-12-17 Operation system example creation method and device Expired - Fee Related CN104714821B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201310695516.8A CN104714821B (en) 2013-12-17 2013-12-17 Operation system example creation method and device
PCT/CN2014/094039 WO2015090195A1 (en) 2013-12-17 2014-12-17 Method and device for creating example of operating system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310695516.8A CN104714821B (en) 2013-12-17 2013-12-17 Operation system example creation method and device

Publications (2)

Publication Number Publication Date
CN104714821A CN104714821A (en) 2015-06-17
CN104714821B true CN104714821B (en) 2018-07-31

Family

ID=53402109

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310695516.8A Expired - Fee Related CN104714821B (en) 2013-12-17 2013-12-17 Operation system example creation method and device

Country Status (2)

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

Families Citing this family (3)

* 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 (en) * 2016-12-27 2020-01-30 深▲せん▼前海達闥雲端智能科技有限公司Cloudminds (Shenzhen) Robotics Systems Co., Ltd. Memory access method, apparatus and electronic equipment for multi-operating system
CN109542610B (en) * 2018-12-04 2023-06-30 中国航空工业集团公司西安航空计算技术研究所 Method for realizing virtual interrupt standard component of multi-partition operating system

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101000566A (en) * 2006-01-12 2007-07-18 三星电子株式会社 Operating system switching device and operating system switching method
CN101178666A (en) * 2007-12-13 2008-05-14 中兴通讯股份有限公司 Coordinating and scheduling method between heterogeneous multi-core
CN101246431A (en) * 2008-03-10 2008-08-20 中兴通讯股份有限公司 Management method for loading multi-core different operating system images
CN101373441A (en) * 2008-09-19 2009-02-25 苏州壹世通科技有限公司 Virtual platform system based on firmware
CN101419561A (en) * 2007-10-26 2009-04-29 中兴通讯股份有限公司 Resource management method and system in isomerization multicore system
CN101449240A (en) * 2006-05-15 2009-06-03 微软公司 Launching hypervisor under running operating system
CN103257929A (en) * 2013-04-18 2013-08-21 中国科学院计算技术研究所 Virtual machine memory mapping method and system

Family Cites Families (5)

* 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
US8336046B2 (en) * 2006-12-29 2012-12-18 Intel Corporation Dynamic VM cloning on request from application based on mapping of virtual hardware configuration to the identified physical hardware resources
KR20090108868A (en) * 2008-04-14 2009-10-19 삼성전자주식회사 Virtual machine management system and method for managing processor resources thereof
US8533713B2 (en) * 2011-03-29 2013-09-10 Intel Corporation Efficent migration of virtual functions to enable high availability and resource rebalance
CN103002044B (en) * 2012-12-18 2016-05-11 武汉大学 A kind of method that improves multi-platform intelligent terminal disposal ability

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101000566A (en) * 2006-01-12 2007-07-18 三星电子株式会社 Operating system switching device and operating system switching method
CN101449240A (en) * 2006-05-15 2009-06-03 微软公司 Launching hypervisor under running operating system
CN101419561A (en) * 2007-10-26 2009-04-29 中兴通讯股份有限公司 Resource management method and system in isomerization multicore system
CN101178666A (en) * 2007-12-13 2008-05-14 中兴通讯股份有限公司 Coordinating and scheduling method between heterogeneous multi-core
CN101246431A (en) * 2008-03-10 2008-08-20 中兴通讯股份有限公司 Management method for loading multi-core different operating system images
CN101373441A (en) * 2008-09-19 2009-02-25 苏州壹世通科技有限公司 Virtual platform system based on firmware
CN103257929A (en) * 2013-04-18 2013-08-21 中国科学院计算技术研究所 Virtual machine memory mapping method and system

Also Published As

Publication number Publication date
WO2015090195A1 (en) 2015-06-25
CN104714821A (en) 2015-06-17

Similar Documents

Publication Publication Date Title
KR101952795B1 (en) Resource processing method, operating system, and device
CN107479943B (en) Multi-operating-system operation method and device based on industrial Internet operating system
JP2016541072A5 (en)
EP2128759B1 (en) Operating system startup control method and information processing apparatus
EP3992805A1 (en) Live migration method for virtual machine and communication device
US9558021B2 (en) System and method for cross-platform application execution and display
CN112130960A (en) Lightweight mobile edge computing node and construction method
JP6859463B2 (en) Methods, devices, devices and media for launching virtual machines
CN116521209B (en) Upgrading method and device of operating system, storage medium and electronic equipment
CN104714821B (en) Operation system example creation method and device
CN104714843B (en) More kernel operating system instances support the method and device of multiprocessor
CN115617364A (en) GPU virtualization deployment method, system, computer equipment and storage medium
CN113568734A (en) Virtualization method and system based on multi-core processor, multi-core processor and electronic equipment
CN109634721B (en) Method and related device for starting communication between virtual machine and host
CN117742890A (en) Virtual machine creation method, device, equipment and storage medium
CN105373412A (en) Virtual machine graph generation method and system
CN117093326A (en) Virtual machine operation control method, device, computer equipment and storage medium
CN118467093A (en) Resource processing method, device, apparatus, readable storage medium and program product
CN112540826A (en) Configuration method of edge computer controller and related equipment
CN117632351A (en) Container deployment method and system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20180731

Termination date: 20201217