diff -ur qemu/configure qemu-new/configure --- qemu/configure 2005-04-23 19:30:28.000000000 +0100 +++ qemu-new/configure 2005-04-26 10:03:20.948830000 +0100 @@ -82,6 +82,8 @@ fmod_inc="" linux="no" kqemu="no" +qvm86="no" +kernel_module="no" kernel_path="" cocoa="no" @@ -94,12 +96,17 @@ ;; MINGW32*) mingw32="yes" +if [ "$cpu" = "i386" ] ; then + kqemu="yes" + qvm86="yes" +fi ;; FreeBSD) bsd="yes" oss="yes" if [ "$cpu" = "i386" ] ; then kqemu="yes" + qvm86="yes" fi ;; NetBSD) @@ -119,6 +126,7 @@ linux="yes" if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then kqemu="yes" + qvm86="yes" fi ;; esac @@ -184,6 +192,8 @@ ;; --disable-kqemu) kqemu="no" ;; + --disable-qvm86) qvm86="no" + ;; --kernel-path=*) kernel_path=${opt#--kernel-path=} ;; --enable-cocoa) cocoa="yes" ; sdl="no" @@ -324,6 +334,7 @@ echo "" echo "kqemu kernel acceleration support:" echo " --disable-kqemu disable kqemu build" +echo " --disable-qvm86 disable qvm86 build" echo " --kernel-path=PATH set the kernel path (configure probes it)" echo "" echo "Advanced options (experts only):" @@ -368,26 +379,41 @@ fi # Linux specific kqemu configuration -if test $kqemu = "yes" -a $linux = "yes" ; then +if test $qvm86 = "yes" ; then + # test if the source code is installed + if test '!' -f "qvm86/Makefile" ; then + qvm86="no" + fi +fi + +if test $kqemu = "yes" -o $qvm86 = "yes" ; then + kernel_module=yes +fi + # find the kernel path +if test $kernel_module = "yes" ; then +if test "$linux" = "yes"; then if test -z "$kernel_path" ; then kernel_version=`uname -r` kernel_path="/lib/modules/$kernel_version/build" if test '!' -d "$kernel_path/include" ; then kernel_path="/usr/src/linux" if test '!' -d "$kernel_path/include" ; then - echo "Could not find kernel includes in /lib/modules or /usr/src/linux - cannot build the kqemu module" - kqemu="no" + echo "Could not find kernel includes in /lib/modules or /usr/src/linux - cannot build the kernel module" + kernel_module="no" fi fi fi +fi # linux +fi # kernel_module -if test $kqemu = "yes" ; then +if test $kernel_module = yes; then +if test "$linux" = "yes"; then # test that the kernel config is present if test '!' -f "$kernel_path/Makefile" ; then - echo "No Makefile file present in $kernel_path - kqemu cannot be built" - kqemu="no" + echo "No Makefile file present in $kernel_path - kernel module cannot be built" + kernel_module="no" fi # find build system (2.6 or legacy) @@ -396,9 +422,13 @@ kbuild26="no" fi -fi # kqemu +fi # linux +fi # kernel_module -fi # kqemu and linux +if test ! $kernel_module = "yes"; then + kqemu="no" + qvm86="no" +fi echo "Install prefix $prefix" @@ -429,9 +459,10 @@ fi echo "" echo "kqemu support $kqemu" -if test $kqemu = "yes" -a $linux = "yes" ; then +echo "qvm86 support $qvm86" +if test $kernel_module = "yes" -a $linux = "yes" ; then echo "" -echo "KQEMU Linux module configuration:" +echo "Kernel module configuration:" echo "kernel sources $kernel_path" echo -n "kbuild type " if test $kbuild26 = "yes"; then @@ -442,7 +473,10 @@ fi if test $sdl_too_old = "yes"; then -echo "-> Your SDL version is too old - please upgrade to have SDL support" +echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support" +fi +if test "$sdl" = "no"; then + echo "WARNING: SDL not found. qemu will not have graphical output" fi #if test "$sdl_static" = "no"; then # echo "WARNING: cannot compile statically with SDL - qemu-fast won't have a graphical output" @@ -566,8 +600,13 @@ if test $kqemu = "yes" ; then echo "CONFIG_KQEMU=yes" >> $config_mak +fi +if test $qvm86 = "yes" ; then + echo "CONFIG_QVM86=yes" >> $config_mak +fi +if test $kernel_module = "yes" ; then echo "KERNEL_PATH=$kernel_path" >> $config_mak - if test $kbuild26 = "yes" ; then + if test "$kbuild26" = "yes" ; then echo "CONFIG_KBUILD26=yes" >> $config_mak fi fi @@ -628,7 +667,7 @@ echo "TARGET_ARCH=i386" >> $config_mak echo "#define TARGET_ARCH \"i386\"" >> $config_h echo "#define TARGET_I386 1" >> $config_h - if test $kqemu = "yes" -a "$target_softmmu" = "yes" -a $cpu = "i386" ; then + if test $kernel_module = "yes" -a "$target_softmmu" = "yes" -a $cpu = "i386" ; then echo "#define USE_KQEMU 1" >> $config_h fi elif test "$target_cpu" = "arm" -o "$target_cpu" = "armeb" ; then diff -ur qemu/kqemu.c qemu-new/kqemu.c --- qemu/kqemu.c 2005-04-24 19:03:37.000000000 +0100 +++ qemu-new/kqemu.c 2005-04-26 09:47:23.199430000 +0100 @@ -43,7 +43,7 @@ #include #include -#include "kqemu/kqemu.h" +#include "qvm86/kqemu.h" /* compatibility stuff */ #ifndef KQEMU_RET_SYSCALL @@ -51,9 +51,9 @@ #endif #ifdef _WIN32 -#define KQEMU_DEVICE "\\\\.\\kqemu" +#define KQEMU_DEVICE "\\\\.\\qvm86" #else -#define KQEMU_DEVICE "/dev/kqemu" +#define KQEMU_DEVICE "/dev/qvm86" #endif #ifdef _WIN32 @@ -188,6 +188,7 @@ kqemu_update_cpuid(env); env->kqemu_enabled = 1; nb_pages_to_flush = 0; + printf ("QEMU acceleration layer enabled\n"); return 0; } diff -ur qemu/Makefile qemu-new/Makefile --- qemu/Makefile 2005-04-23 18:42:13.000000000 +0100 +++ qemu-new/Makefile 2005-04-26 09:34:32.866539000 +0100 @@ -24,6 +24,13 @@ $(MAKE) -C kqemu endif endif +ifdef CONFIG_QVM86 +ifdef CONFIG_WIN32 + $(MAKE) -C qvm86 -f Makefile.winnt +else + $(MAKE) -C qvm86 +endif +endif qemu-img$(EXESUF): qemu-img.c block.c block-cow.c block-qcow.c aes.c block-vmdk.c block-cloop.c block-dmg.c $(CC) -DQEMU_TOOL $(CFLAGS) $(LDFLAGS) $(DEFINES) -o $@ $^ -lz $(LIBS) @@ -42,6 +49,9 @@ ifdef CONFIG_KQEMU $(MAKE) -C kqemu clean endif +ifdef CONFIG_QVM86 + $(MAKE) -C qvm86 clean +endif distclean: clean rm -f config-host.mak config-host.h @@ -76,6 +86,9 @@ ifdef CONFIG_KQEMU cd kqemu ; ./install.sh endif +ifdef CONFIG_QVM86 + cd qvm86 ; ./install.sh +endif # various test targets test speed test2: all diff -ur qemu/target-i386/helper2.c qemu-new/target-i386/helper2.c --- qemu/target-i386/helper2.c 2005-04-23 18:50:32.000000000 +0100 +++ qemu-new/target-i386/helper2.c 2005-04-26 09:40:20.077754000 +0100 @@ -104,11 +104,11 @@ #endif env->cpuid_level = 2; env->cpuid_version = (family << 8) | (model << 4) | stepping; - env->cpuid_features = (CPUID_FP87 | CPUID_DE | CPUID_PSE | + env->cpuid_features = (CPUID_FP87 | CPUID_DE | /*CPUID_PSE |*/ CPUID_TSC | CPUID_MSR | CPUID_MCE | - CPUID_CX8 | CPUID_PGE | CPUID_CMOV); + CPUID_CX8 | /* CPUID_PGE | */ CPUID_CMOV); env->cpuid_ext_features = 0; - env->cpuid_features |= CPUID_FXSR | CPUID_MMX | CPUID_SSE | CPUID_SSE2 | CPUID_PAE | CPUID_SEP; + env->cpuid_features |= CPUID_FXSR | CPUID_MMX | CPUID_SSE | CPUID_SSE2 | CPUID_PAE /*| CPUID_SEP*/; env->cpuid_xlevel = 0; { const char *model_id = "QEMU Virtual CPU version " QEMU_VERSION;