Re: [Qemu-devel] Please help build qemu/darwin-user on Mac Intel

2007-02-03 Thread Ilya Shar
Hi Mike, 

Thanks a lot for the patches.  I applied them
(together with qemu-0.7.0-gcc4.patch, which appears to
be necessary although it's not in the archive you
created) but in the middle of the build dyngen rejects
op.o: 

../dyngen -c -o opc.h op.o
dyngen: Unable to replace ret with jmp in
op_bsfl_T0_cc
make[1]: *** [opc.h] Error 1

Did I mess up somewhere or there is something wrong
with the patches?  

Thanks again for your help! 
Ilya 


--- Mike Kronenberg <[EMAIL PROTECTED]> wrote:

> Hi,
> 
> we have decided to wait for the next qemu release
> until we update the  
> patches for kju, as qemu dev has picked up speed,
> which is good.
> Never the less, you can grab the patches for qemu
> cvs (OS X Intel) here:
> 
> http://www.kberg.ch/qemu/cvspatches20070202.zip
> 
> Best Regards
> Mike
> 
> On 03.02.2007, at 08:47, Pierre d'Herbemont wrote:
> 
> > Hi,
> >
> > On 3 févr. 07, at 02:37, Ilya Shar wrote:
> >
> >> I am trying to build i386-darwin-user to run it
> on an
> >> x86 Mac.  I'm on Mac OS 10.4 Intel with gcc 3.3
> and
> >> I'm getting compiler errors right away:
> >>
> >> $ cvs
> >>
>
-d:pserver:[EMAIL PROTECTED]:/cvsroot/darwine
> >
> > Ilya, qemu's CVS has the most up-to-date version
> of darwin-user  
> > now, so you should use it intead of the version
> which is in the  
> > darwine's cvs. Moreover to compile qemu on intel
> you'll need a few  
> > patche. The team behind Q.app has collected them
> for you [1]. Also  
> > I am not sure that gcc 3.3 can build Mac Intel
> binaries that are  
> > compliant with the current Mac OS X x86 ABI. So
> you may also need  
> > the gcc 4.0 patches that you should find in [1].
> >
> > Pierre.
> >
> > [1]
> http://www.kju-app.org/proj/browser/trunk/patches
> >
> >
> > ___
> > Qemu-devel mailing list
> > Qemu-devel@nongnu.org
> >
> http://lists.nongnu.org/mailman/listinfo/qemu-devel
> 
> 
> 
> ___
> Qemu-devel mailing list
> Qemu-devel@nongnu.org
> http://lists.nongnu.org/mailman/listinfo/qemu-devel
> 




 

Need Mail bonding?
Go to the Yahoo! Mail Q&A for great tips from Yahoo! Answers users.
http://answers.yahoo.com/dir/?link=list&sid=396546091


___
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel


Re: [Qemu-devel] Please help build qemu/darwin-user on Mac Intel

2007-02-03 Thread Mike Kronenberg

Hi,

we have decided to wait for the next qemu release until we update the  
patches for kju, as qemu dev has picked up speed, which is good.

Never the less, you can grab the patches for qemu cvs (OS X Intel) here:

http://www.kberg.ch/qemu/cvspatches20070202.zip

Best Regards
Mike

On 03.02.2007, at 08:47, Pierre d'Herbemont wrote:


Hi,

On 3 févr. 07, at 02:37, Ilya Shar wrote:


I am trying to build i386-darwin-user to run it on an
x86 Mac.  I'm on Mac OS 10.4 Intel with gcc 3.3 and
I'm getting compiler errors right away:

$ cvs
-d:pserver:[EMAIL PROTECTED]:/cvsroot/darwine


Ilya, qemu's CVS has the most up-to-date version of darwin-user  
now, so you should use it intead of the version which is in the  
darwine's cvs. Moreover to compile qemu on intel you'll need a few  
patche. The team behind Q.app has collected them for you [1]. Also  
I am not sure that gcc 3.3 can build Mac Intel binaries that are  
compliant with the current Mac OS X x86 ABI. So you may also need  
the gcc 4.0 patches that you should find in [1].


Pierre.

[1] http://www.kju-app.org/proj/browser/trunk/patches


___
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel




___
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel


