From: C K Kashyap <ckkashyap@gmail.com>
To: Natalia Portillo <claunia@claunia.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Running the user emulation
Date: Thu, 12 Aug 2010 14:07:23 +0530 [thread overview]
Message-ID: <AANLkTi=0aH0ie91vTXh4WfkDiDHvJw0L+cde8j2WEj2n@mail.gmail.com> (raw)
In-Reply-To: <D0DD107D-B1DD-4103-808A-4AD949EDF7C0@claunia.com>
[-- Attachment #1: Type: text/plain, Size: 3289 bytes --]
You mean qemu on NetBSD or NetBSD in general - if so, I know that even
Solaris can also execute linux binaries. And to do it, it would require me
to modify the mac os - which I have no clue how to.
Maybe I'll try out what Stefan said - although, on the face of it, it looks
like an endless cycles of makefile fixes - it might just turn out to be
easy.
The idea is that, qemu already knows how to load up the elf etc .. and has
the engine to execute x86 instructions .... all that's required is to
provide an infrastructure that imitates linux's system calls.
On Thu, Aug 12, 2010 at 12:08 AM, Natalia Portillo <claunia@claunia.com>wrote:
> You can check how NetBSD does that.
>
> NetBSD is able to run executables from other UNIXes and POSIX-compatible
> systems, including, Linux, IRIX, Darwin.
> They do that with a series of syscall conversions and library
> substitutions.
>
> That should be portable to use Mac OS X as host instead of NetBSD, and to
> run thru QEMU (running x86 Linux software on PowerPC Darwin)
>
> Regards,
> Natalia Portillo
>
> El 11/08/2010, a las 10:33, C K Kashyap escribió:
>
> 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?
>
>
> On Wed, Aug 11, 2010 at 2:48 PM, Stefan Weil <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>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
>
>
>
--
Regards,
Kashyap
[-- Attachment #2: Type: text/html, Size: 4611 bytes --]
prev parent reply other threads:[~2010-08-12 8:37 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
2010-08-11 11:26 ` C K Kashyap
2010-08-11 18:38 ` Natalia Portillo
2010-08-12 8:37 ` C K Kashyap [this message]
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='AANLkTi=0aH0ie91vTXh4WfkDiDHvJw0L+cde8j2WEj2n@mail.gmail.com' \
--to=ckkashyap@gmail.com \
--cc=claunia@claunia.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).