restpussy.blogg.se

Virtualbox guest additions
Virtualbox guest additions






virtualbox guest additions

Allocate one page of memory, providing its physical address as an output and virtual address as a return value. Pseudo-code examples in the following sections will assume the availability of these functions adjust them to match your environment: This page contains some struct definitions which could alternatively be obtained from headers provided by VirtualBox, but those headers are rather heavy and assume they are being used alongside a robust set of system headers, so instead we will define these structs ourselves.

virtualbox guest additions

Communication from the VM is primarily initiated by an IRQ on the PCI device's interrupt line, which should then be followed up by appropriate packet requests, one of which should be of a special "Acknowledge Events" type. Receiving works the same way, as you must prepare a packet with a request type and provide its physical address after the MMIO port write finishes, the packet will be populated with the appropriate values if the request was successful. The basic process for sending a message to the VM is to prepare a packet and then write its (physical) address to the MMIO port. The MMIO operations that read or populate packets are synchronous, so setting up one page to pass back and forth is feasible. These can be anywhere in physical memory, and are relatively short.

virtualbox guest additions

The format for the latter is unimportant for the features described on this page - you need only know that the region can be interpreted as an array of 32-bit unsigned integers and offset 3 contains the IRQ mask.Ĭommunication between the guest and the host happens through packets in memory. BAR0 is the MMIO port and BAR1 is a memory region that contains some shared state for the device, such as a bit mask for what events the guest wishes to receive. The PCI device has the vendor ID 0x80EE, same as the VirtualBox implementation of the Bochs display adapter, and a device ID of 0xCAFE. A combination of memory-mapped packets, MMIO port writes, and IRQs allow the guest to communicate its feature support to the VM and for the VM to communicate events such as display changes and mouse movement. The Guest Additions package operates through a PCI/mmio device provided by the VM.








Virtualbox guest additions