qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Initialize data memory in user space emulation


From: Libo Zhou
Subject: Re: Initialize data memory in user space emulation
Date: Fri, 20 Sep 2019 23:26:35 +0800

I actually thought about hacking it to mmap from file into guest memory before 
running ELF. In include/exec/memory.h, the function 
memory_region_init_ram_from_file sounds like what I need. But the entire 
memory.h source file is wrapped by #ifndef CONFIG_USER_ONLY, I cannot use that 
API in user space emulation, right?

------------------ Original ------------------
From:  "Peter Maydell";<address@hidden>;
Send time: Friday, Sep 20, 2019 10:55 PM
To: "Libo Zhou"<address@hidden>; 
Cc: "qemu-devel"<address@hidden>; 
Subject:  Re: Initialize data memory in user space emulation

On Fri, 20 Sep 2019 at 15:49, Libo Zhou <address@hidden> wrote:
> I need to emulate a Digital Signal Processor. The DSP essentially has only 
> basic MIPS ISA, and it manipulates the data stored in a "data memory". I can 
> run an ELF with user space emulation, what I need to additionally do is to 
> initialize the "data memory" first, then run an ELF that manipulates the data 
> in the "data memory", and finally see if the resulting data are correct or 
> not.

QEMU doesn't really support doing that kind of thing, because
actual Linux binaries don't execute in an environment like that.
You could probably hack QEMU to mmap a file into the guest's
memory before we start to run the userspace process, but there's
nothing that will do what you want out of the box.

thanks
-- PMM

reply via email to

[Prev in Thread] Current Thread [Next in Thread]