STEPS TO BUILD SOFTWARE FROM SOURCE FILE
BUILD SOFTWARE FRAMEWORK FOR OS/161
OS/161 INSTALLATION
●
Linux desktop with UBUNTU Version 12.04 or later.
●
Internet connections to download and install packages
Pre Installation Steps
1. Install the packages gettext
(to translate native language statements into English) ,textinfo (to transalate
source code into other formats) and libncurses5-dev ( allowsusers to write
text-base GUI)
sudo apt-get install gettext sudo
apt-get install texinfo
sudo apt-get install libncurses5-dev
2.
Include the paths $HOME/sys161/bin
and $HOME/sys161/tools/bin into the PATH environment variable. Add
the following line at the end of the file .bashrc
export PATH=$HOME/sys161/bin:$HOME/sys161/tools/bin:$PATH
Now
logout and login to get the PATH updated. You can check the current setting of
the
PATH environment variable using the
command
printenv PATH
Installation Steps
STEP 1: Download the following source codes one by
one
●
Binutils for MIPS
● GCC MIPS Cross-Compiler
● GDB for Use with OS/161
●
bmake for use with OS/161
● mk for use with OS/161
● sys/161OS/161
Note : bmake and mk utilities are BSD make utilities used for OS161
STEP 2: Build and Install the Binary Utilities (Binutils)
Unpack
the binutils archive:
tar -xzf os161-binutils.tar.gz
Move
into the newly-created directory:
cd binutils-2.17+os161-2.0.1
Configure
binutils:
./configure
--nfp --disable-werror --target=mips harvard-os161 --prefix=$HOME/sys161/tools
Make
binutils:
make
Finally,
once make has succeeded, install the
binutils into their final location:
make install
Step 3: Install the GCC MIPS Cross-Compiler
Unpack the gcc
archive:
tar -xzf os161-gcc.tar.gz
Move
into the newly-created directory:
cd gcc-4.1.2+os161-2.0
Configure
gcc
./configure
-nfp --disable-shared --disable-threads -- disable-libmudflap --disable-libssp
--target=mips harvard-os161 --prefix=$HOME/sys161/tools
Make
it and install it:
make
make install
Step 4: Install GDB
Unpack the gdb
archive:
tar -xzf os161-gdb.tar.gz
Move
into the newly-created directory:
cd gdb-6.6+os161-2.0
Configure
gdb
./configure
--target=mips-harvard-os161 -- prefix=$HOME/sys161/tools --disable-werror
Make
it and install it:
make
make install
Step 5: Install bmake
Unpack the
bmake archive:
tar -xzf os161-bmake.tar.gz
Move
into the newly-created directory:
cd bmake
Unpack
mk within the bmake directory:
tar -xzf ../os161-mk.tar.gz
Run
the bmake bootstrap script
./boot-strap --prefix=$HOME/sys161/tools
As the boot-strap script finishes, it should
print a list of commands that you can run to install bmake under $HOME/sys161/tools. The list
should look something like this:
mkdir -p /home/kmsalem/sys161/tools/bin cp
/home/kmsalem/bmake/Linux/bmake
/home/kmsalem/sys161/tools/bin/bmake-20101215 rm -f
/home/kmsalem/sys161/tools/bin/bmake
ln -s bmake-20101215 /home/kmsalem/sys161/tools/bin/bmake mkdir
-p /home/kmsalem/sys161/tools/share/man/cat1 cp
/home/kmsalem/bmake/bmake.cat1
/home/kmsalem/sys161/tools/share/man/cat1/bmake.1 sh
/home/kmsalem/bmake/mk/install-mk
Step
6: Set Up Links for Toolchain Binaries
mkdir
$HOME/sys161/bin
cd $HOME/sys161/tools/bin
sh -c 'for i in mips-*; do ln -s
$HOME/sys161/tools/bin/$i
$HOME/sys161/bin/cs350-`echo $i | cut
-d- -f4-`; done'
ln -s $HOME/sys161/tools/bin/bmake $HOME/sys161/bin/bmake
When you are finished with
these steps, a listing of the directory $HOME/sys161/bin should look similar to this:
bmake@ cs350-gcc@ cs350-ld@ cs350-run@
cs350-addr2line@ cs350-gcc-4.1.2@ cs350-nm@ cs350-size@ cs350-ar@ cs350-gccbug@
cs350-objcopy@ cs350- strings@ cs350-as@ cs350-gcov@ cs350-objdump@
cs350-strip@ cs350-c++filt@ cs350-gdb@ cs350-ranlib@
cs350-cpp@ cs350-gdbtui@ cs350-readelf@
Step 7: Build and Install the sys161 Simulator
Unpack the
sys161 archive: tar -xzf sys161.tar.gz
Move into the newly-created
directory: cd sys161-1.99.06
Next, configure sys161:
./configure --prefix=$HOME/sys161 mipseb
Build
sys161 and install it:
make
make install
Finally,
set up a link to a sample sys161 configuration file
cd
$HOME/sys161
ln
-s share/examples/sys161/sys161.conf.sample sys161.conf
Step 8: Install OS/161
First,
create a directory to hold the OS/161 source code, your compiled OS/161
kernels, and related test programs.
cd $HOME
mkdir cs350-os161
Next, move the OS/161 archive into
your new directory and unpack it: mv os161.tar.gz cs350-os161
cd cs350-os161
tar -xzf os161.tar.gz
This will
create a directory called os161-1.99 (under cs350-os161) containing the OS/161 source code. You should
now be able build, install, and run an OS/161 kernel and related application
and test programs by following steps.
Step 9: Configure OS/161 and Build the OS/161 Kernel
The next step is to configure
OS/161 and compile the kernel. From the cs350- os161 directory, do the following:
cd
os161-1.99
./configure
--ostree=$HOME/cs350-os161/root -- toolprefix=cs350-
cd kern/conf
./config
ASST0
cd ../compile/ASST0 bmake depend
bmake
bmake
install
Step 10: Build the OS/161 User-level
Next,
build the OS/161 user level utilities and test programs:
cd
$HOME/cs350-os161/os161-1.99 bmake
bmake install
Step 11: Try Running OS/161
cd
$HOME/cs350-os161/root
cp
$HOME/sys161/sys161.conf sys161.conf sys161 kernel-ASST0
You should see some output that
looks something like this:
sys161: System/161 release 1.99.06, compiled
Aug 23 2013 10:23:34
OS/161 base system version 1.99.05
Copyright (c) 2000, 2001, 2002, 2003, 2004, 2005, 2008, 2009
President
and Fellows of Harvard College. All rights reserved. Put-your-group-name-here's
system version 0 (ASST0 #1)
316k physical memory available Device probe...
lamebus0 (system main bus) emu0 at lamebus0
ltrace0 at lamebus0 ltimer0 at lamebus0 beep0 at ltimer0
rtclock0 at ltimer0 lrandom0 at lamebus0 random0 at lrandom0 lhd0 at lamebus0
lhd1 at lamebus0 lser0 at lamebus0 con0 at lser0
cpu0:
MIPS r3000
OS/161
kernel [? for menu]:
The
last line is a command prompt from the OS/161 kernel. For now, just enter the
command q to shut down the simulation and return to your
shell.
Result:

