From owner-freebsd-emulation@FreeBSD.ORG Mon Jul 25 20:26:43 2005 Return-Path: X-Original-To: freebsd-emulation@freebsd.org Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2AFB016A41F; Mon, 25 Jul 2005 20:26:43 +0000 (GMT) (envelope-from nox@saturn.kn-bremen.de) Received: from gwyn.kn-bremen.de (gwyn.kn-bremen.de [212.63.36.242]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6235F43D45; Mon, 25 Jul 2005 20:26:38 +0000 (GMT) (envelope-from nox@saturn.kn-bremen.de) Received: from gwyn.kn-bremen.de (gwyn [127.0.0.1]) by gwyn.kn-bremen.de (8.13.4/8.13.4/Debian-3) with ESMTP id j6PKQYF8007638; Mon, 25 Jul 2005 22:26:34 +0200 Received: from saturn.kn-bremen.de (uucp@localhost) by gwyn.kn-bremen.de (8.13.4/8.13.4/Submit) with UUCP id j6PKQYIf007636; Mon, 25 Jul 2005 22:26:34 +0200 Received: (from nox@localhost) by saturn.kn-bremen.de (8.11.4/8.8.5) id j6PKQBr43809; Mon, 25 Jul 2005 22:26:11 +0200 (CEST) From: Juergen Lock Date: Mon, 25 Jul 2005 22:26:09 +0200 To: freebsd-emulation@freebsd.org, freebsd-amd64@freebsd.org Message-ID: <20050725222608.A42815@saturn.kn-bremen.de> Mail-Followup-To: freebsd-emulation@freebsd.org, freebsd-amd64@freebsd.org, ports@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0pre3i Cc: ports@FreeBSD.org Subject: need help with kqemu X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2005 20:26:43 -0000 Hi! Fabrice has released a new version of kqemu that now also supports amd64 hosts, but as he doesnt know FreeBSD (and my kernel foo is far from being good enough, neither do i have an amd64 box) we need someone to port the wrapper to amd64. Actually the i386 wrapper he has now added to the release (kqemu-0.7.1.tar.gz) doesnt work either (not sure what happened there, it doesnt even build), so we need someone to fix/update that as well. I have made an update for the port that can be used as a template (only non-kqemu build works), I'll append it below: Removed files: files/BSDmakefile files/kmod_bsd.c New files: files/kqemu-Makefile-patch files/patch-libmath2 files/patch-vl.c (btw patch-vl.c is from Andrey V. Elsukov, it enables kernel debugging via virtual serial console, as posted on -ports: # qemu -hda disk.img -cdrom 6.0-BETA1.iso -serial pty # gdb (gdb) target remote /dev/ptyp0 ....) Index: Makefile =================================================================== RCS file: /home/ncvs/ports/emulators/qemu/Makefile,v retrieving revision 1.27 diff -u -r1.27 Makefile --- Makefile 19 Jul 2005 06:06:56 -0000 1.27 +++ Makefile 25 Jul 2005 16:52:49 -0000 @@ -6,12 +6,9 @@ # PORTNAME= qemu -PORTVERSION= 0.7.0s.20050717 +PORTVERSION= 0.7.1 CATEGORIES= emulators -MASTER_SITES= http://www.qemu.org/ \ - http://people.fruitsalad.org/nox/qemu/ \ - http://dad-answers.com/qemu/ -DISTNAME= ${PORTNAME}-snapshot-2005-07-17_23 +MASTER_SITES= http://www.qemu.org/ EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX} MAINTAINER= nox@jelal.kn-bremen.de @@ -23,12 +20,12 @@ .endif .if defined(WITH_KQEMU) -DISTKQEMU= kqemu-0.6.2-1.tar.gz +DISTKQEMU= kqemu-0.7.1.tar.gz DISTFILES= ${EXTRACT_ONLY} ${DISTKQEMU} +EXTRA_PATCHES= ${FILESDIR}/kqemu-Makefile-patch .endif HAS_CONFIGURE= yes -USE_BZIP2= yes USE_GMAKE= yes USE_GETOPT_LONG= yes USE_SDL= sdl @@ -85,7 +82,7 @@ .if defined(WITH_KQEMU) post-extract: @cd ${WRKSRC} && ${TAR} xfz ${_DISTDIR}/${DISTKQEMU} - @${CP} ${FILESDIR}/BSDmakefile ${FILESDIR}/kmod_bsd.c ${WRKSRC}/kqemu + @${LN} -s Makefile.freebsd ${WRKSRC}/kqemu/BSDmakefile .endif pre-patch: Index: distinfo =================================================================== RCS file: /home/ncvs/ports/emulators/qemu/distinfo,v retrieving revision 1.20 diff -u -r1.20 distinfo --- distinfo 19 Jul 2005 06:06:56 -0000 1.20 +++ distinfo 25 Jul 2005 16:40:12 -0000 @@ -1,4 +1,4 @@ -MD5 (qemu-snapshot-2005-07-17_23.tar.bz2) = 5d21295c1f328ea00de19a54715ee7c3 -SIZE (qemu-snapshot-2005-07-17_23.tar.bz2) = 1114748 -MD5 (kqemu-0.6.2-1.tar.gz) = c6bb3b40fb3d526d731eb0f1f9dee7ee -SIZE (kqemu-0.6.2-1.tar.gz) = 21002 +MD5 (qemu-0.7.1.tar.gz) = b0c80d2c082049a5b8ccbc7f55fe165b +SIZE (qemu-0.7.1.tar.gz) = 1338521 +MD5 (kqemu-0.7.1.tar.gz) = 8fc7967492b2157521198f6639218420 +SIZE (kqemu-0.7.1.tar.gz) = 76135 Index: files/kqemu-Makefile-patch @@ -0,0 +1,13 @@ +Index: qemu/kqemu/Makefile.freebsd +@@ -1,6 +1,10 @@ + # $Id: Makefile.freebsd,v 1.1 2005/04/17 17:21:31 bellard Exp $ + KMOD= kqemu +-SRCS= kmod-freebsd.c ++SRCS= kqemu-freebsd.c + OBJS= kqemu-mod-i386.o ++.if ${OSVERSION} >= 500000 ++CC= cc ++.endif ++WERROR= + + .include Index: files/patch-libmath2 @@ -0,0 +1,67 @@ +Index: qemu/bsd/Makefile +@@ -16,7 +16,8 @@ + ${MACHINE_ARCH}/s_rintl.c \ + ${MACHINE_ARCH}/s_round.c \ + ${MACHINE_ARCH}/s_sinl.S \ +- ${MACHINE_ARCH}/s_tanl.S ++ ${MACHINE_ARCH}/s_tanl.S \ ++ ${MACHINE_ARCH}/s_ldexpl.c + + OBJS= ${SRCS:R:S/$/.o/} + +Index: qemu/bsd/i386/s_ldexpl.c +@@ -0,0 +1,21 @@ ++#include ++#include ++#include ++ ++long double __ldexpl(long double x, int expn) ++{ ++ long double res; ++ if (!isfinite (x) || x == 0.0L) ++ return x; ++ ++ __asm__ ("fscale" ++ : "=t" (res) ++ : "0" (x), "u" ((long double) expn)); ++ ++ if (!isfinite (res) || res == 0.0L) ++ errno = ERANGE; ++ ++ return res; ++} ++ ++weak_alias(__ldexpl,ldexpl) +Index: qemu/bsd/amd64/s_ldexpl.c +@@ -0,0 +1,21 @@ ++#include ++#include ++#include ++ ++long double __ldexpl(long double x, int expn) ++{ ++ long double res; ++ if (!isfinite (x) || x == 0.0L) ++ return x; ++ ++ __asm__ ("fscale" ++ : "=t" (res) ++ : "0" (x), "u" ((long double) expn)); ++ ++ if (!isfinite (res) || res == 0.0L) ++ errno = ERANGE; ++ ++ return res; ++} ++ ++weak_alias(__ldexpl,ldexpl) +Index: qemu/target-i386/helper.c +@@ -2886,6 +2886,8 @@ + ST0 = floatx_round_to_int(ST0, &env->fp_status); + } + ++long double ldexpl(long double, int); ++ + void helper_fscale(void) + { + ST0 = ldexp (ST0, (int)(ST1)); Index: files/patch-vl.c @@ -0,0 +1,21 @@ +Index: qemu/vl.c +@@ -40,6 +40,10 @@ + #include + #include + #include ++#ifdef __FreeBSD__ ++#include ++#include ++#endif + #ifdef _BSD + #include + #ifndef __APPLE__ +@@ -1280,7 +1284,7 @@ + return chr; + } + +-#if defined(__linux__) ++#if defined(__linux__) || defined(__FreeBSD__) + CharDriverState *qemu_chr_open_pty(void) + { + char slave_name[1024];