How to install tools for CS270 on your home computer

This guide describes how to install the software used in this course on your own computer. You are not required to do this. You can use the computers in the CSB 120 lab instead. However, some students find it useful to be able to be able to work from home.

Install Ubuntu

Download the latest LTS version of Ubuntu from here.

Make sure you download the 64-bit version of Ubuntu, not the 32-bit version.

Download VirtualBox from here, or download VMware Player from here. You only need one of the two options, either option will work, but I (Phil) have found VMware Player to have better latency.

Next, install Ubuntu in a virtual machine. Follow this guide.

Install C tools

Open a terminal by clicking this button:

term

A line that starts with '$' means that you should type the part after the '$' in the terminal, then hit enter.

$ sudo apt update && sudo apt upgrade -y

This makes sure that Ubuntu is up to date.

Now, install the tools we need:

$ sudo apt install -y gcc make valgrind

Install assembly tools

We're going to install lc3sim next.

$ sudo apt install -y tk8.6
$ sudo ln -sv /usr/bin/wish8.6 /usr/bin/wish
$ cd
$ wget http://www.cs.colostate.edu/~fsieker/TestSemester/assignments/LC3CSU/lc3CSU.linux.tar
$ tar xf lc3CSU.linux.tar
$ cd lc3CSU
$ make

If it compiles correctly, you should see this output:

./fixPath install.c lc3sim-tk
./lc3as lc3os.asm
STARTING PASS 1
0 errors found in first pass

STARTING PASS 2
0 errors found in second pass
gcc -g -std=c11 -Wall -fPIC -c install.c
gcc -g -std=c11 -Wall -fPIC install.c lc3sim.a -o lc3sim

Now, we're going to put this in our path. Run this command:

$ gedit ~/.bashrc &

Add this line to the end of the file:

export PATH="$PATH:~/lc3CSU"

Save it. (Press Ctrl-S.) Go back to your terminal.

$ source ~/.bashrc

To test whether all of that worked, run:

$ lc3sim-tk

If it works, you should see a window like this:

lc3sim

Install transistor logic tools

Type this at your terminal:

$ sudo apt-add-repository universe
$ sudo apt install -y logisim

To test whether that worked, run:

$ logisim

You should see something like this:

logisim

Now we're done!

Troubleshooting

If you have trouble with one of the steps above, follow this guide:

  1. Make sure that you've done the previous steps correctly. If you skip the step where we install gcc, for example, you will not be able to install the assembly tools.
  2. Look at the error message and Google it. Has anyone else run into the same problem? How did they solve it?
  3. Ask one of the course TA's, or the lab operator in the CSB 120 lab.

How to log in to school computers remotely

Command-line access

You can log in to the school computers like this:

 $ ssh username@hostname.cs.colostate.edu

...where 'username' is your CS username, and hostname is a computer from this list: http://www.cs.colostate.edu/~info/machines

ssh will ask you if you want to trust this computer:

The authenticity of host 'mackerel.cs.colostate.edu (129.82.45.133)' can't be established.
ECDSA key fingerprint is SHA256:9RVVnq2K1IIAl1hUm4+nsR90PS4v1S+/lFuLV/6i4I.
Are you sure you want to continue connecting (yes/no)?

Type 'yes.'

Moving files to/from school computers

You can use scp to copy files over the network like this:

$ scp -r <source> <dest>

Either <source> or <dest> can be a remote path. Here's an example:

On your local computer, create a file named 'copy-me':

$ echo "hello!" > ~/copy-me

Copy the file to the school system like this:

$ scp -r ~/copy-me username@hostname.cs.colostate.edu:.

This will copy the file to the home directory of your school account. You can log in using ssh, and type this command on your school account:

$ cat ~/copy-me

...which will show you the file. Edit the file by typing:

$ echo "hello from school!" >> ~/copy-me

This will append to the file. Now, copy the file back to your local computer:

$ scp -r username@hostname.cs.colostate.edu:./copy-me ~

This will copy the the file from your school acount to the home directory of your local computer.

Look at the file - it should have two lines:

hello!
hello from school!

Using GUI programs

To run a GUI application remotely but see the GUI locally, type this at your terminal:

$ ssh -X username@hostname.cs.colostate.edu

Once you've logged in, type

$ lc3sim

Wait 15 seconds to 3 minutes for the window to show up and load. Note that the program will run more slowly than if you were running it locally.