| title | <code>ops-class.org</code> Setup | |||||||
|---|---|---|---|---|---|---|---|---|
| description | Overview of how to download the OS/161 source code and install a ops-class.org toolchain. | |||||||
| omitTop | true | |||||||
| priority | 0.8 | |||||||
| changefreq | monthly | |||||||
| spelling_exceptions |
|
{ops-class} assignments start with the {os161} instructional operating system and require a special toolchain to compile, run, debug, and test. This page describes how to get the sources and install the toolchain.
Your options for installing the toolchain depend on the operating system running on the computer that you are going to develop on:
-
Windows:
-
Perform a full installation of Ubuntu including a GUI and then install the toolchain by adding our
ops-class.orgPPA. -
Use our Vagrantfile to boot a headless Ubuntu virtual machine with the toolchain installed.
-
If you are running a version of Windows (10+) that supports the Windows Subsystem for Linux, you may be able to install and run the toolchain directly on Windows by adding our
ops-class.orgPPA.
-
-
Mac OS:
-
Perform a full installation of Ubuntu including a GUI and then install the toolchain by adding our
ops-class.orgPPA. -
Use our Vagrantfile to boot a headless Ubuntu virtual machine with the toolchain installed.
-
Run natively by installing from source.
-
-
Ubuntu (or other Linux distributions that support Debian packaging):
-
Install the toolchain natively by adding our
ops-class.orgPPA.
-
-
Other UNIX systems:
-
Run natively by installing from source.
-
You’ll note that most of these options boil down to getting Ubuntu installed somehow—either with or without a GUI—and then using our packages. The only exceptions are Windows installations that can use the packages natively, or those that want to install from source for some reason.
We review the main options below.
Consider this option if:
There are many tutorials on how to install Ubuntu using VirtualBox [1]—here’s one—so we aren’t going to maintain one here. We would suggest choosing Ubuntu 16.04 LTS "Xenial Xerus", the latest LTS (Long Term Support) version. We have packages ready for it as well as Ubuntu 14.04 LTS "Trusty Tahr".
One you have Ubuntu installed and running to your satisfaction, continue by
installing the toolchain using the ops-class.org PPA.
Consider this option if:
We maintain an {ops-class} Vagrant
configuration.
It loads a pre-built headless (no GUI) VirtualBox virtual machine
[2]
based on the minimal
Bento
Ubuntu
Vagrant
boxes.
The current version is based on
Ubuntu 16.04 LTS "Xenial Xerus".
It contains the rest of the toolchain, including sys161,
the OS/161 cross-compilers, and test161.
1.2 is the current version.
Install
Vagrant
and
Git.
Note that Ubuntu packages very old versions of Vagrant for apt-get.
You’ll have better luck following the instructions on the
Vagrant website.
(This is also true for Git. You may want to add the
Git maintainers PPA.)
Then:
git clone https://github.com/ops-class/vagrant cd vagrant && vagrant up
The vagrant up may take a few minutes.
Once it completes, you should be able to log in to the virtual machine and
run the OS/161 tools:
$ vagrant ssh
trinity@zion:~$ sys161
sys161: System/161 release ...
sys161: Usage: sys161 [sys161 options] kernel [kernel args...]
...First examine the vagrant up logs for errors.
Some messages that appear to be errors are in fact usually benign.
These include:
W: mdadm: /etc/mdadm/mdadm.conf defines no arrays.`
==> default: mesg: ==> default: ttyname failed ==> default: : ==> default: Inappropriate ioctl for device ==> default: dpkg-preconfigure: unable to re-open stdin: No such file or directory
Also make sure that all Vagrant commands (vagrant up, vagrant ssh, etc.)
are run from the same directory as your Vagrantfile.
That’s just how Vagrant works.
The Vagrantfile README
describes some potential pitfalls for Windows users.
Some concern initialization.
Another known problem is that some Windows hosts will not allow guests to create symbolic links in shared folders. If you try to build your OS/161 sources from a shared folder, the build will fail when it tries to create symbolic links in the compilation directory.
There are two workarounds.
-
Run all of your
vagrantcommands as a Windows administrator:vagrant up,vagrant ssh, etc. This provides provide the guest with the required permissions to create symbolic links. -
Don’t share your source folder and edit your code inside the virtual machine using a terminal-based editor.
This can be done by first updating the Vagrantfile via git pull and
then forcing Vagrant to reprovision the VM:
vagrant halt git pull vagrant up --provision
But it may be easier to simply destroy the old VM and create a new one. Be sure to preserve your OS/161 sources!
The {ops-class} {ppa} includes all toolchain components packaged for Ubuntu 16.04 LTS "Xenial Xerus". and Ubuntu 14.04 LTS "Trusty Tahr". If you have 16.04 or 14.04 installed, you can install these packages directly. If you are using a slightly earlier or later Ubuntu release, the Xenial packages will probably work: This help page should get you started. If you are using a much earlier Ubuntu release, you should upgrade.
As of early 2017 we have evidence that the Xenial packages also seem to work on Windows 10 under the Windows Subsystem for Linux. So this is another option for Windows users. This is a new option for us, and we’ll update this document as we know more.
sudo add-apt-repository ppa:ops-class/os161-toolchain sudo apt-get update sudo apt-get install os161-toolchain
We don’t support this option, but if you’d like to try instructions are
available at the {os161-link}[OS/161 website].
You will need to download, configure, compile and install the OS/161 toolchain
using the modified sources.
Follow the online directions.
However, rather that using David’s tarballs we would suggest that you use the
official ops-class.org sources which are available on GitHub for
test161, sys161, and the
cross compilers.
Linux and other UNIX variants are likely to work. OSX may require patches. Keep reading for more instructions.
{os161} is maintained by David Holland at Harvard University. We maintain a OS/161 fork on GitHub that includes {ops-class}-specific changes. Most of our changes are to enable automated testing using {test161}.
2.0.2 based on upstream version 2.0.2. Our fork is currently up-to-date with the latest {os161} version.
Clone our
GitHub repository.
Note that this sets the Git remote name to staff so that you can use
origin for your own private repository where you store your changes.
git clone https://github.com/ops-class/os161 -o staff
Pull and merge upstream changes from our
GitHub repository.
Note that this depends on having our OS/161 GitHub repository named staff
rather than origin, as described above.
You will also need to inspect the output of git pull (or git status) and
fix any merge conflicts.
git pull staff master
Below we describe the individual components of the toolchain. But note that the correct way to install the toolchain is either using Vagrant or our PPA as described above.
{test161} is our OS/161 distributed automated grading and testing tool. It is maintained by Scott Haseley. Sources are available on GitHub and pull requests containing bug fixes or enhancements are welcome.
1.2.5 is the current version.
If you are using our PPA, then you already have test161.
If you are installing from source, once you have
Go
installed, the following command will install {test161} into your $GOPATH:
go get -u github.com/ops-class/test161/test161
If you are using our PPA, then follow the upgrade instructions above. If you installed from source:
go get -u github.com/ops-class/test161/test161
{system161} is maintained by
David Holland
at Harvard University.
We maintain our own
GitHub sys161 repository
for the purpose of packaging sys161 for our {ppa}.
We have also made some contributions to sys161 related to {test161}
automation and statistics control.
{ppa-link}[2.0.8] which is identical to upstream version 2.0.8.
If you are using our PPA, then you already have sys161.
You can also try
installing from source
[3].
If you are using our PPA, then follow the upgrade instructions above. If you installed from source, reinstall from source.
{os161} requires a set of patched cross compilers which are maintained by
David Holland
at Harvard University
[4].
We have packaged these for our PPA, and maintain packaging
repositories for
GCC,
GDB,
bmake,
and the binary utilities.
Identical to the latest versions shown here.
If you are using our PPA, then you already have the OS/161 toolchain. You can also try installing from source.
If you are using our PPA, then follow the upgrade instructions above. If you installed from source, reinstall from source.