Setting up Linux for CS 2810

You should have Debian 12 or Ubuntu 22.04 (or more recent).

Install system packages

Start by doing a system update:

sudo apt update
sudo apt upgrade

Then install the tools we will need using the command line:

sudo apt install binutils-riscv64-linux-gnu build-essential curl gdb-multiarch git icdiff make micro python3 qemu-user-binfmt

If that succeeds then it means your Linux installation is working and up-to-date.

Install CodeGrinder

To install CodeGrinder, click on a CodeGrinder assignment in Canvas and follow the instructions:

You should now be ready to download an assignment. From the command line:

Problem instructions are in the doc directory and there is normally a .s file that you need to edit, e.g., hw.s. When you are ready to test your solution:

make

Note that you can run this from the vscode shell or a command-line window.

When everything works and you are ready to submit for grading:

grind grade

Editting files

To edit a file from within the current directory, type the name of the editor followed by the name of the file:

micro hw.s

micro is a simple terminal editor that is good for basic tasks.

Editors like micro (and more sophisticated editors like vim and emacs) work in the terminal text window without requiring a separate graphical window. This is useful when working on remote servers or other environments where a text window may be all that is available.

VSCode

If you are using vscode, you can run it on your native OS and have it ssh into Linux (on WSL or a Mac OS VM) and shuffle files back and forth for you. It looks and feels like you are working on the local OS, but the files that you see and edit through vscode are all from the Linux environment. Here are instructions for getting started setting this up:

Best of luck! Let me know if these instructions need further fixes.