Work in Progress... these are my notes so far...
I've run into xv6 a few times and always wanted to poke around with it. My two goals are:
- Build and run it on OS/X 10.8 (Mountain Lion)
- Change the build system so as to support compilation with Clang just for kicks My environment is a MacBook Pro where I'm running 10.8 and using Homebrew. I found this article useful as a starting point for building on OSX.
-
Install Xcode. After installing Xcode install the Command Line Tools from the Downloads section of Xcode's preferences. I've installed Xcode Version 4.5 (4G182).
-
Install Homebrew
-
Install pre-requisites for building xv6
$ brew install glib gmp mpfr pkgconfig ppl $ brew install libmpc --use-llvm $ brew install qemu --use-gcc
-
Install GNU binutils
$ cd /tmp $ curl -O http://ftp.gnu.org/gnu/binutils/binutils-2.22.tar.gz $ tar -xvzf binutils-2.22.tar.gz $ cd binutils-2.22 $ ./configure --target=i386-jos-elf --disable-nls --prefix=/opt/gnu $ sudo make install
-
Install GCC 4.5 via Homebrew
$ cd /tmp $ curl -O http://ftp.gnu.org/gnu/gcc/gcc-4.7.2/gcc-4.7.2.tar.gz $ cd gcc-4.7.2 $ ./configure --target=i386-jos-elf --disable-nls --without-headers --with-newlib --disable-threads --disable-shared --disable-libmudflap --disable-libssp --with-system-zlib --disable-lto --with-gmp=/usr/local --enable-languages=c --prefix=/opt/gnu $ LDFLAGS=-L/usr/lib make $ make install
$ git clone git://pdos.csail.mit.edu/xv6/xv6.git
$ cd xv6
$ make qemu-nox