Re: [Qemu-devel] Re: strange crash on FreeBSD-current/amd64 (pointer truncation?)

2007-02-03 Thread Gwenole Beauchesne

Hi,


Hmm.  All I can say is the upper half of rbx (which holds T0) gets
spilled on FreeBSD-current/amd64 hosts unless saving and restoring
the full 64 bit of it...


That's also what I got with VirtualBox on x86_64. Here is an update to  
the patch I posted yesterday and that applies to current QEMU CVS  
instead.


Please note this one applies unconditionnally of the host and target  
combinations. Besides, I only tested the following combinations:  
x86_64/x86_64-softmmu, x86_64/i386-softmmu, i586/x86_64-softmmu,  
i586/i386-softmmu. And I verified that the generated code for  
cpu_exec() with both gcc 3.4 and gcc 4.1 actually does the host  
registers save/restore correctly.


BTW, for e.g. SPARC hosts with %l registers, we could define  
something like DONT_PRESERVE_AREG since those would lay in a new  
register window and thus don't require an explicit save/restore.


Regards,
Gwenole Beauchesne






qemu-0.8.3-preserve-host-registers.patch
Description: Binary data
___
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel


Re: [Qemu-devel] qemu on Cygwin

2007-02-03 Thread Alexander Voropay

"Johannes Schindelin" <[EMAIL PROTECTED]> wrote:


 Did anyone try the latest CVS qemu on Cygwin ?


AFAICT this is due to SDL. I did not succeed in compiling any SDL related 
stuff in cygwin, but then, I did not really try, since the MinGW 
compilation is easy enough.


I've successfully compiled SDL 1.2.11 on the fresh-installed Cygwin 1.5.24.
The following test SDL application works:
http://www.cse.nd.edu/courses/cse20211/www/code/sdl.html

The SDL/test contains a bunch of SDL testing applications.
Most of them works too, even sound- and OpenGL related.

--
-=AV=-


___
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel


[Qemu-devel] [Patch] darwin-user: Clean up target_mach_msg_trap(), remove unuseful do_pread, begin sysctl implementation and implement fcntl

2007-02-03 Thread Pierre d'Herbemont

Hi,

This patch cleans up target_mach_msg_trap(), removes unuseful  
do_pread, begins sysctl implementation and implements fcntl.


Pierre.Index: darwin-user/syscall.c
===
RCS file: /sources/qemu/qemu/darwin-user/syscall.c,v
retrieving revision 1.1
diff -u -r1.1 syscall.c
--- darwin-user/syscall.c   18 Jan 2007 20:06:33 -  1.1
+++ darwin-user/syscall.c   3 Feb 2007 16:47:48 -
@@ -23,9 +23,10 @@
 #include 
 #include 
 
-#include 
+#include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -208,15 +209,14 @@
 else
 {
 for( i = 0; i < sizeof(msg_name)/sizeof(msg_name[0]); i++) {
-if(msg_name[0].code & ret) {
-DPRINTF("%s ", msg_name[0].name);
+if(msg_name[i].code == ret) {
+DPRINTF("%s\n", msg_name[i].name);
 found = 1;
+break;
 }
 }
 if(!found)
 qerror("unknow mach message ret code %d\n", ret);
-else
-DPRINTF("\n");
 }
 }
 
@@ -235,11 +235,10 @@
 mach_msg_body_t body;
 };
 
-static inline void * swap_mach_msg_body(struct complex_msg *complex_msg, int 
bswap)
+static inline void swap_mach_msg_body(struct complex_msg *complex_msg, int 
bswap)
 {
 mach_msg_port_descriptor_t *descr = (mach_msg_port_descriptor_t 
*)(complex_msg+1);
 int i,j;
-void *additional_data;
 
 if(bswap == bswap_in)
 tswap32s(&complex_msg->body.msgh_descriptor_count);
@@ -292,41 +291,41 @@
 }
 if(bswap == bswap_out)
 tswap32s(&complex_msg->body.msgh_descriptor_count);
