Skip to content

Instantly share code, notes, and snippets.

@YehezkelShB
Created January 10, 2021 09:29
Show Gist options
  • Save YehezkelShB/546b14477d0ed92068d38a026e4ca11e to your computer and use it in GitHub Desktop.
Save YehezkelShB/546b14477d0ed92068d38a026e4ca11e to your computer and use it in GitHub Desktop.
Download and compile all the tools for compiling and running os161
mkdir os161
cd os161
git clone https://github.com/ops-class/os161.git git
mkdir -p target/bin
PATH=$PATH:`readlink -f target/bin`
sudo apt install libgmp-dev libmpfr-dev libmpc-dev bmake
mkdir binutils target
cd binutils
BINUTILSFILE=binutils-2.24+os161-2.1
wget -c http://os161.eecs.harvard.edu/download/$BINUTILSFILE.tar.gz
tar xf binutils*
cd $BINUTILSFILE
find . -name '*.info' | xargs touch
touch intl/plural.c
./configure --nfp --disable-werror --target=mips-harvard-os161 --prefix=$HOME/os161/tools
make -j
make install
cd ../..
mkdir -p gcc/build
cd gcc
GCCFILE=gcc-4.8.3+os161-2.1
wget -c http://os161.eecs.harvard.edu/download/$GCCFILE.tar.gz
tar xf gcc*
cd $GCCFILE
find . -name '*.info' | xargs touch
touch intl/plural.c
cd ../build
../$GCCFILE/configure \
--enable-languages=c,lto \
--nfp --disable-shared --disable-threads \
--disable-libmudflap --disable-libssp \
--disable-libstdcxx --disable-nls \
--target=mips-harvard-os161 \
--prefix=$HOME/os161/tools
make -j
make install
cd ../..
mkdir gdb
cd !$
GDBFILE=gdb-6.6+os161-2.0
wget -c http://os161.eecs.harvard.edu/download/$GDBFILE.tar.gz
tar xf gdb*
cd $GDBFILE
find . -name '*.info' | xargs touch
touch intl/plural.c
./configure --target=mips-harvard-os161 --prefix=$HOME/os161/tools --disable-werror --disable-sim
make
make install
cd ..
mkdir sys161
cd !$
SYS161FILE=sys161-2.0.8
wget -c http://os161.eecs.harvard.edu/download/$SYS161FILE.tar.gz
tar xf sys161*
cd $SYS161FILE
./configure --prefix=$HOME/os161/tools mipseb
make -j
make install
cd ..
cd ~/os161/tools/bin
sh -c 'for i in mips-*; do ln -s $i os161-`echo $i | cut -d- -f4-`; done'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment