Re: [Qemu-devel] [patch] cocoa.m - Core Graphics support
On Jan 30, 2008, at 9:30 PM, Mike Kronenberg wrote: Unfortunateley, there is no "official" direct access to the framebuffer anymore, since apple depreciated QuickDraw. [1] Well, you can using OpenGL and Apple's Extension have a nearly direct VRAM access, the idea is to use glEnable( GL_UNPACK_CLIENT_STORAGE_APPLE ); glPixelStorei( GL_UNPACK_CLIENT_STORAGE_APPLE, GL_TRUE ); and glTexParameteri( VLCGL_TARGET, GL_TEXTURE_STORAGE_HINT_APPLE, GL_STORAGE_SHARED_APPLE ); On the texture on which you want to draw. See: http://developer.apple.com/documentation/GraphicsImaging/Conceptual/OpenGL-MacProgGuide/opengl_texturedata/chapter_10_section_2.html Pierre.
Re: [Qemu-devel] [PATCH] OSX x86_64 host support
On Dec 7, 2007, at 1:42 PM, Alexander Graf wrote: Right now there is no graphical output available except for VNC, as the cocoa output depends on deprecated APIs that are no longer available in 64-bit mode and SDL does not compile on x86_64 Darwin yet. This is the QuickDraw API? If so, it should be quite straight forward to use OpenGL or CoreGraphics instead... What about not disabling Cocoa, and simply print a nice #error or #warning that explains that the quickdraw part needs fixing? Pierre.
[Qemu-devel] [Patch] darwin-user: Compile fix for ppc targets
Hello, this should address an darwin-user issue that has been creeping in trunk for sometime. Thanks, Pierre. 601-darwin-user-fix.diff Description: Binary data
Re: QEMU Automated Testing (was [Qemu-devel] qemu Makefile.target vl.h hw/acpi.c hw/adlib.c ...)
On 8 avr. 07, at 22:43, Natalia Portillo wrote: But that required some macro interface "click at x,y, wait some seconds, press 'k' key", that is not currently under QEMU. There is cxtest (GPL) which has been created for that matter, it should be interesting to give it a try: http://www.cxtest.org/ "Cxtest is an open source project that provides visual regression testing facilities for X11 based systems. It can automate basic X Window functionality, including finding X windows by title or by graphic picture" Pierre.
[Qemu-devel] [Patch] darwin-user: fix com mpage entry offset
Hi, This patch fix typos in the commpage definition. Pierre. Index: darwin-user/commpage.c === RCS file: /sources/qemu/qemu/darwin-user/commpage.c,v retrieving revision 1.1 diff -u -r1.1 commpage.c --- darwin-user/commpage.c 18 Jan 2007 20:06:33 - 1.1 +++ darwin-user/commpage.c 3 Feb 2007 16:47:47 - @@ -114,10 +114,10 @@ COMMPAGE_ENTRY(spinlock_lock, 1, 0x260, OSSpinLockLock, CALL_DIRECT), COMMPAGE_ENTRY(spinlock_unlock, 1, 0x2a0, OSSpinLockUnlock, CALL_DIRECT), COMMPAGE_ENTRY(pthread_getspecific, 0, 0x2c0, unimpl_commpage, CALL_INDIRECT), -COMMPAGE_ENTRY(gettimeofday, 1, 0x2c0, do_cgettimeofday, CALL_INDIRECT), -COMMPAGE_ENTRY(sys_dcache_flush, 0, 0x2c0, unimpl_commpage, CALL_INDIRECT), -COMMPAGE_ENTRY(sys_icache_invalidate, 0, 0x2c0, unimpl_commpage, CALL_INDIRECT), -COMMPAGE_ENTRY(pthread_self, 0, 0x2c0, unimpl_commpage, CALL_INDIRECT), +COMMPAGE_ENTRY(gettimeofday, 1, 0x2e0, do_cgettimeofday, CALL_INDIRECT), +COMMPAGE_ENTRY(sys_dcache_flush, 0, 0x4e0, unimpl_commpage, CALL_INDIRECT), +COMMPAGE_ENTRY(sys_icache_invalidate, 0, 0x520, unimpl_commpage, CALL_INDIRECT), +COMMPAGE_ENTRY(pthread_self, 0, 0x580, unimpl_commpage, CALL_INDIRECT), COMMPAGE_ENTRY(relinquish,0, 0x5c0, unimpl_commpage, CALL_INDIRECT), @@ -305,7 +305,7 @@ void unimpl_commpage(void *cpu_env, int num) { -gemu_log("qemu: commpage function 0x%x not implemented\n", num); +qerror("qemu: commpage function 0x%x not implemented\n", num); } /
Re: [Qemu-devel] Page protection and i386 cmpxchg8b
On 27 févr. 07, at 08:22, Ilya Shar wrote: Please see the diff file attached. I meant send a diff to the qemu-devel in a new mail with [Patch] in the subject so that it can be committed :-) However, at second thought, I think that it might need some re-work, see [1], and the arguments might need to be byte-swapped. Any suggestions how to fix this? As I said before, I think that the problem appears because: qemu signal handlers might be overridden by some mach calls, that could explain the problem you are encountering. We need to work on this. That's really not easy to fix, in two words. [1] I think it should consist in writing a custom implementation of semaphore_signal_trap, semaphore_signal_thread_trap, semaphore_wait_signal_trap, etc. that hook into signal.c. Tell me if you want more info on this. Pierre. ___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel
Re: [Qemu-devel] Page protection and i386 cmpxchg8b
On 23 févr. 07, at 23:56, Ilya Shar wrote: Sure. At first I was hitting unsupported mach syscalls, so I modified darwin-user/syscall.h according to /Developer/SDKs/MacOSX10.3.9.sdk/usr/include/mach/syscall_sw.h : $ diff syscall.c syscall.c.orig 458,465d457 < case -33: < DPRINTF("semaphore_signal_trap(0x%x)\n", arg1); < ret = semaphore_signal_trap(arg1); < break; < case -34: < DPRINTF("semaphore_signal_all_trap(0x%x)\n", arg1); < ret = semaphore_signal_all_trap(arg1); < break; 471,474d462 < case -37: < DPRINTF("semaphore_wait_signal_trap(0x%x, 0x%x)\n", arg1, arg2); < ret = semaphore_wait_signal_trap(arg1,arg2); < break; cvs diff -u would be easier to read for me. (or diff -u). You could send this patch to the qemu-devel, that would be cool. With this Sfari went past the unsupported call -33 and now stops in call -61 (syscall_thread_switch). Can I just modify syscalls.c in a similar way to fix it? Yes you can! But a really alarming thing happens before it gets there. If my ethernet cable is not plugged in, cmpxchg8b write to a nonwritable page brings my system down. I suppose it happens in somewhere in the drivers. Ouch! I have noticed the same: qemu can trigger bugs really easily at the kernel level :( Could you explain how you know that cmpxchg8b is the key to our problem? Also qemu signal handlers might be overridden by some mach calls, that could explain the problem you are encountering. We need to work on this. Pierre. ___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel
Re: [Qemu-devel] Page protection and i386 cmpxchg8b
Hi Ilya! On 23 févr. 07, at 21:32, Ilya Shar wrote: I'm running i386-darwin-usrer on i386 and some apps (Safari browser) crash because cmpxchg8b attempts to wrie to a qemu-allocated page which is readable but write-protected. When I comment out mprotect in exec.c Are you sure it does Safari does crash because of that call? I have the Apple Bug Reporter which complains about the fact that qemu gets a EXC_BAD_ACCESS, but then I get this error: qemu: Unsupported mach syscall: -61(0xffc3) (= semaphore_signal_trap) or qemu: Unsupported mach syscall: -33(0xffdf) (= syscall_thread_switch) To fix this we have to implement those syscalls. //mprotect(g2h(page_addr), qemu_host_page_size, // (prot & PAGE_BITS) & ~PAGE_WRITE); I can proceed further. I would guess mprotect is there for a reason so it doesn't seem like a good solution, besides the runs get substantially slower without mprotect. Is there a solution to this problem or a way to better understand what is going on? I think the idea behind the mprotect is to make sure that any changes to this pages gets monitored, and that the tb can be invalidated if the code was modified (self modify-ing code). Pierre. ___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel
[Qemu-devel] [resent] [Patch] darwin-user: revert host_info patch and don't fail if sysctl is unknown when we are on the same host/target
Hi, This fix x86-on-x86 and ppc-on-ppc. Pierre. ChangeLog: Revert host_info changes and don't fail if sysctl is unknown when we are on the same host/target. Index: darwin-user/syscall.c === RCS file: /sources/qemu/qemu/darwin-user/syscall.c,v retrieving revision 1.2 diff -u -r1.2 syscall.c --- darwin-user/syscall.c 5 Feb 2007 19:47:42 - 1.2 +++ darwin-user/syscall.c 16 Feb 2007 09:36:54 - @@ -367,7 +367,14 @@ case 200: /* host_info */ { mig_reply_error_t *err = (mig_reply_error_t *)hdr; -struct host_basic_info *data = (void *)(err+1); +struct { +uint32_t unknow1; +uint32_t max_cpus; +uint32_t avail_cpus; +uint32_t memory_size; +uint32_t cpu_type; +uint32_t cpu_subtype; +} *data = (void *)(err+1); DPRINTF("maxcpu = 0x%x\n", data->max_cpus); DPRINTF("numcpu = 0x%x\n", data->avail_cpus); @@ -1342,9 +1349,12 @@ if(name) /* Sometimes sysctl is called with no arg1, ignore */ ret = get_errno(sysctl(name, namelen, oldp, oldlenp, newp, newlen)); +#if defined(TARGET_I386) ^ defined(__i386__) || defined(TARGET_PPC) ^ defined(__ppc__) if (!is_error(ret) && bswap_syctl(name, namelen, oldp, *oldlenp) != 0) { return -ENOTDIR; } +#endif + if(name) { //bswap_syctl(name, namelen, newp, newlen); tswap32s((uint32_t*)oldlenp); ___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel
[Qemu-devel] [Patch] darwin-user: revert host_info patch and don't fail if sysctl is unknown when we are on the same host/target
Hi, This fix the x86-on-x86 and ppc-on-ppc. Pierre. ChangeLog: Revert host_info changes and don't fail if sysctl is unknown when we are on the same host/target. Index: darwin-user/syscall.c === RCS file: /sources/qemu/qemu/darwin-user/syscall.c,v retrieving revision 1.2 diff -u -r1.2 syscall.c --- darwin-user/syscall.c 5 Feb 2007 19:47:42 - 1.2 +++ darwin-user/syscall.c 16 Feb 2007 09:36:54 - @@ -367,7 +367,14 @@ case 200: /* host_info */ { mig_reply_error_t *err = (mig_reply_error_t *)hdr; -struct host_basic_info *data = (void *)(err+1); +struct { +uint32_t unknow1; +uint32_t max_cpus; +uint32_t avail_cpus; +uint32_t memory_size; +uint32_t cpu_type; +uint32_t cpu_subtype; +} *data = (void *)(err+1); DPRINTF("maxcpu = 0x%x\n", data->max_cpus); DPRINTF("numcpu = 0x%x\n", data->avail_cpus); @@ -1342,9 +1349,12 @@ if(name) /* Sometimes sysctl is called with no arg1, ignore */ ret = get_errno(sysctl(name, namelen, oldp, oldlenp, newp, newlen)); +#if defined(TARGET_I386) ^ defined(__i386__) || defined(TARGET_PPC) ^ defined(__ppc__) if (!is_error(ret) && bswap_syctl(name, namelen, oldp, *oldlenp) != 0) { return -ENOTDIR; } +#endif + if(name) { //bswap_syctl(name, namelen, newp, newlen); tswap32s((uint32_t*)oldlenp); ___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel
Re: [Qemu-devel] Please help fix an illegal instruction / SSE problem
On 16 févr. 07, at 04:51, Ilya Shar wrote: Every Cocoa application I try to run under i386-darwin-user/qemu-i386 exits on an illegal instruction: Starting /Applications/Calculator.app/Contents/MacOS/Calculator with qemu queue_signal: sig=4 qemu: uncaught target signal 4 (Illegal instruction) - exiting The last block always executes SSE instructions: IN: 0x0ab7: movdqa 0xfffa(%esi,%edx,1),%xmm0 0x0abd: movdqa 0xa(%esi,%edx,1),%xmm1 0x0ac3: movdqa 0x1a(%esi,%edx,1),%xmm2 0x0ac9: movdqa 0x2a(%esi,%edx,1),%xmm3 0x0acf: movdqa 0x3a(%esi,%edx,1),%xmm4 0x0ad5: movdqa %xmm0,%xmm5 0x0ad9: movdqa %xmm4,%xmm0 0x0add: data16 0x0ade: (bad) Non-graphics applications run fine. Could it be a configuration/compilation problem (although some SEE instructions seem to be handled fine)? If not, is there a way to better diagnose the problem? I on Mac OS Intel with QEMU 0.9.0. Calculator is crashing in the commpage (see darwin-user/commpage.c). Commpage is for now shared with the host for x86-on-x86 (and for ppc- on-ppc too). As the commpage is optimized by the kernel for your host specific proc, there tends to be problem with qemu. You could try to play a bit with qemu cpuid (darwin-user/main.c:788), or implement the needed instructions in qemu. An other way would be to use what's in commpage.c (see commpage_init()), by translating the target address space. Pierre. ___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel
Re: [Qemu-devel] Help with gdb on Mac OS
On 12 févr. 07, at 07:54, Ilya Shar wrote: I am trying to step through i386-darwin-user/qemu-i386 Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: KERN_PROTECTION_FAILURE at address: 0x2115eaf5 helper_cmpxchg8b () at ../cpu-all.h:344 344 ((uint32_t *)ptr)[0] = x.p[0]; (gdb) The offending value of ptr is misalligned, can this indicate a problem? Reducing optimization or setting -g3 doesn't change this behavior. Strangely, the same example runs fine without gdb. qemu will handle the signal fine. Actually it is more a feature than a bug ;-) Unfortunately "(gdb) handle EXC_BAD_ACCESS pass" is kind of broken as EXC_BAD_ACCESS is not translated to the corresponding bsd signal, so qemu won't handle it. You should probably try to use the gdb interface provided by qemu if you wan't to debug the target program instead of qemu: # i386-darwin-user/qemu-i386 -g /bin/ls You can now connect to the gdb interface using: #gdb -arch i386 (gdb) target remote localhost:1234 (gdb) c Pierre. ___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel
Re: [Qemu-devel] [Patch] darwin-user build failed
On 7 févr. 07, at 14:58, Toshimitsu Tanaka wrote: --- darwin-user/syscall.old 2007-02-07 22:23:53.0 +0900 +++ darwin-user/syscall.c 2007-02-07 22:04:53.0 +0900 @@ -1249,8 +1249,8 @@ }; struct sysctl_dir sysctls_kern[] = { -ENTRYE(KERN_TRANSLATE, "translate", sysctl_translate), /* 44 */ -ENTRYE(KERN_EXEC, "exec", sysctl_exec), / * 45 */ +//ENTRYE(KERN_TRANSLATE, "translate", sysctl_translate), /* 44 */ +//ENTRYE(KERN_EXEC, "exec", sysctl_exec), /* 45 */ You should better use a #ifdef for your fixes, like: #ifdef KERN_TRANSLATE ENTRYE(KERN_TRANSLATE, "translate",sysctl_translate), / * 44 */ #endif BTW, also I think those issues come from your Xcode's headers that are not the latest one. Latest Xcode version is 2.4.1. If that the case, something like: #ifndef LC_UUID #warning seems like your systems headers comes from a Xcode version lesser than 2.4.1. #endif should be added to machload.c. Thanks, Pierre. ___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel
Re: [Qemu-devel] [Patch] documentation: Change qemu-darwin-* to qemu-* and fix a typo about supported target
On 6 févr. 07, at 09:51, Phil Krylov wrote: Hi Pierre, [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] Did you mean "PowerPC on PowerPC" in the last line? Yes I do. Thanks Phil :) BTW, last patch was the wrong diff. ChangeLog: Change qemu-darwin-* to qemu-* Fix a typo about supported target (reported by Phil Krylov). Index: qemu-doc.texi === RCS file: /sources/qemu/qemu/qemu-doc.texi,v retrieving revision 1.128 diff -u -r1.128 qemu-doc.texi --- qemu-doc.texi 5 Feb 2007 19:42:07 - 1.128 +++ qemu-doc.texi 6 Feb 2007 10:34:01 - @@ -1747,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 @@ -1870,7 +1870,7 @@ @item target PowerPC on x86: Not working as the ppc commpage can't be mapped (yet!) @item -target x86 on x86: Most apps (Cocoa and Carbon too) works. [1] +target PowerPC on PowerPC: Most apps (Cocoa and Carbon too) works. [1] @item target x86 on PowerPC: most utilities work. Cocoa and Carbon apps are not yet supported. @end itemize @@ -1891,20 +1891,20 @@ libraries: @example -qemu-darwin-i386 /bin/ls +qemu-i386 /bin/ls @end example or to run the ppc version of the executable: @example -qemu-darwin-ppc /bin/ls +qemu-ppc /bin/ls @end example @item On ppc, you'll have to tell qemu where your x86 libraries (and dynamic linker) are installed: @example -qemu-darwin-i386 -L /opt/x86_root/ /bin/ls +qemu-i386 -L /opt/x86_root/ /bin/ls @end example @code{-L /opt/x86_root/} tells that the dynamic linker (dyld) path is in ___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel
[Qemu-devel] [Patch] documentation: Change qemu-darwin-* to qemu-*
Hi, This patch fixes a typo in the doc. Pierre. ChangeLog: Change qemu-darwin-* to qemu-* 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}. + [EMAIL PRO
[Qemu-devel] [Patch] darwin-user: fix com mpage entry offset
Hi, This patch fix typos in the commpage definition. Pierre. Index: darwin-user/commpage.c === RCS file: /sources/qemu/qemu/darwin-user/commpage.c,v retrieving revision 1.1 diff -u -r1.1 commpage.c --- darwin-user/commpage.c 18 Jan 2007 20:06:33 - 1.1 +++ darwin-user/commpage.c 3 Feb 2007 16:47:47 - @@ -114,10 +114,10 @@ COMMPAGE_ENTRY(spinlock_lock, 1, 0x260, OSSpinLockLock, CALL_DIRECT), COMMPAGE_ENTRY(spinlock_unlock, 1, 0x2a0, OSSpinLockUnlock, CALL_DIRECT), COMMPAGE_ENTRY(pthread_getspecific, 0, 0x2c0, unimpl_commpage, CALL_INDIRECT), -COMMPAGE_ENTRY(gettimeofday, 1, 0x2c0, do_cgettimeofday, CALL_INDIRECT), -COMMPAGE_ENTRY(sys_dcache_flush, 0, 0x2c0, unimpl_commpage, CALL_INDIRECT), -COMMPAGE_ENTRY(sys_icache_invalidate, 0, 0x2c0, unimpl_commpage, CALL_INDIRECT), -COMMPAGE_ENTRY(pthread_self, 0, 0x2c0, unimpl_commpage, CALL_INDIRECT), +COMMPAGE_ENTRY(gettimeofday, 1, 0x2e0, do_cgettimeofday, CALL_INDIRECT), +COMMPAGE_ENTRY(sys_dcache_flush, 0, 0x4e0, unimpl_commpage, CALL_INDIRECT), +COMMPAGE_ENTRY(sys_icache_invalidate, 0, 0x520, unimpl_commpage, CALL_INDIRECT), +COMMPAGE_ENTRY(pthread_self, 0, 0x580, unimpl_commpage, CALL_INDIRECT), COMMPAGE_ENTRY(relinquish,0, 0x5c0, unimpl_commpage, CALL_INDIRECT), @@ -305,7 +305,7 @@ void unimpl_commpage(void *cpu_env, int num) { -gemu_log("qemu: commpage function 0x%x not implemented\n", num); +qerror("qemu: commpage function 0x%x not implemented\n", num); } /___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel
[Qemu-devel] [Patch] cpu-exec.c: Make cpu_signal_handler work on Mac OS X/Darwin x86
Hi, This should fix: /Users/ilya/tmp/feb4/qemu_cvs_user/qemu/cpu-exec.c: In function 'cpu_x86_signal_handler': /Users/ilya/tmp/feb4/qemu_cvs_user/qemu/cpu-exec.c:1307: error: request for member 'gregs' in something not a structure or union /Users/ilya/tmp/feb4/qemu_cvs_user/qemu/cpu-exec.c:1307: error: 'EIP' undeclared (first use in this function) ... on Mac OS X/x86. Index: cpu-exec.c === RCS file: /sources/qemu/qemu/cpu-exec.c,v retrieving revision 1.91 diff -u -r1.91 cpu-exec.c --- cpu-exec.c 2 Feb 2007 03:57:09 - 1.91 +++ cpu-exec.c 5 Feb 2007 09:32:32 - @@ -1261,6 +1261,20 @@ #if defined(__i386__) +#ifdef linux + +# define EIP_sig(context) ((context)->uc_mcontext.gregs[REG_EIP]) +# define TRAP_sig(context)((context)->uc_mcontext.gregs[REG_TRAPNO]) +# define ERROR_sig(context) ((context)->uc_mcontext.gregs[REG_ERR]) + +#elif defined(__APPLE__) +# include + +# define EIP_sig(context) (*((unsigned long*)&(context)->uc_mcontext->ss.eip)) +# define TRAP_sig(context)((context)->uc_mcontext->es.trapno) +# define ERROR_sig(context) ((context)->uc_mcontext->es.err) +#endif + #if defined(USE_CODE_COPY) static void cpu_send_trap(unsigned long pc, int trap, struct ucontext *uc) @@ -1295,8 +1309,8 @@ #define REG_ERRERR #define REG_TRAPNO TRAPNO #endif -pc = uc->uc_mcontext.gregs[REG_EIP]; -trapno = uc->uc_mcontext.gregs[REG_TRAPNO]; +pc = EIP_sig(uc); +trapno = TRAP_sig(uc); #if defined(TARGET_I386) && defined(USE_CODE_COPY) if (trapno == 0x00 || trapno == 0x05) { /* send division by zero or bound exception */ @@ -1306,7 +1320,7 @@ #endif return handle_cpu_signal(pc, (unsigned long)info->si_addr, trapno == 0xe ? - (uc->uc_mcontext.gregs[REG_ERR] >> 1) & 1 : 0, + (ERROR_sig(uc) >> 1) & 1 : 0, &uc->uc_sigmask, puc); } Ilya, Hope this will work for you. Pierre.___ 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
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.
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
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}.
Re: [Qemu-devel] Please help build qemu/darwin-user on Mac Intel
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
Re: [Qemu-devel] [Patch] ENOMEDIUM fix for Darwin and *BSD
On 26 janv. 07, at 16:39, Thiemo Seufer wrote: Pierre d'Herbemont wrote: Hi, This fix, /qemu/hw/ide.c: In function `ide_atapi_io_error': /qemu/hw/ide.c:972: error: `ENOMEDIUM' undeclared (first use in this function) I committed a slightly different patch. And it's better ;) Pierre. ___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel
[Qemu-devel] [Patch] darwin-user: Save some vm space for the regular program loading zone
Hi, This patch is a small hack, that is needed to load most of regular program (for some reason I forgot to put that on the initial darwin- user patch). Hopefully once darwin-user will have a sanitized guest / qemu memory interface, this could be removed. (I have in mind Paul Brook's guest memory space sliding trick). Pierre. Index: Makefile.target === RCS file: /sources/qemu/qemu/Makefile.target,v retrieving revision 1.142 diff -u -r1.142 Makefile.target --- Makefile.target 24 Jan 2007 21:40:21 - 1.142 +++ Makefile.target 26 Jan 2007 15:08:12 - @@ -172,6 +172,11 @@ LIBS+=-lmx endif +ifdef CONFIG_DARWIN_USER +# Leave some space for the regular program loading zone +BASE_LDFLAGS+=-Wl,-segaddr,__STD_PROG_ZONE,0x1000 -image_base 0x0e00 +endif + OP_CFLAGS+=$(OS_CFLAGS) # ___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel
[Qemu-devel] [Patch] ENOMEDIUM fix for Darwin and *BSD
Hi, This fix, /qemu/hw/ide.c: In function `ide_atapi_io_error': /qemu/hw/ide.c:972: error: `ENOMEDIUM' undeclared (first use in this function) on Darwin and certainly on other *BSDs Pierre. Index: vl.h === RCS file: /sources/qemu/qemu/vl.h,v retrieving revision 1.177 diff -u -r1.177 vl.h --- vl.h24 Jan 2007 21:40:21 - 1.177 +++ vl.h26 Jan 2007 14:51:15 - @@ -44,6 +44,9 @@ #ifndef O_BINARY #define O_BINARY 0 #endif +#ifndef ENOMEDIUM +#define ENOMEDIUM ENODEV +#endif #ifdef __sun__ #define ENOMEDIUM 4097 ___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel
[Qemu-devel] [Patch] siginfo fix for Darwin/Mac OS X
Hi, This patch is an attempt to suppress the anonymous "struct siginfo" trick, as it doesn't work on darwin since struct siginfo isn't defined, and stay anonymous. Here I use siginfo_t, assuming that it is defined on most platform. But feel free to add a "typedef struct siginfo siginfo_t;" for your platform if needed, or some other trick. (Variation of this hack is possible as "struct __siginfo" is valid on darwin. Feel free to use) Pierre. Index: target-sparc/cpu.h === RCS file: /sources/qemu/qemu/target-sparc/cpu.h,v retrieving revision 1.26 diff -u -r1.26 cpu.h --- target-sparc/cpu.h 23 Dec 2006 14:18:40 - 1.26 +++ target-sparc/cpu.h 24 Jan 2007 20:18:37 - @@ -275,8 +275,7 @@ } while (0) #endif -struct siginfo; -int cpu_sparc_signal_handler(int hostsignum, struct siginfo *info, void *puc); +int cpu_sparc_signal_handler(int host_signum, void *pinfo, void *puc); #include "cpu-all.h" Index: target-sh4/cpu.h === RCS file: /sources/qemu/qemu/target-sh4/cpu.h,v retrieving revision 1.4 diff -u -r1.4 cpu.h --- target-sh4/cpu.h23 Dec 2006 14:18:40 - 1.4 +++ target-sh4/cpu.h24 Jan 2007 20:18:37 - @@ -121,9 +121,8 @@ CPUSH4State *cpu_sh4_init(void); int cpu_sh4_exec(CPUSH4State * s); -struct siginfo; -int cpu_sh4_signal_handler(int hostsignum, struct siginfo *info, - void *puc); +int cpu_sh4_signal_handler(int host_signum, void *pinfo, + void *puc); #include "softfloat.h" Index: target-ppc/cpu.h === RCS file: /sources/qemu/qemu/target-ppc/cpu.h,v retrieving revision 1.24 diff -u -r1.24 cpu.h --- target-ppc/cpu.h23 Dec 2006 14:18:40 - 1.24 +++ target-ppc/cpu.h24 Jan 2007 20:18:38 - @@ -575,8 +575,7 @@ /* you can call this signal handler from your SIGBUS and SIGSEGV signal handlers to inform the virtual CPU of exceptions. non zero is returned if the signal was handled by the virtual CPU. */ -struct siginfo; -int cpu_ppc_signal_handler(int host_signum, struct siginfo *info, +int cpu_ppc_signal_handler(int host_signum, void *pinfo, void *puc); void do_interrupt (CPUPPCState *env); Index: target-m68k/cpu.h === RCS file: /sources/qemu/qemu/target-m68k/cpu.h,v retrieving revision 1.2 diff -u -r1.2 cpu.h --- target-m68k/cpu.h 23 Dec 2006 14:18:40 - 1.2 +++ target-m68k/cpu.h 24 Jan 2007 20:18:38 - @@ -97,8 +97,7 @@ /* you can call this signal handler from your SIGBUS and SIGSEGV signal handlers to inform the virtual CPU of exceptions. non zero is returned if the signal was handled by the virtual CPU. */ -struct siginfo; -int cpu_m68k_signal_handler(int host_signum, struct siginfo *info, +int cpu_m68k_signal_handler(int host_signum, void *pinfo, void *puc); void cpu_m68k_flush_flags(CPUM68KState *, int); Index: target-i386/cpu.h === RCS file: /sources/qemu/qemu/target-i386/cpu.h,v retrieving revision 1.39 diff -u -r1.39 cpu.h --- target-i386/cpu.h 23 Dec 2006 14:18:40 - 1.39 +++ target-i386/cpu.h 24 Jan 2007 20:18:38 - @@ -628,8 +628,7 @@ /* you can call this signal handler from your SIGBUS and SIGSEGV signal handlers to inform the virtual CPU of exceptions. non zero is returned if the signal was handled by the virtual CPU. */ -struct siginfo; -int cpu_x86_signal_handler(int host_signum, struct siginfo *info, +int cpu_x86_signal_handler(int host_signum, void *pinfo, void *puc); void cpu_x86_set_a20(CPUX86State *env, int a20_state); Index: target-arm/cpu.h === RCS file: /sources/qemu/qemu/target-arm/cpu.h,v retrieving revision 1.18 diff -u -r1.18 cpu.h --- target-arm/cpu.h23 Dec 2006 14:18:40 - 1.18 +++ target-arm/cpu.h24 Jan 2007 20:18:38 - @@ -133,8 +133,7 @@ /* you can call this signal handler from your SIGBUS and SIGSEGV signal handlers to inform the virtual CPU of exceptions. non zero is returned if the signal was handled by the virtual CPU. */ -struct siginfo; -int cpu_arm_signal_handler(int host_signum, struct siginfo *info, +int cpu_arm_signal_handler(int host_signum, void *pinfo, void *puc); #define CPSR_M (0x1f) Index: cpu-exec.c === RCS file: /sources/qemu/qemu/cpu-exec.c,v retrieving revision 1.89 diff -u -r1.89 cpu-exec.c --- cpu-exec.c 24 Jan 2007 01:47:51 - 1.89 +++ cpu-exec.c 24 Jan 2007 20:18:38 - @@ -1280,9 +1280,10 @@ } #endif -int cpu_signal_handler(int host_signum, struct sigin
[Qemu-devel] [Patch] Use Cocoa and CoreAudio backend by default on Darwin systems
Hi, This patch defaults the use of the Cocoa and CoreAudio drivers on Darwin. Most Darwin users are indeed Mac OS X users. And as Mac OS X doesn't have libSDL by default, but has Cocoa and CoreAudio, it sounds better to turn Cocoa and CoreAudio on by default. Pierre. Index: configure === RCS file: /sources/qemu/qemu/configure,v retrieving revision 1.119 diff -u -r1.119 configure --- configure 18 Jan 2007 20:06:33 - 1.119 +++ configure 24 Jan 2007 20:15:37 - @@ -128,6 +128,8 @@ bsd="yes" darwin="yes" darwin_user="yes" +cocoa="yes" +coreaudio="yes" OS_CFLAGS="-mdynamic-no-pic" ;; SunOS) @@ -503,7 +505,9 @@ if test "$_sdlversion" -lt 121 ; then sdl_too_old=yes else -sdl=yes + if test "$cocoa" = "no" ; then + sdl=yes + fi fi # static link with sdl ? @@ -524,6 +528,13 @@ fi # sdl compile test fi # cross compilation + +else + # Make sure to disable cocoa if sdl was set + if test "$sdl" = "yes" ; then + cocoa="no" + coreaudio="no" + fi fi # -z $sdl ## ___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel
[Qemu-devel] [Patch] darwin-user: Fix set_error return value
Hi, This fix set_error return value typo. Pierre.Index: darwin-user/main.c === RCS file: /sources/qemu/qemu/darwin-user/main.c,v retrieving revision 1.1 diff -u -r1.1 main.c --- darwin-user/main.c 18 Jan 2007 20:06:33 - 1.1 +++ darwin-user/main.c 24 Jan 2007 19:48:53 - @@ -478,7 +478,7 @@ } /* ABI convention: after a syscall if there was an error the CF flag is set */ -static inline set_error(CPUX86State *env, int ret) +static inline void set_error(CPUX86State *env, int ret) { if(ret<0) env->eflags = env->eflags | 0x1; ___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel
Re: [Qemu-devel] [PATCH] siginfo fix for Darwin/Mac OS X on PowerPC and cleanup
On 18 janv. 07, at 23:57, Thiemo Seufer wrote: It might be better to keep the full set around for documentation. It's a good point. -int cpu_signal_handler(int host_signum, struct siginfo *info, +int cpu_signal_handler(int host_signum, struct siginfo *pinfo, void *puc) { struct ucontext *uc = puc; +siginfo_t *info = pinfo; unsigned long pc; int is_write; Why does this make a difference? struct siginfo is not defined on darwin. (it works because struct siginfo is defined also as an anonymous structure in qemu header) But after re-thinking, my patch is rather unelegant. I think we should definitely use a void * type for info, rather than using the anonymous struct siginfo trick. Any thought? Pierre. ___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel
Re: [Qemu-devel] [PATCH] darwin-user merge attempt - patch v3
On 17 janv. 07, at 23:13, Thiemo Seufer wrote: I figure it needs some more work to keep the Linux build happy. Oh sorry! Here goes the fix: darwin_user.3.diff.txt.gz Description: GNU Zip compressed data Thanks for the report, Pierre.___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel
[Qemu-devel] [PATCH] siginfo fix for Darwin/Mac OS X on PowerPC and cleanup
Hi, This patch addresses cpu-exec.c compilation on Mac OS X/ppc. It also cleans up unused Macro definition. Pierre. Index: cpu-exec.c === RCS file: /sources/qemu/qemu/cpu-exec.c,v retrieving revision 1.88 diff -u -r1.88 cpu-exec.c --- cpu-exec.c 7 Dec 2006 18:28:42 - 1.88 +++ cpu-exec.c 18 Jan 2007 12:30:04 - @@ -1334,51 +1334,30 @@ /* All Registers access - only for local access */ # define REG_sig(reg_name, context) ((context)->uc_mcontext.regs->reg_name) /* Gpr Registers access */ -# define GPR_sig(reg_num, context) REG_sig(gpr[reg_num], context) # define IAR_sig(context) REG_sig(nip, context) /* Program counter */ -# define MSR_sig(context) REG_sig(msr, context) /* Machine State Register (Supervisor) */ -# define CTR_sig(context) REG_sig(ctr, context) /* Count register */ -# define XER_sig(context) REG_sig(xer, context) /* User's integer exception register */ -# define LR_sig(context) REG_sig(link, context) /* Link register */ -# define CR_sig(context) REG_sig(ccr, context) /* Condition register */ -/* Float Registers access */ -# define FLOAT_sig(reg_num, context) (((double*)((char*)((context)->uc_mcontext.regs+48*4)))[reg_num]) # define FPSCR_sig(context) (*(int*)((char*)((context)->uc_mcontext.regs+(48+32*2)*4))) /* Exception Registers access */ -# define DAR_sig(context) REG_sig(dar, context) # define DSISR_sig(context)REG_sig(dsisr, context) # define TRAP_sig(context) REG_sig(trap, context) #endif /* linux */ #ifdef __APPLE__ # include -typedef struct ucontext SIGCONTEXT; /* All Registers access - only for local access */ # define REG_sig(reg_name, context) ((context)->uc_mcontext->ss.reg_name) -# define FLOATREG_sig(reg_name, context) ((context)->uc_mcontext->fs.reg_name) # define EXCEPREG_sig(reg_name, context) ((context)->uc_mcontext->es.reg_name) -# define VECREG_sig(reg_name, context) ((context)->uc_mcontext->vs.reg_name) /* Gpr Registers access */ -# define GPR_sig(reg_num, context) REG_sig(r##reg_num, context) # define IAR_sig(context) REG_sig(srr0, context) /* Program counter */ -# define MSR_sig(context) REG_sig(srr1, context) /* Machine State Register (Supervisor) */ -# define CTR_sig(context) REG_sig(ctr, context) -# define XER_sig(context) REG_sig(xer, context) /* Link register */ -# define LR_sig(context) REG_sig(lr, context) /* User's integer exception register */ -# define CR_sig(context) REG_sig(cr, context) /* Condition register */ -/* Float Registers access */ -# define FLOAT_sig(reg_num, context) FLOATREG_sig(fpregs[reg_num], context) -# define FPSCR_sig(context)((double)FLOATREG_sig(fpscr, context)) /* Exception Registers access */ -# define DAR_sig(context) EXCEPREG_sig(dar, context) /* Fault registers for coredump */ # define DSISR_sig(context)EXCEPREG_sig(dsisr, context) # define TRAP_sig(context) EXCEPREG_sig(exception, context) /* number of powerpc exception taken */ #endif /* __APPLE__ */ -int cpu_signal_handler(int host_signum, struct siginfo *info, +int cpu_signal_handler(int host_signum, struct siginfo *pinfo, void *puc) { struct ucontext *uc = puc; +siginfo_t *info = pinfo; unsigned long pc; int is_write; ___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel
[Qemu-devel] [PATCH] define ENOMEDIUM if not defined
Hi, This patch fix block.c build on Mac OS X/Darwin. Pierre. Index: block.c === RCS file: /sources/qemu/qemu/block.c,v retrieving revision 1.40 diff -u -r1.40 block.c --- block.c 7 Jan 2007 18:22:37 - 1.40 +++ block.c 18 Jan 2007 12:29:58 - @@ -35,6 +35,10 @@ #define SECTOR_BITS 9 #define SECTOR_SIZE (1 << SECTOR_BITS) +#ifndefENOMEDIUM +#defineENOMEDIUM ENODEV +#endif + typedef struct BlockDriverAIOCBSync { BlockDriverAIOCB common; QEMUBH *bh; ___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel
Re: [Qemu-devel] [PATCH] darwin-user merge attempt - patch v2
Here is an updated version of the patch: darwin_user.2.diff.txt.gz Description: GNU Zip compressed data It mostly fix i386-darwin-user on ppc which was broken in previous patch. Pierre. On 12 janv. 07, at 07:44, Pierre d'Herbemont wrote: Hi, Here is an attempt to merge the qemu tree hosted in darwine CVS repository [1]. This branch contains a darwin-user target for qemu, which goal is similar to linux-user on linux. For now there is still much to do, like: 1- fill the ioctls*.h files 2- Accurately implement all the syscall. 3- have all the user access protected by lock_user/unlock_user and g2h/h2g macro. 4- Fix the bugs that prevent Cocoa apps from running i386-darwin- user on ppc But darwin-user is starting to become functionnal: - i386-darwin-user on x86: (Some) cocoa apps run fines. - i386-darwin-user on ppc: (Some) command line utility work fines, but we may have some bugs left that prevent Cocoa applications from working. - ppc-darwin-user on ppc: commpage issues can prevent qemu from running, hopefully todo#3 could fix that. - ppc-darwin-user on x86: ppc and x86 commpage overlap, so the ppc commpage can't be mapped, hopefully todo#3 could fix that too. I hope to ear some feedback about inclusion in the qemu TOT. Pierre. (Note that Matt Reda used to work on that too.) [1] http://darwine.cvs.sourceforge.net/darwine/qemu/ ___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel
[Qemu-devel] [PATCH] darwin-user merge attempt
Hi, Here is an attempt to merge the qemu tree hosted in darwine CVS repository [1]. This branch contains a darwin-user target for qemu, which goal is similar to linux-user on linux. For now there is still much to do, like: 1- fill the ioctls*.h files 2- Accurately implement all the syscall. 3- have all the user access protected by lock_user/unlock_user and g2h/h2g macro. 4- Fix the bugs that prevent Cocoa apps from running i386-darwin-user on ppc But darwin-user is starting to become functionnal: - i386-darwin-user on x86: (Some) cocoa apps run fines. - i386-darwin-user on ppc: (Some) command line utility work fines, but we may have some bugs left that prevent Cocoa applications from working. - ppc-darwin-user on ppc: commpage issues can prevent qemu from running, hopefully todo#3 could fix that. - ppc-darwin-user on x86: ppc and x86 commpage overlap, so the ppc commpage can't be mapped, hopefully todo#3 could fix that too. I hope to ear some feedback about inclusion in the qemu TOT. Pierre. (Note that Matt Reda used to work on that too.) [1] http://darwine.cvs.sourceforge.net/darwine/qemu/ darwin_user.1.diff.txt.bz2 Description: Binary data ___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel
Re: [Qemu-devel] qemu Makefile configure
On 3 janv. 07, at 15:23, Bernhard Fischer wrote: On Wed, Jan 03, 2007 at 01:59:50PM +, Thiemo Seufer wrote: ifeq ($(ARCH),ppc) -> CFLAGS+= -D__powerpc__ + CPPFLAGS += -D__powerpc__ (doesn't cpp already define that on ppc?) That's for the Darwin/Mac OS X PowerPC platforms where __powerpc__ is not defined by gcc. Pierre ___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel
Re: [Qemu-devel] ENOMEDIUM OS X patch
On Aug 28, 2006, at 5:45 PM, Jose Renau wrote: OS X does not include ENOMEDIUM on the error list (I think that the same is true for Solaris). This patch solves the problem. so this would be more appropriate: +#ifndef ENOMEDIUM +#define ENOMEDIUM 4097 +#endif than: +#ifdef CONFIG_COCOA +#define ENOMEDIUM 4097 +#endif Pierre. ___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel
Re: [Qemu-devel] User-space emulation on Mac OS X to run Mac OS X Intel applications
On 21 oct. 05, at 22:16, Steven wrote: Hi all, Looking at qemu, it seems as if it could be possible to allow it to run Intel OS X apps on PowerPC OS X, much like a reverse Rosetta. The x86 frameworks/libraries are included with Xcode, so possibly everything else could run natively, just have the app itself emulated. Is anybody willing to try getting this to work? I used to work on it. I will resume the work in 6 months. http://wiki.opendarwin.org/index.php/Darwine:qemu-darwin-user The remaining problems were mostly the apple only (that only dyld should call) syscalls like load_shared_file, which needs to be implemented properly. Pierre. ___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel
Re: [Qemu-devel] news on the OS X cocoa port
On 21 juil. 05, at 15:46, Hetz Ben Hamo wrote: On 7/21/05, Mike Kronenberg <[EMAIL PROTECTED]> wrote: Hetz Ben Hamo wrote: I just looked at the screenshots, and if you don't mind, I want to offer few suggestions for your GUI: 1. RAM size - how about adding up/down arrows (in addition to what you have right now) to increase RAM? Good Idea. How should they id/decrement the value? One by one or doubling the Value? My suggestion - by 8MB incrememental steps, but allow the user to type a number in case someone wants type a specific number. Why a slider, or arrow? A simple text box is far more simpler, quicker. Don't tell me that you'll click on the arrow button to get 256, when you are at 128! 2. Instead of Radio buttons in the Floppy/CDROM/Hard drive, I would suggest to replace it with Check Boxes, so the ones that are not needed by the user, will be grayed out until the check boxes will be marked. I look into that. Have You an Idea how we could optimize the choosing of cd-rom and cd-rom-image. Sure. A simple pull down menu instead of the ... circle button, where you have 2 options: * Physical Media * Other (ISO) If the user selects Other (ISO) - a sile selection could appear to select an ISO and then appears. If the user selects "Physical Media" - the device name appear in the selection. For the button title why "other". Something like "File" or "CD-ROM image" sounds better, more explicit. And why don't we have an intermediate window that allow the user to choose a file or a device, or in the selector you specify if you want a device or a file. It may simplify the interface. I'd like to keep the Panel as easy as possible, so "normal" Users won't be destracted by to much options. Probably I'm gonna ad '-localtime', '-smb', and '-user-net'/'-dummy-net', since I activate them by default. I think Localtime, should also be a checkbox item (in a seperate line), and user-net / dummy net should be a radio button selection, but all of them should be hidden until the user press the "Advanced.." button. Sounds like a Windows App to me :P No need for Advanced mode, the advanced mode sounds scary to me. Keep it simple. Something like a "Network & File Sharing" section for -smb and -user- net. "Time" section for -localtime. If the interface is sufficiently explicit and simple no need to hide them, if the names are sufficiently user friendly. This must be discussed a bit, so feel free to reply if you are not agree. BTW, what does Fabrice thinks of having nib files and png in CVS? Mike, thanks for the work. Pierre. ___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel
Re: [Qemu-devel] Current CVS broken
Selon Natalia Portillo <[EMAIL PROTECTED]>: > Hi! > > Before last commits the monitor wasn't working on MacOS X (it appears > but anything I write on it is ignored), and not it even doesn't compile: > > gcc -Wall -O2 -g -fno-strict-aliasing -D__powerpc__ -I. -I/Users/ > claunia/qemu/target-mips -I/Users/claunia/qemu -D_GNU_SOURCE - > D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I/Users/claunia/qemu/fpu - > I/Users/claunia/qemu/slirp -c -o ppc-dis.o /Users/claunia/qemu/ppc-dis.c > In file included from /Users/claunia/qemu/ppc-dis.c:3076: > /Users/claunia/qemu/target-mips/cpu.h:25: error: parse error before > numeric constant > /Users/claunia/qemu/target-mips/cpu.h:25: warning: no semicolon at > end of struct or union > /Users/claunia/qemu/target-mips/cpu.h:27: error: parse error before > '}' token > /Users/claunia/qemu/target-mips/cpu.h:49: error: field `tlb' has > incomplete type > make[1]: *** [ppc-dis.o] Error 1 > make: *** [all] Error 1 Can you try to build using gcc -no-cpp-precomp? Pierre. ___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel
Re: [Qemu-devel] [PATCH] cocoa.m
On 28 mai 05, at 20:36, Mike Kronenberg wrote:Pierre d'Herbemont wrote:That should be done with not much troubles, if we manage to get qemu thread safe. Did you try that way? Until the 7. May I was trying to get all into qemu... sources are still there.I was looking into making the contoller one thread and the each qemu a thread, so one can run multiple qemus. It is still on the List - but it's a little more time intensive (I use qemu for my work) . So I gutted cocoa.m to the elemental UI things... like it is now and made a controller with the features I need a lot and I think would be useful to have in the final product.I would like very much, that my patch would be comitted, so bugs can be fixed and features added.As soon as we can make qemu threadsave, it's easy to merge the working frontend with qemu.For now a single-threaded qemu could be ok... The patch will be smaller, and the multiple instance feature may be added later. What do you think?Pierre.___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel
Re: [Qemu-devel] cocoa.m using openGL
On 28 mai 05, at 20:39, Mike Kronenberg wrote:Pierre d'Herbemont wrote:It doesn't work on my iMac DV G3 400. I know that its ATI Rage 128 is very limited, but I think that we'll had to keep both version...Did You get an error-message so we could include a autoswitch?Nop... The main window's buffer seems to point to a wrong memory address. I have seen, this bug before when playing with OpenGL and texture on this Macine. Screenshot here:http://stegefin.free.fr/q-ogl.pngPierre.___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel
Re: [Qemu-devel] cocoa.m using openGL
On 24 mai 05, at 17:11, Mike Kronenberg wrote:Testbuild and diff are onhttp://www.kberg.ch/cocoaqemuIt doesn't work on my iMac DV G3 400. I know that its ATI Rage 128 is very limited, but I think that we'll had to keep both version...The PNG preview works but not the main screen.I'll be able to debug a bit more in the weekend.Pierre.___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel
Re: [Qemu-devel] [PATCH] cocoa.m
On 27 mai 05, at 16:51, Mike Kronenberg wrote: Pierre would like to put the whole thing in the head tree. I would be ready to do so, too, if this is wanted. I didn't realize that the Q app was a front end. It would be much cleaner to have it running in qemu as the cocoa qemu driver. That should be done with not much troubles, if we manage to get qemu thread safe. Did you try that way? Pierre. ___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel
Re: [Qemu-devel] [PATCH] Embed QEmu screen on a custom window
On 26 mai 05, at 23:07, Christian MICHON wrote: I do not know what cocoa.m implementation is, but I've seen screenshots. cocoa.m is just a qemu video driver which uses natives Mac OS X UI Libraries. It does require space, and if you go full-screen, you can't do modifications. I am not sure that you speak about the cocoa driver. The cocoa video driver is lighter than the SDL one, since it doesn't require the SDL dependencies. And I don't get the full-screen point: cocoa.m still need much work, and that is why it doesn't support fullscreen (yet). (BTW Mike has been doing some great improvements which will be hopefully soon committed in the head cvs repository.) Hence the suggestion to go full SDL. Fabrice would like to see the native GTK, or Win32 qemu video coded. Because then a decent UI could be added to qemu. The front ends will always be limited, and the previous hack seems a bit crazy, and nearly nasty: you can do that directly via a video driver for qemu, and moreover it will let you far more control over qemu. Pierre. ___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel
Re: [Qemu-devel] cocoa.m using openGL
Mike!Le 24 mai 05 à 17:11, Mike Kronenberg a écrit :[..]=> openGL is 3.5% faster on my systemImpressive ;)plus- it solves some issues i had with hiding/showing the toolbar (damaging the qd_view)- it could accelerate the generation of livethumbnails i am usingTestbuild and diff are onhttp://www.kberg.ch/cocoaqemuAt this point I'm asking, whether my patch should/can be included into the CVS, what changes I should make, or how to continue...Send your patch to Fabrice (and the list)! I can't really test it right now, but after a really quick look, it looks clean enough for me.And I don't think you should wait any longer. I think it is better to work directly on the CVS, with a patch per bug/features scheme.bye,Pierre.___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel
Re: [Qemu-devel] cocoa.m using openGL
Hi Peter, That is really great! To send your work: 1) download the cvs repository, see: http://savannah.nongnu.org/cvs/?group=qemu 2) send your diff: # cd /path/to/qemu # cvs diff -u cocoa.m > cocoapatch.diff.txt If you think your patch is clean enough, send it to Fabrice (and the list) so that it can be merged in qemu's repository. It seems that cocoa.m is under heavy work, which is good :) Pierre. Le 22 mai 05 à 15:00, Peter Stewart a écrit : Hello to all, esp. Pierre d'Herbemont, I have changed cocoa.m (0.7.0) to use openGL with very fast texturing. I removed the use of QuickDraw. The DisplayState data is now DMA'd to the graphics card instead of copied by the CPU. This uses apple's texture range extensions. The change means that the transfer of "display memory" incurs no CPU overhead. I also put in a bit more mouse stuff, and made some other fixes. I can't work out how to get the Window to get focus once it loses it, which is really a pain. I Shark'd it to make sure there wasn't any overhead from the texturing. I tested with Knoppix and FreeDOS. I am not sure if this is of interest to people, I just had a lazy weekend. I would like to give the code to the qemu project, but don't really know how to. thanks, peter. ___ 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] [Patch] target-ppc mtcrf instruction not recognized
On 16 mai 05, at 09:54, Benjamin Herrenschmidt wrote: OK, I did put this in my working repository and I'll submit this to Fabrice. Please try to do this change to check if other bits need to be relax or not: Index: target-ppc/translate.c === RCS file: /cvsroot/qemu/qemu/target-ppc/translate.c,v retrieving revision 1.31 diff -u -r1.31 translate.c --- target-ppc/translate.c 12 May 2005 18:46:11 - 1.31 +++ target-ppc/translate.c 14 May 2005 17:14:35 - @@ -2123,7 +2123,7 @@ } /* mtcrf */ -GEN_HANDLER(mtcrf, 0x1F, 0x10, 0x04, 0x00100801, PPC_MISC) +GEN_HANDLER(mtcrf, 0x1F, 0x10, 0x04, 0x0801, PPC_MISC) { gen_op_load_gpr_T0(rS(ctx->opcode)); gen_op_store_cr(CRM(ctx->opcode)); I've tested it: it works fine as expected. And maybe someone should fill an Apple bug report to tell them their as is buggy ;-) It is definitely a bug in Apple assembler I would say, so I suggest you add a comment in the above patch in order to avoid somebody later on "fixing" your mask :) I thought it was, but it seems to be not so buggy ;) I have had a look at the Apple's as source code of Darwin 8.0 (10.4) [1] and I have found an interesting comment : /* * If this is the mtcrf opcode (0x7c000120) and val is not zero and * has exactly one bit set then use the new form of the mtcrf * opcode. This has bit 0x0010 set and the FXM field is a bit * mask. Else use the old form without bit 0x0010 set. */ I don't know what they are refering to, but that may have been introduced by the PowerPC 970 or an other new PPC, since it was not present on the Mac OS X 10.2's as [2]. Pierre. [1] http://darwinsource.opendarwin.org/10.4/cctools-576/as/ppc.c [2] http://darwinsource.opendarwin.org/10.2/cctools-435/as/ppc.c ___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel
Re: [Qemu-devel] [Patch] target-ppc mtcrf instruction not recognized
On 14 mai 05, at 20:15, J. Mayer wrote: Qemu assume all reserved fields are set to zero, not 1. PowerPC specifications says: (section 8.1 of PEM) "Some instructions fields are reserved or must contain a predefined value as shown in the individual instruction layouts. If a reserved field does not have all bits cleared, or if a field that must contain a particular value does not contains that value, the instruction form is invalid ..." In section 4.1.3.2: "Invalid forms result when a bit or openrands is coded incorrectly, for example, or when a reserved bit (shown as '0') is coded as '1'. and "an attempt to execute an invalid form of an instruction either invokes the illegal instruction error handler (or program exception) or yields boundedly-undefined results. In the case of mtcrf, the PowerPC specification says the bits 11, 21 and 31 (IBM notation) _must_ be zero. This is what is described in 32 bits PEM as well as 64 bits PEM (including the latest revision dated on 31/03/2005) and the 740/750 PowerPC user manual (which is the one currently emulated by Qemu). It would be acceptable to relax the check if it would make MacOS X 10.4 boot. But in this case, only the bit 11 (which causes the problem here) should be relaxed. Then, the bit mask becomes 0x0801 (not 0x). http://publibn.boulder.ibm.com/doc_link/en_US/a_doc_lib/aixassem/ alangref/mtcrf.htm This is the language reference for POWER & PowerPC. Some forms described in this documentation are valid only for POWER CPUs. Please use PowerPC Environment Manual for PowerPC only specifications. In fact I was referring to my old PowerPC Spec book in french from IBM (titled Architecture PowerPC), this link was the first google returned. After looking again in my book, I found what you said. I am confused, I wrote this a bit quickly. But the fact remains, would you send a correct patch for that? It'll definitely be compulsory in order to boot Mac OS X 10.4, and for darwin-user. Thanks, Pierre. ___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel
[Qemu-devel] [Patch] target-ppc mtcrf instruction not recognized
Hi, I have been playing with ppc-darwin-user. And I have to say that qemu- ppc is too strict with ppc opcode validity: On Mac OS X binary release called Tiger (or 10.4), the __bzero function [1] contains a mtcrf, which has been translated to 0x7c901120, by Apple's as. Current qemu rejects it, saying it is invalid. According to the IBM Specification the mtcrf instruction [2], contains reserved flags, for which the values are unknown. qemu assumes that those are set to 1, which is obviously wrong. The attached patch provides a fix. The mtcrf case might not be the only case in which such a situation occurs. That would need a special attention, though being strict is better than letting pass. Pierre. [1] http://fxr.watson.org/fxr/source/osfmk/ppc/commpage/bzero_32.s? v=DARWIN8#L98 [2] http://publibn.boulder.ibm.com/doc_link/en_US/a_doc_lib/aixassem/ alangref/mtcrf.htm Index: target-ppc/translate.c === RCS file: /cvsroot/qemu/qemu/target-ppc/translate.c,v retrieving revision 1.31 diff -u -r1.31 translate.c --- target-ppc/translate.c 12 May 2005 18:46:11 - 1.31 +++ target-ppc/translate.c 14 May 2005 17:14:35 - @@ -2123,7 +2123,7 @@ } /* mtcrf */ -GEN_HANDLER(mtcrf, 0x1F, 0x10, 0x04, 0x00100801, PPC_MISC) +GEN_HANDLER(mtcrf, 0x1F, 0x10, 0x04, 0x, PPC_MISC) { gen_op_load_gpr_T0(rS(ctx->opcode)); gen_op_store_cr(CRM(ctx->opcode)); ___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel
Re: [Qemu-devel] QEMU CVS, X-Code 2.0 and Tiger
On 4 mai 05, at 08:48, Natalia Portillo wrote: Hi! I'm getting (along with a LOT of warnings) the following error when trying to compiler under Tiger/X-Code2 (GCC 4.0.0-apple): TiBook:~/qemu claunia$ make for d in i386-softmmu ppc-softmmu sparc-softmmu x86_64-softmmu; do \ make -C $d all || exit 1 ; \ done ../dyngen -c -o opc.h op.o dyngen: blr expected at the end of op_bsfl_T0_cc make[1]: *** [opc.h] Error 1 make: *** [all] Error 1 Any idea? switch to gcc-3.3... It is still included with in the package. Or use Daniel Egger solution (seems to work only for i386-softmmu): On Thu, 14 Oct 2004 12:09:45 +0200, Daniel Egger <[EMAIL PROTECTED]> wrote: I just wanted to mention to those of you trying to compile Qemu on Darwin with the latest gcc snapshots that you need to supply the -fno-tree-ch flag for the compilation of op.c at certain optimization levels for dyngen to work[1]. Performance of i386-softemu qemu is quite descent, and the resulting code is smaller than with the native gcc 3.3 but the ppc emu doesn't compile. [1] Otherwise there'll be no branch to link register (blr) instruction at the end of some of the virtualized instructions which dyngen relies on to find the borders. Pierre. ___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel
Re: [Qemu-devel] 2 Questions [Cocoa Driver]
On 2 mai 05, at 13:20, Mike Kronenberg wrote: It seams that my first Mail got eaten: Status on my Work for cocoasupport for qemu - made a Toolbar with options to save VM, change Image for CD-Rom/Floppy - made a Controlling app, to start and configure WMs (right now I'm integrating that ap im qemu) [...] have fun and remember, this is a Feature Demo - expect instability :) Very nice ;) Hope you'll produce a patch, that'll get merged in cvs ;) However when I try to launch your test app here is what I get: iBook:~/Desktop/cocoaqemu.app/Contents steg$ ./MacOS/cocoaqemu ZeroLink: could not load .o file: /Users/mike/cocoaqemu/build/cocoaqemu.build/cocoaqemu.build/Objects- normal/ppc/main.ob ZeroLink: could not load .o file: /Users/mike/cocoaqemu/build/cocoaqemu.build/cocoaqemu.build/Objects- normal/ppc/qemuController.ob ZeroLink: unknown symbol '_main' Abort trap I bet you use nib files and so on... In this case you'll have to bypass the use of Xcode, by creating the appropriate Makefiles which will build the qemu.app, I have an almost clean patch [1] that you may want to use as a base. Tell me is you want more infos. Pierre. [1]? .DS_Store ? .gdb_history ? cocoa ? cocoa.m ? linux-test Index: Makefile.target === RCS file: /cvsroot/qemu/qemu/Makefile.target,v retrieving revision 1.69 diff -u -r1.69 Makefile.target --- Makefile.target 28 Apr 2005 21:15:08 - 1.69 +++ Makefile.target 2 May 2005 19:19:54 - @@ -209,6 +209,10 @@ LIBS+=-lmx endif +ifdef CONFIG_COCOA +PROGS+=$(QEMU_SYSTEM).app +endif + # DEFINES+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE @@ -387,6 +391,16 @@ VL_LDFLAGS+=-p endif +# Mac OS X Application + +$(QEMU_SYSTEM).app: $(QEMU_SYSTEM) cocoa/Info.plist cocoa/qemu.nib + mkdir -p $@/Contents/MacOS + mkdir -p $@/Contents/Resources/English.lproj + echo -n "APPL" > $@/Contents/PkgInfo + cp ../cocoa/Info.plist $@/Contents + cp -R ../cocoa/qemu.nib $@/Contents/Resources/English.lproj + cp $(QEMU_SYSTEM) $@/Contents/MacOS/Qemu + ifeq ($(ARCH),ia64) VL_LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/ia64.ld endif @@ -459,7 +473,7 @@ $(CC) $(DEFINES) -c -o $@ $< clean: - rm -f *.o *.a *~ $(PROGS) gen-op.h opc.h op.h nwfpe/*.o slirp/*.o fpu/*.o + rm -f *.o *.a *~ $(PROGS) gen-op.h opc.h op.h nwfpe/*.o slirp/*.o fpu/*.o *.app install: all ifneq ($(PROGS),) ___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel
Re: [Qemu-devel] Windows XP Home on qemu 0.6.0 and Mac OS X 10.3.8
On 1 mai 05, at 06:24, Karl Magdsick wrote: http://fabrice.bellard.free.fr/qemu/kqemu-doc.html indicates kqemu is only for x86 Linux 2.4.x and Linux 2.6.x, not PPC Xnu 7.9.x. Qemu 0.6.0 might also be too old to take advantage of kqemu. If he used the installer from Free OS Zoo, this would seem to indicate he doesn't know which compile options were used. In any case, I would hope that if the kqemu options cause large overhad, they weren't turned on for a compilation targeted at both an architecture and kernel for which kqemu did not exist at the time of compiliation. Are you suggesting that his emulator is running slowly because it is repeatedly attempting and failing to use the accelerated kernel interface? The version martin uses is 0.6.0 Pierre ___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel