Fall 2004
NOTE: You are viewing class materials from a previous year. See also this year's class materials.

Tools Used in 6.828

If you use the MIT Athena machines that run Linux, then all the software tools you will need for this course are located in the 6.828 locker: just type 'add 6.828' to get access to them. If you would like to compile and run the tools on your own machine, however, here is the information you need. Of course, we cannot guarantee that these tools will be portable to every possible machine you might want to run them on; they should at least compile easily on most recent versions of Linux, however.

It should be possible to get this development environment running 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

First, if you are using a platform that is not a 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'. You can download the specific versions we used via these links, although more recent versions of gcc and binutils should work too:

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

$ cd binutils-2.15
$ ./configure --target=i386-jos-elf
$ make
$ make install
$ cd ../gcc-3.4.1
$ ./configure --target=i386-jos-elf
$ make
$ make install

If there are errors compiling gcc when it gets to libstdc++, don't worry about it.

Then you'll have in /usr/local/bin a bunch of binaries with names like i386-jos-elf-gcc. It will also be necessary to change the GNUMakefile used in the labs to use i386-jos-elf-gcc instead of gcc. There are instructions for how to do this inside of GNUMakefile.

Bochs Emulator

Bochs version 2.1.1 is set up on athena for x86 machines. If you want to use the same version on your home machine, you have two options.

  • Copy the binaries from athena. Run the following commands as root:
    cd /usr/local/bin
    scp username@athena.dialup.mit.edu:/mit/6.828/bin/bochs-bin bochs
    cd /usr/local/share
    scp -r username@athena.dialup.mit.edu:/mit/6.828/share/bochs bochs
  • The other option is to download, compile, and install bochs from the source archive. This is the only option if you want to run bochs under a different OS or on a different architecture. If you download a prebuilt version of bochs, it will not be compiled with the same options as we use for the class.

    The latest stable version of bochs is 2.1.1, and it can be downloaded from the Bochs downoad page. However, this version has some issues where triple faults will cause Bochs to hang. We are currently using a recent CVS snapshot on athena. If you choose to use the CVS snapshot on your home machine, you will need to update the instructions below accordingly.

    You may also want to run ./configure --help and look at the available options. The --prefix= option can be very useful.

    tar xzvf bochs-2.1.1.tar.gz
    cd bochs-2.1.1
    ./configure --enable-disasm \
                --enable-debugger \
                --enable-new-pit \
                --enable-all-optimizations \
                --enable-4meg-pages \
                --enable-global-pages \
                --enable-pae \
                --enable-all-optimizations \
                --disable-reset-on-triple-fault \
    make install

    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. If the make install step fails, it is probably possible to install it manually by copying ./bochs to /usr/bin/bochs and setting the environment variable BXSHARE to the path to the bochs-2.1.1 directory.

Questions or comments regarding 6.828? Send e-mail to the TAs at 6.828-staff@pdos.lcs.mit.edu.

Top // 6.828 home // Last updated Wednesday, 22-Sep-2021 12:14:43 EDT