CN113961308A - Hypervisor-based debugging peripheral implementation method and system - Google Patents

Hypervisor-based debugging peripheral implementation method and system Download PDF

Info

Publication number
CN113961308A
CN113961308A CN202111219880.8A CN202111219880A CN113961308A CN 113961308 A CN113961308 A CN 113961308A CN 202111219880 A CN202111219880 A CN 202111219880A CN 113961308 A CN113961308 A CN 113961308A
Authority
CN
China
Prior art keywords
guest
hypervisor
peripheral
register
debugging
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.)
Pending
Application number
CN202111219880.8A
Other languages
Chinese (zh)
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.)
Zhongling Zhixing Chengdu Technology Co ltd
Original Assignee
Zhongling Zhixing Chengdu 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 Zhongling Zhixing Chengdu Technology Co ltd filed Critical Zhongling Zhixing Chengdu Technology Co ltd
Priority to CN202111219880.8A priority Critical patent/CN113961308A/en
Publication of CN113961308A publication Critical patent/CN113961308A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45562Creating, deleting, cloning virtual machine instances
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45575Starting, stopping, suspending or resuming virtual machine instances
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45591Monitoring or debugging support

Abstract

The invention relates to the technical field of computers, and particularly discloses a debugging peripheral implementation method and system based on Hypervisor, wherein the method comprises the steps of firstly, the Hypervisor creates a plurality of Guest OSs according to user configuration; then, the Hypervisor parses the Guest OS resource file; then, the Hypervisor starts a Guest OS, enters the Guest OS to run and executes corresponding services; guest OS generates register read-write operation to the testing peripheral; then, the Hypervisor judges and adjusts the switch state of the peripheral; then, the Hypervisor intercepts a Guest OS peripheral register configured by the resource file; finally, the Hypervisor prints Guest OS operation to the external register; therefore, the method does not depend on the Guest OS to normally start in the peripheral debugging and testing process, and can more intuitively and conveniently see the operation process of the Guest OS to the peripheral register.

Description