-additional_data = descr;
-return additional_data;
+}
+
+static inline void swap_mach_msg(mach_msg_header_t *hdr, int bswap)
+{
+if (bswap == bswap_out && hdr->msgh_bits & MACH_MSGH_BITS_COMPLEX)
+swap_mach_msg_body((struct complex_msg *)hdr, bswap);
+
+swap_mach_msg_header(hdr);
+
+if (bswap == bswap_in && hdr->msgh_bits & MACH_MSGH_BITS_COMPLEX)
+swap_mach_msg_body((struct complex_msg *)hdr, bswap);
 }
 
 static inline uint32_t target_mach_msg_trap(
 mach_msg_header_t *hdr, uint32_t options, uint32_t send_size,
-uint32_t rcv_size, uint32_t rcv_name, uint32_t time_out, uint32_t 
notify )
+uint32_t rcv_size, uint32_t rcv_name, uint32_t time_out, uint32_t 
notify)
 {
-extern int mach_msg_trap(mach_msg_header_t *, uint32_t, uint32_t, 
uint32_t, uint32_t, uint32_t, uint32_t);
+extern int mach_msg_trap(mach_msg_header_t *, mach_msg_option_t,
+  mach_msg_size_t, mach_msg_size_t, mach_port_t,
+  mach_msg_timeout_t, mach_port_t);
 mach_msg_audit_trailer_t *trailer;
 mach_msg_id_t msg_id;
 uint32_t ret = 0;
-char *additional_data;
 int i;
 
-swap_mach_msg_header(hdr);
-
-print_description_msg_header(hdr);
+swap_mach_msg(hdr, bswap_in);
 
 msg_id = hdr->msgh_id;
 
-if (hdr->msgh_bits & MACH_MSGH_BITS_COMPLEX)
-additional_data = swap_mach_msg_body((struct complex_msg *)hdr, 
bswap_in);
-else
-additional_data = (void*)(hdr+1);
+print_description_msg_header(hdr);
 
 ret = mach_msg_trap(hdr, options, send_size, rcv_size, rcv_name, time_out, 
notify);
 
 print_mach_msg_return(ret);
 
-if (hdr->msgh_bits & MACH_MSGH_BITS_COMPLEX)
-additional_data = swap_mach_msg_body((struct complex_msg *)hdr, 
bswap_out);
-else
-additional_data = (void*)(hdr+1);
-
 if( (options & MACH_RCV_MSG) && (REQUESTED_TRAILER_SIZE(options) > 0) )
 {
 /* XXX: the kernel always return the full trailer with MACH_SEND_MSG, 
so we should
@@ -368,33 +367,20 @@
 case 200: /* host_info */
 {
 mig_reply_error_t *err = (mig_reply_error_t *)hdr;
-struct {
-uint32_t unknow1;
-uint32_t maxcpu;
-uint32_t numcpu;
-uint32_t memsize;
-uint32_t cpu_type;
-uint32_t cpu_subtype;
-} *data = (void *)(err+1);
-
-DPRINTF("maxcpu = 0x%x\n",   data->maxcpu);
-DPRINTF("numcpu = 0x%x\n",   data->maxcpu);
-DPRINTF("memsize = 0x%x\n",  data->memsize);
+struct host_basic_info *data = (void *)(err+1);
+
+DPRINTF("maxcpu = 0x%x\n",   data->max_cpus);
+DPRINTF("numcpu = 0x%x\n",   data->avail_cpus);
+DPRINTF("memsize = 0x%x\n",  data->memory_size);
 
 #if defined(TARGET_I386)
 data->cpu_type = CPU_TYPE_I386;
 DPRINTF("cpu_type changed to 0x%x(i386)\n", data->cpu_type);
-#elif defined(TARGET_PPC)
-data->cpu_type = CPU_TYPE_POWERPC;
-DPRINTF("cpu_type changed to 0x%x(ppc)\n", data->cpu_type);
-#else
-# error target not supported
-#endif
-
-#if defined(TARGET_I386)
 data->cpu_subtype = CPU_SUBTYPE_PENT;
 DPRINTF("cpu_subtype changed to 0x%x(i386_pent)\n

[Qemu-devel] [Patch] darwin-user: Update usage output, add a small comment on int 0x90 and suppress dead code.

2007-02-03 Thread Pierre d'Herbemont

Hi,

This patch alters a bit the qemu-darwin-user usage output. It also  
add a bit more documentation on int 0x90, and suppress dead code.


Pierre.Index: darwin-user/main.c
===
RCS file: /sources/qemu/qemu/darwin-user/main.c,v
retrieving revision 1.2
diff -u -r1.2 main.c
--- darwin-user/main.c  31 Jan 2007 12:08:13 -  1.2
+++ darwin-user/main.c  3 Feb 2007 16:47:48 -
@@ -646,17 +646,18 @@
"Darwin CPU emulator (compiled for %s emulation)\n"
"\n"
"-h   print this help\n"
-   "-L path  set the elf interpreter prefix (default=%s)\n"
+   "-L path  set the %s library path (default='%s')\n"
"-s size  set the stack size in bytes (default=%ld)\n"
"\n"
"debug options:\n"
 #ifdef USE_CODE_COPY
"-no-code-copy   disable code copy acceleration\n"
 #endif
-   "-d options   activate log (logfile=%s)\n"
+   "-d options   activate log (logfile='%s')\n"
"-g wait for gdb on port 1234\n"
"-p pagesize  set the host page size to 'pagesize'\n",
TARGET_ARCH,
+   TARGET_ARCH,
interp_prefix,
stack_size,
DEBUG_LOGFILE);
@@ -753,11 +754,6 @@
 /* Zero out regs */
 memset(regs, 0, sizeof(struct target_pt_regs));
 
-#if 0
-/* Scan interp_prefix dir for replacement files. */
-init_paths(interp_prefix);
-#endif
-
 /* NOTE: we need to init the CPU at this stage to get
qemu_host_page_size */
 env = cpu_init();
@@ -888,7 +884,7 @@
 set_idt(0x81, 3); /* Mach Syscalls */
 set_idt(0x82, 3); /* thread Syscalls */
 
-set_idt(0x90, 3); /* Unix Syscall backdoor */
+set_idt(0x90, 3); /* qemu-darwin-user's Unix syscalls backdoor */
 
 
 cpu_x86_load_seg(env, R_CS, __USER_CS);
___
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel


[Qemu-devel] [Patch] documentation: Document qemu-darwin-user

2007-02-03 Thread Pierre d'Herbemont

Hi,

I think that a small note about qemu-darwin-user in the doc should be  
quite useful...


Pierre.

Index: qemu-doc.texi
===
RCS file: /sources/qemu/qemu/qemu-doc.texi,v
retrieving revision 1.126
diff -u -r1.126 qemu-doc.texi
--- qemu-doc.texi   2 Feb 2007 00:37:56 -   1.126
+++ qemu-doc.texi   3 Feb 2007 17:11:57 -
@@ -25,7 +25,7 @@
 * Installation::
 * QEMU PC System emulator::
 * QEMU System emulator for non PC targets::
-* QEMU Linux User space emulator::
+* QEMU User space emulator::
 * compilation:: Compilation from the sources
 * Index::
 @end menu
@@ -57,8 +57,8 @@
 without rebooting the PC or to debug system code.
 
 @item 
-User mode emulation (Linux host only). In this mode, QEMU can launch
-Linux processes compiled for one CPU on another CPU. It can be used to
+User mode emulation. In this mode, QEMU can launch
+processes compiled for one CPU on another CPU. It can be used to
 launch the Wine Windows API emulator (@url{http://www.winehq.org}) or
 to ease cross-compilation and cross-debugging.
 
@@ -1704,8 +1704,29 @@
 A Linux 2.6 test image is available on the QEMU web site. More
 information is available in the QEMU mailing-list archive.
 
[EMAIL PROTECTED] QEMU Linux User space emulator 
[EMAIL PROTECTED] QEMU Linux User space emulator 
[EMAIL PROTECTED] QEMU User space emulator 
[EMAIL PROTECTED] QEMU User space emulator 
+
[EMAIL PROTECTED]
+* Supported Operating Systems ::
+* Linux User space emulator::
+* Mac OS X/Darwin User space emulator ::
[EMAIL PROTECTED] menu
+
[EMAIL PROTECTED] Supported Operating Systems
[EMAIL PROTECTED] Supported Operating Systems
+
+The following OS are supported in user space emulation:
+
[EMAIL PROTECTED] @minus
[EMAIL PROTECTED]
+Linux (refered as qemu-linux-user)
[EMAIL PROTECTED]
+Mac OS X/Darwin (refered as qemu-darwin-user)
[EMAIL PROTECTED] itemize
+
[EMAIL PROTECTED] Linux User space emulator
[EMAIL PROTECTED] Linux User space emulator
 
 @menu
 * Quick Start::
@@ -1715,7 +1736,7 @@
 @end menu
 
 @node Quick Start
[EMAIL PROTECTED] Quick Start
[EMAIL PROTECTED] Quick Start
 
 In order to launch a Linux process, QEMU needs the process executable
 itself and all the target (x86) dynamic libraries used by it. 
@@ -1726,7 +1747,7 @@
 libraries:
 
 @example 
-qemu-i386 -L / /bin/ls
+qemu-linux-i386 -L / /bin/ls
 @end example
 
 @code{-L /} tells that the x86 dynamic linker must be searched with a
@@ -1765,7 +1786,7 @@
 @end itemize
 
 @node Wine launch
[EMAIL PROTECTED] Wine launch
[EMAIL PROTECTED] Wine launch
 
 @itemize
 
@@ -1794,7 +1815,7 @@
 @end itemize
 
 @node Command line options
[EMAIL PROTECTED] Command line options
[EMAIL PROTECTED] Command line options
 
 @example
 usage: qemu-i386 [-h] [-d] [-L path] [-s size] program [arguments...]
@@ -1819,7 +1840,7 @@
 @end table
 
 @node Other binaries
[EMAIL PROTECTED] Other binaries
[EMAIL PROTECTED] Other binaries
 
 @command{qemu-arm} is also capable of running ARM "Angel" semihosted ELF
 binaries (as implemented by the arm-elf and arm-eabi Newlib/GDB
@@ -1831,6 +1852,91 @@
 
 The binary format is detected automatically.
 
[EMAIL PROTECTED] Mac OS X/Darwin User space emulator
[EMAIL PROTECTED] Mac OS X/Darwin User space emulator
+
[EMAIL PROTECTED]
+* Mac OS X/Darwin Status::
+* Mac OS X/Darwin Quick Start::
+* Mac OS X/Darwin Command line options::
[EMAIL PROTECTED] menu
+
[EMAIL PROTECTED] Mac OS X/Darwin Status
[EMAIL PROTECTED] Mac OS X/Darwin Status
+
[EMAIL PROTECTED] @minus
[EMAIL PROTECTED]
+target x86 on x86: Most apps (Cocoa and Carbon too) works. [1]
[EMAIL PROTECTED]
+target PowerPC on x86: Not working as the ppc commpage can't be mapped (yet!)
[EMAIL PROTECTED]
+target x86 on x86: Most apps (Cocoa and Carbon too) works. [1]
[EMAIL PROTECTED]
+target x86 on PowerPC: most utilities work. Cocoa and Carbon apps are not yet 
supported.
[EMAIL PROTECTED] itemize
+
+[1] If you're host commpage can be executed by qemu.
+
[EMAIL PROTECTED] Mac OS X/Darwin Quick Start
[EMAIL PROTECTED] Quick Start
+
+In order to launch a Mac OS X/Darwin process, QEMU needs the process executable
+itself and all the target dynamic libraries used by it. If you don't have the 
FAT
+libraries (you're running Mac OS X/ppc) you'll need to obtain it from a Mac OS 
X
+CD or compile them by hand.
+
[EMAIL PROTECTED]
+
[EMAIL PROTECTED] On x86, you can just try to launch any process by using the 
native
+libraries:
+
[EMAIL PROTECTED] 
+qemu-darwin-i386 /bin/ls
[EMAIL PROTECTED] example
+
+or to run the ppc version of the executable:
+
[EMAIL PROTECTED] 
+qemu-darwin-ppc /bin/ls
[EMAIL PROTECTED] example
+
[EMAIL PROTECTED] On ppc, you'll have to tell qemu where your x86 libraries 
(and dynamic linker)
+are installed:
+
[EMAIL PROTECTED] 
+qemu-darwin-i386 -L /opt/x86_root/ /bin/ls
[EMAIL PROTECTED] example
+
[EMAIL PROTECTED] /opt/x86_root/} tells that the dynamic linker (dyld) path is 
in
[EMAIL PROTECTED]/opt/x86_root/usr/bin/dyld}.