Supported OS: FreeBSD 5.3-RELEASE
Hello,
For a couple of days ago, i have successfully tested FreeBSD (just the kernel boot). The kernel boots (from cd), and when I choosed the packages to install, the installer, makes the slices (bsdlabels ...). I aborted the installation, because I had no more time to do more ... The OS seems to work, but I dont have tested network features, sound or the XServer. The Version of QEMU is 0.7.0, not the actual CVS. I have patched the version to run on freebsd (lrintf, llrintf ..., I dont have used the patch from ports, because I dont know).
marm
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Please, feel free to put your results in the unofficial OS support list http://www.claunia.com/qemu/
Quoted 16 lines · El 25/07/2005, a las 7:43, [email protected] escribió:
Hello,
For a couple of days ago, i have successfully tested FreeBSD (just the kernel boot). The kernel boots (from cd), and when I choosed the packages to install, the installer, makes the slices (bsdlabels ...). I aborted the installation, because I had no more time to do more ... The OS seems to work, but I dont have tested network features, sound or the XServer. The Version of QEMU is 0.7.0, not the actual CVS. I have patched the version to run on freebsd (lrintf, llrintf ..., I dont have used the patch from ports, because I dont know).
marm
Quoted 6 lines
_______________________________________________
Qemu-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/qemu-devel
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Darwin)
iD8DBQFC5KMzSOHwOb87puQRAnJvAJ9pYd+5Fbs31v3xLWDxGiKj0W/Z6gCfZNmK Cql4cKOIOFE24UiJ/YSjsOc=
=3NFa
-----END PGP SIGNATURE-----
Here is what I have learned so far w.r.t. freebsd. Hope this helps people running qemu+freebsd.
Qemu versions: qemu-0.7.0s.20050717 & qemu-0.7.1 [1] + kqemu
Host: freebsd-5.x freebsd-6, freebsd-7-current [2]
Processors: P4, AthlonXP, P4 HT[3]
VMs[4]: freebsd-4.x, freebsd-5.x, dragonfly (latest)
netbsd-1.3.x, redhat linux (don't recall versions), plan9, winXP, win2k, win2k3 (an earlier beta) -- all on X86
Notes:
[1] qemu-0.7.1 works with the patches from the current qemu port. Hopefully Juergen Lock will update the port soon.
[2] Most of my testing is with -current but generally older versions have not given any trouble.
[3] Hyperthreaded P4 + kqemu works fine for the most part but I have encountered some problems. Haven't had time to investigate further.
[4] VMs were built using various versions of qemu so they may or may not build with the latest qemu.
qemu-system-x86-64 brings up 6.0-BETA1-amd64 into the install menu but then it (sysinstall) fails to find any disks! When stopped at the boot prompt, prior to freebsd kernel booting, we see that the bios does detect the C disk so this likely means the freebsd probe code is using some feature that qemu does not emulate.
Typically I test all unix VMs by fetching sources, rebuilding everything and rebooting -- this is a pretty good test for real h/w as well! I have used only the tap device, not user mode networking (slirp). Networking works well enough. NFS mounting the host FS works but is rather slow. I have not tested sound. With kqemu VMs run about twice as slow as real h/w. Not bad at all!
qemu+gdb works very well for debugging freebsd kernels! (I believe I sent the details on some freebsd list earlier which you can search for).
For convenience I use if_bridge and run a local dhcpd that serves DHCP requests on the bridge0 device. In addition I use NAT using pf. /etc/qemu-ifup looks like this:
#!/bin/sh
sbin/ifconfig $1 up/sbin/ifconfig bridge0 deletem $1 2>/dev/null/sbin/ifconfig bridge0 addm $1
This combination allows me to run multiple VMs (I just suspend (^Z) the ones not in use). The only fiddling I do is to use a script to ensure that different VMs use different MAC address.
-- bakul
[Qemu-devel] kqemu problem - linux amd64 host, win xp guest
host:
Linux laptok 2.6.12-gentoo-r6 #1 Fri Jul 22 10:21:50 CEST 2005 x86_64 AMD Athlon(tm) 64 Processor 3400+ AuthenticAMD GNU/Linux
guest:
Windows XP Home Edition, Service Pack 2 + all updates
qemu:
0.7.1: i386-softmmu, x86_64-softmmu, x86_64-softmmu + kqemu
problem:
Everything works with i386-softmmu and x86_64-softmmu. Problems with kqemu: win xp displays only the
"We apologize for inconvenience, but Windows did not start successfully. A recent hardware or software change might have caused this." screen all the time.
Quoted 10 lines · Bakul Shah
Here is what I have learned so far w.r.t. freebsd. Hope this helps people running qemu+freebsd.
Qemu versions: qemu-0.7.0s.20050717 & qemu-0.7.1 [1] + kqemu
Host: freebsd-5.x freebsd-6, freebsd-7-current [2]
Processors: P4, AthlonXP, P4 HT[3]
VMs[4]: freebsd-4.x, freebsd-5.x, dragonfly (latest)
netbsd-1.3.x, redhat linux (don't recall versions), plan9, winXP, win2k, win2k3 (an earlier beta) -- all on X86
Quoted 4 lines
Notes:
[1] qemu-0.7.1 works with the patches from the current qemu port. Hopefully Juergen Lock will update the port soon.
...
I just sent a request for help with the new kqemu to the FreeBSD lists, maybe I should have Cc'd this one:
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
Makefile +5 -8
@@ -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= [email protected]
@@ -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
distinfo +4 -4
@@ -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 <bsd.kmod.mk>
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 <math.h>
++#include <errno.h>
++#include <sysdep.h>
++
++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 <math.h>
++#include <errno.h>
++#include <sysdep.h>
++
++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 <sys/socket.h>
+ #include <netinet/in.h>
+ #include <dirent.h>
++#ifdef __FreeBSD__
++#include <sys/types.h>
++#include <libutil.h>
++#endif
+ #ifdef _BSD
+ #include <sys/stat.h>
+ #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];
Quoted 2 lines · Juergen Lock
I just sent a request for help with the new kqemu to the FreeBSD lists, maybe I should have Cc'd this one:
Updated the patch here:
http://docs.freebsd.org/cgi/mid.cgi?200507251825.51540.jkim
Thanks,
Jung-uk Kim