CSE 506, Fall 2011: Tools

All of the tools that you need to execute and complete the labs are installed in your course virtual machine. Details TBA.

If you wish to compile and run the tools on your own machine, the information that you need is as follows. Note that we cannot guarantee that these tools will run on your computer, and we cannot support these tools on your own computer. However, the tools should run on recent versions of Linux. The tools should also run under Windows with the help of Cygwin. Install cygwin, and be sure to install the flex and bison packages (they are under the development header).

Compiler Toolchain

Most modern Linux distributions and BSDs have an ELF toolchain compatible with the JOS labs. That is, the system-standard gcc, as, ld and objdump should just work. The lab Makefile should automatically detect this. If the makefile fails to detect your build tools, you can specify their location by adding the following line to conf/env.mk:


If you are using something other than standard x86 linux or BSD, you will need the GNU C compiler toolchain, configured and built as a cross-compiler for the target 'i386-jos-elf', as well as the GNU debugger, configured for the i386-jos-elf toolchain. You can download versions that are known to work with JOS via the following links, although more recent versions of gcc and binutils, and GDB should work too:

Once you've unpacked these archives, run the following commands as root:

# cd binutils-2.19
# ./configure --target=i386-jos-elf --disable-nls
# make
# make install
# cd ../gcc-4.1.2
# ./configure --target=i386-jos-elf --disable-nls --without-headers \
              --with-newlib --disable-threads --disable-shared \
              --disable-libmudflap --disable-libssp
# make
# make install
# cd ../gdb-6.8
# ./configure --target=i386-jos-elf --program-prefix=i386-jos-elf- \
# make
# make install

Then you'll have in /usr/local/bin a bunch of binaries with names like i386-jos-elf-gcc. The lab makefile should detect this toolchain and use it in preference to your machine's default toolchain. If this doesn't work, there are instructions on how to override the toolchain inside the GNUmakefile in the labs.

QEMU Emulator

QEMU is a modern and fast PC emulator. QEMU version 0.12.5 is set up on your course virtual machine.

Unfortunately, QEMU's debugging facilities, while powerful, are somewhat immature, so we highly recommend you use our patched version of QEMU instead of the stock version that may come with your distribution. The version installed in your virtual machine is already patched.

Pre-compiled, patched Ubuntu packages are available here (all need to be installed):

qemu i386 amd64
qemu-common i386 amd64
qemu-kvm i386 amd64
qemu-kvm-extras i386 amd64

To build your own patched version of QEMU:

Download the official 0.12.5 source tarball from the QEMU homepage and apply the following patches:

i386-debug Use DS-relative virtual addresses instead of linear addresses in the GDB stub.
info-mem Fix "info mem" in the QEMU monitor to not skip the last mapped memory range.
info-pg Add "info pg" to the QEMU monitor that prints the page table.
e100 Fixes bugs in QEMU's simulated E100 and adds E100 debugging.
pcap Adds packet capture support.
option Adds the -pcap and -debug-e100 command line options used by e100 and pcap.

Last updated: Tue Nov 08 13:38:29 -0500 2011 [validate xhtml]