Computer Systems Organization

CSCI-UA.0201(005), Fall 2018

Lab assignments

Lab 1 Basic C programming
Lab 2 Rabin Karp Substring Matching
Lab 3 Binary Mystery
Lab 4 Malloc
Lab 5 Multi-thread programming

Collaboration and Integrity Policy

Please read this carefully. We will run plagiarism detection software on all submitted code.

Lab Setup Instructions

Set up VirtualBox
FAQs on setting up VirtualBox
Set up Git repository
FAQs on gits

Setting up Virtual Box

We will grade your labs on an Ubuntu 16.04 machine. We recommend you do the labs in the the class virtual machine (based on Ubuntu 16.04).

For a basic virtual machine setup, perform the following four steps:

For more advanced tune-ups to help your productivity, do the following:

Note that if you choose to do your labs outside of the class virtual machine, we will not provide any technical support should you encounter any OS-related issues in doing the labs. Furthermore, should the results of your lab differ from what we have obtained by running the tests on Linux, we will use our test results in determining the grade.

FAQs on Virtual Box Setup
  • VT-x/AMD-V hardware acceleration is not available.

    Virtualbox wants you to enable virtualization in BIOS. If you don't know how to do that, come to see one of the course staff.

  • VM fails to launch and halts with either black screen or distorted image.

    VirtualBox dedicates a key on the keyboard, called "Host Key", for special use. If you look at the bottom right of your VM window, you will see what your current Host key is. If you have a very small keyboard which doesn't have the default Host Key (which is the right Ctrl button), you need to open up VBox "Preference" window, click "Input", and change Host Key.

    One thing that might work is: hit "Host Key" + F1, wait for a second, and hit "Host Key" + F7, then wait for a while. Repeat a few times and see if the desktop shows up. This seems to be a known bug in VBox.

    Another thing you can try is to allocate more video memory to your VM. Shutdown your VM first. Then open "Settings", click "Display", and change "Video Memory" to a larger value.

  • "Insert Guest Additions CD Image..." fails.

    If on your VM desktop, there is an icon that appears like a CD, that means you inserted the CD image already. You cannot insert the CD image twice.

  • Mount shared folder fails and get "protocol error".

    When you add a shared folder in VM settings, you will specify a folder name. If you folder name is abcdefg, then when you mount your shared folder inside VM, you should change the command to sudo mount -t vboxsf -o uid=1000,gid=1000 abcdefg /mnt/cso18-labs

  • When typing in password, nothing happens.

    That is a security feature. Terminal won't display your typed password because someone sitting next to you can see it and steal your password. Just continue to type your full password, and hit Enter

  • How to resize the VM to full screen?

    After you install the Guest Additions CD Image, in the VirtualBox Menu bar, click "View" then "Full-Screen Mode", then wait for a while. The first time switching to full screen requires patience. If it still does not work, uncheck "Full-Screen Mode" and then check "Full-Screen Mode", and wait for a while. Repeat until you run out of patience and decide to give up and use "Scaled Mode" instead...

  • The command sudo unable to resolve host.

    This is just a warning, you can ignore it. But if you really wants to get rid of the warning message, open up a terminal, type sudo sh -c 'echo "127.0.1.1\tvbox" >> /etc/hosts'

Setting up Git Repository

For each student in the class, we have created for him/her a corresponding private lab repository on Github.com. You will submit labs by pushing to your private repo on github.com (as many times as you want) and we will collect labs for grading after the lab deadline directly from Github.com. Below are the steps for setting up your the lab environment on your laptop. If you are not familiar with the git version control system, follow the resources here to get started.

Handin Procedure

To handin your files, simply commit and push them to github.com by doing:
$ git commit -am "saving all my changes and handing in"
$ git push origin 
We will fetch your lab files from Github.com at the specified deadline and grade them.

FAQs on Git repository
  • What message should I fill in for git commit -am "message"

    The "message" can be any string. But we ask you to leave something descriptive as message. In the future, when you check your git logs, this message helps you recall what you did for this commit. We (CSO staff) will never read your commit message. It's not going to affect grading.

  • How can I change a message if it's already pushed to GitHub?

    You don't need to change a message. There are ways to change messages but for CSO you never need them. Don't do it. It's going to cause conflict. Super dangerous.

  • I got an error message Fatal: Not a git repository (or any of the parent directories).

    This means you are typing git commands outside the directory containing your git repository. You need to type cd recitation-XXX, where XXX is your GitHub username. Remember to always type most git commands inside git repository. Commands like git clone, git config --global can be issued anywhere.

  • Can I edit files through GitHub.com?

    No. You should never do that. That's very likely to cause conflicts. Super dangerous. Please only use GitHub.com for read-only access, i.e. checking if all your changes have been pushed to your remote repository.

  • When I do git pull, I got an error Repository not found. Check the repository address, there should be no quotes (") or angle brackets (< >). The lab instructions use quotes or angle brackets to mark a placeholder for your GitHub username. If git pull upstream master fails, then check upstream address by typing git remote -v To edit your upstream address, remove it first by typing git remote remove upstream, and then add it back with git remote add