Hypervisor-based debugging peripheral implementation method and system
Technical Field
The invention relates to the technical field of computers, in particular to a debugging peripheral implementation method and system based on Hypervisor.
Background
Hypervisor, called a Virtual Machine Monitor, is an operating system that runs other operating systems. The Hypervisor runs an intermediate operating system between the physical hardware and the operating system, which allows multiple operating systems and applications to share a set of basic physical hardware, and the operating system running on the Hypervisor is called a Guest operating system (Guest OS).
Hypervisor has been used in the server field before, but with the development of embedded systems, it is considered as the next leading field of embedded systems to solve the difficult decision of the increasingly complex application scenarios on the limited resource utilization of the embedded systems. The Hypervisor provides flexibility for bearing heterogeneous operating systems on the same multi-core processor, and realizes good reliability and a fault control mechanism so as to ensure the safe separation between key tasks, hard real-time application programs and general-purpose and untrusted user application programs. For example, in the current intelligent cockpit of an automobile, the Hypervisor technology is utilized to simultaneously realize the display of a full liquid crystal instrument and the display of a central control entertainment system on a single board, wherein the full liquid crystal instrument runs on a Guest OS which selects Linux or QNX, and the central control entertainment system runs on a Guest OS which selects Android.
Currently, a general Guest OS provides a debug peripheral method in an operating system itself, for example, debug information is printed through printk, communication between Linux kernel space and user space is realized through proc file system, kernel data structures and their attributes are exported to a user through sysfs, and the like. The engineer can debug the Guest OS peripheral through the debug information.
The peripheral can be debugged by entering a Guest OS (operating system), but the system is abnormally rushed due to the problems of peripheral drive programming logic and the like in the actual peripheral debugging process, and the peripheral state and debugging information cannot be checked by entering the Guest OS.
Currently most device drivers of Guest OS do not consider virtualized scenarios. In a non-virtualized scenario, the system is powered up again by an abnormal restart. Under the multi-system environment based on Hypervisor, Guest OS is abnormally restarted, and Hypervisor cannot power up the whole system again. Because the Guest OS peripheral is not powered on again, the operation on the peripheral before and after the restart may conflict, so that the peripheral cannot work normally. In the normal restarting process, the Guest OS peripheral driver can execute shutdown operation on the peripheral, and after the system is restarted, the peripheral can work normally. Therefore, in case of abnormal restart of Guest OS, Hypervisor needs to execute shutdown operation of Guest OS peripheral device driver. Because the shutdown operations of different peripherals are completely different and the codes are complicated, it is very difficult to reduce the operation to the peripheral read-write register.
Therefore, there is a need to provide a Hypervisor-based peripheral debugging implementation solution to solve the above problems.
Disclosure of Invention
The invention aims to: when the Hypervisor runs on the Hypervisor, the register of the Guest OS transparent transmission peripheral is intercepted, so that the record of the operation of the register of the Guest OS peripheral is realized, and the Guest OS peripheral can be conveniently debugged.
In order to achieve the above purpose, the technical solution adopted by the invention to solve the technical problem is as follows:
a Hypervisor-based peripheral debugging and testing implementation method comprises the following steps:
s1: the Hypervisor creates a plurality of Guest OSs according to the user configuration;
s2: hypervisor parses Guest OS resource files;
s3: the Hypervisor starts a Guest OS, enters the Guest OS to run and executes corresponding services; moreover, Guest OS generates register read-write operation to the testing peripheral;
s4: the Hypervisor judges and adjusts the on-off state of the peripheral; if the switch state is closed, ending, otherwise, continuing to execute the step S5;
s5: judging whether the peripheral register operated currently is within the specified range of the Guest OS resource file; if not, ending, otherwise, intercepting the operation of the Guest OS on the external register by the Hypervisor, and continuing to execute the step S6;
s6: the Hypervisor prints operation of Guest OS to the external register; analyzing the operation of Guest OS on the register, acquiring the testing information of the testing peripheral, and outputting the testing information to log information or printing the testing information to a serial port.
According to a specific embodiment, in step S6 of the embedded multi-system upgrade method based on Hypervisor of the present invention, the step of the Hypervisor printing Guest OS operating the external register includes:
s601: obtaining Guest OS ID of peripheral operations by Hypervisor;
s602: obtaining Guest OS peripheral names by Hypervisor;
s603: the operation of the Hypervisor printing Guest OS on the external register is performed in a printing format comprising: < Guest OS ID > < Guest OS peripheral name >: write Reg:0x0, Val:0x 0;
based on the same invention concept, the invention also provides a debugging peripheral implementation system based on Hypervisor, which comprises:
the Guest OS resource file analyzing module is used for analyzing Guest OS resource file appointed debugging peripheral equipment and intercepted register operation;
the peripheral register intercepting module is used for intercepting the operation of the corresponding Guest OS on the register by analyzing the Guest OS resource file;
and the debugging information printing module is used for analyzing the operation of Guest OS on the register, acquiring debugging information of the debugging peripheral equipment, and outputting the debugging information to log information or printing the debugging information to a serial port.
In summary, compared with the prior art, the invention has the beneficial effects that:
the invention relates to an embedded multi-system upgrading method based on Hypervisor, which comprises the steps that firstly, the Hypervisor creates a plurality of Guest OSs according to user configuration; then, the Hypervisor parses the Guest OS resource file; then, the Hypervisor starts a Guest OS, enters the Guest OS to run and executes corresponding services; guest OS generates register read-write operation to the testing peripheral; then, the Hypervisor judges and adjusts the switch state of the peripheral; then, the Hypervisor intercepts a Guest OS peripheral register configured by the resource file; finally, the Hypervisor prints Guest OS operation to the external register; therefore, the method does not depend on the Guest OS to normally start in the peripheral debugging and testing process, and can more intuitively and conveniently see the operation process of the Guest OS to the peripheral register.
Description of the drawings:
FIG. 1 is a schematic flow chart of the present invention.
FIG. 2 is a schematic diagram of the data flow of the present invention.
FIG. 3 is a schematic view of the present invention.
Detailed Description
The invention is described in further detail below with reference to the figures and the embodiments. It should be understood that the scope of the above-described subject matter is not limited to the following examples, and any techniques implemented based on the disclosure of the present invention are within the scope of the present invention.
As shown in fig. 1 and fig. 2, the debugging peripheral implementation method based on the Hypervisor of the present invention includes the following steps:
s1: the Hypervisor creates a plurality of Guest OSs according to the user configuration;
s2: hypervisor parses Guest OS resource files;
s3: the Hypervisor starts a Guest OS, enters the Guest OS to run and executes corresponding services; moreover, Guest OS generates register read-write operation to the testing peripheral;
s4: the Hypervisor judges and adjusts the on-off state of the peripheral;
s5: the Hypervisor intercepts the operation record of Guest OS configured by the Guest OS resource file to the external register;
s6: hypervisor prints Guest OS operation on the peripheral registers. The Hypervisor analyzes the operation of the Guest OS on the peripheral register to obtain the testing information of the testing peripheral, and outputs the testing information to log information or prints the testing information to a serial port.
In step S6 of the embedded multi-system upgrading method based on Hypervisor of the present invention, the step of the Hypervisor printing Guest OS operating the peripheral register includes:
s601: obtaining Guest OS ID of peripheral operations by Hypervisor;
s602: obtaining Guest OS peripheral names by Hypervisor;
s603: the operation of the Hypervisor printing Guest OS on the external register is performed in a printing format comprising: < Guest OS ID > < Guest OS peripheral name >: write Reg:0x0, Val:0x 0.
Based on the same inventive concept, the invention also provides a debugging peripheral implementation system based on Hypervisor, as shown in FIG. 3, the system comprises:
the Guest OS resource file analyzing module is used for analyzing Guest OS resource file appointed debugging peripheral equipment and intercepted register operation;
the peripheral register intercepting module is used for intercepting the operation of the corresponding Guest OS on the register by analyzing the Guest OS resource file;
and the debugging information printing module is used for analyzing the operation of Guest OS on the register, acquiring debugging information of the debugging peripheral equipment, and outputting the debugging information to log information or printing the debugging information to a serial port.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents and improvements made within the spirit and principle of the present invention are intended to be included within the scope of the present invention.

