qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] Code source modifying


From: Ormaetxea Xabier
Subject: Re: [Qemu-devel] Code source modifying
Date: Mon, 10 Jul 2017 10:16:39 +0000

Hi Peter!

Ah sorry, I thought that replying to your message it was somehow redirected to 
the mailing list. So, every-time I respond, I have to do it to address@hidden 
Or a CC it's enough? Sorry for my ignorance...

Anyway, do you imagine how can I make this "virtual world"-"real world" 
connection? I mean, is there an easy way of connecting an execution from the 
standalone with the source code?

Thank you for your work!

Xabi

-----Mensaje original-----
De: Peter Maydell [mailto:address@hidden 
Enviado el: lunes, 10 de julio de 2017 11:58
Para: Ormaetxea Xabier
Asunto: Re: [Qemu-devel] Code source modifying

It's really better to keep threads on the public mailing lists,
that way the answers help everybody (and anybody who knows the
answer can reply)...

Anyway, you cannot do what you're trying to do the way you're
trying to do it.

thanks
-- PMM

On 10 July 2017 at 10:40, Ormaetxea Xabier <address@hidden> wrote:
> Hello Peter!
>
> I will use the "read every loop" in cpu_exec(), I suppose it’s the "best" 
> place to do it.
>
> And yes, I really mean virtual address... Let's see if I can explain well 
> myself (not the best at english).
> The standalone program works over the virtual platform, so when I want the 
> exterior timer to start counting I will use a:
>
> 0x95000000*=0xffffffff
>
> And when I want to finish it:
>
> 0x95000000*=0x00000000
>
> Now, from the code source, I need to read in every step (let's say every 
> cpu_exec() loop) that virtual position. Like connecting the virtual and real 
> addresses.
>
> Something just like:
>
> if (0x95000000*==0xffffffff){
>         system("echo 1 > /sys/class/gpio/gpio913/value");
> }
> else{
>         system("echo 0 > /sys/class/gpio/gpio913/value");
> }
>
> But I don't know where it maps my virtual (0x95000000) memory. So... can't do 
> 0x95000000*==0xffffffff.
>
> Thank you for your help!
>
> Xabi
>
>
>
> -----Mensaje original-----
> De: Peter Maydell [mailto:address@hidden
> Enviado el: lunes, 10 de julio de 2017 11:26
> Para: Ormaetxea Xabier
> CC: address@hidden
> Asunto: Re: [Qemu-devel] Code source modifying
>
> On 10 July 2017 at 10:14, Ormaetxea Xabier <address@hidden> wrote:
>> My standalone program writes "0xffffffff" in the position 0x95000000
>> when the timer should start, and "0x00000000" when it have to finish.
>> I want to modify the code so every single (standalone) program step
>> reads the virtual 0x95000000 and changes the value of a gpio. But I
>> can't find how I can read from the source code the virtual memory,
>> and I can't find neither where/how does the program process (step
>> by step) the standalone program.
>
> QEMU doesn't really work that way. What we do is take blocks of the
> guest binary (usually up to the next branch instruction), translate
> the whole block to native host binary code, and then execute those
> translated blocks. So our main execution loop (cpu_exec()) is
> basically a loop that does:
>  * handle any pending interrupt or exception work
>  * find previously translated block for this PC
>    (and translate it if it didn't already exist)
>  * execute that TB (which will execute multiple guest insns
>    and may jump directly to another TB without coming back to C code)
>
> Do you really mean virtual addresses here? That is very weird:
> hardware doesn't do that -- timer devices are at fixed physical
> addresses which the guest can then choose to map where they like
> in the virtual address space using the MMU.
>
> thanks
> -- PMM

reply via email to

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