IN-KERNEL MEMORY-MAPPED I/O DEVICE EMULATION

In-Kernel Memory-Mapped I/O Device Emulation

In-Kernel Memory-Mapped I/O Device Emulation

Blog Article

Device emulation is a common necessity that arises at various steps revlon colorstay lip liner plum of the development cycle, hardware migration, or reverse-engineering.While implementing the algorithms behind the device may be a nontrivial task by itself, connecting the emulator to an existing environment, such as drivers intended to work with the actual hardware, may be no less complex.Devices relying on memory-mapped input/output are of a particular interest, because unlike port-mapped input/output there is much less of a chance that the target platform provides a direct interface to intercept the transmissions.A well-known approach used in various virtual machine software is to put the entire operating system under a hypervisor and build the emulator externally.

This may not be desirable for reasons like hypervisor complexity, performance loss, and additional requirements for the host hardware.In this paper we extend this approach to the kernel and explain how it may be possible to build the emulator by relying on the existing interfaces sensationnel kiyari provided by an operating system.Given the common availability of an MMU unit as well as memory protection mechanisms, allowing the handling of page or segment traps at read or write access, we presume that a suggested technique of intercepting memory-mapped input/output could be implemented in a broad number of target platforms.To illustrate the specifics and show potential issues we provide the ways to simplify the implementation and optimize it in speed depending on the target capabilities, the protocol emulated, and the project requirements.

As a working proof we created a SMC emulator for an x86 target, which makes use of this approach.

Report this page