Use VMs on either lab machines or on VirtualBox.
Username: student
, Password: kernel369
Run ./SetupKeys.sh
to ensure keystrokes are right.
Run sudo dhclient eth1
to get internet connectivity.
Adding both the above commands to ~/.bash_profile
will make then run every time you login to the VM, which you might find convenient.
You ideally want to use version control on your VM so you can transfer your files over and ensure that they are backed up in case you crash the kernel. This is a bit tricky since you will get an HTTP error if you try to use Git (at least from Github). Solution? Use an SSH key.
Inside the VM, run ssh-keygen -t rsa -b 4096
and follow the steps to create an SSH key pair.
The public key will be stored in ~/.ssh/id_rsa.pub
. You need to copy the text in this file.
You can scp
it to the lab machines to do this with the following command:
scp ~/.ssh/id_rsa.pub <utorid>@mathlab.utsc.utoronto.ca:~/Desktop/vm.pub
You will now see this file (renamed to vm.pub
) on your Desktop on the lab machines.
Copy the contents of this file, go to Github -> Settings -> SSH and GPG Keys
, click New SSH key
and paste it there.
You should now be able to clone your Github repo using the URL in Use SSH
section of the Clone or download
dialog. Your command in the VM should look something like
git clone git@github.com:<git_username>/<repo>.git
Sina often asks you to write some of the starter code on exams. It’s annoying, especially if you haven’t seen the Kernel list API before. Here’s a nice blog post explaining how this API works in the backend so you’re not blindly memorizing everything: Using Kernel Lists
Remember the right behaviour for when pid = 0
in the my_syscall()
function. Ideally, turn it into black-list mode, such that all processes except the ones in the list for the corresponding syscall are monitored.
Use the spinlocks whenever you’re modifying system tables.
Make sure you’re returning the correct values for each of the edge cases in my_syscall()
. Many people make mistakes here, so don’t lose the easy marks. The comments describe what value should be returned in each case.
In the struct pt_reg
paramater passed in to the interceptor()
function, the field ax
stores the syscall ID that was originally being made by the program (but got intercepted).