Systems Programming and Machine Organization
This is the 2012 version of the course. Main site
- 1 Virtual Machine
- 2 Version control with code.seas.harvard.edu
- 3 Obtaining and submitting problem sets
For this course, we will be using virtual machines (namely the CS50 appliance) for working on and submitting problem sets. Thanks to CS50 and CS51 for the content below.
Install your VM
If you have a Mac and are a current Harvard student, and you do not currently have VMware Fusion installed on your computer, please email the staff. Wait for a reply, and then follow the instructions below to obtain a VMap account and install VMware Fusion. Alternatively, you may install VirtualBox instead of VMware Fusion. However, VMware Fusion has significantly fewer issues with the appliance than VirtualBox, so we recommend filling out the form for VMware Fusion.
Follow the instructions here to install the CS50 appliance on your machine.
Update your appliance
- Open the terminal emulator (the shortcut is in the lower left corner, next to the Google Chrome icon).
- Type the following command and hit Enter. This may take a few minutes to complete.
sudo yum -y update appliance50
- You may be prompted to approve the installation. If so, type y and hit Enter. If not, skip this step.
- Wait for installation complete, and that's it!
Run the following command to download install miscellaneous tools we will be using throughout the course:
sudo yum install gcc-c++ kcachegrind perf strace bochs qemu
When prompted, type y and hit Enter to approve the tool installations, and then you're ready to hack!
Version control with code.seas.harvard.edu
We will be using git with code.seas.harvard.edu for turning in problem set submissions as well as version control.
What is git?
Git was originally developed by Linus Torvalds for development of the Linux kernel. Git is a distributed version control system. Centralized version control software typically supports a single, remote repository from which all users "checkout" files. All changes must be sent to the repository to be tracked and shared. A distributed version control system supports many local repositories which each track changes and can synchronize with each other in a peer-to-peer fashion.
What is code.seas?
Code.seas is an online git repository and project management website for SEAS. We’ll be using it for collecting psets via git.
Signing up for code.seas
The following only needs to be done once. You may skip steps 1-3 if you already have a working code.seas account.
- Go to https://code.seas.harvard.edu/login.
- Enter in your FAS credentials. Extension school students, you can fill out a form to get a FAS account if you don’t already have one.
- You may be directed to an OpenID Verification page that asks you to confirm your identity. Click the "Allow Always" button on the right of the screen. You may then be asked to enter some details for your profile, but will eventually see your Dashboard.
- The next step is to add your SSH keys:
- SSH keys provide you with a way to easily access your git repositories from your CS61 VM.
- If you haven't already, you need to create an SSH key on your CS51 VM.
- You can check out this handy HCS tutorial, or follow these steps:
- Launch your VM.
- Open up a terminal.
- Run ssh-keygen -t dsa and follow the instructions.
- You have now created your ssh keys. They live in the directory "~/.ssh".
- Now run cat .ssh/id_dsa.pub to display your public key.
- Copy your public key (that is, select the text on the screen, and copy it to the clipboard)
- In the SEAS Code Repository, click “Manage SSH keys”, click "Add SSH Key", paste your key into the field, and click "Save".
- You are now ready to use git with code.seas.harvard.edu!
If you are having any trouble with your keys (eg, you cannot clone a repo because "the connection timed out"), check if your firewall is blocking port 22, and open port 22 if it is blocked. You can use your favorite search engine to figure out how to do this.
If you are having any trouble logging in, please follow these steps:
- Quit your browser -- (flush cookies).
- Try to login to code.seas with your FAS account.
- If that fails, you may need to change your FAS password and repeat steps 1 and 2.
- If that fails, email Academic Computing at firstname.lastname@example.org and let them know your FAS account name. They will set up for you a local account.
Obtaining and submitting problem sets
We will be distributing and collecting problem sets using git and code.seas.harvard.edu.
Obtaining problem sets
Getting the problem set repo
The following only needs to be done once:
First, you'll need to clone the psets repo on code.seas:
- Go to https://code.seas.harvard.edu/cs61/cs61-psets. Login to code.seas if necessary.
- Click the "Clone repository" button.
- This takes you to a new page, which gives you a chance to name your repository clone. Keep the suggested name (username-cs51-psets). Click the orange “Clone Repository” button.
- After waiting for your repository to be created, you’ll be at a page that contains information about your new repository. You’re going to need the “Clone & push url” in a minute, so either copy the URL, or figure out how to get back to this page.
- On the right sidebar, click the "Manage collaborators" button.
- On the right sidebar, click the "Add collaborators" button.
- Click the "Add a team" tab, and add "cs61-staff". Be sure to give the cs61-staff team permissions to at least view and review (and commit, if you want), before clicking the orange "Add as collaborator" button.
Next, you'll need to get a local copy of the repo on your machine:
- Launch your VM and open up a terminal.
- Configure your git "identity":
git config --global user.name "FIRST_NAME LAST_NAME" git config --global user.email "YOUR_@COLLEGE_EMAIL"
- Execute the following command:
git clone REPO_URL
REPO_URL is the "Clone & push url" from step 4.
- You will have a new folder called "username-cs61-psets", in which will be a subdirectory for the first problem set (and in the future, later problem sets).
Obtaining future problem sets
The following should be done every time a new pset is released/updated:
- Launch your VM and open a terminal.
- Navigate to your "username-cs61-psets" directory.
git pull email@example.com:cs61/cs61-psets.git master.
This will download the latest pset directory into your repo.
Submitting problem sets
It's really easy: just run
git push origin master from your "username-cs61-psets" directory, and that's it!