Update Checkbochs patches.
[pintos-anon] / src / misc / bochs.README
1 Pintos is designed to run well under Bochs 2.1.1.  A number of patches
2 are provided:
3
4         bochs-2.1.1-jitter.patch: 
5                 Add `jitter' feature used by pintos -j.
6
7         bochs-2.1.1-tty-stdout.patch:
8                 Make Bochs comfortable with stdout for the serial port.
9         
10         bochs-2.1.1-bigendian.patch:
11                 Fix gdb stub support on big-endian machines.
12
13         bochs-2.1.1-solaris.patch:
14                 Fix compilation under Solaris.
15                 Enable serial ports under Solaris.
16
17         bochs-2.1.1-checkbochs.patch:
18                 Implements Eraser-like lock checking support.
19                 (This patch is provided by Sorav Bansal, with
20                 modifications by Ben Pfaff.)
21
22 On Solaris, we recommend applying all the patches for use with Pintos.
23 On other host OSes, do not apply the Solaris patch.
24 Regardless of OS, you should only apply the Checkbochs patch if you
25 want to use the lock checking support.
26
27 To apply all the patches, cd into the Bochs directory, then type
28         patch -p1 < $PATCHDIR/bochs-2.1.1-tty-stdout.patch
29         patch -p1 < $PATCHDIR/bochs-2.1.1-jitter.patch
30         patch -p1 < $PATCHDIR/bochs-2.1.1-bigendian.patch
31 Only on Solaris, apply the Solaris patch as well:
32         patch -p1 < $PATCHDIR/bochs-2.1.1-solaris.patch
33 If you wish to use Checkbochs, apply the Checkbochs patch:
34         patch -p1 < $PATCHDIR/bochs-2.1.1-checkbochs.patch
35 You will have to supply the proper $PATCHDIR, of course.  You can can
36 provide the --dry-run option to patch if you want to test whether the
37 patch would apply cleanly before actually patching.
38
39 Here's a ./configure invocation for Bochs that works optimally with
40 the `pintos' utility:
41         ./configure --with-x --with-x11 --with-term --with-nogui
42 If you want the gdb stub, add --enable-gdb-stub
43 If you want the internal debugger, add --enable-debugger
44
45 Here are the commands used to build and install all the versions of
46 Bochs we make available on the elaines.  These commands assume a
47 Bourne shell, and that PATCHDIR is set to the directory that contains
48 the Bochs patches.
49
50 # Setup.
51 PATCHDIR=$HOME/cs140/eraser/src/misc
52 PREFIX="/usr/class/cs140/`uname -m`"
53 BINDIR=$PREFIX/bin
54 CFGOPTS="--with-x --with-x11 --with-term --with-nogui --prefix=$PREFIX"
55
56 # Fetch sources.
57 if test ! -e bochs-2.1.1.tar.gz; then
58         wget http://easynews.dl.sourceforge.net/sourceforge/bochs/bochs-2.1.1.tar.gz
59 fi
60
61 # Apply patches.
62 rm -rf bochs-2.1.1 checkbochs-2.1.1
63 tar xzf bochs-2.1.1.tar.gz
64 (cd bochs-2.1.1 && patch -p1 < $PATCHDIR/bochs-2.1.1-tty-stdout.patch)
65 (cd bochs-2.1.1 && patch -p1 < $PATCHDIR/bochs-2.1.1-jitter.patch)
66 (cd bochs-2.1.1 && patch -p1 < $PATCHDIR/bochs-2.1.1-bigendian.patch)
67 if [ `uname -m` = sun4u ]; then 
68         (cd bochs-2.1.1 && patch -p1 < $PATCHDIR/bochs-2.1.1-solaris.patch)
69 fi
70 cp -pR bochs-2.1.1 checkbochs-2.1.1
71 (cd checkbochs-2.1.1 && patch -p1 < $PATCHDIR/bochs-2.1.1-checkbochs.patch)
72
73 # Build and install Bochs variants.
74 (cd bochs-2.1.1 && rm -rf _plain && mkdir _plain && cd _plain && 
75  ../configure $CFGOPTS && make && make install)
76 (cd bochs-2.1.1 && rm -rf _gdb && mkdir _gdb && cd _gdb && 
77  ../configure --enable-gdb-stub $CFGOPTS && make && cp bochs $BINDIR/bochs-gdb)
78 (cd bochs-2.1.1 && rm -rf _dbg && mkdir _dbg && cd _dbg && 
79  ../configure --enable-debugger $CFGOPTS && make && cp bochs $BINDIR/bochs-dbg)
80
81 # Build and install Checkbochs variants.
82 (cd checkbochs-2.1.1 && autoconf)
83 (cd checkbochs-2.1.1 && rm -rf _plain && mkdir _plain && cd _plain &&
84  ../configure $CFGOPTS && make && cp bochs $BINDIR/checkbochs)
85 (cd checkbochs-2.1.1 && rm -rf _gdb && mkdir _gdb && cd _gdb && 
86  ../configure --enable-gdb-stub $CFGOPTS &&
87  make && cp bochs $BINDIR/checkbochs-gdb)
88 (cd checkbochs-2.1.1 && rm -rf _dbg && mkdir _dbg && cd _dbg && 
89  ../configure --enable-debugger $CFGOPTS &&
90  make && cp bochs $BINDIR/checkbochs-dbg)
91
92