Skip to contentSkip to conversation

Using memory mapped IO to read and write in guest memory data

Qemu-devel [email protected] 1 participant 1 message Aug 9, 2016 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Hi all.

I have been searching thoroughly for the latest requirement I need to fulfill using QEMU.
The scenario is like this:
• I have another simulator which is a C program, this program has a shared memory which can be exposed to a file when need be, it can also write to an address or read from it when required
• I have a machine which runs FreeRTOS via QEMU, not the best operating system out there, I know. But it can accept interrupts and jump to the specified memory regions upon receiving it, so if QEMU has an address that I can write to using the external simulator application, then I can interrupt the OS to read the address for changes afterwards. IMHO I have figured out that I can actually create MMIO to map an IO into memory address, but I cant seem to figure out the how tos that have been written to expose this feature.

• So how can I actually initialize a memory mapped IO in qemu options(upon runtime or build)?
• How can I read and write into it, The aforementioned C program can write freely to anything I desire, where and what should I write, where and how should I read(from memory mapped IO)

Are there also other alternatives to solve this problem? Like, can I actually use a file as the QEMU guest system memory and write to it and read from it with free will? Or is there a way to attach a process to QEMU that can see and edit its guest memory?

Thanks in advance.