CS 134

Clone and Build the OS/161 Userspace Tools

Cloning the Repository

Local Repository and VS Code Setup

Once you have checked out an assignment from GitHub Classroom, it will appear as a repository on GitHub.

The next step is to get a copy of the repository on the server so you can work on it. We'll generally call this the “local” copy.

  • L-Floppy speaking

    Hey, wait! It's not local! It's on the remote server!

  • PinkRobot speaking

    Yes, the terminology is confusing. “Local” here is in contrast to the “remote” copy which is stored on the GitHub servers.

  • BlueRobot speaking

    So the copy of the repository you will work on is local to the CS 70 server.

  • PinkRobot speaking

    (Which is, admittedly, “remote” from the perspective of your computer.)

Cloning and Opening the Repository in VS Code

Getting a copy of a Git repository that you can work on is called cloning. You could do everything you'll need to using the git command-line tool (or any of a number of GUI Git clients), but Visual Studio Code has support for working with Git repos built in.

  1. Go to your repository on GitHub.
  2. Click the green button that says <> Code.
  3. You'll see a URL; copy that URL (easiest by clicking the button that looks like two stacked squares).
  4. Open VS Code.
  5. Make sure you are logged into the CS 134 server
  6. On the sidebar of VS Code click the “Explorer” icon (looks like two pieces of paper) or the “Source Control” icon (looks like three circles connected by two lines).
  7. Click Clone Repository.
  8. In the text box at the top of the window, paste the URL you copied.
  9. Now edit the path to choose a location. We recommend the cs134 directory that is already in your home directory.
  10. VS Code will download the repository and ask if you want to open the repository. Say yes!

Building the OS/161 Userspace Tools

Open up a terminal in VS Code (View > Terminal or Command-`). Now, to get your cloned repository ready for use, you need to run the following commands:

./setup

Running ./setup can take several minutes depending on the speed of the machine you are using. Remember that you can skip ahead to some of the reading parts of the assignment while you are waiting for parts to compile.

When ./setup finishes, it will have built all of the user-level commands (such as /sbin/reboot) and libraries for OS/161, but not the kernel itself. You can check that it has compiled one of these files by running:

file root/sbin/reboot

which should print something along the lines of:

root/sbin/reboot: ELF 32-bit MSB mips-1 executable, MIPS R3000_BE,
version 1, statically linked, not stripped

Okay, now you're ready to work...

To Complete This Part of the Assignment…

You'll know you're done with this part of the assignment when you've done all of the following:

(When logged in, completion status appears here.)