qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Weil <weil@mail.berlios.de>
To: C K Kashyap <ckkashyap@gmail.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Running the user emulation
Date: Wed, 11 Aug 2010 12:03:13 +0200	[thread overview]
Message-ID: <4C627561.3090707@mail.berlios.de> (raw)
In-Reply-To: <AANLkTinREy-9RnGvoo3io_53bSfFJ2z_yTQJRt778eRD@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3048 bytes --]

Am 11.08.2010 11:33, schrieb C K Kashyap:
> I was wondering if it would be easy to force build the user-emulation 
> on mac - as in, lets say my a.out from linux is really trivial - even 
> statically linked for that matter. All it does is, say, write "hello 
> world\n" to the screen - I'd imaging that write system call would be 
> similar on mac (as far as writing to stdout is concerned) .... Would 
> it be possible/easy to give it a shot?
>
>

It should be possible. Projects like wine can emulate windows system 
calls on linux.
Emulating darwin system calls on linux is much easier.

If you want to try it yourself, you could start by removing the exit 
from file configure:

     if test "$linux" != "yes" ; then
       echo "ERROR: Target '$target' is only available on a Linux host"
       # exit 1
     fi

Then you can run 'configure --target-list=i386-linux-user'.
Run make and fix all error messages which you will get.
If you think they are in code which you don't need for your a.out,
#if 0 ... #endif helps to remove that code.

Run the new-built qemu-i386 with your a.out and fix the remaining bugs.

That's all :-)


> On Wed, Aug 11, 2010 at 2:48 PM, Stefan Weil <weil@mail.berlios.de 
> <mailto:weil@mail.berlios.de>> wrote:
>
>     Am 11.08.2010 11:06, schrieb C K Kashyap:
>>     Let me see if I understand this right -
>>
>>     qemu loads the a.out and begins to interpret the x86 instructions
>>     in the a.out and when a system call happens, it makes the call
>>     the host system .... is that right?
>>
>
>
>     Right. That's the way how linux user mode emulation (for example
>     qemu-i386) works.
>     See linux-user/syscall.c if you want to see more details.
>
>     bsd-user and darwin-user are also supported (more or less), but
>     darwin-user
>     only supports translation of darwin/powerpc to darwin/x86 syscalls.
>     It won't help you to run a linux a.out on your mac.
>
>
>>
>>
>>     On Wed, Aug 11, 2010 at 2:12 PM, Stefan Weil
>>     <weil@mail.berlios.de <mailto:weil@mail.berlios.de>> wrote:
>>
>>         Am 11.08.2010 10:31, schrieb C K Kashyap:
>>>         Hi,
>>>         I've built qemu on my mac osx using this config -
>>>         ./configure --prefix=/Users/ckk/local/
>>>         --target-list="i386-softmmu x86_64-softmmu" --enable-linux-user
>>>
>>>         Now, I have a simple a.out built on linux - how can I run it
>>>         using qemu on my mac box?
>>>
>>>         -- 
>>>         Regards,
>>>         Kashyap
>>
>>         Hi Kashyap,
>>
>>         you cannot run it in user mode emulation unless you replace
>>         Mac OS by Linux
>>         on your mac box. Linux user emulations requires a Linux host.
>>
>>         If you have a Linux host, you would need
>>         --target-list=i386-linux-user.
>>
>>         You can run your a.out if you run system emulation (e.g.
>>         i386-softmmu/qemu)
>>         and install Linux there, of course.
>>
>>         Regards,
>>         Stefan
>>
>>     -- 
>>     Regards,
>>     Kashyap
>
> -- 
> Regards,
> Kashyap


[-- Attachment #2: Type: text/html, Size: 4321 bytes --]

  reply	other threads:[~2010-08-11 10:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-11  8:31 [Qemu-devel] Running the user emulation C K Kashyap
2010-08-11  8:42 ` Stefan Weil
2010-08-11  9:06   ` C K Kashyap
2010-08-11  9:18     ` Stefan Weil
2010-08-11  9:33       ` C K Kashyap
2010-08-11 10:03         ` Stefan Weil [this message]
2010-08-11 11:26           ` C K Kashyap
2010-08-11 18:38         ` Natalia Portillo
2010-08-12  8:37           ` C K Kashyap

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=4C627561.3090707@mail.berlios.de \
    --to=weil@mail.berlios.de \
    --cc=ckkashyap@gmail.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).