![]() |
CS 235 Advanced Operating Systems, Winter 2008ToolsYou'll use two sets of tools in this class: an x86 emulator, QEMU, for running your kernel; and a compiler toolchain, including assembler, linker, C compiler, and so forth, for compiling your kernel. Here's the information you'll need to use the versions on our class compute server, or to download and install your own copies. This class assumes familiarity with Unix commands throughout. Using Cygwin on a Windows MachineIf you have a Windows machine, the easiest way to work on labs from home is to use the Cygwin system to log in to a class machine. Cygwin is quite popular, so it is unlikely that you will mess up your computer by installing it. But if you don't want to go through this procedure, you can use any on-campus SEASnet computer lab (even the Windows labs) to complete the labs, since those computers already have X already set up; you can log in to a class machine from there. Here's how to install Cygwin on your Windows machine.
You should also be able to compile the class tools and the labs on your Windows machine, once Cygwin has been installed. Let us know if you have success with this. Using the Class Compute ServerWe have set up a compute server for your use. This compute server may
be faster than SEASnet (assuming it doesn't get overused). Request a
username from the instructor. Once you have a username, you should be
able to log in to the compute server with " We need your SSH public key to give you an account on the compute
server. The SSH public key is a way to log in to a machine without
using a password. If you are already using Using SEASnetThe class tools are available in a shared directory. Add
% setenv PATH ${PATH}:/u/cs/class/cs235/cbin/bin % setenv MANPATH ${MANPATH}:/u/cs/class/cs235/cbin/man If you use the $ export PATH=${PATH}:/u/cs/class/cs235/cbin/bin $ export MANPATH=${MANPATH}:/u/cs/class/cs235/cbin/man Of course, it will be slightly easier if you add these commands to your
login shell script ( If you Downloading Your Own CopiesThe process is pretty easy if you have access to a Unix or Mac OS X machine. It should be possible under Windows, too, with the help of Cygwin, as described above. Install cygwin, and be sure to install the flex and bison packages (they are under the development header). First, choose a prefix, or directory, you'll use for storing the tools.
Good choices include Before you go any further, make sure that your The class tools are pretty large. You'll need around 500 MB of space to compile all the tools, but after deleting the sources, the installed executables and libraries take up less than 100 MB. Your mileage may vary. Compiler ToolchainFirst, check whether you need to build a GNU C compiler toolchain. If
your native GNU binutils and GCC compiler build for an i386 ELF target
(like most standard Linux and BSD systems), and your GCC is version 3.0 or
higher, you should be able to use the native compiler. To check, run Otherwise, configure and build the GNU C compiler toolchain as a
cross-compiler for the target '
Unpack these archives using " i*86-jos-*) noconfigdirs="$noconfigdirs target-libstdc++-v3" ;;Then run the following commands. (Supply your prefix for PFX .)
cd binutils-2.18 ./configure --target=i386-jos-elf --prefix=PFX make make install cd ../gcc-4.2.2 ./configure --target=i386-jos-elf --prefix=PFX --enable-languages=c,c++ --disable-libssp make make install Depending on the prefix, you may need to be root to run ' You can also download and configure the full QEMU EmulatorNext, download and install version 0.9.0 or 0.9.1 of
the QEMU emulator. It is easiest to
download and install a precompiled version;
this page
has versions for Linux, Mac OS X (the "Q" emulator), and Windows. If you
want to compile from source on a Unix machine, a simple
The QEMU monitor is accessible by pressing Ctrl-Alt-2 inside the QEMU window; return to normal display with Ctrl-Alt-1. QEMU tends to take control of your mouse given any opportunity. If you can't find a mouse pointer, check the QEMU title bar for text like "Press Ctrl-Alt to exit grab"; if it's there, press Ctrl-Alt to regain control. Bochs EmulatorYou may also download, compile, and install Bochs from the source archive. (If you download a prebuilt version of Bochs, it will not be compiled with the same options as we use for the class.) Download Bochs 2.3.6 from the Bochs download page. Configure and install as follows: gzcat bochs-2.3.6.tar.gz | tar xf - cd bochs-2.3.6 ./configure --enable-cpu-level=6 --enable-disasm \ --enable-debugger --enable-x86-debugger \ --enable-iodebug --enable-instrumentation \ --enable-4meg-pages --enable-pae --enable-global-pages \ --enable-all-optimizations --with-all-libs \ --prefix=PFX make make install You may also want to run ./configure --help and look at the available options. Mac OS X note: Make sure you have installed
the Xcode package with support for X11. Try the following
./configure line instead:
./configure --with-carbon --without-wx \ --enable-cpu-level=6 --enable-disasm \ --enable-debugger --enable-x86-debugger \ --enable-iodebug --enable-instrumentation \ --enable-4meg-pages --enable-pae --enable-global-pages \ --enable-all-optimizations \ --prefix=PFX Other
./configure flags: Some of our
challenge problems may require adding other flags to Bochs's
./configure line. For instance, to add VGA support, configure
with --enable-vbe .If you wish to use a different UI than the default one, modify your .bochsrc file accordingly. See the bochsrc documentation. It should also be possible to just run man bochsrc. If you are compiling on a non-x86 platform or on Windows, it may be necessary to remove the --enable-all-optimizations flag. |