Claims (3)

1. A Hypervisor-based peripheral debugging and testing implementation method is characterized by comprising the following steps:
s1: the Hypervisor creates a plurality of Guest OSs according to the user configuration;
s2: hypervisor parses Guest OS resource files;
s3: the Hypervisor starts a Guest OS, enters the Guest OS to run and executes corresponding services so as to generate register read-write operation on the testing peripheral;
s4: the Hypervisor judges and adjusts the on-off state of the peripheral; if the switch state is closed, ending, otherwise, continuing to execute the step S5;
s5: judging whether the peripheral register operated currently is within the specified range of the Guest OS resource file; if not, ending, otherwise, intercepting the operation of the Guest OS on the external register by the Hypervisor, and continuing to execute the step S6;
s6: the Hypervisor prints operation of Guest OS to the external register; analyzing the operation of Guest OS on the register, acquiring the testing information of the testing peripheral, and outputting the testing information to log information or printing the testing information to a serial port.
2. The embedded multi-system upgrade method based on Hypervisor of claim 1, wherein in step S6, the step of the Hypervisor printing Guest OS operation on the external setup register includes:
s601: hypervisor acquires Guest OS ID for peripheral operation;
s602: obtaining Guest OS peripheral names by Hypervisor;
s603: the operation of the Hypervisor printing Guest OS on the external register is performed in a printing format comprising: < Guest OS ID > < Guest OS peripheral name >: write Reg:0x0, Val:0x 0;
3. a debugging peripheral implementation system based on Hypervisor comprises:
the Guest OS resource file analyzing module is used for analyzing Guest OS resource file appointed debugging peripheral equipment and intercepted register operation;
the peripheral register intercepting module is used for intercepting the operation of the corresponding Guest OS on the register by analyzing the Guest OS resource file;
and the debugging information printing module is used for analyzing the operation of Guest OS on the register, acquiring debugging information of the debugging peripheral equipment, and outputting the debugging information to log information or printing the debugging information to a serial port.
CN202111219880.8A 2021-10-20 2021-10-20 Hypervisor-based debugging peripheral implementation method and system Pending CN113961308A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111219880.8A CN113961308A (en) 2021-10-20 2021-10-20 Hypervisor-based debugging peripheral implementation method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111219880.8A CN113961308A (en) 2021-10-20 2021-10-20 Hypervisor-based debugging peripheral implementation method and system

Publications (1)

Publication Number Publication Date
CN113961308A true CN113961308A (en) 2022-01-21

Family

ID=79465552

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111219880.8A Pending CN113961308A (en) 2021-10-20 2021-10-20 Hypervisor-based debugging peripheral implementation method and system

Country Status (1)

Country Link
CN (1) CN113961308A (en)

Similar Documents

Publication Publication Date Title
US8230399B2 (en) Method for system call interception in user space
US9396013B2 (en) Method for controlling a virtual machine and a virtual machine system
US11604741B2 (en) Method for dynamically provisioning virtualized functions in a USB device by means of a virtual USB hub
US8671405B2 (en) Virtual machine crash file generation techniques
US7685474B2 (en) Failsafe computer support assistant using a support virtual machine
JP2014203106A (en) Central processing unit, information processor, and register value acquisition method in virtual core
US20070129860A1 (en) Vehicle Service Equipment Interface Drivers
US10430222B2 (en) Cloud based platform simulation for management controller development
US7111200B2 (en) Apparatus and method for debugging a logical partition
US10210842B2 (en) Techniques of displaying host data on a monitor connected to a service processor during pre-boot initialization stage
US10514972B2 (en) Embedding forensic and triage data in memory dumps
US10042666B2 (en) Platform simulation for management controller development on virtual machines
CN114138644A (en) BMC (baseboard management controller) debugging method, monitoring method, system, device, equipment and medium
CN109542524B (en) Linux and android mutual fast switching method
CN113961308A (en) Hypervisor-based debugging peripheral implementation method and system
CN114490276B (en) Peripheral anomaly monitoring method, device and system and storage medium
Sakthikumar et al. White Paper A Tour beyond BIOS Implementing the ACPI Platform Error Interface with the Unified Extensible Firmware Interface
CN113377566A (en) UEFI (unified extensible firmware interface) -based server starting method and device and storage medium
US20070101220A1 (en) Systems and methods for accessing input/output devices
CN110321171B (en) Startup detection device, system and method
Benbachir et al. Hypertracing: Tracing through virtualization layers
US11847015B2 (en) Mechanism for integrating I/O hypervisor with a combined DPU and server solution
CN114327648B (en) Driving debugging method and device, electronic equipment and storage medium
US20220398083A1 (en) Providing system updates in automotive contexts
CN116225765A (en) Method for executing instruction in virtual machine and virtual machine monitor

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