First, make sure you have the tools installed. If you are working on the department server, the tools will most likely already be there. Otherwise, ask your course staff for help. If you are using the virtual appliance, execute these commands (they will work on any Ubuntu machine):
sudo apt-get install emacs23 cscope cscope-el
Now generate the cscope database on your kernel:
cd ~/os161/src/kern
find . -name "*.c" -o -name "*.S" -o -name "*.h" > cscope.files
cscope -q -R -b -i cscope.files
The second command will generate a list of source files and the third command will build a cscope database.Â
Now you can search for symbols using the cscope browser:
cscope -d
Or you can use cscope within your favourite editor, such as vim or emacs: