CN117762573A - Method and system for processing equipment information in virtual machine under embedded platform - Google Patents

Method and system for processing equipment information in virtual machine under embedded platform Download PDF

Info

Publication number
CN117762573A
CN117762573A CN202410197315.3A CN202410197315A CN117762573A CN 117762573 A CN117762573 A CN 117762573A CN 202410197315 A CN202410197315 A CN 202410197315A CN 117762573 A CN117762573 A CN 117762573A
Authority
CN
China
Prior art keywords
information
virtual machine
resource table
value
address
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.)
Granted
Application number
CN202410197315.3A
Other languages
Chinese (zh)
Other versions
CN117762573B (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.)
Chengdu Jingrong Lianchuang Technology Co ltd
Original Assignee
Chengdu Jingrong Lianchuang Technology Co ltd
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 Chengdu Jingrong Lianchuang Technology Co ltd filed Critical Chengdu Jingrong Lianchuang Technology Co ltd
Priority to CN202410197315.3A priority Critical patent/CN117762573B/en
Priority claimed from CN202410197315.3A external-priority patent/CN117762573B/en
Publication of CN117762573A publication Critical patent/CN117762573A/en
Application granted granted Critical
Publication of CN117762573B publication Critical patent/CN117762573B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a method and a system for processing equipment information in a virtual machine under an embedded platform, which relate to the field of equipment information processing in the virtual machine, and the method comprises the following steps: configuring the size of a resource table and a storage address in a memory; selecting CPU information of the virtual machine and equipment information in the configuration file and putting the CPU information and the equipment information in the configuration file into a resource table; binary file generation is carried out on the resource table and the binary file is copied into a designated memory; and when the operating system is initialized, the virtual machine analyzes the values of the equipment information in the resource table file from the appointed memory according to the corresponding key value pair format, and assigns the values to the variables corresponding to the virtual machine system. According to the invention, the device information is abstracted out of the resource table, the device resource information is transmitted to the virtual machine in the form of the resource table, and the hardware address information in the source code of the operating system is not required to be specially modified when the virtual machine is required to be deployed on different hardware platforms subsequently, so that the reusability and development efficiency of software are greatly improved.

Description

Method and system for processing equipment information in virtual machine under embedded platform
Technical Field
The invention relates to the field of equipment information processing in a virtual machine, in particular to a method and a system for processing equipment information in a virtual machine under an embedded platform.
Background
Today, virtualization technology (Virtualization) is developed to a new level, and common Virtualization technologies may be divided into four types of full Virtualization, paravirtualization, operating system Virtualization, and hardware-assisted Virtualization. In the technology of the paravirtual machine, the physical resources such as a CPU, a memory, a disk, a peripheral and the like are isolated by the Hypervisor, so that safe and reliable operation of each virtual machine can be ensured.
In general, the virtual machine system may be an embedded real-time operating system such as Linux, vxWorks, RT-Thread, freeRTOS, uCOS, because the system running in the virtual machine has a large difference, a device tree mode is adopted in Linux at present, the DTS file (referred to as a DTS file, which is a device tree description in an ASII text format, is also a device tree source code to be written, and generally corresponds to a hardware platform, and is located under the "/arm/boot/DTS" directory of the Linux source code), and describes board-level devices in a tree structure, such as the number of CPUs, memory base addresses, peripheral information, etc., where the basic structure of the device tree is as shown in fig. 2, and the trunk of the tree is a bus of the system and is called a "root node" in the device tree. Such as I2C controllers, SPI controllers, CAN controllers, etc., are all branches to the system main line, called "child nodes of the root node" on the device tree.
Each "{ }" in the device tree is a node, and the source code of the device tree is divided into three parts:
(1) Header file: the device tree is a header file that can use "# include" to reference "# h" suffixes like the C language, and can also reference device tree "# dtsi" to suffixes.
(2) Device tree node: "/{ … }; "means" root node ", there is only one root node per device tree. The root nodes of the different files will eventually merge into one. Characters such as "chosen { … }, memory { … }," reserved-memory { … }, "ids { … }, etc., inside the root node are all child nodes of the root node.
(3) The equipment tree node adds the content: the child node has one more "≡" than the child node under the root node, which means that the node is appending data to the existing child node.
The device tree can describe hardware resource information of a hardware platform, such as detailed information of a memory address, an interrupt number, a register address, a network card phy address and the like of the network card, in a linux starting stage, the device tree is transmitted to a linux kernel through uboot, the linux kernel acquires hardware information from the device tree, a linux operating system analyzes a DTB (device tree source code compiling file) in the starting stage, the DTB is stored in a memory (logic structure: tree structure), and if a certain driver needs to use the device information, the corresponding device information is directly acquired from the device tree. While device trees are currently used in linux in many cases, other embedded real-time operating systems (vxWorks, RT-Thread, freeRTOS, uCOS, etc.) do not currently support device trees. In addition, the embedded real-time operating system is not capable of supporting a plurality of components in order to be lighter, high in real-time and simple to use, so that the transplanting of equipment trees is not feasible. Therefore, developing a device information processing method that can be adapted to each embedded real-time operating system will effectively reduce the development cost of the virtual machine under the embedded platform.
Disclosure of Invention
Aiming at the defects in the prior art, the method and the system for processing the device information in the virtual machine under the embedded platform solve the problem that the development cost of the virtual machine under the embedded platform is high because the conventional embedded real-time operating system does not have a universal device information processing means.
In order to achieve the aim of the invention, the invention adopts the following technical scheme:
The method for processing the equipment information in the virtual machine under the embedded platform comprises the following steps:
S1, defining equipment information in a configuration file;
s2, configuring the size of a resource table and the storage address of the resource table in a memory;
S3, selecting CPU information of the virtual machine and equipment information in the configuration file and putting the CPU information and the equipment information in the configuration file into a resource table;
s4, generating a binary file for the resource table to obtain a resource table file;
S5, copying the resource table file into a specified memory;
S6, enabling the virtual machine to analyze the values of the equipment information in the resource table file from the appointed memory according to the corresponding key value pair format when the operating system is initialized;
And S7, assigning the value of the device information obtained through analysis to a variable corresponding to the virtual machine system, and completing device information processing in the virtual machine under the embedded platform.
Further, the device information includes ten kinds of information, which are respectively device names devices, universal asynchronous receiving and transmitting devices uart, universal input/output ports gpio, synchronous serial buses i2c, watchdog, serial peripheral interfaces spi, queue serial peripheral interfaces qspi, servers dha, controller area network buses can and Ethernet ports eth; each type of information includes a name, a register address value, a register address length, a memory address addr, a size, a type, and an interrupt number.
further, the specific method of step S2 is as follows:
And acquiring a physical address starting position of the virtual machine, setting the size X of the resource table, and selecting a space with the size X from the physical address starting position of the virtual machine as a storage address of the resource table in the memory.
further, the size of the resource table is 1MB and is stored in a 1MB space starting from 0x 10000000.
further, the specific method of step S6 is as follows:
When the virtual machine is initialized in an operating system, reading the starting address and the size of a resource table file through a platform_init function, and reading information according to the storage address offset of different information; the read information includes a value of a running memory address of the virtual machine operating system, a value of a running memory address size of the virtual machine operating system, a value of a virtual machine name, a value of a total number of devices, a value of a name of a device, a value of a device register address length, a value of a device interrupt number, a value of a CPU core information configuration set, a value of a CPU core number, a value of an interrupt base address, a value of a serial port base address, a value of a network card base address, a value of an SPI base address, a value of a GPIO base address, and a value of PCI device information.
the device information processing system comprises a device information definition module, a resource table configuration module, an information input module, a binary file generation module, a file copy module, an information analysis module and an assignment module;
the device information definition module is used for defining device information in the configuration file;
the resource table configuration module is used for configuring the size of the resource table and the storage address of the resource table in the memory;
the information input module is used for selecting CPU information of the virtual machine and equipment information in the configuration file and putting the CPU information and the equipment information in the configuration file into the resource table;
The binary file generation module is used for generating binary files for the resource table to obtain resource table files;
The file copying module is used for copying the resource table file into the appointed memory;
The information analysis module is used for enabling the virtual machine to analyze the values of the equipment information in the resource table file from the appointed memory according to the corresponding key value pair format when the operating system is initialized;
and the assignment module is used for assigning the value of the device information obtained through analysis to a variable corresponding to the virtual machine system to finish the device information processing in the virtual machine under the embedded platform.
Further, the device information includes ten kinds of information, which are respectively device names devices, universal asynchronous receiving and transmitting devices uart, universal input/output ports gpio, synchronous serial buses i2c, watchdog, serial peripheral interfaces spi, queue serial peripheral interfaces qspi, servers dha, controller area network buses can and Ethernet ports eth; each type of information includes a name, a register address value, a register address length, a memory address addr, a size, a type, and an interrupt number.
The beneficial effects of the invention are as follows: according to the invention, the device information is abstracted out of the resource table, the device resource information is transmitted to the virtual machine in the form of the resource table, and then when the virtual machine is required to be deployed on different hardware platforms, the hardware address information in the source code of the operating system is not required to be specially modified, and the same operating system image can be deployed on different hardware platforms through virtualized deployment software, so that the reusability and development efficiency of the software are greatly improved.
Drawings
FIG. 1 is a schematic flow chart of the method;
FIG. 2 is a schematic diagram of the basic structure of a conventional DTS file device tree;
FIG. 3 is a schematic diagram of the address of a resource table stored in a memory.
Detailed Description
The following description of the embodiments of the present invention is provided to facilitate understanding of the present invention by those skilled in the art, but it should be understood that the present invention is not limited to the scope of the embodiments, and all the inventions which make use of the inventive concept are protected by the spirit and scope of the present invention as defined and defined in the appended claims to those skilled in the art.
As shown in fig. 1, the method for processing device information in the virtual machine under the embedded platform includes the following steps:
S1, defining equipment information in a configuration file;
s2, configuring the size of a resource table and the storage address of the resource table in a memory;
S3, selecting CPU information of the virtual machine and equipment information in the configuration file and putting the CPU information and the equipment information in the configuration file into a resource table;
s4, generating a binary file for the resource table to obtain a resource table file;
S5, copying the resource table file into a specified memory;
S6, enabling the virtual machine to analyze the values of the equipment information in the resource table file from the appointed memory according to the corresponding key value pair format when the operating system is initialized;
And S7, assigning the value of the device information obtained through analysis to a variable corresponding to the virtual machine system, and completing device information processing in the virtual machine under the embedded platform.
Correspondingly, the device information processing system in the virtual machine under the embedded platform comprises a device information definition module, a resource table configuration module, an information input module, a binary file generation module, a file copy module, an information analysis module and an assignment module;
the device information definition module is used for defining device information in the configuration file;
the resource table configuration module is used for configuring the size of the resource table and the storage address of the resource table in the memory;
the information input module is used for selecting CPU information of the virtual machine and equipment information in the configuration file and putting the CPU information and the equipment information in the configuration file into the resource table;
The binary file generation module is used for generating binary files for the resource table to obtain resource table files;
The file copying module is used for copying the resource table file into the appointed memory;
The information analysis module is used for enabling the virtual machine to analyze the values of the equipment information in the resource table file from the appointed memory according to the corresponding key value pair format when the operating system is initialized;
and the assignment module is used for assigning the value of the device information obtained through analysis to a variable corresponding to the virtual machine system to finish the device information processing in the virtual machine under the embedded platform.
The device information comprises ten kinds of information, namely a device name device, a universal asynchronous receiver/transmitter uart, a universal input/output port gpio, a synchronous serial bus i2c, a watchdog watch dog, a serial peripheral interface spi, a queue serial peripheral interface qspi, a server dha, a controller area network bus can and an Ethernet port eth; each type of information includes a name, a register address value, a register address length, a memory address addr, a size, a type, and an interrupt number.
As shown in fig. 3, the specific method in step S2 is as follows: and acquiring a physical address starting position of the virtual machine, setting the size X of the resource table, and selecting a space with the size X from the physical address starting position of the virtual machine as a storage address of the resource table in the memory. Specifically, the size of the resource table is 1MB and is stored in a 1MB space from 0x 10000000.
The specific method of step S6 is as follows: when the virtual machine is initialized in an operating system, reading the starting address and the size of a resource table file through a platform_init function, and reading information according to the storage address offset of different information; the read information includes a value of a running memory address of the virtual machine operating system, a value of a running memory address size of the virtual machine operating system, a value of a virtual machine name, a value of a total number of devices, a value of a name of a device, a value of a device register address length, a value of a device interrupt number, a value of a CPU core information configuration set, a value of a CPU core number, a value of an interrupt base address, a value of a serial port base address, a value of a network card base address, a value of an SPI base address, a value of a GPIO base address, and a value of PCI device information.
In the implementation process, for the Hypervisor, the memory seen by the Hypervisor is the physical memory in the DDR, the physical address seen in the root cell is the physical address in the DDR, the physical address seen in the Guest cell is the virtual address, the addresses are allocated by the Hypervisor, and the specific division of the DDR is shown in FIG. 2. Addresses 0x2008000000 and 0x2008100000 are real physical addresses in the DDR, the addresses are managed by the Hypervisor, addresses 0x10000000 and 0x80000000 are physical addresses for the virtual machine system, the resource table file is stored in the 1MB space from 0x10000000, the resource table file is a binary file, and the virtual machine will read the resource table file after starting. The size and the storage address of the resource table file can be configured by itself, but the uniqueness of the address needs to be ensured and cannot conflict.
in one embodiment of the invention, the defined device information is as follows:
"devices": {
"uart0": {
"addr": 671088640,
"size": 4096,
"type": "pl011",
"irq": [
38
],
"attr": "pl011"
},
"uart1": {
"addr": 671092736,
"size": 4096,
"type": "pl011",
"irq": [
39
],
"attr": "pl011"
},
"uart2": {
"addr": 671096832,
"size": 4096,
"type": "pl011",
"irq": [
40
],
"attr": "pl011"
},
"uart3": {
"addr": 671100928,
"size": 4096,
"type": "pl011",
"irq": [
41
],
"attr": "pl011"
},
"gpio0": {
"addr": 671105024,
"size": 4096,
"type": "",
"irq": [
42
],
"attr": ""
},
"gpio1": {
"addr": 671109120,
"size": 4096,
"type": "",
"irq": [
43
],
"attr": ""
},
"i2c0": {
"addr": 671113216,
"size": 4096,
"type": "",
"irq": [
44
],
"attr": ""
},
"i2c1": {
"addr": 671117312,
"size": 4096,
"type": "",
"irq": [
45
],
"attr": ""
},
"watchdog0": {
"addr": 671129600,
"size": 8192,
"type": "",
"irq": [
48
],
"attr": ""
},
"watchdog1": {
"addr": 671178752,
"size": 8192,
"type": "",
"irq": [
49
],
"attr": ""
},
"spi0": {
"addr": 671137792,
"size": 4096,
"type": "",
"irq": [
50
],
"attr": ""
},
"spi1": {
"addr": 671166464,
"size": 4096,
"type": "",
"irq": [
51
],
"attr": ""
},
"qspi": {
"addr": 671170560,
"size": 4096,
"type": "",
"irq": [],
"attr": ""
},
"dha": {
"addr": 673210368,
"size": 4096,
"type": "",
"irq": [
1
],
"attr": ""
},
"can0": {
"addr": 673214464,
"size": 1024,
"type": "",
"irq": [
119
],
"attr": ""
},
"can1": {
"addr": 673215488,
"size": 1024,
"type": "",
"irq": [
123
],
"attr": ""
},
"eth0": {
"addr": 673234944,
"size": 8192,
"type": "",
"irq": [
81
],
"attr": ""
},
"eth1": {
"addr": 673251328,
"size": 8192,
"type": "",
"irq": [
82
],
"attr": ""
}
}
The resource table structure is stored in a key-value format as shown in table 1 below:
TABLE 1
In one embodiment of the present invention, the virtual machine system in the starting stage reads the information of the key value pair as exemplified in table 1 from the designated memory address, and assigns the information to the corresponding variable in the virtual machine system according to the values of the CPU core information, interrupt address, serial port base address, network card base address, SPI base address, GPIO base address and other external device information in the resource table, so as to complete the assignment, and the specific initialization process is as follows:
int platform_init( void ){
int ret;
int idx;
uintptr_tsc_addr=jh_get_resource_table_addr () (the starting address value of the resource table in memory, below replaced by variable rsc _addr)
uintptr_tsc_size=jh_get_resource_table_size (); (the length value of the resource table in memory, below replaced by variable rsc _size)
log_info ("resource table:") (LOG output, output information: resource table)
LOG_INFO ("addr: 0x% lx", rsc _addr); (LOG output, output information is the value of rsc _addr)
LOG INFO ("size: 0x% lx", rsc _size) (LOG output, output information is rsc _size value)
# define_is_err (v) ((v) = 0|| (v) > (uintptr_t) (-128)/(v) < = (uintptr_t) (-1))) (this IS an error monitoring macro definition that the code will call below
if( _IS_ERR(rsc_addr) || _IS_ERR(rsc_size) ){
_LOG_INFO("invalid resource table");
return -1;
(this if judgment sentence is whether or not the values of rsc _addr and rsc _size are legal)
ret=resource_table_init (rsc _addr, rsc _size) (initializing the resource table)
if (ret < 0) { (return value check for initialization operation)
_LOG_INFO("resource table init failed.\n");
return -1;
}
uint64_tcpus=0 (the aggregate value of the cpu configuration is stored in the variable cpu)
The value of the number of the CPU cores is stored in the CPU_count
ret=resource_table_cpus (& cpus); (obtaining the aggregate value of cpu configuration)
if (ret < 0) { (function return value check)
_LOG_INFO("get cpus failed.");
return -1;
}
for (idx=0; idx < 64;++idx) { (the value of the number of cpu cores calculated by for-loop)
if( cpus&(1UL<<idx) ){
cpu_count++;
}
}
LOG INFO ("cpu: 0x% lx", cpu); (output of aggregate values for cpu configuration)
LOG_INFO ("cpu_count:% d", cpu_count); (value of number of output cpu cores)
(the following two lines of code are values that assign the aggregate value of the cpu configuration and the number of cpu cores obtained from the resource table to variable values defined in the virtual machine)
platform.cpus = cpus;
platform.cpu_count = cpu_count;
(the following four lines of codes are obtained from the resource table and output to the log the values of the cpu platform name and the virtual machine name)
const char *cpu_name = resource_table_cpu_name();
const char *cell_name = resource_table_cell_name();
_LOG_INFO("cell name: %s", resource_table_cell_name() );
_LOG_INFO("cpu name : %s", resource_table_cpu_name() );
if (cpu_name= NULL cell_name= NULL) { (error checking is performed)
_LOG_INFO("invalid name.");
return -1;
}
int mem_count=resource_table_memory_count (); (obtain the value of the memory address size in the resource table)
if (mem_count < =0) { (error check)
_LOG_INFO("get memory count failed.");
return -1;
}
if (mem_count > array_count (platform. Memory)) { (memory overflow treatment)
mem_count = ARRAY_COUNT(platform.memorys);
}
LOG_INFO ("memory count:% d\n", mem_count); (Address daily LOG output)
for (idx=0; idx < mem_count; ++idx) { (this for loop fetches and assigns values of virtual and physical addresses and size of the configuration of memory into defined variables in the virtual machine)
uint64_t phys, virt, size;
ret = resource_table_memory_at( idx,&phys,&virt,&size );
if( ret<0 ){
_LOG_INFO("get memory @%d failed.", idx);
return -1;
break;
}
_LOG_INFO("[%d] phys: 0x%llx", idx,phys );
_LOG_INFO("virt: 0x%llx", virt );
_LOG_INFO("size: 0x%llx", size );
platform.memorys[idx].phys = phys;
platform.memorys[idx].virt = virt;
platform.memorys[idx].size = size;
}
(the following 13 lines of code are the base address and its associated variable values obtained and interrupted from the resource table)
resource_table_gic_t gic;
ret = resource_table_gic(&gic );
if( ret<0 ){
_LOG_INFO("get gic failed.");
return -1;
}
platform.gicd = gic.gicd;
platform.gicr = gic.gicr;
platform.gicc = gic.gicc;
platform.gich = gic.gich;
platform.gicv = gic.gicv;
_LOG_INFO("GICD: 0x%lx", (unsigned long)platform.gicd);
_LOG_INFO("GICR: 0x%lx", (unsigned long)platform.gicr);
(the following code is information of the device from the resource table, including the device name, the total number of devices, the register address value, the register address length, the memory address addr, the size, the type and the interrupt number)
int device_count = resource_table_device_count();
if( device_count<0 ){
_LOG_INFO("get device count failed.");
return -1;
}
if( device_count>ARRAY_COUNT(platform.devices) ){
device_count = ARRAY_COUNT(platform.devices);
}
_LOG_INFO("device count: %d", device_count);
for( idx=0; idx<device_count; ++idx ){
resource_talbe_dev_t dev;
ret = resource_table_device_at( idx,&dev );
if( ret<0 ){
_LOG_INFO("get devices @%d failed.", idx);
return -1;
break;
}
_LOG_INFO("[%d] %s", idx, dev.name);
_LOG_INFO("reg_add: 0x%lx", dev.reg_addr);
_LOG_INFO("reg_len: 0x%lx", dev.reg_len );
_LOG_INFO("irq: 0x%lx", dev.irq);
strcpy( platform.devices[idx].name, dev.name);
platform.devices[idx].reg_addr = dev.reg_addr;
platform.devices[idx].reg_len = dev.reg_len;
platform.devices[idx].irq = dev.irq;
}
platform.memory_count = mem_count;
platform.device_count = device_count;
strcpy(platform.cell_name, cell_name);
strcpy(platform.cpu_name, cpu_name);
return 1;
}
In summary, in the virtualization development, the virtualized environment needs to be deployed on many platforms, such as FT2000, D2000, RK3588, E2000, etc., and address information of hardware resources of the virtualized environment is differentiated on different hardware resource platforms. Therefore, on different platforms, the virtual machine operating system needs to be adapted and modified, and a system image aiming at a specific platform is compiled. According to the invention, the device information is abstracted out of the resource table, the device resource information is transmitted to the virtual machine in the form of the resource table, and then when the virtual machine is required to be deployed on different hardware platforms, the hardware address information in the source code of the operating system is not required to be specially modified, and the same operating system image can be deployed on different hardware platforms through virtualized deployment software, so that the reusability and development efficiency of the software are greatly improved.

Claims (7)

1. The method for processing the equipment information in the virtual machine under the embedded platform is characterized by comprising the following steps of:
S1, defining equipment information in a configuration file;
s2, configuring the size of a resource table and the storage address of the resource table in a memory;
S3, selecting CPU information of the virtual machine and equipment information in the configuration file and putting the CPU information and the equipment information in the configuration file into a resource table;
s4, generating a binary file for the resource table to obtain a resource table file;
S5, copying the resource table file into a specified memory;
S6, enabling the virtual machine to analyze the values of the equipment information in the resource table file from the appointed memory according to the corresponding key value pair format when the operating system is initialized;
And S7, assigning the value of the device information obtained through analysis to a variable corresponding to the virtual machine system, and completing device information processing in the virtual machine under the embedded platform.
2. The method for processing device information in an embedded under-platform virtual machine according to claim 1, wherein the device information includes ten types of information, which are respectively device names devices, universal asynchronous receiver transmitter uart, universal input/output port gpio, synchronous serial bus i2c, watchdog, serial peripheral interface spi, queue serial peripheral interface qspi, server dha, controller area network bus can, and ethernet port eth; each type of information includes a name, a register address value, a register address length, a memory address addr, a size, a type, and an interrupt number.
3. the method for processing device information in an embedded under-platform virtual machine according to claim 1, wherein the specific method in step S2 is as follows:
And acquiring a physical address starting position of the virtual machine, setting the size X of the resource table, and selecting a space with the size X from the physical address starting position of the virtual machine as a storage address of the resource table in the memory.
4. the method for processing device information in an embedded under-platform virtual machine according to claim 3, wherein the size of the resource table is 1MB and is stored in a 1MB space from 0x 10000000.
5. the method for processing device information in an embedded under-platform virtual machine according to claim 1, wherein the specific method in step S6 is as follows:
When the virtual machine is initialized in an operating system, reading the starting address and the size of a resource table file through a platform_init function, and reading information according to the storage address offset of different information; the read information includes a value of a running memory address of the virtual machine operating system, a value of a running memory address size of the virtual machine operating system, a value of a virtual machine name, a value of a total number of devices, a value of a name of a device, a value of a device register address length, a value of a device interrupt number, a value of a CPU core information configuration set, a value of a CPU core number, a value of an interrupt base address, a value of a serial port base address, a value of a network card base address, a value of an SPI base address, a value of a GPIO base address, and a value of PCI device information.
6. the device information processing system in the virtual machine under the embedded platform is characterized by comprising a device information definition module, a resource table configuration module, an information input module, a binary file generation module, a file copy module, an information analysis module and an assignment module;
the device information definition module is used for defining device information in the configuration file;
the resource table configuration module is used for configuring the size of the resource table and the storage address of the resource table in the memory;
the information input module is used for selecting CPU information of the virtual machine and equipment information in the configuration file and putting the CPU information and the equipment information in the configuration file into the resource table;
The binary file generation module is used for generating binary files for the resource table to obtain resource table files;
The file copying module is used for copying the resource table file into the appointed memory;
The information analysis module is used for enabling the virtual machine to analyze the values of the equipment information in the resource table file from the appointed memory according to the corresponding key value pair format when the operating system is initialized;
and the assignment module is used for assigning the value of the device information obtained through analysis to a variable corresponding to the virtual machine system to finish the device information processing in the virtual machine under the embedded platform.
7. The system according to claim 6, wherein the device information includes ten types of information, namely device name devices, universal asynchronous receiver transmitter uart, universal input/output port gpio, synchronous serial bus i2c, watchdog, serial peripheral interface spi, queue serial peripheral interface qspi, server dha, controller area network bus can, and ethernet port eth; each type of information includes a name, a register address value, a register address length, a memory address addr, a size, a type, and an interrupt number.
CN202410197315.3A 2024-02-22 Method and system for processing equipment information in virtual machine under embedded platform Active CN117762573B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410197315.3A CN117762573B (en) 2024-02-22 Method and system for processing equipment information in virtual machine under embedded platform

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410197315.3A CN117762573B (en) 2024-02-22 Method and system for processing equipment information in virtual machine under embedded platform

Publications (2)

Publication Number Publication Date
CN117762573A true CN117762573A (en) 2024-03-26
CN117762573B CN117762573B (en) 2024-05-17

Family

ID=

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120198446A1 (en) * 2011-02-02 2012-08-02 Hitachi, Ltd. Computer System and Control Method Therefor
CN103984591A (en) * 2014-05-15 2014-08-13 中国人民解放军国防科学技术大学 PCI (Peripheral Component Interconnect) device INTx interruption delivery method for computer virtualization system
US9052935B1 (en) * 2012-11-27 2015-06-09 Symantec Corporation Systems and methods for managing affinity rules in virtual-machine environments
CN109558212A (en) * 2018-11-27 2019-04-02 深信服科技股份有限公司 A kind of virtualized management method of physical equipment, system, physical equipment and medium
CN115269057A (en) * 2022-09-23 2022-11-01 麒麟软件有限公司 Method for generating configuration file of isolation system based on equipment tree
CN116954830A (en) * 2023-09-18 2023-10-27 麒麟软件有限公司 Method for enabling virtual machine to realize msi/x interrupt under jailhouse
CN117573338A (en) * 2023-11-08 2024-02-20 中汽创智科技有限公司 Resource allocation method and device and electronic equipment
CN117573292A (en) * 2024-01-15 2024-02-20 麒麟软件有限公司 Method for Xen running general RTOS virtual machine

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120198446A1 (en) * 2011-02-02 2012-08-02 Hitachi, Ltd. Computer System and Control Method Therefor
US9052935B1 (en) * 2012-11-27 2015-06-09 Symantec Corporation Systems and methods for managing affinity rules in virtual-machine environments
CN103984591A (en) * 2014-05-15 2014-08-13 中国人民解放军国防科学技术大学 PCI (Peripheral Component Interconnect) device INTx interruption delivery method for computer virtualization system
CN109558212A (en) * 2018-11-27 2019-04-02 深信服科技股份有限公司 A kind of virtualized management method of physical equipment, system, physical equipment and medium
CN115269057A (en) * 2022-09-23 2022-11-01 麒麟软件有限公司 Method for generating configuration file of isolation system based on equipment tree
CN116954830A (en) * 2023-09-18 2023-10-27 麒麟软件有限公司 Method for enabling virtual machine to realize msi/x interrupt under jailhouse
CN117573338A (en) * 2023-11-08 2024-02-20 中汽创智科技有限公司 Resource allocation method and device and electronic equipment
CN117573292A (en) * 2024-01-15 2024-02-20 麒麟软件有限公司 Method for Xen running general RTOS virtual machine

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
MAXIM BARYSHNIKOV: "Jailhouse hypervisor", 《FACULTY OF ELECTRICAL ENGINEERING DEPARTMENT OF SYSTEMS AND CONTROL》, 31 May 2016 (2016-05-31), pages 1 - 48 *
RALF RAMSAUER等: "Look Mum, no VM Exits! (Almost)", 《ARXIV》, 19 May 2017 (2017-05-19), pages 1 - 6 *
林肯公园_97CC: "【Jailhouse 文章】Jailhouse Hypervisor", pages 1 - 6, Retrieved from the Internet <URL:https://www.cfanz.cn/resource/detail/ljQvzmzNyynJz> *
蒋传勇: "基于QEMU的恶意程序行为检测研究", 《中国优秀硕士学位论文全文数据库信息科技辑》, 15 March 2020 (2020-03-15), pages 138 - 166 *
路边闲人2: "嵌入式虚拟化平台jailhouse踩坑笔记", pages 1 - 12, Retrieved from the Internet <URL:https://blog.csdn.net/v6543210/article/details/113890847> *

Similar Documents

Publication Publication Date Title
WO2017054573A1 (en) Configuration method and device
US10915348B2 (en) Technologies for duplicating virtual machine states
CN113986515B (en) Method and device for creating sandbox environment for plug-in operation and computing equipment
RU2611018C2 (en) Common method of constructing a virtual pci-device and a virtual mmio-device
CN110716845B (en) Log information reading method of Android system
CN114721719B (en) Method and system for containerized deployment of heterogeneous applications in cluster
US20190250942A1 (en) Storage Device Operation Method and Physical Server
US20170337064A1 (en) System and method for booting an information handling system
CN114327944A (en) Method, device, equipment and storage medium for sharing memory by multiple systems
CN104407890A (en) Method for starting Android system from OTG (On-The-Go) equipment
KR100736973B1 (en) Device representation apparatus and methods
TWI603199B (en) Capability based device driver framework
CN116521209B (en) Upgrading method and device of operating system, storage medium and electronic equipment
CN117762573B (en) Method and system for processing equipment information in virtual machine under embedded platform
US20200285559A1 (en) System, apparatus and method for dynamic tracing in a system having one or more virtualization environments
CN117762573A (en) Method and system for processing equipment information in virtual machine under embedded platform
CN107168815B (en) Method for collecting hardware error information
US20230244380A1 (en) Device and method for implementing live migration
CN111611014B (en) Multi-security-level software simultaneous operation method meeting DO178C standard
Achermann et al. Generating correct initial page tables from formal hardware descriptions
US8555046B2 (en) Computer system and its HW abstraction method
KR100638476B1 (en) Virtual platform based system on chip development environment and development method for the same
Tang et al. Basic Knowledge of Firmware
CN116301908B (en) Buildroot local compiling method and system based on Shenwei architecture
US20230289500A1 (en) Method and system for building hardware images from heterogeneous designs for eletronic systems

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant