Basic Eraser support.
[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
20 On Solaris, we recommend applying all the patches for use with Pintos.
21 On other host OSes, do not apply the Solaris patch.
22 Regardless of OS, you should only apply the Checkbochs patch if you
23 want to use the lock checking support.
24
25 To apply all the patches, cd into the Bochs directory, then type
26         patch -p1 < $PATCHDIR/bochs-2.1.1-tty-stdout.patch
27         patch -p1 < $PATCHDIR/bochs-2.1.1-jitter.patch
28         patch -p1 < $PATCHDIR/bochs-2.1.1-bigendian.patch
29 Only on Solaris, apply the Solaris patch as well:
30         patch -p1 < $PATCHDIR/bochs-2.1.1-solaris.patch
31 If you wish to use Checkbochs, apply the Checkbochs patch:
32         patch -p1 < $PATCHDIR/bochs-2.1.1-checkbochs.patch
33 You will have to supply the proper $PATCHDIR, of course.  You can can
34 provide the --dry-run option to patch if you want to test whether the
35 patch would apply cleanly before actually patching.
36
37 Here's a ./configure invocation for Bochs that works optimally with
38 the `pintos' utility:
39         ./configure --with-x --with-x11 --with-term --with-nogui
40 If you want the gdb stub, add --enable-gdb-stub
41 If you want the internal debugger, add --enable-debugger
42
43 Here are the commands used to build and install all the versions of
44 Bochs we make available on the elaines.  These commands assume a
45 Bourne shell, and that PATCHDIR is set to the directory that contains
46 the Bochs patches.
47
48 # Setup.
49 PREFIX="/usr/class/cs140/`uname -m`"
50 BINDIR=$PREFIX/bin
51 CFGOPTS="--with-x --with-x11 --with-term --with-nogui --prefix=$PREFIX"
52
53 # Fetch sources.
54 wget http://easynews.dl.sourceforge.net/sourceforge/bochs/bochs-2.1.1.tar.gz
55
56 # Apply patches.
57 tar xzf bochs-2.1.1.tar.gz
58 (cd bochs-2.1.1 && patch -p1 < $PATCHDIR/bochs-2.1.1-tty-stdout.patch)
59 (cd bochs-2.1.1 && patch -p1 < $PATCHDIR/bochs-2.1.1-jitter.patch)
60 (cd bochs-2.1.1 && patch -p1 < $PATCHDIR/bochs-2.1.1-bigendian.patch)
61 if [ `uname -m` = sun4u ]; then 
62         (cd bochs-2.1.1 && patch -p1 < $PATCHDIR/bochs-2.1.1-solaris.patch)
63 fi
64 cp -pR bochs-2.1.1 checkbochs-2.1.1
65 (cd checkbochs-2.1.1 && patch -p1 < $PATCHDIR/bochs-2.1.1-checkbochs.patch)
66
67 # Build and install Bochs variants.
68 (cd bochs-2.1.1 && rm -rf plain && mkdir plain && cd plain && 
69  ../configure $CFGOPTS && make && make install)
70 (cd bochs-2.1.1 && rm -rf with-gdb mkdir with-gdb && cd with-gdb && 
71  ../configure --enable-gdb-stub $CFGOPTS && 
72  make && cp bochs $BINDIR/bochs-gdb)
73 (cd bochs-2.1.1 && rm -rf with-dbg && mkdir with-dbg && cd with-dbg && 
74  ../configure --enable-debugger $CFGOPTS &&
75  make && cp bochs $BINDIR/bochs-dbg)
76
77 # Build and install Checkbochs variants.
78 (cd checkbochs-2.1.1 && rm -rf plain && mkdir plain && cd plain &&
79  ../configure $CFGOPTS && make && cp bochs $BINDIR/checkbochs)
80 (cd checkbochs-2.1.1 && rm -rf with-gdb && mkdir with-gdb && cd with-gdb && 
81  ../configure --enable-gdb-stub $CFGOPTS && 
82  make && cp bochs $BINDIR/checkbochs-gdb)
83 (cd checkbochs-2.1.1 && rm -rf with-dbg && mkdir with-dbg && cd with-dbg && 
84  ../configure --enable-debugger $CFGOPTS &&
85  make && cp bochs $BINDIR/checkbochs-dbg)
86
87