Replace GSX Server support with VMware Player support.
[pintos-anon] / doc / installation.texi
1 @node Installing Pintos
2 @appendix Installing Pintos
3
4 This chapter explains how to install a Pintos development environment on
5 your own machine.  If you are using a Pintos development environment
6 that has been set up by someone else, you do not need to read this
7 chapter or follow these instructions.
8
9 The Pintos development environment is targeted at Unix-like systems.  It
10 has been most extensively tested on GNU/Linux, in particular the Debian
11 and Ubuntu distributions, and Solaris.  It is not designed to install
12 under any form of Windows.
13
14 Prerequisites for installing a Pintos development environment include
15 the following, on top of standard Unix utilities:
16
17 @itemize @bullet
18 @item
19 Required: @uref{http://gcc.gnu.org/, GCC}.  Version 4.0 or later is
20 preferred.  Version 3.3 or later should work.  If the host machine has
21 an 80@var{x}86 processor, then GCC should be available as @command{gcc};
22 otherwise, an 80@var{x}86 cross-compiler should be available as
23 @command{i386-elf-gcc}.  A sample set of commands for installing GCC
24 3.3.6 as a cross-compiler are included in
25 @file{src/@/misc/@/gcc-3.3.6-cross-howto}.
26
27 @item
28 Required: @uref{http://www.gnu.org/software/binutils/, GNU binutils}.
29 Pintos uses @command{addr2line}, @command{ar}, @command{ld},
30 @command{objcopy}, and @command{ranlib}.  If the host machine is not an
31 80@var{x}86, versions targeting 80@var{x}86 should be available with an
32 @samp{i386-elf-} prefix.
33
34 @item
35 Required: @uref{http://www.perl.org, Perl}.  Version 5.8.0 or later is
36 preferred.  Version 5.6.1 or later should work.
37
38 @item
39 Required: @uref{http://www.gnu.org/software/make/, GNU make}, version
40 3.80 or later.
41
42 @item
43 Recommended: @uref{http://fabrice.bellard.free.fr/qemu/, qemu}, version
44 0.8.0 or later.  If qemu is not available, Bochs can be used, but its
45 slowness is frustrating.
46
47 @item
48 Recommended: @uref{http://www.gnu.org/software/gdb/, GDB}.  GDB is
49 helpful in debugging (@pxref{GDB}).  If the host machine is not an
50 80@var{x}86, a version of GDB targeting 80@var{x}86 should be available
51 as @samp{i386-elf-gdb}.
52
53 @item
54 Recommended: @uref{http://www.x.org/, X}.  Being able to use an X server
55 makes the virtual machine feel more like a physical machine, but it is
56 not strictly necessary.
57
58 @item
59 Optional: @uref{http://www.gnu.org/software/texinfo/, Texinfo}, version
60 4.5 or later.  Texinfo is required to build the PDF version of the
61 documentation.
62
63 @item
64 Optional: @uref{http://www.tug.org/, @TeX{}}.  Also required to build
65 the PDF version of the documentation.
66
67 @item
68 Optional: @uref{http://www.vmware.com/, VMware Player}.  This is a
69 third platform that can also be used to test Pintos.
70 @end itemize
71
72 Once these prerequisites are available, follow these instructions to
73 install Pintos:
74
75 @enumerate 1
76 @item
77 Install @uref{http://bochs.sourceforge.net/, Bochs}, version 2.2.6, as
78 described below (@pxref{Building Bochs for Pintos}).
79
80 @item
81 Install scripts from @file{src/utils}.  Copy @file{backtrace},
82 @command{pintos}, @command{pintos-gdb}, @command{pintos-mkdisk} into the
83 default @env{PATH}.
84
85 @item 
86 Install @file{src/misc/gdb-macros} in a public location.  Then use a
87 text editor to edit the installed copy of @command{pintos-gdb}, changing
88 the definition of @env{GDBMACROS} to point to where you installed
89 @file{gdb-macros}.  Test the installation by running
90 @command{pintos-gdb} without any arguments.  If it does not complain
91 about missing @file{gdb-macros}, it is installed correctly.
92
93 @item
94 Compile the remaining Pintos utilities by typing @command{make} in
95 @file{src/utils}.  Install @file{squish-pty} somewhere in @env{PATH}.
96 To support VMware Player, install @file{squish-unix}.
97 If your Perl is older than version 5.8.0, also install
98 @file{setitimer-helper}; otherwise, it is unneeded.
99
100 @item
101 Pintos should now be ready for use.  If you have the Pintos reference
102 solutions, which are provided only to faculty and their teaching
103 assistants, then you may test your installation by running @command{make
104 check} in the top-level @file{tests} directory.  The tests take between
105 20 minutes and 1 hour to run, depending on the speed of your hardware.
106
107 @item
108 Optional: Build the documentation, by running @command{make dist} in the
109 top-level @file{doc} directory.  This creates a @file{WWW} subdirectory
110 within @file{doc} that contains HTML and PDF versions of the
111 documentation, plus the design document templates and various hardware
112 specifications referenced by the documentation.  Building the PDF
113 version of the manual requires Texinfo and @TeX{} (see above).  You may
114 install @file{WWW} wherever you find most useful.
115 @end enumerate
116
117 @menu
118 * Building Bochs for Pintos::   
119 @end menu
120
121 @node Building Bochs for Pintos
122 @section Building Bochs for Pintos
123
124 Upstream Bochs has bugs and warts that should be fixed when used with
125 Pintos.  Thus, Bochs should be installed manually for use with Pintos,
126 instead of using the packaged version of Bochs included with an
127 operating system distribution.
128
129 Two different Bochs binaries should be installed.  One, named simply
130 @command{bochs}, should have the GDB stub enabled, by passing
131 @option{--enable-gdb-stub} to the Bochs @command{configure} script.  The
132 other, named @command{bochs-dbg}, should have the internal debugger
133 enabled, by passing @option{--enable-debugger} to @command{configure}.
134 (The @command{pintos} script selects a binary based on the options
135 passed to it.)  In each case, the X, terminal, and ``no GUI'' interfaces
136 should be configured, by passing @option{--with-x --with-x11 --with-term
137 --with-nogui} to @command{configure}.
138
139 This version of Pintos is designed for use with Bochs 2.2.6.  A number
140 of patches for this version of Bochs are included in @file{src/misc}:
141
142 @table @file
143 @item bochs-2.2.6-big-endian.patch
144
145 Makes the GDB stubs work on big-endian systems such as Solaris/Sparc, by
146 doing proper byteswapping.  It should be harmless elsewhere.
147
148 @item bochs-2.2.6-jitter.patch
149
150 Adds the ``jitter'' feature, in which timer interrupts are delivered at
151 random intervals (@pxref{Debugging versus Testing}).
152
153 @item bochs-2.2.6-triple-fault.patch
154
155 Causes Bochs to break to GDB when a triple fault occurs and
156 the GDB stub is active (@pxref{Triple Faults}).
157
158 @item bochs-2.2.6-ms-extensions.patch
159
160 Needed for Bochs to compile with GCC on some hosts.  Probably
161 harmless elsewhere.
162
163 @item bochs-2.2.6-solaris-tty.patch
164
165 Needed for Bochs to compile in terminal support on Solaris
166 hosts.  Probably harmless elsewhere.
167
168 @item bochs-2.2.6-solaris-link.patch
169
170 Needed on Solaris hosts.  Do not apply it elsewhere.
171 @end table
172
173 To apply all the patches, @command{cd} into the Bochs directory, then
174 type:
175 @example
176 patch -p1 < $PINTOSDIR/src/misc/bochs-2.2.6-big-endian.patch
177 patch -p1 < $PINTOSDIR/src/misc/bochs-2.2.6-jitter.patch
178 patch -p1 < $PINTOSDIR/src/misc/bochs-2.2.6-triple-fault.patch
179 patch -p1 < $PINTOSDIR/src/misc/bochs-2.2.6-ms-extensions.patch
180 patch -p1 < $PINTOSDIR/src/misc/bochs-2.2.6-solaris-tty.patch
181 patch -p1 < $PINTOSDIR/src/misc/bochs-2.2.6-solaris-link.patch
182 @end example
183 @noindent
184 You will have to supply the proper @env{$PINTOSDIR}, of course.  You can
185 use @command{patch}'s @option{--dry-run} option if you want to test
186 whether the patches would apply cleanly before trying to apply them.
187
188 Sample commands to build and install Bochs for Pintos are supplied in
189 @file{src/misc/bochs-2.2.6-build.sh}.