From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.33) id 1BMyB1-0003aB-G2 for qemu-devel@nongnu.org; Sun, 09 May 2004 19:57:47 -0400 Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.33) id 1BMyAR-0003N7-Ck for qemu-devel@nongnu.org; Sun, 09 May 2004 19:57:43 -0400 Received: from [194.109.24.13] (helo=smtp-out3.xs4all.nl) by monty-python.gnu.org with esmtp (Exim 4.33) id 1BMyAQ-0003M8-PA for qemu-devel@nongnu.org; Sun, 09 May 2004 19:57:11 -0400 Received: from olifantasia.com (a213-84-8-196.adsl.xs4all.nl [213.84.8.196]) by smtp-out3.xs4all.nl (8.12.10/8.12.10) with ESMTP id i49Nv9lt090354 for ; Mon, 10 May 2004 01:57:09 +0200 (CEST) Message-ID: <409EC554.9060103@olifantasia.com> Date: Mon, 10 May 2004 01:57:08 +0200 From: Martin MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------030001000209030808090605" Subject: [Qemu-devel] Here is a patch to build qemu with powerpc (system) support on win32 Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org This is a multi-part message in MIME format. --------------030001000209030808090605 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit I mad a little patch to be able to enable powerpc system emulation on windows The patch is against qemu 0.5.5. Just run configure with ./configure --target-list=i386-softmmu ppc-softmmu (Which is the default with this patch) and it builds both qemu.exe (which is i386 system emulation) and qemu-system-ppc.exe (which is ppc system emulation) I tested it with the VGA framebuffer enabled linux kernel zIamge and the debian install disk on Jocelyns page http://jocelyn.mayer.free.fr/qemu-ppc/ It seems to work for me. I used the commandline: qemu-system-ppc.exe --kernel zImage_vgafb.prep --fda debian_install_root.bin --boot a and it just boots. If anyone is interested I can make my binary qemu-system-ppc.exe available but I think it would be better to place one on the Fabrices qemu homepage or on Jocelyns qemu-ppc homepage if it is ready for primetime Strange thing about the patch is I had to manually set the env struct to zero in cpu_ppc_init (in translate.c) for(i=0;itime_offset; - localtime_r(&t, tm); + #ifdef WIN32 + memcpy(tm,localtime(&t),sizeof(*tm)); + #else + localtime_r (&t, &local) ; + #endif } static void set_time (m48t59_t *NVRAM, struct tm *tm) @@ -129,7 +133,11 @@ static void get_alarm (m48t59_t *NVRAM, struct tm *tm) { - localtime_r(&NVRAM->alarm, tm); + #ifdef WIN32 + memcpy(tm,localtime(&NVRAM->alarm),sizeof(*tm)); + #else + localtime_r (&NVRAM->alarm, tm); + #endif } static void set_alarm (m48t59_t *NVRAM, struct tm *tm) diff -urbN qemu-0.5.5/target-ppc/helper.c qemu-0.5.5-win32/target-ppc/helper.c --- qemu-0.5.5/target-ppc/helper.c 2004-05-08 16:51:18.000000000 +0200 +++ qemu-0.5.5-win32/target-ppc/helper.c 2004-05-10 00:02:46.000000000 +0200 @@ -17,7 +17,13 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifdef _WIN32 +#define PROT_READ 1 +#define PROT_WRITE 2 +#else #include +#endif #include "exec.h" #if defined (USE_OPEN_FIRMWARE) diff -urbN qemu-0.5.5/target-ppc/translate.c qemu-0.5.5-win32/target-ppc/translate.c --- qemu-0.5.5/target-ppc/translate.c 2004-05-08 16:51:18.000000000 +0200 +++ qemu-0.5.5-win32/target-ppc/translate.c 2004-05-10 01:30:06.000000000 +0200 @@ -2933,13 +2933,21 @@ CPUPPCState *cpu_ppc_init(void) { CPUPPCState *env; + int i; cpu_exec_init(); env = malloc(sizeof(CPUPPCState)); if (!env) return NULL; +#ifdef WIN32 +for(i=0;iaccess_type = ACCESS_INT; - return env; } --------------030001000209030808090605--