Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Document requisite patch for qemu
  • Loading branch information
Michael Brown committed Aug 28, 2006
1 parent 18a84f4 commit 6e5ffef
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 4 deletions.
16 changes: 12 additions & 4 deletions contrib/bochs/README.qemu
Expand Up @@ -14,14 +14,21 @@ To get qemu running is fairly simple:
cvs -d:pserver:anonymous@cvs.savannah.nongnu.org:/sources/qemu \
co qemu

2a. Patch the qemu code. There is currently a bug that causes qemu to
execute Etherboot incredibly slowly. The bug seems to be related
to the relative prioritisation of CPU and I/O operations within
qemu. This patch (which I found via Google) isn't a proper fix,
but it does work around the problem:
patch -p0 < qemu-patch

3. Configure qemu with
pushd qemu
./configure --enable-system --enable-profiler
./configure --enable-system
popd

Note that qemu will not compile with gcc4; if your system's
default compiler is gcc4 then specify the path to gcc3 using
e.g. --cc=gcc-3.3.6
Note that qemu will not compile with gcc4; if your system's
default compiler is gcc4 then specify the path to gcc3 using
e.g. --cc=gcc-3.3.6

4. Build qemu:
make -C qemu
Expand Down Expand Up @@ -52,6 +59,7 @@ To get qemu running is fairly simple:
popd

9. Start qemu
export SDL_VIDEO_X11_DGAMOUSE=0
./qemu/i386-softmmu/qemu -L qemu/pc-bios \
-net nic,model=rtl8139 -net tap,ifname=tap0 \
-boot a -fda ../../src/bin/rtl8139.dsk
Expand Down
26 changes: 26 additions & 0 deletions contrib/bochs/qemu-patch
@@ -0,0 +1,26 @@
Index: qemu/cpu-exec.c
===================================================================
RCS file: /sources/qemu/qemu/cpu-exec.c,v
retrieving revision 1.84
diff -u -r1.84 cpu-exec.c
--- qemu/cpu-exec.c 29 Jul 2006 19:09:31 -0000 1.84
+++ qemu/cpu-exec.c 28 Aug 2006 01:54:15 -0000
@@ -788,6 +788,18 @@
cpu_loop_exit();
}
#endif
+#if 1
+#define MIN_CYCLE_COUNT 100
+ {
+ static int cycle_count;
+
+ if (++cycle_count > MIN_CYCLE_COUNT) {
+ cycle_count = 0;
+ env->exception_index = EXCP_INTERRUPT;
+ cpu_loop_exit();
+ }
+ }
+#endif
}
} else {
env_to_regs();

0 comments on commit 6e5ffef

Please sign in to comment.