All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lex <lex@progger.ru>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] using qemu binary translation to run I386 code under x86_64
Date: Sat, 02 Nov 2013 14:23:16 +0200	[thread overview]
Message-ID: <5274EEB4.6080606@progger.ru> (raw)

Hi all,

I am new to the list and to qemu development in general, so my question 
might be discussed already (though I failed to find an answer in 
archives, thus writing here).

I want to use qemu to execute x86 32-bit binary code inside of x86_64 
process under OS X. In future, I would like to be able to execute the 
same code on other architectures (not x86).

Background: I have a library written in 32-bit intel assembly which does 
not use any system calls (just computations). Eventhough sources are 
available, there is no plans to rewrite it into C, because code is very 
ancient, parts are received from reverse-engineering/disasming (and thus 
are unmaintainable) etc.

Up until recently, I was using helper 32-bit executable, interfacing 
with it through stdandart input/output from 64-bit process. It is no 
longer an option unfortunately.

Is it possible to:
1. set up memory of target CPU (load the binary, write in function 
arguments)
2. using qemu, call the function from the library
3. read memory of target CPU (get data, returned by the function).

Thing is that I don't need full system emulation (hardware, bios, etc) - 
that would be an overkill. qemu usermode looks very promising in that 
regard, but it seems support for darwin was removed...

So, I wonder whether things I am asking are already possible and how 
much efford it might require?

Thanks in advance for all your help!

Lex

                 reply	other threads:[~2013-11-02 12:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5274EEB4.6080606@progger.ru \
    --to=lex@progger.ru \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.