kernel debugging question

Jon Noack noackjr at
Sun May 16 15:15:18 PDT 2004

On 05/16/04 13:13, P. de Boer wrote:
On Sun, 16 May 2004 12:55:35 +0200 Patrick Mauritz wrote:
you could probably use qemu (,
an x86 emulator (similar to bochs, but with dynamic translation for
quite good performance) - it allows to attach a gdb to the client 

unfortunately there are some linuxisms in the code and the last 
freebsd patch I could find - at 
is pretty dated and doesn't apply to current versions of qemu
The BSD patch only fails on one chunk on vl.c when applied to the 
sources of version 0.5.4. That reject is easily fixed by hand.
However, that wouldn't help much, since dfly doesn't seem to boot on
it anyway.. (hangs directly after the BTX loader banner)
It looks like the patch was recently committed:
Either grab the latest from CVS, wait for 0.5.6, or here's a more recent 
version of the patch:

This later patch, bsd.diff, applies with a little fuzz to version 0.5.5 
with the exception of one chunk on vl.c (again).  Applying the attached 
fix.diff to bsd.diff (yes, it's a patch to the patch) allows the 
modified bsd.diff to apply cleanly.  You could also just fix this by hand.

I had to apply the attached sdl.diff to fix SDL detection (change 
'sdl-config' to 'sdl11-config').

This hacked-up 0.5.5 configures, compiles (you need to use gmake), and 
runs fine on FreeBSD 5.2-CURRENT.  The nbench test (from the linux-test 
image) shows that it's about 8 times slower for integer and 13 times 
slower for floating point on my Pentium 4.

I also tried the linux binary on FreeBSD 5.2-CURRENT.  Compared to the 
hacked version I just built, it runs a shade faster for integer but 
significantly slower (>25%) for floating-point.  Finally, note that 
qemu-fast is Linux-specific (requires modified Linux kernel) and will 
just hang on execution.

Jon Noack
--- bsd.diff	Sun May 16 14:38:41 2004
+++ bsd.diff	Sun May 16 14:55:17 2004
@@ -153,7 +153,7 @@
 diff -w -u -d -r1.57 vl.c
 --- vl.c	4 Apr 2004 20:22:28 -0000	1.57
 +++ vl.c	5 Apr 2004 08:02:38 -0000
-@@ -28,24 +28,30 @@
+@@ -28,21 +28,26 @@
  #include <fcntl.h>
  #include <signal.h>
  #include <time.h>
@@ -179,6 +179,10 @@
 +#include <sys/stat.h>
 +#include <libutil.h>
+ #endif
+ #if defined(CONFIG_SLIRP)
+@@ -50,6 +55,7 @@
  #ifdef _WIN32
--- configure.orig	Sun May 16 15:02:05 2004
+++ configure	Sun May 16 15:01:21 2004
@@ -204,7 +204,7 @@
 if test -z "$sdl" ; then

More information about the Kernel mailing list