CS 134

Connecting to the CS 134 Server

To build OS/161 and run the kernel, we need a few things:

  • A cross-compilation toolchain that can build code for the MIPS architecture.
  • The sys161 simulator that can run the kernel (and simulate the hardware it runs on).

Although in principle, it's possible to build the toolchain and simulator on your own computer, it can be a bit tricky. The easiest way to get started is to use the CS 134 server, which has everything you need already set up, and is also easy to access from the lab or your own computer.

Set Up Your CS 134 Server Account

You should have received an email from Nic Dodds that contains your username for the server and a temporary password. If you have not received that email, let us know immediately!

  • PinkRobot speaking

    If you have already followed the instructions in that email and successfully changed your password, you can skip to the next part.

If you are trying to connect from off-campus you'll need to use a VPN to connect to the server.

Open a terminal to get a command-line prompt (on your computer, or inside Visual Studio Code) and connect to cs134.cs.hmc.edu with the command

ssh <username>@cs134.cs.hmc.edu

where is replaced by your actual username (e.g., first initial + last name). It will ask for your old password (i.e. the temporary password you were given) and then ask you to pick a new password. Then it will disconnect you immediately.

  • Hedgehog speaking

    Help! I'm confused!

  • PinkRobot speaking

    No worries; this will be new to many of you. Check out this video where Prof. Bang does the same thing, though he's using cs131.fun and we are using cs134.cs.hmc.edu.

  • BlueRobot speaking

    If that doesn't get you going, please ask for help!

Important: Pick a secure password. Bad actors constantly scan all computers connected to the internet (including cs134.cs.hmc.edu) and try to log in with hundreds or thousands of plausible usernames and passwords. If you pick a weak password then there's a high probability that the server will be hacked and become unusable for everyone, even though this isn't a particularly "important" computer.

Log in and Configure Git

Run the same command ssh <username>@cs134.cs.hmc.edu and log in with your new password. You should see a big "CS 134" and get a prompt (e.g. ~ SERVER >) saying that you are currently in your personal home directory (a.k.a. ~ or /home/<username>) and asking you for a command to run on the remote server.

Try these commands

  • hostname
  • Should say that the machine where this command ran is cs134-server.
  • pwd
  • Should say that you are currently in your personal directory /home/.
  • ls
  • Should show you the contents of your home directory, including sub-directories "data" and "cs134".

While you are logged in, run the following two commands to configure git:

  • git config --global user.name "Your Name Here"
  • git config --global user.email "Your Email Address @ Here"

where you put your own name and email address in the quotes.

  • PinkRobot speaking

    If you don't get an error message, everything worked!

  • L-Floppy speaking

    Hooray!

Finally, you can end your remote session on the CS 134 server by running the command exit.

Log Into the Server Using VS Code

At this point we will switch to using the VS Code editor to connect to the server instead of using the ssh command. This way you'll be able to transparently work on files on the server without having to copy files back and forth.

  • Rabbit speaking

    VS Code still uses ssh behind the scenes!

Open VS Code on your computer (or a CS Lab computer). This gives you an editor for files on the hard drive of the computer you are using.

Now click on the >< button in the lower left corner. In the pop-up menu, select "Connect to Host" and enter <username>@cs134.cs.hmc.edu for the host (where is replaced by your CS 134 server username from above). When prompted, enter your server password (that you set above).

A new "remote" window will pop up! This window is essentially running on the remote computer cs134.cs.hmc.edu, so you can edit files on the server hard drive and get a prompt to run commands on the server.

  • PinkRobot speaking

    It might be a little bit slow at first as it initializes the remote connection.

  • BlueRobot speaking

    It should get smoother once that's done!

  • L-Chippy speaking

    I need help again!

  • PinkRobot speaking

    Sure thing. See if this video of Prof. Bang doing this helps (though he's using cs131.fun instead of cs134.cs.hmc.edu).

Once you have the remote window, go ahead and close the other (local) window. You won't need it and it might confuse you!

Check that VS Code is Running on the Server

Open a terminal to get a command-line prompt inside VS Code (via the View > Terminal menu option, or the Control-` keyboard shortcut). Run the command hostname and verify that the terminal is running on the server.

To Complete This Part of the Assignment...

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

(When logged in, completion status appears here.)