[Qemu-devel] Build error - target i386-linux-user on RHEL4.8 x86_64

2010-08-24 Thread C K Kashyap
Hi,
I tried to build qemu's user mode linux emulation on RHEL 4.8 x86_64 -
but I run into this issue -
  ARi386-linux-user/libqemu.a
  LINK  i386-linux-user/qemu-i386
/usr/bin/ld:/home/ckk/lab/qemu-0.12.5/x86_64.ld:41: syntax error
collect2: ld returned 1 exit status
make[1]: *** [qemu-i386] Error 1
make: *** [subdir-i386-linux-user] Error 2
[...@windowher-dr qemu-0.12.5]$


This was from qemu-0.12.5.

I am however, able to build qemu-0.11.1 correctly.

I'd really appreciate it if someone could help me with the build error.

-- 
Regards,
Kashyap



[Qemu-devel] qemu user mode emulation / callgraph

2010-08-23 Thread C K Kashyap
Hi
I was wondering if qemu's user mode emulation could be tweaked to generate
callgraph.

Today was the first time I tried the user mode emulation - I ran into the
below issue

[u...@kashyap lab]$ qemu-x86_64 -cpu qemu64 ./a.out
ERROR: ioctl(SNDCTL_DSP_MAPINBUF): target=0x80085013 host=0x80105013
ERROR: ioctl(SNDCTL_DSP_MAPOUTBUF): target=0x80085014 host=0x80105014
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
Segmentation fault

I'd appreciate any help.

-- 
Regards,
Kashyap


Re: [Qemu-devel] OS with only segmentation - will it be faster?

2010-08-12 Thread C K Kashyap
Thanks Malc .. I'll check out the video ... and perhaps ping you off the
list.


On Fri, Aug 13, 2010 at 10:15 AM, malc  wrote:

> On Fri, 13 Aug 2010, C K Kashyap wrote:
>
> > Hi,
> > This is not strictly qemu related but I think people who have a good idea
> > about it must be on this list.
> > I was wondering if I had an app that requires a fixed quantity of memory
> -
> > sufficiently less than the available physical memory. Would it benefit
> from
> > getting rid of the paging mechanism in the OS/hardware?
> > As in, since the number of tasks are also fixed - we'd use only
> segmentation
> > to partition the VM area? Would eliminating the paging layer give good
> > returns?
> >
>
> Microsoft researchers working on Singularity claimed[1] that it does
> provide significant speed improvements, and recent (few days ago)
> discussion on comp.arch suggested as much (no need to go though TLB).
>
> [1]
> http://channel9.msdn.com/shows/Going+Deep/Singularity-A-research-OS-written-in-C/
>(maybe the claim was made in some other video, in any case it should
> be there on Channel 9)
>
> --
> mailto:av1...@comtv.ru
>



-- 
Regards,
Kashyap


[Qemu-devel] OS with only segmentation - will it be faster?

2010-08-12 Thread C K Kashyap
Hi,
This is not strictly qemu related but I think people who have a good idea
about it must be on this list.
I was wondering if I had an app that requires a fixed quantity of memory -
sufficiently less than the available physical memory. Would it benefit from
getting rid of the paging mechanism in the OS/hardware?
As in, since the number of tasks are also fixed - we'd use only segmentation
to partition the VM area? Would eliminating the paging layer give good
returns?

-- 
Regards,
Kashyap


Re: [Qemu-devel] Running the user emulation

2010-08-12 Thread C K Kashyap
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 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  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 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


Re: [Qemu-devel] Running the user emulation

2010-08-11 Thread C K Kashyap
Thanks Stefan for the explanation ... It does not look like a pleasant thing
to do though :)

On Wed, Aug 11, 2010 at 3:33 PM, Stefan Weil  wrote:

>  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 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 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


Re: [Qemu-devel] Running the user emulation

2010-08-11 Thread 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?


On Wed, Aug 11, 2010 at 2:48 PM, Stefan Weil  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  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


Re: [Qemu-devel] Running the user emulation

2010-08-11 Thread 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?



On Wed, Aug 11, 2010 at 2:12 PM, Stefan Weil  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


[Qemu-devel] Running the user emulation

2010-08-11 Thread 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


Re: [Qemu-devel] Virtual memory question

2010-08-08 Thread C K Kashyap
I am curious to know why you'd want to do it?

On Mon, Aug 9, 2010 at 2:03 AM, Dennis  wrote:

> Hi,
>
> I've been looking at the qemu source code but couldn't find anything
> that would suit my needs.
> Basically I'm looking for a way to use a file on disk as physical
> memory inside Qemu.
>
> Before I attempt to reinvent the wheel, has someone ever hacked in
> similar functionality and if so is there a diff patch available
> anywhere?
>
>


-- 
Regards,
Kashyap